src/HOL/Tools/BNF/bnf_gfp_tactics.ML
changeset 56248 67dc9549fa15
parent 56179 6b5c46582260
child 56765 644f0d4820a1
equal deleted inserted replaced
56247:1ad01f98dc3e 56248:67dc9549fa15
   202           else EVERY' [rtac Un_cong, rtac @{thm box_equals},
   202           else EVERY' [rtac Un_cong, rtac @{thm box_equals},
   203             rtac (nth passive_set_map0s (j - 1) RS sym),
   203             rtac (nth passive_set_map0s (j - 1) RS sym),
   204             rtac trans_fun_cong_image_id_id_apply, etac (morE RS arg_cong), atac],
   204             rtac trans_fun_cong_image_id_id_apply, etac (morE RS arg_cong), atac],
   205           CONJ_WRAP_GEN' (rtac (Thm.permute_prems 0 1 Un_cong))
   205           CONJ_WRAP_GEN' (rtac (Thm.permute_prems 0 1 Un_cong))
   206             (fn (i, (set_map0, coalg_set)) =>
   206             (fn (i, (set_map0, coalg_set)) =>
   207               EVERY' [rtac sym, rtac trans, rtac (refl RSN (2, @{thm UN_cong})),
   207               EVERY' [rtac sym, rtac trans, rtac (refl RSN (2, @{thm SUP_cong})),
   208                 etac (morE RS sym RS arg_cong RS trans), atac, rtac set_map0,
   208                 etac (morE RS sym RS arg_cong RS trans), atac, rtac set_map0,
   209                 rtac (@{thm UN_simps(10)} RS trans), rtac (refl RS @{thm UN_cong}),
   209                 rtac (@{thm UN_simps(10)} RS trans), rtac (refl RS @{thm SUP_cong}),
   210                 ftac coalg_set, atac, dtac set_mp, atac, rtac mp, rtac (mk_conjunctN n i),
   210                 ftac coalg_set, atac, dtac set_mp, atac, rtac mp, rtac (mk_conjunctN n i),
   211                 REPEAT_DETERM o etac allE, atac, atac])
   211                 REPEAT_DETERM o etac allE, atac, atac])
   212             (rev ((1 upto n) ~~ (active_set_map0s ~~ coalg_sets)))])
   212             (rev ((1 upto n) ~~ (active_set_map0s ~~ coalg_sets)))])
   213       (rec_Sucs ~~ (morEs ~~ (map (chop m) set_map0ss ~~ map (drop m) coalg_setss)))] 1;
   213       (rec_Sucs ~~ (morEs ~~ (map (chop m) set_map0ss ~~ map (drop m) coalg_setss)))] 1;
   214 
   214 
   864       CONJ_WRAP' (fn (rec_Suc, (dtor_map, set_nats)) => EVERY'
   864       CONJ_WRAP' (fn (rec_Suc, (dtor_map, set_nats)) => EVERY'
   865         [SELECT_GOAL (unfold_thms_tac ctxt
   865         [SELECT_GOAL (unfold_thms_tac ctxt
   866           (rec_Suc :: dtor_map :: set_nats @ @{thms image_Un image_UN UN_simps(10)})),
   866           (rec_Suc :: dtor_map :: set_nats @ @{thms image_Un image_UN UN_simps(10)})),
   867         rtac Un_cong, rtac refl,
   867         rtac Un_cong, rtac refl,
   868         CONJ_WRAP_GEN' (rtac (Thm.permute_prems 0 1 Un_cong))
   868         CONJ_WRAP_GEN' (rtac (Thm.permute_prems 0 1 Un_cong))
   869           (fn i => EVERY' [rtac @{thm UN_cong[OF refl]},
   869           (fn i => EVERY' [rtac @{thm SUP_cong[OF refl]},
   870             REPEAT_DETERM o etac allE, etac (mk_conjunctN n i)]) (n downto 1)])
   870             REPEAT_DETERM o etac allE, etac (mk_conjunctN n i)]) (n downto 1)])
   871       (rec_Sucs ~~ (dtor_maps ~~ set_map0ss))] 1
   871       (rec_Sucs ~~ (dtor_maps ~~ set_map0ss))] 1
   872   end;
   872   end;
   873 
   873 
   874 fun mk_set_map0_tac col_natural =
   874 fun mk_set_map0_tac col_natural =
   875   EVERY' (map rtac [@{thm ext}, o_apply RS trans, sym, o_apply RS trans, @{thm image_UN} RS trans,
   875   EVERY' (map rtac [@{thm ext}, o_apply RS trans, sym, o_apply RS trans, @{thm image_UN} RS trans,
   876     refl RS @{thm UN_cong}, col_natural]) 1;
   876     refl RS @{thm SUP_cong}, col_natural]) 1;
   877 
   877 
   878 fun mk_col_bd_tac m j cts rec_0s rec_Sucs sbd_Card_order sbd_Cinfinite set_sbdss =
   878 fun mk_col_bd_tac m j cts rec_0s rec_Sucs sbd_Card_order sbd_Cinfinite set_sbdss =
   879   let
   879   let
   880     val n = length rec_0s;
   880     val n = length rec_0s;
   881   in
   881   in
   962           EVERY' [rtac ord_eq_le_trans, rtac dtor_set, rtac @{thm Un_least},
   962           EVERY' [rtac ord_eq_le_trans, rtac dtor_set, rtac @{thm Un_least},
   963             rtac ord_eq_le_trans, rtac @{thm box_equals}, rtac passive_set_map0,
   963             rtac ord_eq_le_trans, rtac @{thm box_equals}, rtac passive_set_map0,
   964             rtac (dtor_ctor RS sym RS arg_cong), rtac trans_fun_cong_image_id_id_apply, atac,
   964             rtac (dtor_ctor RS sym RS arg_cong), rtac trans_fun_cong_image_id_id_apply, atac,
   965             CONJ_WRAP_GEN' (rtac (Thm.permute_prems 0 1 @{thm Un_least}))
   965             CONJ_WRAP_GEN' (rtac (Thm.permute_prems 0 1 @{thm Un_least}))
   966               (fn (active_set_map0, in_Jrel) => EVERY' [rtac ord_eq_le_trans,
   966               (fn (active_set_map0, in_Jrel) => EVERY' [rtac ord_eq_le_trans,
   967                 rtac @{thm UN_cong[OF _ refl]}, rtac @{thm box_equals[OF _ _ refl]},
   967                 rtac @{thm SUP_cong[OF _ refl]}, rtac @{thm box_equals[OF _ _ refl]},
   968                 rtac active_set_map0, rtac (dtor_ctor RS sym RS arg_cong), rtac @{thm UN_least},
   968                 rtac active_set_map0, rtac (dtor_ctor RS sym RS arg_cong), rtac @{thm UN_least},
   969                 dtac set_rev_mp, etac @{thm image_mono}, etac imageE,
   969                 dtac set_rev_mp, etac @{thm image_mono}, etac imageE,
   970                 dtac @{thm ssubst_mem[OF pair_collapse]},
   970                 dtac @{thm ssubst_mem[OF pair_collapse]},
   971                 REPEAT_DETERM o eresolve_tac (CollectE :: conjE ::
   971                 REPEAT_DETERM o eresolve_tac (CollectE :: conjE ::
   972                   @{thms case_prodE iffD1[OF Pair_eq, elim_format]}),
   972                   @{thms case_prodE iffD1[OF Pair_eq, elim_format]}),