src/HOL/Set.thy
changeset 46127 af3b95160b59
parent 46036 6a86cc88b02f
child 46128 53e7cc599f58
equal deleted inserted replaced
46126:bab00660539d 46127:af3b95160b59
   506 
   506 
   507 lemma subsetCE [no_atp,elim]: "A \<subseteq> B ==> (c \<notin> A ==> P) ==> (c \<in> B ==> P) ==> P"
   507 lemma subsetCE [no_atp,elim]: "A \<subseteq> B ==> (c \<notin> A ==> P) ==> (c \<in> B ==> P) ==> P"
   508   -- {* Classical elimination rule. *}
   508   -- {* Classical elimination rule. *}
   509   by (auto simp add: less_eq_set_def le_fun_def)
   509   by (auto simp add: less_eq_set_def le_fun_def)
   510 
   510 
   511 lemma subset_eq [no_atp]: "A \<le> B = (\<forall>x\<in>A. x \<in> B)" by blast
   511 lemma subset_eq [code, no_atp]: "A \<le> B = (\<forall>x\<in>A. x \<in> B)" by blast
   512 
   512 
   513 lemma contra_subsetD [no_atp]: "A \<subseteq> B ==> c \<notin> B ==> c \<notin> A"
   513 lemma contra_subsetD [no_atp]: "A \<subseteq> B ==> c \<notin> B ==> c \<notin> A"
   514   by blast
   514   by blast
   515 
   515 
   516 lemma subset_refl: "A \<subseteq> A"
   516 lemma subset_refl: "A \<subseteq> A"
  1808 
  1808 
  1809 
  1809 
  1810 subsubsection {* Operations for execution *}
  1810 subsubsection {* Operations for execution *}
  1811 
  1811 
  1812 definition is_empty :: "'a set \<Rightarrow> bool" where
  1812 definition is_empty :: "'a set \<Rightarrow> bool" where
  1813   "is_empty A \<longleftrightarrow> A = {}"
  1813   [code_abbrev]: "is_empty A \<longleftrightarrow> A = {}"
  1814 
  1814 
  1815 hide_const (open) is_empty
  1815 hide_const (open) is_empty
  1816 
  1816 
  1817 definition remove :: "'a \<Rightarrow> 'a set \<Rightarrow> 'a set" where
  1817 definition remove :: "'a \<Rightarrow> 'a set \<Rightarrow> 'a set" where
  1818   "remove x A = A - {x}"
  1818   [code_abbrev]: "remove x A = A - {x}"
  1819 
  1819 
  1820 hide_const (open) remove
  1820 hide_const (open) remove
  1821 
  1821 
  1822 definition project :: "('a \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> 'a set" where
  1822 definition project :: "('a \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> 'a set" where
  1823   [code_abbrev]: "project P A = {a \<in> A. P a}"
  1823   [code_abbrev]: "project P A = {a \<in> A. P a}"
  1832 
  1832 
  1833 instance proof
  1833 instance proof
  1834 qed (auto simp add: equal_set_def)
  1834 qed (auto simp add: equal_set_def)
  1835 
  1835 
  1836 end
  1836 end
       
  1837 
  1837 
  1838 
  1838 text {* Misc *}
  1839 text {* Misc *}
  1839 
  1840 
  1840 hide_const (open) member not_member
  1841 hide_const (open) member not_member
  1841 
  1842