src/HOL/Set.thy
changeset 69768 7e4966eaf781
parent 69712 dc85b5b3a532
child 69939 812ce526da33
equal deleted inserted replaced
69767:d10fafeb93c0 69768:7e4966eaf781
   928 
   928 
   929 lemma if_image_distrib [simp]:
   929 lemma if_image_distrib [simp]:
   930   "(\<lambda>x. if P x then f x else g x) ` S = f ` (S \<inter> {x. P x}) \<union> g ` (S \<inter> {x. \<not> P x})"
   930   "(\<lambda>x. if P x then f x else g x) ` S = f ` (S \<inter> {x. P x}) \<union> g ` (S \<inter> {x. \<not> P x})"
   931   by auto
   931   by auto
   932 
   932 
   933 lemma image_cong: "\<lbrakk> M = N;  \<And>x. x \<in> N \<Longrightarrow> f x = g x \<rbrakk> \<Longrightarrow> f ` M = g ` N"
   933 lemma image_cong:
   934 by (simp add: image_def)
   934   "f ` M = g ` N" if "M = N" "\<And>x. x \<in> N \<Longrightarrow> f x = g x"
   935 
   935   using that by (simp add: image_def)
   936 lemma image_cong_simp: "\<lbrakk> M = N; \<And>x. x \<in> N =simp=> f x = g x\<rbrakk> \<Longrightarrow> f ` M = g ` N"
   936 
   937 by (simp add: image_def simp_implies_def)
   937 lemma image_cong_simp [cong]:
       
   938   "f ` M = g ` N" if "M = N" "\<And>x. x \<in> N =simp=> f x = g x"
       
   939   using that image_cong [of M N f g] by (simp add: simp_implies_def)
   938 
   940 
   939 lemma image_Int_subset: "f ` (A \<inter> B) \<subseteq> f ` A \<inter> f ` B"
   941 lemma image_Int_subset: "f ` (A \<inter> B) \<subseteq> f ` A \<inter> f ` B"
   940   by blast
   942   by blast
   941 
   943 
   942 lemma image_diff_subset: "f ` A - f ` B \<subseteq> f ` (A - B)"
   944 lemma image_diff_subset: "f ` A - f ` B \<subseteq> f ` (A - B)"