src/HOL/Tools/BNF/bnf_lfp_tactics.ML
changeset 57967 e6d2e998c30f
parent 57806 8e74998e04b8
child 58315 6d8458bc6e27
equal deleted inserted replaced
57966:6fab7e95587d 57967:e6d2e998c30f
   580         rtac sym, rtac ctor_map];
   580         rtac sym, rtac ctor_map];
   581   in
   581   in
   582     (induct_tac THEN' EVERY' (map3 mk_map_cong0 ctor_maps map_cong0s set_setsss)) 1
   582     (induct_tac THEN' EVERY' (map3 mk_map_cong0 ctor_maps map_cong0s set_setsss)) 1
   583   end;
   583   end;
   584 
   584 
   585 fun mk_le_rel_OO_tac ctxt m induct ctor_nchotomys ctor_Irels rel_mono_strongs le_rel_OOs =
   585 fun mk_le_rel_OO_tac ctxt m induct ctor_nchotomys ctor_Irels rel_mono_strong0s le_rel_OOs =
   586   EVERY' (rtac induct ::
   586   EVERY' (rtac induct ::
   587   map4 (fn nchotomy => fn Irel => fn rel_mono => fn le_rel_OO =>
   587   map4 (fn nchotomy => fn Irel => fn rel_mono => fn le_rel_OO =>
   588     EVERY' [rtac impI, etac (nchotomy RS @{thm nchotomy_relcomppE}),
   588     EVERY' [rtac impI, etac (nchotomy RS @{thm nchotomy_relcomppE}),
   589       REPEAT_DETERM_N 2 o dtac (Irel RS iffD1), rtac (Irel RS iffD2),
   589       REPEAT_DETERM_N 2 o dtac (Irel RS iffD1), rtac (Irel RS iffD2),
   590       rtac rel_mono, rtac (le_rel_OO RS @{thm predicate2D}),
   590       rtac rel_mono, rtac (le_rel_OO RS @{thm predicate2D}),
   591       rtac @{thm relcomppI}, atac, atac,
   591       rtac @{thm relcomppI}, atac, atac,
   592       REPEAT_DETERM_N m o EVERY' [rtac ballI, rtac ballI, rtac impI, atac],
   592       REPEAT_DETERM_N m o EVERY' [rtac ballI, rtac ballI, rtac impI, atac],
   593       REPEAT_DETERM_N (length le_rel_OOs) o
   593       REPEAT_DETERM_N (length le_rel_OOs) o
   594         EVERY' [rtac ballI, rtac ballI, Goal.assume_rule_tac ctxt]])
   594         EVERY' [rtac ballI, rtac ballI, Goal.assume_rule_tac ctxt]])
   595   ctor_nchotomys ctor_Irels rel_mono_strongs le_rel_OOs) 1;
   595   ctor_nchotomys ctor_Irels rel_mono_strong0s le_rel_OOs) 1;
   596 
   596 
   597 (* BNF tactics *)
   597 (* BNF tactics *)
   598 
   598 
   599 fun mk_map_id0_tac map_id0s unique =
   599 fun mk_map_id0_tac map_id0s unique =
   600   (rtac sym THEN' rtac unique THEN'
   600   (rtac sym THEN' rtac unique THEN'
   699           atac]]
   699           atac]]
   700   in
   700   in
   701     EVERY' [rtac iffI, if_tac, only_if_tac] 1
   701     EVERY' [rtac iffI, if_tac, only_if_tac] 1
   702   end;
   702   end;
   703 
   703 
   704 fun mk_rel_induct_tac ctxt IHs m ctor_induct2 ks ctor_rels rel_mono_strongs =
   704 fun mk_rel_induct_tac ctxt IHs m ctor_induct2 ks ctor_rels rel_mono_strong0s =
   705   let val n = length ks;
   705   let val n = length ks;
   706   in
   706   in
   707     unfold_tac ctxt @{thms le_fun_def le_bool_def all_simps(1,2)[symmetric]} THEN
   707     unfold_tac ctxt @{thms le_fun_def le_bool_def all_simps(1,2)[symmetric]} THEN
   708     EVERY' [REPEAT_DETERM o rtac allI, rtac ctor_induct2,
   708     EVERY' [REPEAT_DETERM o rtac allI, rtac ctor_induct2,
   709       EVERY' (map3 (fn IH => fn ctor_rel => fn rel_mono_strong =>
   709       EVERY' (map3 (fn IH => fn ctor_rel => fn rel_mono_strong0 =>
   710         EVERY' [rtac impI, dtac (ctor_rel RS iffD1), rtac (IH RS @{thm spec2} RS mp),
   710         EVERY' [rtac impI, dtac (ctor_rel RS iffD1), rtac (IH RS @{thm spec2} RS mp),
   711           etac rel_mono_strong,
   711           etac rel_mono_strong0,
   712           REPEAT_DETERM_N m o rtac @{thm ballI[OF ballI[OF imp_refl]]},
   712           REPEAT_DETERM_N m o rtac @{thm ballI[OF ballI[OF imp_refl]]},
   713           EVERY' (map (fn j =>
   713           EVERY' (map (fn j =>
   714             EVERY' [select_prem_tac n (dtac asm_rl) j, rtac @{thm ballI[OF ballI]},
   714             EVERY' [select_prem_tac n (dtac asm_rl) j, rtac @{thm ballI[OF ballI]},
   715               Goal.assume_rule_tac ctxt]) ks)])
   715               Goal.assume_rule_tac ctxt]) ks)])
   716       IHs ctor_rels rel_mono_strongs)] 1
   716       IHs ctor_rels rel_mono_strong0s)] 1
   717   end;
   717   end;
   718 
   718 
   719 fun mk_fold_transfer_tac ctxt m ctor_rel_induct map_transfers folds =
   719 fun mk_fold_transfer_tac ctxt m ctor_rel_induct map_transfers folds =
   720   let
   720   let
   721     val n = length map_transfers;
   721     val n = length map_transfers;