src/HOL/Complete_Lattice.thy
changeset 44084 caac24afcadb
parent 44068 dc0a73004c94
parent 44083 9f8790f8e589
child 44085 a65e26f1427b
equal deleted inserted replaced
44070:cebb7abb54b1 44084:caac24afcadb
   127   using le_SUP_I [of i A f] by auto
   127   using le_SUP_I [of i A f] by auto
   128 
   128 
   129 lemma le_Inf_iff: "b \<sqsubseteq> \<Sqinter>A \<longleftrightarrow> (\<forall>a\<in>A. b \<sqsubseteq> a)"
   129 lemma le_Inf_iff: "b \<sqsubseteq> \<Sqinter>A \<longleftrightarrow> (\<forall>a\<in>A. b \<sqsubseteq> a)"
   130   by (auto intro: Inf_greatest dest: Inf_lower)
   130   by (auto intro: Inf_greatest dest: Inf_lower)
   131 
   131 
   132 lemma le_INF_iff: "u \<sqsubseteq> (\<Sqinter>i\<in>A. f i) \<longleftrightarrow> (\<forall>i \<in> A. u \<sqsubseteq> f i)"
   132 lemma le_INF_iff: "u \<sqsubseteq> (\<Sqinter>i\<in>A. f i) \<longleftrightarrow> (\<forall>i\<in>A. u \<sqsubseteq> f i)"
   133   by (auto simp add: INF_def le_Inf_iff)
   133   by (auto simp add: INF_def le_Inf_iff)
   134 
   134 
   135 lemma Sup_le_iff: "\<Squnion>A \<sqsubseteq> b \<longleftrightarrow> (\<forall>a\<in>A. a \<sqsubseteq> b)"
   135 lemma Sup_le_iff: "\<Squnion>A \<sqsubseteq> b \<longleftrightarrow> (\<forall>a\<in>A. a \<sqsubseteq> b)"
   136   by (auto intro: Sup_least dest: Sup_upper)
   136   by (auto intro: Sup_least dest: Sup_upper)
   137 
   137 
   138 lemma SUP_le_iff: "(\<Squnion>i\<in>A. f i) \<sqsubseteq> u \<longleftrightarrow> (\<forall>i \<in> A. f i \<sqsubseteq> u)"
   138 lemma SUP_le_iff: "(\<Squnion>i\<in>A. f i) \<sqsubseteq> u \<longleftrightarrow> (\<forall>i\<in>A. f i \<sqsubseteq> u)"
   139   by (auto simp add: SUP_def Sup_le_iff)
   139   by (auto simp add: SUP_def Sup_le_iff)
   140 
   140 
   141 lemma Inf_empty [simp]:
   141 lemma Inf_empty [simp]:
   142   "\<Sqinter>{} = \<top>"
   142   "\<Sqinter>{} = \<top>"
   143   by (auto intro: antisym Inf_greatest)
   143   by (auto intro: antisym Inf_greatest)
   158 
   158 
   159 lemma Sup_UNIV [simp]:
   159 lemma Sup_UNIV [simp]:
   160   "\<Squnion>UNIV = \<top>"
   160   "\<Squnion>UNIV = \<top>"
   161   by (auto intro!: antisym Sup_upper)
   161   by (auto intro!: antisym Sup_upper)
   162 
   162 
   163 lemma Inf_insert: "\<Sqinter>insert a A = a \<sqinter> \<Sqinter>A"
   163 lemma Inf_insert (*[simp]*): "\<Sqinter>insert a A = a \<sqinter> \<Sqinter>A"
   164   by (auto intro: le_infI le_infI1 le_infI2 antisym Inf_greatest Inf_lower)
   164   by (auto intro: le_infI le_infI1 le_infI2 antisym Inf_greatest Inf_lower)
   165 
   165 
   166 lemma INF_insert: "(\<Sqinter>x\<in>insert a A. f x) = f a \<sqinter> INFI A f"
   166 lemma INF_insert: "(\<Sqinter>x\<in>insert a A. f x) = f a \<sqinter> INFI A f"
   167   by (simp add: INF_def Inf_insert)
   167   by (simp add: INF_def Inf_insert)
   168 
   168 
   169 lemma Sup_insert: "\<Squnion>insert a A = a \<squnion> \<Squnion>A"
   169 lemma Sup_insert (*[simp]*): "\<Squnion>insert a A = a \<squnion> \<Squnion>A"
   170   by (auto intro: le_supI le_supI1 le_supI2 antisym Sup_least Sup_upper)
   170   by (auto intro: le_supI le_supI1 le_supI2 antisym Sup_least Sup_upper)
   171 
   171 
   172 lemma SUP_insert: "(\<Squnion>x\<in>insert a A. f x) = f a \<squnion> SUPR A f"
   172 lemma SUP_insert: "(\<Squnion>x\<in>insert a A. f x) = f a \<squnion> SUPR A f"
   173   by (simp add: SUP_def Sup_insert)
   173   by (simp add: SUP_def Sup_insert)
   174 
   174 
   181 lemma Inf_Sup: "\<Sqinter>A = \<Squnion>{b. \<forall>a \<in> A. b \<sqsubseteq> a}"
   181 lemma Inf_Sup: "\<Sqinter>A = \<Squnion>{b. \<forall>a \<in> A. b \<sqsubseteq> a}"
   182   by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least)
   182   by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least)
   183 
   183 
   184 lemma Sup_Inf:  "\<Squnion>A = \<Sqinter>{b. \<forall>a \<in> A. a \<sqsubseteq> b}"
   184 lemma Sup_Inf:  "\<Squnion>A = \<Sqinter>{b. \<forall>a \<in> A. a \<sqsubseteq> b}"
   185   by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least)
   185   by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least)
   186 
       
   187 lemma Inf_singleton [simp]:
       
   188   "\<Sqinter>{a} = a"
       
   189   by (auto intro: antisym Inf_lower Inf_greatest)
       
   190 
       
   191 lemma Sup_singleton [simp]:
       
   192   "\<Squnion>{a} = a"
       
   193   by (auto intro: antisym Sup_upper Sup_least)
       
   194 
       
   195 lemma Inf_binary:
       
   196   "\<Sqinter>{a, b} = a \<sqinter> b"
       
   197   by (simp add: Inf_insert)
       
   198 
       
   199 lemma Sup_binary:
       
   200   "\<Squnion>{a, b} = a \<squnion> b"
       
   201   by (simp add: Sup_insert)
       
   202 
   186 
   203 lemma Inf_superset_mono: "B \<subseteq> A \<Longrightarrow> \<Sqinter>A \<sqsubseteq> \<Sqinter>B"
   187 lemma Inf_superset_mono: "B \<subseteq> A \<Longrightarrow> \<Sqinter>A \<sqsubseteq> \<Sqinter>B"
   204   by (auto intro: Inf_greatest Inf_lower)
   188   by (auto intro: Inf_greatest Inf_lower)
   205 
   189 
   206 lemma Sup_subset_mono: "A \<subseteq> B \<Longrightarrow> \<Squnion>A \<sqsubseteq> \<Squnion>B"
   190 lemma Sup_subset_mono: "A \<subseteq> B \<Longrightarrow> \<Squnion>A \<sqsubseteq> \<Squnion>B"
   304 proof -
   288 proof -
   305   show "\<Sqinter>A = \<top> \<longleftrightarrow> (\<forall>x\<in>A. x = \<top>)"
   289   show "\<Sqinter>A = \<top> \<longleftrightarrow> (\<forall>x\<in>A. x = \<top>)"
   306   proof
   290   proof
   307     assume "\<forall>x\<in>A. x = \<top>"
   291     assume "\<forall>x\<in>A. x = \<top>"
   308     then have "A = {} \<or> A = {\<top>}" by auto
   292     then have "A = {} \<or> A = {\<top>}" by auto
   309     then show "\<Sqinter>A = \<top>" by auto
   293     then show "\<Sqinter>A = \<top>" by (auto simp add: Inf_insert)
   310   next
   294   next
   311     assume "\<Sqinter>A = \<top>"
   295     assume "\<Sqinter>A = \<top>"
   312     show "\<forall>x\<in>A. x = \<top>"
   296     show "\<forall>x\<in>A. x = \<top>"
   313     proof (rule ccontr)
   297     proof (rule ccontr)
   314       assume "\<not> (\<forall>x\<in>A. x = \<top>)"
   298       assume "\<not> (\<forall>x\<in>A. x = \<top>)"
   448 
   432 
   449 subclass distrib_lattice proof -- {* Question: is it sufficient to include @{class distrib_lattice}
   433 subclass distrib_lattice proof -- {* Question: is it sufficient to include @{class distrib_lattice}
   450   and prove @{text inf_Sup} and @{text sup_Inf} from that? *}
   434   and prove @{text inf_Sup} and @{text sup_Inf} from that? *}
   451   fix a b c
   435   fix a b c
   452   from sup_Inf have "a \<squnion> \<Sqinter>{b, c} = (\<Sqinter>d\<in>{b, c}. a \<squnion> d)" .
   436   from sup_Inf have "a \<squnion> \<Sqinter>{b, c} = (\<Sqinter>d\<in>{b, c}. a \<squnion> d)" .
   453   then show "a \<squnion> b \<sqinter> c = (a \<squnion> b) \<sqinter> (a \<squnion> c)" by (simp add: INF_def Inf_binary)
   437   then show "a \<squnion> b \<sqinter> c = (a \<squnion> b) \<sqinter> (a \<squnion> c)" by (simp add: INF_def Inf_insert)
   454 qed
   438 qed
   455 
   439 
   456 lemma Inf_sup:
   440 lemma Inf_sup:
   457   "\<Sqinter>B \<squnion> a = (\<Sqinter>b\<in>B. b \<squnion> a)"
   441   "\<Sqinter>B \<squnion> a = (\<Sqinter>b\<in>B. b \<squnion> a)"
   458   by (simp add: sup_Inf sup_commute)
   442   by (simp add: sup_Inf sup_commute)
   702 
   686 
   703 lemma Inter_greatest: "(\<And>X. X \<in> A \<Longrightarrow> C \<subseteq> X) \<Longrightarrow> C \<subseteq> Inter A"
   687 lemma Inter_greatest: "(\<And>X. X \<in> A \<Longrightarrow> C \<subseteq> X) \<Longrightarrow> C \<subseteq> Inter A"
   704   by (fact Inf_greatest)
   688   by (fact Inf_greatest)
   705 
   689 
   706 lemma Int_eq_Inter: "A \<inter> B = \<Inter>{A, B}"
   690 lemma Int_eq_Inter: "A \<inter> B = \<Inter>{A, B}"
   707   by (fact Inf_binary [symmetric])
   691   by (simp add: Inf_insert)
   708 
   692 
   709 lemma Inter_empty: "\<Inter>{} = UNIV"
   693 lemma Inter_empty: "\<Inter>{} = UNIV"
   710   by (fact Inf_empty) (* already simp *)
   694   by (fact Inf_empty) (* already simp *)
   711 
   695 
   712 lemma Inter_UNIV: "\<Inter>UNIV = {}"
   696 lemma Inter_UNIV: "\<Inter>UNIV = {}"
  1210   by auto
  1194   by auto
  1211 
  1195 
  1212 
  1196 
  1213 text {* Legacy names *}
  1197 text {* Legacy names *}
  1214 
  1198 
       
  1199 lemma (in complete_lattice) Inf_singleton [simp]:
       
  1200   "\<Sqinter>{a} = a"
       
  1201   by (simp add: Inf_insert)
       
  1202 
       
  1203 lemma (in complete_lattice) Sup_singleton [simp]:
       
  1204   "\<Squnion>{a} = a"
       
  1205   by (simp add: Sup_insert)
       
  1206 
       
  1207 lemma (in complete_lattice) Inf_binary:
       
  1208   "\<Sqinter>{a, b} = a \<sqinter> b"
       
  1209   by (simp add: Inf_insert)
       
  1210 
       
  1211 lemma (in complete_lattice) Sup_binary:
       
  1212   "\<Squnion>{a, b} = a \<squnion> b"
       
  1213   by (simp add: Sup_insert)
       
  1214 
  1215 lemmas (in complete_lattice) INFI_def = INF_def
  1215 lemmas (in complete_lattice) INFI_def = INF_def
  1216 lemmas (in complete_lattice) SUPR_def = SUP_def
  1216 lemmas (in complete_lattice) SUPR_def = SUP_def
  1217 lemmas (in complete_lattice) le_SUPI = le_SUP_I
  1217 lemmas (in complete_lattice) le_SUPI = le_SUP_I
  1218 lemmas (in complete_lattice) le_SUPI2 = le_SUP_I2
  1218 lemmas (in complete_lattice) le_SUPI2 = le_SUP_I2
  1219 lemmas (in complete_lattice) le_INFI = le_INF_I
  1219 lemmas (in complete_lattice) le_INFI = le_INF_I