378 val perm_names = map (fn x => "permute_" ^ x) qty_names |
378 val perm_names = map (fn x => "permute_" ^ x) qty_names |
379 val thy' = define_lifted_perms qty_full_names (perm_names ~~ perms) raw_perm_simps thy; |
379 val thy' = define_lifted_perms qty_full_names (perm_names ~~ perms) raw_perm_simps thy; |
380 val lthy13 = Theory_Target.init NONE thy'; |
380 val lthy13 = Theory_Target.init NONE thy'; |
381 val q_name = space_implode "_" qty_names; |
381 val q_name = space_implode "_" qty_names; |
382 val _ = tracing "Lifting induction"; |
382 val _ = tracing "Lifting induction"; |
383 val q_induct = lift_thm lthy13 induct; |
383 val constr_names = map (Long_Name.base_name o fst o dest_Const) consts; |
|
384 val q_induct = Rule_Cases.name constr_names (lift_thm lthy13 induct); |
384 fun note_simp_suffix s th ctxt = |
385 fun note_simp_suffix s th ctxt = |
385 snd (Local_Theory.note ((Binding.name (q_name ^ "_" ^ s), |
386 snd (Local_Theory.note ((Binding.name (q_name ^ "_" ^ s), |
386 [Attrib.internal (K Simplifier.simp_add)]), th) ctxt); |
387 [Attrib.internal (K Simplifier.simp_add)]), th) ctxt); |
387 val (_, lthy14) = Local_Theory.note ((Binding.name (q_name ^ "_induct"), []), [q_induct]) lthy13; |
388 val (_, lthy14) = Local_Theory.note ((Binding.name (q_name ^ "_induct"), []), [q_induct]) lthy13; |
388 val q_inducts = Project_Rule.projects lthy13 (1 upto (length alpha_inducts)) q_induct |
389 val q_inducts = Project_Rule.projects lthy13 (1 upto (length alpha_inducts)) q_induct |
389 val (_, lthy14a) = Local_Theory.note ((Binding.name (q_name ^ "_inducts"), []), q_inducts) lthy14; |
390 val (_, lthy14a) = Local_Theory.note ((Binding.name (q_name ^ "_inducts"), []), q_inducts) lthy14; |
390 val q_perm = map (lift_thm lthy14) raw_perm_def; |
391 val q_perm = map (lift_thm lthy14) raw_perm_def; |
391 val lthy15 = note_simp_suffix "perm" q_perm lthy14a; |
392 val lthy15 = note_simp_suffix "perm" q_perm lthy14a; |
392 val q_fv = map (lift_thm lthy15) fv_def; |
393 val q_fv = map (lift_thm lthy15) fv_def; |
393 val lthy16 = note_simp_suffix "fv" q_fv lthy15; |
394 val lthy16 = note_simp_suffix "fv" q_fv lthy15; |
394 val q_bn = map (lift_thm lthy16) raw_bn_eqs; |
395 val q_bn = map (lift_thm lthy16) raw_bn_eqs; |
395 val lthy17 = note_simp_suffix "bn" q_bn lthy16; |
396 val lthy17 = note_simp_suffix "bn" q_bn lthy16; |