399 |
399 |
400 |
400 |
401 |
401 |
402 (** transitivity proof for alphas **) |
402 (** transitivity proof for alphas **) |
403 |
403 |
|
404 (* applies cases rules and resolves them with the last premise *) |
404 fun ecases_tac cases = |
405 fun ecases_tac cases = |
405 Subgoal.FOCUS (fn {prems, ...} => |
406 Subgoal.FOCUS (fn {prems, ...} => |
406 HEADGOAL (resolve_tac cases THEN' rtac (List.last prems))) |
407 HEADGOAL (resolve_tac cases THEN' rtac (List.last prems))) |
407 |
408 |
408 fun aatac pred_names = |
409 fun aatac pred_names = |
409 SUBPROOF (fn {prems, context, ...} => |
410 SUBPROOF (fn {prems, context, ...} => |
410 HEADGOAL (resolve_tac (map (transform_prem1 context pred_names) prems))) |
411 HEADGOAL (resolve_tac (map (transform_prem1 context pred_names) prems))) |
411 |
412 |
|
413 (* instantiates exI with the permutation p + q *) |
412 val perm_inst_tac = |
414 val perm_inst_tac = |
413 Subgoal.FOCUS (fn {params, ...} => |
415 Subgoal.FOCUS (fn {params, ...} => |
414 let |
416 let |
415 val (p, q) = pairself snd (last2 params) |
417 val (p, q) = pairself snd (last2 params) |
416 val pq_inst = foldl1 (uncurry Thm.capply) [@{cterm "plus::perm => perm => perm"}, p, q] |
418 val pq_inst = foldl1 (uncurry Thm.capply) [@{cterm "plus::perm => perm => perm"}, p, q] |
445 HEADGOAL (rtac induct THEN_ALL_NEW |
447 HEADGOAL (rtac induct THEN_ALL_NEW |
446 EVERY' [ rtac @{thm allI}, rtac @{thm impI}, |
448 EVERY' [ rtac @{thm allI}, rtac @{thm impI}, |
447 ecases_tac cases ctxt THEN_ALL_NEW all_cases ctxt ]) |
449 ecases_tac cases ctxt THEN_ALL_NEW all_cases ctxt ]) |
448 end |
450 end |
449 |
451 |
450 xfun prep_trans_goal alpha_trm ((arg1, arg2), arg_ty) = |
452 fun prep_trans_goal alpha_trm ((arg1, arg2), arg_ty) = |
451 let |
453 let |
452 val lhs = alpha_trm $ arg1 $ arg2 |
454 val lhs = alpha_trm $ arg1 $ arg2 |
453 val mid = alpha_trm $ arg2 $ (Bound 0) |
455 val mid = alpha_trm $ arg2 $ (Bound 0) |
454 val rhs = alpha_trm $ arg1 $ (Bound 0) |
456 val rhs = alpha_trm $ arg1 $ (Bound 0) |
455 in |
457 in |