src/HOL/Set.thy
changeset 42456 13b4b6ba3593
parent 42455 6702c984bf5a
child 42459 38b9f023cc34
equal deleted inserted replaced
42455:6702c984bf5a 42456:13b4b6ba3593
    75 to the front (and similarly for @{text "t=x"}):
    75 to the front (and similarly for @{text "t=x"}):
    76 *}
    76 *}
    77 
    77 
    78 simproc_setup defined_Collect ("{x. P x & Q x}") = {*
    78 simproc_setup defined_Collect ("{x. P x & Q x}") = {*
    79   let
    79   let
    80     val Coll_perm_tac =
    80     val Collect_perm_tac =
    81       rtac @{thm Collect_cong} 1 THEN
    81       rtac @{thm Collect_cong} 1 THEN
    82       rtac @{thm iffI} 1 THEN
    82       rtac @{thm iffI} 1 THEN
    83       ALLGOALS (EVERY' [REPEAT_DETERM o etac @{thm conjE}, DEPTH_SOLVE_1 o ares_tac @{thms conjI}]);
    83       ALLGOALS (EVERY' [REPEAT_DETERM o etac @{thm conjE}, DEPTH_SOLVE_1 o ares_tac @{thms conjI}]);
    84   in
    84   in
    85     fn _ => fn ss => fn ct =>
    85     fn _ => fn ss => Quantifier1.rearrange_Collect Collect_perm_tac ss o term_of
    86       Quantifier1.rearrange_Coll Coll_perm_tac (theory_of_cterm ct) ss (term_of ct)
       
    87   end
    86   end
    88 *}
    87 *}
    89 
    88 
    90 lemmas CollectE = CollectD [elim_format]
    89 lemmas CollectE = CollectD [elim_format]
    91 
    90 
   331 simproc_setup defined_Bex ("EX x:A. P x & Q x") = {*
   330 simproc_setup defined_Bex ("EX x:A. P x & Q x") = {*
   332   let
   331   let
   333     val unfold_bex_tac = unfold_tac @{thms Bex_def};
   332     val unfold_bex_tac = unfold_tac @{thms Bex_def};
   334     fun prove_bex_tac ss = unfold_bex_tac ss THEN Quantifier1.prove_one_point_ex_tac;
   333     fun prove_bex_tac ss = unfold_bex_tac ss THEN Quantifier1.prove_one_point_ex_tac;
   335   in
   334   in
   336     fn _ => fn ss => fn ct =>
   335     fn _ => fn ss => Quantifier1.rearrange_bex (prove_bex_tac ss) ss o term_of
   337       Quantifier1.rearrange_bex prove_bex_tac (theory_of_cterm ct) ss (term_of ct)
       
   338   end
   336   end
   339 *}
   337 *}
   340 
   338 
   341 simproc_setup defined_All ("ALL x:A. P x --> Q x") = {*
   339 simproc_setup defined_All ("ALL x:A. P x --> Q x") = {*
   342   let
   340   let
   343     val unfold_ball_tac = unfold_tac @{thms Ball_def};
   341     val unfold_ball_tac = unfold_tac @{thms Ball_def};
   344     fun prove_ball_tac ss = unfold_ball_tac ss THEN Quantifier1.prove_one_point_all_tac;
   342     fun prove_ball_tac ss = unfold_ball_tac ss THEN Quantifier1.prove_one_point_all_tac;
   345   in
   343   in
   346     fn _ => fn ss => fn ct =>
   344     fn _ => fn ss => Quantifier1.rearrange_ball (prove_ball_tac ss) ss o term_of
   347       Quantifier1.rearrange_ball prove_ball_tac (theory_of_cterm ct) ss (term_of ct)
       
   348   end
   345   end
   349 *}
   346 *}
   350 
   347 
   351 lemma ballI [intro!]: "(!!x. x:A ==> P x) ==> ALL x:A. P x"
   348 lemma ballI [intro!]: "(!!x. x:A ==> P x) ==> ALL x:A. P x"
   352   by (simp add: Ball_def)
   349   by (simp add: Ball_def)