src/HOL/Set.thy
changeset 32705 04ce6bb14d85
parent 32683 7c1fe854ca6a
child 32888 ae17e72aac80
equal deleted inserted replaced
32682:304a47739407 32705:04ce6bb14d85
   650 lemma Compl_eq: "- A = {x. ~ x : A}" by blast
   650 lemma Compl_eq: "- A = {x. ~ x : A}" by blast
   651 
   651 
   652 
   652 
   653 subsubsection {* Binary union -- Un *}
   653 subsubsection {* Binary union -- Un *}
   654 
   654 
   655 definition union :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "Un" 65) where
   655 abbreviation union :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "Un" 65) where
   656   sup_set_eq [symmetric]: "A Un B = sup A B"
   656   "op Un \<equiv> sup"
   657 
   657 
   658 notation (xsymbols)
   658 notation (xsymbols)
   659   union  (infixl "\<union>" 65)
   659   union  (infixl "\<union>" 65)
   660 
   660 
   661 notation (HTML output)
   661 notation (HTML output)
   662   union  (infixl "\<union>" 65)
   662   union  (infixl "\<union>" 65)
   663 
   663 
   664 lemma Un_def:
   664 lemma Un_def:
   665   "A \<union> B = {x. x \<in> A \<or> x \<in> B}"
   665   "A \<union> B = {x. x \<in> A \<or> x \<in> B}"
   666   by (simp add: sup_fun_eq sup_bool_eq sup_set_eq [symmetric] Collect_def mem_def)
   666   by (simp add: sup_fun_eq sup_bool_eq Collect_def mem_def)
   667 
   667 
   668 lemma Un_iff [simp]: "(c : A Un B) = (c:A | c:B)"
   668 lemma Un_iff [simp]: "(c : A Un B) = (c:A | c:B)"
   669   by (unfold Un_def) blast
   669   by (unfold Un_def) blast
   670 
   670 
   671 lemma UnI1 [elim?]: "c:A ==> c : A Un B"
   671 lemma UnI1 [elim?]: "c:A ==> c : A Un B"
   687 
   687 
   688 lemma insert_def: "insert a B = {x. x = a} \<union> B"
   688 lemma insert_def: "insert a B = {x. x = a} \<union> B"
   689   by (simp add: Collect_def mem_def insert_compr Un_def)
   689   by (simp add: Collect_def mem_def insert_compr Un_def)
   690 
   690 
   691 lemma mono_Un: "mono f \<Longrightarrow> f A \<union> f B \<subseteq> f (A \<union> B)"
   691 lemma mono_Un: "mono f \<Longrightarrow> f A \<union> f B \<subseteq> f (A \<union> B)"
   692   apply (fold sup_set_eq)
   692   by (fact mono_sup)
   693   apply (erule mono_sup)
       
   694   done
       
   695 
   693 
   696 
   694 
   697 subsubsection {* Binary intersection -- Int *}
   695 subsubsection {* Binary intersection -- Int *}
   698 
   696 
   699 definition inter :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "Int" 70) where
   697 abbreviation inter :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "Int" 70) where
   700   inf_set_eq [symmetric]: "A Int B = inf A B"
   698   "op Int \<equiv> inf"
   701 
   699 
   702 notation (xsymbols)
   700 notation (xsymbols)
   703   inter  (infixl "\<inter>" 70)
   701   inter  (infixl "\<inter>" 70)
   704 
   702 
   705 notation (HTML output)
   703 notation (HTML output)
   706   inter  (infixl "\<inter>" 70)
   704   inter  (infixl "\<inter>" 70)
   707 
   705 
   708 lemma Int_def:
   706 lemma Int_def:
   709   "A \<inter> B = {x. x \<in> A \<and> x \<in> B}"
   707   "A \<inter> B = {x. x \<in> A \<and> x \<in> B}"
   710   by (simp add: inf_fun_eq inf_bool_eq inf_set_eq [symmetric] Collect_def mem_def)
   708   by (simp add: inf_fun_eq inf_bool_eq Collect_def mem_def)
   711 
   709 
   712 lemma Int_iff [simp]: "(c : A Int B) = (c:A & c:B)"
   710 lemma Int_iff [simp]: "(c : A Int B) = (c:A & c:B)"
   713   by (unfold Int_def) blast
   711   by (unfold Int_def) blast
   714 
   712 
   715 lemma IntI [intro!]: "c:A ==> c:B ==> c : A Int B"
   713 lemma IntI [intro!]: "c:A ==> c:B ==> c : A Int B"
   723 
   721 
   724 lemma IntE [elim!]: "c : A Int B ==> (c:A ==> c:B ==> P) ==> P"
   722 lemma IntE [elim!]: "c : A Int B ==> (c:A ==> c:B ==> P) ==> P"
   725   by simp
   723   by simp
   726 
   724 
   727 lemma mono_Int: "mono f \<Longrightarrow> f (A \<inter> B) \<subseteq> f A \<inter> f B"
   725 lemma mono_Int: "mono f \<Longrightarrow> f (A \<inter> B) \<subseteq> f A \<inter> f B"
   728   apply (fold inf_set_eq)
   726   by (fact mono_inf)
   729   apply (erule mono_inf)
       
   730   done
       
   731 
   727 
   732 
   728 
   733 subsubsection {* Set difference *}
   729 subsubsection {* Set difference *}
   734 
   730 
   735 lemma Diff_iff [simp]: "(c : A - B) = (c:A & c~:B)"
   731 lemma Diff_iff [simp]: "(c : A - B) = (c:A & c~:B)"