src/HOL/Set.thy
changeset 31166 a90fe83f58ea
parent 30814 10dc9bc264b7
child 31197 c1c163ec6c44
equal deleted inserted replaced
31159:bac0d673b6d6 31166:a90fe83f58ea
  1031 lemma rangeE [elim?]: "b \<in> range (\<lambda>x. f x) ==> (!!x. b = f x ==> P) ==> P"
  1031 lemma rangeE [elim?]: "b \<in> range (\<lambda>x. f x) ==> (!!x. b = f x ==> P) ==> P"
  1032   by blast
  1032   by blast
  1033 
  1033 
  1034 
  1034 
  1035 subsubsection {* Set reasoning tools *}
  1035 subsubsection {* Set reasoning tools *}
       
  1036 
       
  1037 text{* Elimination of @{text"{x. \<dots> & x=t & \<dots>}"}. *}
       
  1038 
       
  1039 lemma singleton_conj_conv[simp]: "{x. x=a & P x} = (if P a then {a} else {})"
       
  1040 by auto
       
  1041 
       
  1042 lemma singleton_conj_conv2[simp]: "{x. a=x & P x} = (if P a then {a} else {})"
       
  1043 by auto
       
  1044 
       
  1045 ML{*
       
  1046   local
       
  1047     val Coll_perm_tac = rtac @{thm Collect_cong} 1 THEN rtac @{thm iffI} 1 THEN
       
  1048     ALLGOALS(EVERY'[REPEAT_DETERM o (etac @{thm conjE}),
       
  1049                     DEPTH_SOLVE_1 o (ares_tac [@{thm conjI}])])
       
  1050   in
       
  1051     val defColl_regroup = Simplifier.simproc (the_context ())
       
  1052       "defined Collect" ["{x. P x & Q x}"]
       
  1053       (Quantifier1.rearrange_Coll Coll_perm_tac)
       
  1054   end;
       
  1055 
       
  1056   Addsimprocs [defColl_regroup];
       
  1057 
       
  1058 *}
  1036 
  1059 
  1037 text {*
  1060 text {*
  1038   Rewrite rules for boolean case-splitting: faster than @{text
  1061   Rewrite rules for boolean case-splitting: faster than @{text
  1039   "split_if [split]"}.
  1062   "split_if [split]"}.
  1040 *}
  1063 *}