src/HOL/Tools/BNF/bnf_gfp_tactics.ML
changeset 60757 c09598a97436
parent 60752 b48830b670a1
child 60777 ee811a49c8f6
equal deleted inserted replaced
60756:f122140b7195 60757:c09598a97436
   115 
   115 
   116 fun mk_coalg_set_tac ctxt coalg_def =
   116 fun mk_coalg_set_tac ctxt coalg_def =
   117   dtac ctxt (coalg_def RS iffD1) 1 THEN
   117   dtac ctxt (coalg_def RS iffD1) 1 THEN
   118   REPEAT_DETERM (etac ctxt conjE 1) THEN
   118   REPEAT_DETERM (etac ctxt conjE 1) THEN
   119   EVERY' [dtac ctxt rev_bspec, assume_tac ctxt] 1 THEN
   119   EVERY' [dtac ctxt rev_bspec, assume_tac ctxt] 1 THEN
   120   REPEAT_DETERM (eresolve0_tac [CollectE, conjE] 1) THEN assume_tac ctxt 1;
   120   REPEAT_DETERM (eresolve_tac ctxt [CollectE, conjE] 1) THEN assume_tac ctxt 1;
   121 
   121 
   122 fun mk_mor_elim_tac ctxt mor_def =
   122 fun mk_mor_elim_tac ctxt mor_def =
   123   (dtac ctxt (mor_def RS iffD1) THEN'
   123   (dtac ctxt (mor_def RS iffD1) THEN'
   124   REPEAT o etac ctxt conjE THEN'
   124   REPEAT o etac ctxt conjE THEN'
   125   TRY o rtac ctxt @{thm image_subsetI} THEN'
   125   TRY o rtac ctxt @{thm image_subsetI} THEN'
   224     val thms = ((1 upto n) ~~ map_comp0s ~~ map_cong0s ~~ set_map0ss ~~ in_rels);
   224     val thms = ((1 upto n) ~~ map_comp0s ~~ map_cong0s ~~ set_map0ss ~~ in_rels);
   225 
   225 
   226     fun mk_if_tac ((((i, map_comp0), map_cong0), set_map0s), in_rel) =
   226     fun mk_if_tac ((((i, map_comp0), map_cong0), set_map0s), in_rel) =
   227       EVERY' [rtac ctxt allI, rtac ctxt allI, rtac ctxt impI, dtac ctxt (mk_conjunctN n i),
   227       EVERY' [rtac ctxt allI, rtac ctxt allI, rtac ctxt impI, dtac ctxt (mk_conjunctN n i),
   228         etac ctxt allE, etac ctxt allE, etac ctxt impE, assume_tac ctxt, etac ctxt bexE,
   228         etac ctxt allE, etac ctxt allE, etac ctxt impE, assume_tac ctxt, etac ctxt bexE,
   229         REPEAT_DETERM o eresolve0_tac [CollectE, conjE],
   229         REPEAT_DETERM o eresolve_tac ctxt [CollectE, conjE],
   230         rtac ctxt (in_rel RS iffD2), rtac ctxt exI, rtac ctxt (Drule.rotate_prems 1 conjI),
   230         rtac ctxt (in_rel RS iffD2), rtac ctxt exI, rtac ctxt (Drule.rotate_prems 1 conjI),
   231         CONJ_WRAP' (fn thm => EVERY' [rtac ctxt trans, rtac ctxt trans, rtac ctxt map_comp0, rtac ctxt map_cong0,
   231         CONJ_WRAP' (fn thm => EVERY' [rtac ctxt trans, rtac ctxt trans, rtac ctxt map_comp0, rtac ctxt map_cong0,
   232           REPEAT_DETERM_N m o rtac ctxt thm, REPEAT_DETERM_N n o rtac ctxt (@{thm comp_id} RS fun_cong),
   232           REPEAT_DETERM_N m o rtac ctxt thm, REPEAT_DETERM_N n o rtac ctxt (@{thm comp_id} RS fun_cong),
   233           assume_tac ctxt])
   233           assume_tac ctxt])
   234         @{thms fst_diag_id snd_diag_id},
   234         @{thms fst_diag_id snd_diag_id},
   244 
   244 
   245     fun mk_only_if_tac ((((i, map_comp0), map_cong0), set_map0s), in_rel) =
   245     fun mk_only_if_tac ((((i, map_comp0), map_cong0), set_map0s), in_rel) =
   246       EVERY' [dtac ctxt (mk_conjunctN n i), rtac ctxt allI, rtac ctxt allI, rtac ctxt impI,
   246       EVERY' [dtac ctxt (mk_conjunctN n i), rtac ctxt allI, rtac ctxt allI, rtac ctxt impI,
   247         etac ctxt allE, etac ctxt allE, etac ctxt impE, assume_tac ctxt,
   247         etac ctxt allE, etac ctxt allE, etac ctxt impE, assume_tac ctxt,
   248         dtac ctxt (in_rel RS @{thm iffD1}),
   248         dtac ctxt (in_rel RS @{thm iffD1}),
   249         REPEAT_DETERM o eresolve0_tac ([CollectE, conjE, exE] @
   249         REPEAT_DETERM o eresolve_tac ctxt ([CollectE, conjE, exE] @
   250           @{thms CollectE Collect_split_in_rel_leE}),
   250           @{thms CollectE Collect_split_in_rel_leE}),
   251         rtac ctxt bexI, rtac ctxt conjI, rtac ctxt trans, rtac ctxt map_comp0, rtac ctxt trans, rtac ctxt map_cong0,
   251         rtac ctxt bexI, rtac ctxt conjI, rtac ctxt trans, rtac ctxt map_comp0, rtac ctxt trans, rtac ctxt map_cong0,
   252         REPEAT_DETERM_N m o rtac ctxt (@{thm id_comp} RS fun_cong),
   252         REPEAT_DETERM_N m o rtac ctxt (@{thm id_comp} RS fun_cong),
   253         REPEAT_DETERM_N n o rtac ctxt (@{thm comp_id} RS fun_cong),
   253         REPEAT_DETERM_N n o rtac ctxt (@{thm comp_id} RS fun_cong),
   254         assume_tac ctxt, rtac ctxt trans, rtac ctxt map_comp0, rtac ctxt trans, rtac ctxt map_cong0,
   254         assume_tac ctxt, rtac ctxt trans, rtac ctxt map_comp0, rtac ctxt trans, rtac ctxt map_cong0,
   652           (length_Lev's ~~ (from_to_sbdss ~~ to_sbd_injss))))))) 1
   652           (length_Lev's ~~ (from_to_sbdss ~~ to_sbd_injss))))))) 1
   653   end;
   653   end;
   654 
   654 
   655 fun mk_congruent_str_final_tac ctxt m lsbisE map_comp_id map_cong0 equiv_LSBISs =
   655 fun mk_congruent_str_final_tac ctxt m lsbisE map_comp_id map_cong0 equiv_LSBISs =
   656   EVERY' [rtac ctxt @{thm congruentI}, dtac ctxt lsbisE,
   656   EVERY' [rtac ctxt @{thm congruentI}, dtac ctxt lsbisE,
   657     REPEAT_DETERM o eresolve0_tac [CollectE, conjE, bexE], rtac ctxt (o_apply RS trans),
   657     REPEAT_DETERM o eresolve_tac ctxt [CollectE, conjE, bexE], rtac ctxt (o_apply RS trans),
   658     etac ctxt (sym RS arg_cong RS trans), rtac ctxt (map_comp_id RS trans),
   658     etac ctxt (sym RS arg_cong RS trans), rtac ctxt (map_comp_id RS trans),
   659     rtac ctxt (map_cong0 RS trans), REPEAT_DETERM_N m o rtac ctxt refl,
   659     rtac ctxt (map_cong0 RS trans), REPEAT_DETERM_N m o rtac ctxt refl,
   660     EVERY' (map (fn equiv_LSBIS =>
   660     EVERY' (map (fn equiv_LSBIS =>
   661       EVERY' [rtac ctxt @{thm equiv_proj}, rtac ctxt equiv_LSBIS, etac ctxt set_mp, assume_tac ctxt])
   661       EVERY' [rtac ctxt @{thm equiv_proj}, rtac ctxt equiv_LSBIS, etac ctxt set_mp, assume_tac ctxt])
   662     equiv_LSBISs), rtac ctxt sym, rtac ctxt (o_apply RS trans),
   662     equiv_LSBISs), rtac ctxt sym, rtac ctxt (o_apply RS trans),