296 val f_alt_def_goal = HOLogic.mk_Trueprop (HOLogic.mk_eq (f_alt_def_goal_lhs, f_alt_def_goal_rhs)); |
296 val f_alt_def_goal = HOLogic.mk_Trueprop (HOLogic.mk_eq (f_alt_def_goal_lhs, f_alt_def_goal_rhs)); |
297 fun f_alt_def_tac ctxt i = |
297 fun f_alt_def_tac ctxt i = |
298 EVERY' [Transfer.gen_frees_tac [] ctxt, DETERM o Transfer.transfer_tac true ctxt, |
298 EVERY' [Transfer.gen_frees_tac [] ctxt, DETERM o Transfer.transfer_tac true ctxt, |
299 SELECT_GOAL (Local_Defs.unfold0_tac ctxt [id_apply]), rtac ctxt refl] i; |
299 SELECT_GOAL (Local_Defs.unfold0_tac ctxt [id_apply]), rtac ctxt refl] i; |
300 val rep_isom_transfer = transfer_of_rep_isom_data rep_isom_data |
300 val rep_isom_transfer = transfer_of_rep_isom_data rep_isom_data |
301 val (_, transfer_lthy) = Proof_Context.note_thmss "" [((Binding.empty, []), |
301 val (_, transfer_lthy) = |
302 [([rep_isom_transfer], [Transfer.transfer_add])])] lthy |
302 Proof_Context.note_thmss "" |
|
303 [(Binding.empty_atts, [([rep_isom_transfer], [Transfer.transfer_add])])] lthy |
303 val f_alt_def = Goal.prove_sorry transfer_lthy [] [] f_alt_def_goal |
304 val f_alt_def = Goal.prove_sorry transfer_lthy [] [] f_alt_def_goal |
304 (fn {context = ctxt, prems = _} => HEADGOAL (f_alt_def_tac ctxt)) |
305 (fn {context = ctxt, prems = _} => HEADGOAL (f_alt_def_tac ctxt)) |
305 |> Thm.close_derivation |
306 |> Thm.close_derivation |
306 |> singleton (Variable.export lthy args_lthy) |
307 |> singleton (Variable.export lthy args_lthy) |
307 val lthy = args_lthy |
308 val lthy = args_lthy |
442 SELECT_GOAL (Local_Defs.unfold0_tac ctxt @{thms eq_onp_top_eq_eq}) (* normalize *), |
443 SELECT_GOAL (Local_Defs.unfold0_tac ctxt @{thms eq_onp_top_eq_eq}) (* normalize *), |
443 Raw_Simplifier.rewrite_goal_tac ctxt |
444 Raw_Simplifier.rewrite_goal_tac ctxt |
444 (map safe_mk_meta_eq @{thms id_apply simp_thms Ball_def}), |
445 (map safe_mk_meta_eq @{thms id_apply simp_thms Ball_def}), |
445 rtac ctxt TrueI] i; |
446 rtac ctxt TrueI] i; |
446 |
447 |
447 val (_, transfer_lthy) = Proof_Context.note_thmss "" [((Binding.empty, []), |
448 val (_, transfer_lthy) = |
448 [(@{thms right_total_UNIV_transfer},[Transfer.transfer_add]), |
449 Proof_Context.note_thmss "" [(Binding.empty_atts, |
449 (@{thms Domain_eq_top}, [Transfer.transfer_domain_add]) ])] lthy; |
450 [(@{thms right_total_UNIV_transfer},[Transfer.transfer_add]), |
|
451 (@{thms Domain_eq_top}, [Transfer.transfer_domain_add])])] lthy; |
450 |
452 |
451 val quot_thm_isom = Goal.prove_sorry transfer_lthy [] [] typedef_goal |
453 val quot_thm_isom = Goal.prove_sorry transfer_lthy [] [] typedef_goal |
452 (fn {context = ctxt, prems = _} => typ_isom_tac ctxt 1) |
454 (fn {context = ctxt, prems = _} => typ_isom_tac ctxt 1) |
453 |> Thm.close_derivation |
455 |> Thm.close_derivation |
454 |> singleton (Variable.export transfer_lthy lthy) |
456 |> singleton (Variable.export transfer_lthy lthy) |