100 fix f :: "'b \<Rightarrow> 'a" and A |
100 fix f :: "'b \<Rightarrow> 'a" and A |
101 show "complete_lattice.INFI Sup A f = (\<Squnion>a\<in>A. f a)" |
101 show "complete_lattice.INFI Sup A f = (\<Squnion>a\<in>A. f a)" |
102 by (simp only: dual.INF_def SUP_def) |
102 by (simp only: dual.INF_def SUP_def) |
103 qed |
103 qed |
104 |
104 |
105 lemma INF_leI: "i \<in> A \<Longrightarrow> (\<Sqinter>i\<in>A. f i) \<sqsubseteq> f i" |
105 lemma INF_lower: "i \<in> A \<Longrightarrow> (\<Sqinter>i\<in>A. f i) \<sqsubseteq> f i" |
106 by (auto simp add: INF_def intro: Inf_lower) |
106 by (auto simp add: INF_def intro: Inf_lower) |
107 |
107 |
108 lemma le_SUP_I: "i \<in> A \<Longrightarrow> f i \<sqsubseteq> (\<Squnion>i\<in>A. f i)" |
108 lemma INF_greatest: "(\<And>i. i \<in> A \<Longrightarrow> u \<sqsubseteq> f i) \<Longrightarrow> u \<sqsubseteq> (\<Sqinter>i\<in>A. f i)" |
|
109 by (auto simp add: INF_def intro: Inf_greatest) |
|
110 |
|
111 lemma SUP_upper: "i \<in> A \<Longrightarrow> f i \<sqsubseteq> (\<Squnion>i\<in>A. f i)" |
109 by (auto simp add: SUP_def intro: Sup_upper) |
112 by (auto simp add: SUP_def intro: Sup_upper) |
110 |
113 |
111 lemma le_INF_I: "(\<And>i. i \<in> A \<Longrightarrow> u \<sqsubseteq> f i) \<Longrightarrow> u \<sqsubseteq> (\<Sqinter>i\<in>A. f i)" |
114 lemma SUP_least: "(\<And>i. i \<in> A \<Longrightarrow> f i \<sqsubseteq> u) \<Longrightarrow> (\<Squnion>i\<in>A. f i) \<sqsubseteq> u" |
112 by (auto simp add: INF_def intro: Inf_greatest) |
|
113 |
|
114 lemma SUP_leI: "(\<And>i. i \<in> A \<Longrightarrow> f i \<sqsubseteq> u) \<Longrightarrow> (\<Squnion>i\<in>A. f i) \<sqsubseteq> u" |
|
115 by (auto simp add: SUP_def intro: Sup_least) |
115 by (auto simp add: SUP_def intro: Sup_least) |
116 |
116 |
117 lemma Inf_lower2: "u \<in> A \<Longrightarrow> u \<sqsubseteq> v \<Longrightarrow> \<Sqinter>A \<sqsubseteq> v" |
117 lemma Inf_lower2: "u \<in> A \<Longrightarrow> u \<sqsubseteq> v \<Longrightarrow> \<Sqinter>A \<sqsubseteq> v" |
118 using Inf_lower [of u A] by auto |
118 using Inf_lower [of u A] by auto |
119 |
119 |
120 lemma INF_leI2: "i \<in> A \<Longrightarrow> f i \<sqsubseteq> u \<Longrightarrow> (\<Sqinter>i\<in>A. f i) \<sqsubseteq> u" |
120 lemma INF_lower2: "i \<in> A \<Longrightarrow> f i \<sqsubseteq> u \<Longrightarrow> (\<Sqinter>i\<in>A. f i) \<sqsubseteq> u" |
121 using INF_leI [of i A f] by auto |
121 using INF_lower [of i A f] by auto |
122 |
122 |
123 lemma Sup_upper2: "u \<in> A \<Longrightarrow> v \<sqsubseteq> u \<Longrightarrow> v \<sqsubseteq> \<Squnion>A" |
123 lemma Sup_upper2: "u \<in> A \<Longrightarrow> v \<sqsubseteq> u \<Longrightarrow> v \<sqsubseteq> \<Squnion>A" |
124 using Sup_upper [of u A] by auto |
124 using Sup_upper [of u A] by auto |
125 |
125 |
126 lemma le_SUP_I2: "i \<in> A \<Longrightarrow> u \<sqsubseteq> f i \<Longrightarrow> u \<sqsubseteq> (\<Squnion>i\<in>A. f i)" |
126 lemma SUP_upper2: "i \<in> A \<Longrightarrow> u \<sqsubseteq> f i \<Longrightarrow> u \<sqsubseteq> (\<Squnion>i\<in>A. f i)" |
127 using le_SUP_I [of i A f] by auto |
127 using SUP_upper [of i A f] by auto |
128 |
128 |
129 lemma le_Inf_iff (*[simp]*): "b \<sqsubseteq> \<Sqinter>A \<longleftrightarrow> (\<forall>a\<in>A. b \<sqsubseteq> a)" |
129 lemma le_Inf_iff (*[simp]*): "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 (*[simp]*): "u \<sqsubseteq> (\<Sqinter>i\<in>A. f i) \<longleftrightarrow> (\<forall>i\<in>A. u \<sqsubseteq> f i)" |
132 lemma le_INF_iff (*[simp]*): "u \<sqsubseteq> (\<Sqinter>i\<in>A. f i) \<longleftrightarrow> (\<forall>i\<in>A. u \<sqsubseteq> f i)" |
264 lemma Inf_union_distrib: "\<Sqinter>(A \<union> B) = \<Sqinter>A \<sqinter> \<Sqinter>B" |
264 lemma Inf_union_distrib: "\<Sqinter>(A \<union> B) = \<Sqinter>A \<sqinter> \<Sqinter>B" |
265 by (rule antisym) (auto intro: Inf_greatest Inf_lower le_infI1 le_infI2) |
265 by (rule antisym) (auto intro: Inf_greatest Inf_lower le_infI1 le_infI2) |
266 |
266 |
267 lemma INF_union: |
267 lemma INF_union: |
268 "(\<Sqinter>i \<in> A \<union> B. M i) = (\<Sqinter>i \<in> A. M i) \<sqinter> (\<Sqinter>i\<in>B. M i)" |
268 "(\<Sqinter>i \<in> A \<union> B. M i) = (\<Sqinter>i \<in> A. M i) \<sqinter> (\<Sqinter>i\<in>B. M i)" |
269 by (auto intro!: antisym INF_mono intro: le_infI1 le_infI2 le_INF_I INF_leI) |
269 by (auto intro!: antisym INF_mono intro: le_infI1 le_infI2 INF_greatest INF_lower) |
270 |
270 |
271 lemma Sup_union_distrib: "\<Squnion>(A \<union> B) = \<Squnion>A \<squnion> \<Squnion>B" |
271 lemma Sup_union_distrib: "\<Squnion>(A \<union> B) = \<Squnion>A \<squnion> \<Squnion>B" |
272 by (rule antisym) (auto intro: Sup_least Sup_upper le_supI1 le_supI2) |
272 by (rule antisym) (auto intro: Sup_least Sup_upper le_supI1 le_supI2) |
273 |
273 |
274 lemma SUP_union: |
274 lemma SUP_union: |
275 "(\<Squnion>i \<in> A \<union> B. M i) = (\<Squnion>i \<in> A. M i) \<squnion> (\<Squnion>i\<in>B. M i)" |
275 "(\<Squnion>i \<in> A \<union> B. M i) = (\<Squnion>i \<in> A. M i) \<squnion> (\<Squnion>i\<in>B. M i)" |
276 by (auto intro!: antisym SUP_mono intro: le_supI1 le_supI2 SUP_leI le_SUP_I) |
276 by (auto intro!: antisym SUP_mono intro: le_supI1 le_supI2 SUP_least SUP_upper) |
277 |
277 |
278 lemma INF_inf_distrib: "(\<Sqinter>a\<in>A. f a) \<sqinter> (\<Sqinter>a\<in>A. g a) = (\<Sqinter>a\<in>A. f a \<sqinter> g a)" |
278 lemma INF_inf_distrib: "(\<Sqinter>a\<in>A. f a) \<sqinter> (\<Sqinter>a\<in>A. g a) = (\<Sqinter>a\<in>A. f a \<sqinter> g a)" |
279 by (rule antisym) (rule le_INF_I, auto intro: le_infI1 le_infI2 INF_leI INF_mono) |
279 by (rule antisym) (rule INF_greatest, auto intro: le_infI1 le_infI2 INF_lower INF_mono) |
280 |
280 |
281 lemma SUP_sup_distrib: "(\<Squnion>a\<in>A. f a) \<squnion> (\<Squnion>a\<in>A. g a) = (\<Squnion>a\<in>A. f a \<squnion> g a)" |
281 lemma SUP_sup_distrib: "(\<Squnion>a\<in>A. f a) \<squnion> (\<Squnion>a\<in>A. g a) = (\<Squnion>a\<in>A. f a \<squnion> g a)" |
282 by (rule antisym) (auto intro: le_supI1 le_supI2 le_SUP_I SUP_mono, |
282 by (rule antisym) (auto intro: le_supI1 le_supI2 SUP_upper SUP_mono, |
283 rule SUP_leI, auto intro: le_supI1 le_supI2 le_SUP_I SUP_mono) |
283 rule SUP_least, auto intro: le_supI1 le_supI2 SUP_upper SUP_mono) |
284 |
284 |
285 lemma Inf_top_conv (*[simp]*) [no_atp]: |
285 lemma Inf_top_conv (*[simp]*) [no_atp]: |
286 "\<Sqinter>A = \<top> \<longleftrightarrow> (\<forall>x\<in>A. x = \<top>)" |
286 "\<Sqinter>A = \<top> \<longleftrightarrow> (\<forall>x\<in>A. x = \<top>)" |
287 "\<top> = \<Sqinter>A \<longleftrightarrow> (\<forall>x\<in>A. x = \<top>)" |
287 "\<top> = \<Sqinter>A \<longleftrightarrow> (\<forall>x\<in>A. x = \<top>)" |
288 proof - |
288 proof - |
322 "(\<Squnion>x\<in>A. B x) = \<bottom> \<longleftrightarrow> (\<forall>x\<in>A. B x = \<bottom>)" |
322 "(\<Squnion>x\<in>A. B x) = \<bottom> \<longleftrightarrow> (\<forall>x\<in>A. B x = \<bottom>)" |
323 "\<bottom> = (\<Squnion>x\<in>A. B x) \<longleftrightarrow> (\<forall>x\<in>A. B x = \<bottom>)" |
323 "\<bottom> = (\<Squnion>x\<in>A. B x) \<longleftrightarrow> (\<forall>x\<in>A. B x = \<bottom>)" |
324 by (auto simp add: SUP_def Sup_bot_conv) |
324 by (auto simp add: SUP_def Sup_bot_conv) |
325 |
325 |
326 lemma INF_const [simp]: "A \<noteq> {} \<Longrightarrow> (\<Sqinter>i\<in>A. f) = f" |
326 lemma INF_const [simp]: "A \<noteq> {} \<Longrightarrow> (\<Sqinter>i\<in>A. f) = f" |
327 by (auto intro: antisym INF_leI le_INF_I) |
327 by (auto intro: antisym INF_lower INF_greatest) |
328 |
328 |
329 lemma SUP_const [simp]: "A \<noteq> {} \<Longrightarrow> (\<Squnion>i\<in>A. f) = f" |
329 lemma SUP_const [simp]: "A \<noteq> {} \<Longrightarrow> (\<Squnion>i\<in>A. f) = f" |
330 by (auto intro: antisym SUP_leI le_SUP_I) |
330 by (auto intro: antisym SUP_upper SUP_least) |
331 |
331 |
332 lemma INF_top (*[simp]*): "(\<Sqinter>x\<in>A. \<top>) = \<top>" |
332 lemma INF_top (*[simp]*): "(\<Sqinter>x\<in>A. \<top>) = \<top>" |
333 by (cases "A = {}") (simp_all add: INF_empty) |
333 by (cases "A = {}") (simp_all add: INF_empty) |
334 |
334 |
335 lemma SUP_bot (*[simp]*): "(\<Squnion>x\<in>A. \<bottom>) = \<bottom>" |
335 lemma SUP_bot (*[simp]*): "(\<Squnion>x\<in>A. \<bottom>) = \<bottom>" |
336 by (cases "A = {}") (simp_all add: SUP_empty) |
336 by (cases "A = {}") (simp_all add: SUP_empty) |
337 |
337 |
338 lemma INF_commute: "(\<Sqinter>i\<in>A. \<Sqinter>j\<in>B. f i j) = (\<Sqinter>j\<in>B. \<Sqinter>i\<in>A. f i j)" |
338 lemma INF_commute: "(\<Sqinter>i\<in>A. \<Sqinter>j\<in>B. f i j) = (\<Sqinter>j\<in>B. \<Sqinter>i\<in>A. f i j)" |
339 by (iprover intro: INF_leI le_INF_I order_trans antisym) |
339 by (iprover intro: INF_lower INF_greatest order_trans antisym) |
340 |
340 |
341 lemma SUP_commute: "(\<Squnion>i\<in>A. \<Squnion>j\<in>B. f i j) = (\<Squnion>j\<in>B. \<Squnion>i\<in>A. f i j)" |
341 lemma SUP_commute: "(\<Squnion>i\<in>A. \<Squnion>j\<in>B. f i j) = (\<Squnion>j\<in>B. \<Squnion>i\<in>A. f i j)" |
342 by (iprover intro: SUP_leI le_SUP_I order_trans antisym) |
342 by (iprover intro: SUP_upper SUP_least order_trans antisym) |
343 |
343 |
344 lemma INF_absorb: |
344 lemma INF_absorb: |
345 assumes "k \<in> I" |
345 assumes "k \<in> I" |
346 shows "A k \<sqinter> (\<Sqinter>i\<in>I. A i) = (\<Sqinter>i\<in>I. A i)" |
346 shows "A k \<sqinter> (\<Sqinter>i\<in>I. A i) = (\<Sqinter>i\<in>I. A i)" |
347 proof - |
347 proof - |
368 lemma less_INF_D: |
368 lemma less_INF_D: |
369 assumes "y < (\<Sqinter>i\<in>A. f i)" "i \<in> A" shows "y < f i" |
369 assumes "y < (\<Sqinter>i\<in>A. f i)" "i \<in> A" shows "y < f i" |
370 proof - |
370 proof - |
371 note `y < (\<Sqinter>i\<in>A. f i)` |
371 note `y < (\<Sqinter>i\<in>A. f i)` |
372 also have "(\<Sqinter>i\<in>A. f i) \<le> f i" using `i \<in> A` |
372 also have "(\<Sqinter>i\<in>A. f i) \<le> f i" using `i \<in> A` |
373 by (rule INF_leI) |
373 by (rule INF_lower) |
374 finally show "y < f i" . |
374 finally show "y < f i" . |
375 qed |
375 qed |
376 |
376 |
377 lemma SUP_lessD: |
377 lemma SUP_lessD: |
378 assumes "(\<Squnion>i\<in>A. f i) < y" "i \<in> A" shows "f i < y" |
378 assumes "(\<Squnion>i\<in>A. f i) < y" "i \<in> A" shows "f i < y" |
379 proof - |
379 proof - |
380 have "f i \<le> (\<Squnion>i\<in>A. f i)" using `i \<in> A` |
380 have "f i \<le> (\<Squnion>i\<in>A. f i)" using `i \<in> A` |
381 by (rule le_SUP_I) |
381 by (rule SUP_upper) |
382 also note `(\<Squnion>i\<in>A. f i) < y` |
382 also note `(\<Squnion>i\<in>A. f i) < y` |
383 finally show "f i < y" . |
383 finally show "f i < y" . |
384 qed |
384 qed |
385 |
385 |
386 lemma INF_UNIV_bool_expand: |
386 lemma INF_UNIV_bool_expand: |
757 |
757 |
758 lemma Collect_all_eq: "{x. \<forall>y. P x y} = (\<Inter>y. {x. P x y})" |
758 lemma Collect_all_eq: "{x. \<forall>y. P x y} = (\<Inter>y. {x. P x y})" |
759 by blast |
759 by blast |
760 |
760 |
761 lemma INT_lower: "a \<in> A \<Longrightarrow> (\<Inter>x\<in>A. B x) \<subseteq> B a" |
761 lemma INT_lower: "a \<in> A \<Longrightarrow> (\<Inter>x\<in>A. B x) \<subseteq> B a" |
762 by (fact INF_leI) |
762 by (fact INF_lower) |
763 |
763 |
764 lemma INT_greatest: "(\<And>x. x \<in> A \<Longrightarrow> C \<subseteq> B x) \<Longrightarrow> C \<subseteq> (\<Inter>x\<in>A. B x)" |
764 lemma INT_greatest: "(\<And>x. x \<in> A \<Longrightarrow> C \<subseteq> B x) \<Longrightarrow> C \<subseteq> (\<Inter>x\<in>A. B x)" |
765 by (fact le_INF_I) |
765 by (fact INF_greatest) |
766 |
766 |
767 lemma INT_empty: "(\<Inter>x\<in>{}. B x) = UNIV" |
767 lemma INT_empty: "(\<Inter>x\<in>{}. B x) = UNIV" |
768 by (fact INF_empty) |
768 by (fact INF_empty) |
769 |
769 |
770 lemma INT_absorb: "k \<in> I \<Longrightarrow> A k \<inter> (\<Inter>i\<in>I. A i) = (\<Inter>i\<in>I. A i)" |
770 lemma INT_absorb: "k \<in> I \<Longrightarrow> A k \<inter> (\<Inter>i\<in>I. A i) = (\<Inter>i\<in>I. A i)" |
945 |
945 |
946 lemma image_eq_UN: "f ` A = (\<Union>x\<in>A. {f x})" |
946 lemma image_eq_UN: "f ` A = (\<Union>x\<in>A. {f x})" |
947 by blast |
947 by blast |
948 |
948 |
949 lemma UN_upper: "a \<in> A \<Longrightarrow> B a \<subseteq> (\<Union>x\<in>A. B x)" |
949 lemma UN_upper: "a \<in> A \<Longrightarrow> B a \<subseteq> (\<Union>x\<in>A. B x)" |
950 by (fact le_SUP_I) |
950 by (fact SUP_upper) |
951 |
951 |
952 lemma UN_least: "(\<And>x. x \<in> A \<Longrightarrow> B x \<subseteq> C) \<Longrightarrow> (\<Union>x\<in>A. B x) \<subseteq> C" |
952 lemma UN_least: "(\<And>x. x \<in> A \<Longrightarrow> B x \<subseteq> C) \<Longrightarrow> (\<Union>x\<in>A. B x) \<subseteq> C" |
953 by (fact SUP_leI) |
953 by (fact SUP_least) |
954 |
954 |
955 lemma Collect_bex_eq [no_atp]: "{x. \<exists>y\<in>A. P x y} = (\<Union>y\<in>A. {x. P x y})" |
955 lemma Collect_bex_eq [no_atp]: "{x. \<exists>y\<in>A. P x y} = (\<Union>y\<in>A. {x. P x y})" |
956 by blast |
956 by blast |
957 |
957 |
958 lemma UN_insert_distrib: "u \<in> A \<Longrightarrow> (\<Union>x\<in>A. insert a (B x)) = insert a (\<Union>x\<in>A. B x)" |
958 lemma UN_insert_distrib: "u \<in> A \<Longrightarrow> (\<Union>x\<in>A. insert a (B x)) = insert a (\<Union>x\<in>A. B x)" |
1164 "\<Squnion>{a, b} = a \<squnion> b" |
1164 "\<Squnion>{a, b} = a \<squnion> b" |
1165 by (simp add: Sup_insert) |
1165 by (simp add: Sup_insert) |
1166 |
1166 |
1167 lemmas (in complete_lattice) INFI_def = INF_def |
1167 lemmas (in complete_lattice) INFI_def = INF_def |
1168 lemmas (in complete_lattice) SUPR_def = SUP_def |
1168 lemmas (in complete_lattice) SUPR_def = SUP_def |
1169 lemmas (in complete_lattice) le_SUPI = le_SUP_I |
1169 lemmas (in complete_lattice) INF_leI = INF_lower |
1170 lemmas (in complete_lattice) le_SUPI2 = le_SUP_I2 |
1170 lemmas (in complete_lattice) INF_leI2 = INF_lower2 |
1171 lemmas (in complete_lattice) le_INFI = le_INF_I |
1171 lemmas (in complete_lattice) le_INFI = INF_greatest |
|
1172 lemmas (in complete_lattice) le_SUPI = SUP_upper |
|
1173 lemmas (in complete_lattice) le_SUPI2 = SUP_upper2 |
|
1174 lemmas (in complete_lattice) SUP_leI = SUP_least |
1172 lemmas (in complete_lattice) less_INFD = less_INF_D |
1175 lemmas (in complete_lattice) less_INFD = less_INF_D |
1173 |
1176 |
1174 lemmas INFI_apply = INF_apply |
1177 lemmas INFI_apply = INF_apply |
1175 lemmas SUPR_apply = SUP_apply |
1178 lemmas SUPR_apply = SUP_apply |
1176 |
1179 |