author | ballarin |
Fri, 14 Jul 2006 14:37:15 +0200 | |
changeset 20129 | 95e84d2c9f2c |
parent 19984 | 29bb4659f80a |
child 20318 | 0e0ea63fe768 |
permissions | -rw-r--r-- |
14551 | 1 |
(* |
14706 | 2 |
Title: HOL/Algebra/Lattice.thy |
14551 | 3 |
Id: $Id$ |
4 |
Author: Clemens Ballarin, started 7 November 2003 |
|
5 |
Copyright: Clemens Ballarin |
|
6 |
*) |
|
7 |
||
14706 | 8 |
header {* Orders and Lattices *} |
14551 | 9 |
|
16417 | 10 |
theory Lattice imports Main begin |
14751
0d7850e27fed
Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents:
14706
diff
changeset
|
11 |
|
0d7850e27fed
Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents:
14706
diff
changeset
|
12 |
text {* Object with a carrier set. *} |
0d7850e27fed
Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents:
14706
diff
changeset
|
13 |
|
0d7850e27fed
Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents:
14706
diff
changeset
|
14 |
record 'a partial_object = |
0d7850e27fed
Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents:
14706
diff
changeset
|
15 |
carrier :: "'a set" |
14551 | 16 |
|
17 |
subsection {* Partial Orders *} |
|
18 |
||
19 |
record 'a order = "'a partial_object" + |
|
20 |
le :: "['a, 'a] => bool" (infixl "\<sqsubseteq>\<index>" 50) |
|
21 |
||
19783 | 22 |
locale partial_order = |
23 |
fixes L (structure) |
|
14551 | 24 |
assumes refl [intro, simp]: |
25 |
"x \<in> carrier L ==> x \<sqsubseteq> x" |
|
26 |
and anti_sym [intro]: |
|
27 |
"[| x \<sqsubseteq> y; y \<sqsubseteq> x; x \<in> carrier L; y \<in> carrier L |] ==> x = y" |
|
28 |
and trans [trans]: |
|
29 |
"[| x \<sqsubseteq> y; y \<sqsubseteq> z; |
|
30 |
x \<in> carrier L; y \<in> carrier L; z \<in> carrier L |] ==> x \<sqsubseteq> z" |
|
31 |
||
14651 | 32 |
constdefs (structure L) |
19286 | 33 |
lless :: "[_, 'a, 'a] => bool" (infixl "\<sqsubset>\<index>" 50) |
14651 | 34 |
"x \<sqsubset> y == x \<sqsubseteq> y & x ~= y" |
14551 | 35 |
|
14651 | 36 |
-- {* Upper and lower bounds of a set. *} |
37 |
Upper :: "[_, 'a set] => 'a set" |
|
14693 | 38 |
"Upper L A == {u. (ALL x. x \<in> A \<inter> carrier L --> x \<sqsubseteq> u)} \<inter> |
14551 | 39 |
carrier L" |
40 |
||
14651 | 41 |
Lower :: "[_, 'a set] => 'a set" |
14693 | 42 |
"Lower L A == {l. (ALL x. x \<in> A \<inter> carrier L --> l \<sqsubseteq> x)} \<inter> |
14551 | 43 |
carrier L" |
44 |
||
14651 | 45 |
-- {* Least and greatest, as predicate. *} |
46 |
least :: "[_, 'a, 'a set] => bool" |
|
14693 | 47 |
"least L l A == A \<subseteq> carrier L & l \<in> A & (ALL x : A. l \<sqsubseteq> x)" |
14551 | 48 |
|
14651 | 49 |
greatest :: "[_, 'a, 'a set] => bool" |
14693 | 50 |
"greatest L g A == A \<subseteq> carrier L & g \<in> A & (ALL x : A. x \<sqsubseteq> g)" |
14551 | 51 |
|
14651 | 52 |
-- {* Supremum and infimum *} |
53 |
sup :: "[_, 'a set] => 'a" ("\<Squnion>\<index>_" [90] 90) |
|
54 |
"\<Squnion>A == THE x. least L x (Upper L A)" |
|
14551 | 55 |
|
14651 | 56 |
inf :: "[_, 'a set] => 'a" ("\<Sqinter>\<index>_" [90] 90) |
57 |
"\<Sqinter>A == THE x. greatest L x (Lower L A)" |
|
14551 | 58 |
|
14651 | 59 |
join :: "[_, 'a, 'a] => 'a" (infixl "\<squnion>\<index>" 65) |
60 |
"x \<squnion> y == sup L {x, y}" |
|
14551 | 61 |
|
16325
a6431098a929
Fixed "axiom" generation for mixed locales with and without predicates.
ballarin
parents:
15328
diff
changeset
|
62 |
meet :: "[_, 'a, 'a] => 'a" (infixl "\<sqinter>\<index>" 70) |
14651 | 63 |
"x \<sqinter> y == inf L {x, y}" |
14551 | 64 |
|
14651 | 65 |
|
66 |
subsubsection {* Upper *} |
|
14551 | 67 |
|
68 |
lemma Upper_closed [intro, simp]: |
|
69 |
"Upper L A \<subseteq> carrier L" |
|
70 |
by (unfold Upper_def) clarify |
|
71 |
||
72 |
lemma UpperD [dest]: |
|
19783 | 73 |
fixes L (structure) |
14551 | 74 |
shows "[| u \<in> Upper L A; x \<in> A; A \<subseteq> carrier L |] ==> x \<sqsubseteq> u" |
14693 | 75 |
by (unfold Upper_def) blast |
14551 | 76 |
|
77 |
lemma Upper_memI: |
|
19783 | 78 |
fixes L (structure) |
14551 | 79 |
shows "[| !! y. y \<in> A ==> y \<sqsubseteq> x; x \<in> carrier L |] ==> x \<in> Upper L A" |
14693 | 80 |
by (unfold Upper_def) blast |
14551 | 81 |
|
82 |
lemma Upper_antimono: |
|
83 |
"A \<subseteq> B ==> Upper L B \<subseteq> Upper L A" |
|
84 |
by (unfold Upper_def) blast |
|
85 |
||
14651 | 86 |
|
87 |
subsubsection {* Lower *} |
|
14551 | 88 |
|
89 |
lemma Lower_closed [intro, simp]: |
|
90 |
"Lower L A \<subseteq> carrier L" |
|
91 |
by (unfold Lower_def) clarify |
|
92 |
||
93 |
lemma LowerD [dest]: |
|
19783 | 94 |
fixes L (structure) |
14551 | 95 |
shows "[| l \<in> Lower L A; x \<in> A; A \<subseteq> carrier L |] ==> l \<sqsubseteq> x" |
14693 | 96 |
by (unfold Lower_def) blast |
14551 | 97 |
|
98 |
lemma Lower_memI: |
|
19783 | 99 |
fixes L (structure) |
14551 | 100 |
shows "[| !! y. y \<in> A ==> x \<sqsubseteq> y; x \<in> carrier L |] ==> x \<in> Lower L A" |
14693 | 101 |
by (unfold Lower_def) blast |
14551 | 102 |
|
103 |
lemma Lower_antimono: |
|
104 |
"A \<subseteq> B ==> Lower L B \<subseteq> Lower L A" |
|
105 |
by (unfold Lower_def) blast |
|
106 |
||
14651 | 107 |
|
108 |
subsubsection {* least *} |
|
14551 | 109 |
|
110 |
lemma least_carrier [intro, simp]: |
|
111 |
shows "least L l A ==> l \<in> carrier L" |
|
112 |
by (unfold least_def) fast |
|
113 |
||
114 |
lemma least_mem: |
|
115 |
"least L l A ==> l \<in> A" |
|
116 |
by (unfold least_def) fast |
|
117 |
||
118 |
lemma (in partial_order) least_unique: |
|
119 |
"[| least L x A; least L y A |] ==> x = y" |
|
120 |
by (unfold least_def) blast |
|
121 |
||
122 |
lemma least_le: |
|
19783 | 123 |
fixes L (structure) |
14551 | 124 |
shows "[| least L x A; a \<in> A |] ==> x \<sqsubseteq> a" |
125 |
by (unfold least_def) fast |
|
126 |
||
127 |
lemma least_UpperI: |
|
19783 | 128 |
fixes L (structure) |
14551 | 129 |
assumes above: "!! x. x \<in> A ==> x \<sqsubseteq> s" |
130 |
and below: "!! y. y \<in> Upper L A ==> s \<sqsubseteq> y" |
|
14693 | 131 |
and L: "A \<subseteq> carrier L" "s \<in> carrier L" |
14551 | 132 |
shows "least L s (Upper L A)" |
14693 | 133 |
proof - |
134 |
have "Upper L A \<subseteq> carrier L" by simp |
|
135 |
moreover from above L have "s \<in> Upper L A" by (simp add: Upper_def) |
|
136 |
moreover from below have "ALL x : Upper L A. s \<sqsubseteq> x" by fast |
|
137 |
ultimately show ?thesis by (simp add: least_def) |
|
14551 | 138 |
qed |
139 |
||
14651 | 140 |
|
141 |
subsubsection {* greatest *} |
|
14551 | 142 |
|
143 |
lemma greatest_carrier [intro, simp]: |
|
144 |
shows "greatest L l A ==> l \<in> carrier L" |
|
145 |
by (unfold greatest_def) fast |
|
146 |
||
147 |
lemma greatest_mem: |
|
148 |
"greatest L l A ==> l \<in> A" |
|
149 |
by (unfold greatest_def) fast |
|
150 |
||
151 |
lemma (in partial_order) greatest_unique: |
|
152 |
"[| greatest L x A; greatest L y A |] ==> x = y" |
|
153 |
by (unfold greatest_def) blast |
|
154 |
||
155 |
lemma greatest_le: |
|
19783 | 156 |
fixes L (structure) |
14551 | 157 |
shows "[| greatest L x A; a \<in> A |] ==> a \<sqsubseteq> x" |
158 |
by (unfold greatest_def) fast |
|
159 |
||
160 |
lemma greatest_LowerI: |
|
19783 | 161 |
fixes L (structure) |
14551 | 162 |
assumes below: "!! x. x \<in> A ==> i \<sqsubseteq> x" |
163 |
and above: "!! y. y \<in> Lower L A ==> y \<sqsubseteq> i" |
|
14693 | 164 |
and L: "A \<subseteq> carrier L" "i \<in> carrier L" |
14551 | 165 |
shows "greatest L i (Lower L A)" |
14693 | 166 |
proof - |
167 |
have "Lower L A \<subseteq> carrier L" by simp |
|
168 |
moreover from below L have "i \<in> Lower L A" by (simp add: Lower_def) |
|
169 |
moreover from above have "ALL x : Lower L A. x \<sqsubseteq> i" by fast |
|
170 |
ultimately show ?thesis by (simp add: greatest_def) |
|
14551 | 171 |
qed |
172 |
||
14693 | 173 |
|
14551 | 174 |
subsection {* Lattices *} |
175 |
||
176 |
locale lattice = partial_order + |
|
177 |
assumes sup_of_two_exists: |
|
178 |
"[| x \<in> carrier L; y \<in> carrier L |] ==> EX s. least L s (Upper L {x, y})" |
|
179 |
and inf_of_two_exists: |
|
180 |
"[| x \<in> carrier L; y \<in> carrier L |] ==> EX s. greatest L s (Lower L {x, y})" |
|
181 |
||
182 |
lemma least_Upper_above: |
|
19783 | 183 |
fixes L (structure) |
14551 | 184 |
shows "[| least L s (Upper L A); x \<in> A; A \<subseteq> carrier L |] ==> x \<sqsubseteq> s" |
185 |
by (unfold least_def) blast |
|
186 |
||
187 |
lemma greatest_Lower_above: |
|
19783 | 188 |
fixes L (structure) |
14551 | 189 |
shows "[| greatest L i (Lower L A); x \<in> A; A \<subseteq> carrier L |] ==> i \<sqsubseteq> x" |
190 |
by (unfold greatest_def) blast |
|
191 |
||
14666 | 192 |
|
14551 | 193 |
subsubsection {* Supremum *} |
194 |
||
195 |
lemma (in lattice) joinI: |
|
196 |
"[| !!l. least L l (Upper L {x, y}) ==> P l; x \<in> carrier L; y \<in> carrier L |] |
|
197 |
==> P (x \<squnion> y)" |
|
198 |
proof (unfold join_def sup_def) |
|
14693 | 199 |
assume L: "x \<in> carrier L" "y \<in> carrier L" |
14551 | 200 |
and P: "!!l. least L l (Upper L {x, y}) ==> P l" |
201 |
with sup_of_two_exists obtain s where "least L s (Upper L {x, y})" by fast |
|
202 |
with L show "P (THE l. least L l (Upper L {x, y}))" |
|
14693 | 203 |
by (fast intro: theI2 least_unique P) |
14551 | 204 |
qed |
205 |
||
206 |
lemma (in lattice) join_closed [simp]: |
|
207 |
"[| x \<in> carrier L; y \<in> carrier L |] ==> x \<squnion> y \<in> carrier L" |
|
208 |
by (rule joinI) (rule least_carrier) |
|
209 |
||
14651 | 210 |
lemma (in partial_order) sup_of_singletonI: (* only reflexivity needed ? *) |
14551 | 211 |
"x \<in> carrier L ==> least L x (Upper L {x})" |
212 |
by (rule least_UpperI) fast+ |
|
213 |
||
214 |
lemma (in partial_order) sup_of_singleton [simp]: |
|
19783 | 215 |
"x \<in> carrier L ==> \<Squnion>{x} = x" |
14551 | 216 |
by (unfold sup_def) (blast intro: least_unique least_UpperI sup_of_singletonI) |
217 |
||
14666 | 218 |
|
219 |
text {* Condition on @{text A}: supremum exists. *} |
|
14551 | 220 |
|
221 |
lemma (in lattice) sup_insertI: |
|
222 |
"[| !!s. least L s (Upper L (insert x A)) ==> P s; |
|
223 |
least L a (Upper L A); x \<in> carrier L; A \<subseteq> carrier L |] |
|
14693 | 224 |
==> P (\<Squnion>(insert x A))" |
14551 | 225 |
proof (unfold sup_def) |
14693 | 226 |
assume L: "x \<in> carrier L" "A \<subseteq> carrier L" |
14551 | 227 |
and P: "!!l. least L l (Upper L (insert x A)) ==> P l" |
228 |
and least_a: "least L a (Upper L A)" |
|
229 |
from L least_a have La: "a \<in> carrier L" by simp |
|
230 |
from L sup_of_two_exists least_a |
|
231 |
obtain s where least_s: "least L s (Upper L {a, x})" by blast |
|
232 |
show "P (THE l. least L l (Upper L (insert x A)))" |
|
14693 | 233 |
proof (rule theI2) |
14551 | 234 |
show "least L s (Upper L (insert x A))" |
235 |
proof (rule least_UpperI) |
|
236 |
fix z |
|
14693 | 237 |
assume "z \<in> insert x A" |
238 |
then show "z \<sqsubseteq> s" |
|
239 |
proof |
|
240 |
assume "z = x" then show ?thesis |
|
241 |
by (simp add: least_Upper_above [OF least_s] L La) |
|
242 |
next |
|
243 |
assume "z \<in> A" |
|
244 |
with L least_s least_a show ?thesis |
|
245 |
by (rule_tac trans [where y = a]) (auto dest: least_Upper_above) |
|
246 |
qed |
|
247 |
next |
|
248 |
fix y |
|
249 |
assume y: "y \<in> Upper L (insert x A)" |
|
250 |
show "s \<sqsubseteq> y" |
|
251 |
proof (rule least_le [OF least_s], rule Upper_memI) |
|
252 |
fix z |
|
253 |
assume z: "z \<in> {a, x}" |
|
254 |
then show "z \<sqsubseteq> y" |
|
255 |
proof |
|
256 |
have y': "y \<in> Upper L A" |
|
257 |
apply (rule subsetD [where A = "Upper L (insert x A)"]) |
|
258 |
apply (rule Upper_antimono) apply clarify apply assumption |
|
259 |
done |
|
260 |
assume "z = a" |
|
261 |
with y' least_a show ?thesis by (fast dest: least_le) |
|
262 |
next |
|
263 |
assume "z \<in> {x}" (* FIXME "z = x"; declare specific elim rule for "insert x {}" (!?) *) |
|
264 |
with y L show ?thesis by blast |
|
265 |
qed |
|
266 |
qed (rule Upper_closed [THEN subsetD]) |
|
267 |
next |
|
268 |
from L show "insert x A \<subseteq> carrier L" by simp |
|
269 |
from least_s show "s \<in> carrier L" by simp |
|
14551 | 270 |
qed |
271 |
next |
|
272 |
fix l |
|
273 |
assume least_l: "least L l (Upper L (insert x A))" |
|
274 |
show "l = s" |
|
275 |
proof (rule least_unique) |
|
276 |
show "least L s (Upper L (insert x A))" |
|
277 |
proof (rule least_UpperI) |
|
14693 | 278 |
fix z |
279 |
assume "z \<in> insert x A" |
|
280 |
then show "z \<sqsubseteq> s" |
|
281 |
proof |
|
282 |
assume "z = x" then show ?thesis |
|
283 |
by (simp add: least_Upper_above [OF least_s] L La) |
|
284 |
next |
|
285 |
assume "z \<in> A" |
|
286 |
with L least_s least_a show ?thesis |
|
287 |
by (rule_tac trans [where y = a]) (auto dest: least_Upper_above) |
|
14551 | 288 |
qed |
289 |
next |
|
14693 | 290 |
fix y |
291 |
assume y: "y \<in> Upper L (insert x A)" |
|
292 |
show "s \<sqsubseteq> y" |
|
293 |
proof (rule least_le [OF least_s], rule Upper_memI) |
|
294 |
fix z |
|
295 |
assume z: "z \<in> {a, x}" |
|
296 |
then show "z \<sqsubseteq> y" |
|
297 |
proof |
|
298 |
have y': "y \<in> Upper L A" |
|
299 |
apply (rule subsetD [where A = "Upper L (insert x A)"]) |
|
300 |
apply (rule Upper_antimono) apply clarify apply assumption |
|
301 |
done |
|
302 |
assume "z = a" |
|
303 |
with y' least_a show ?thesis by (fast dest: least_le) |
|
304 |
next |
|
305 |
assume "z \<in> {x}" |
|
306 |
with y L show ?thesis by blast |
|
307 |
qed |
|
308 |
qed (rule Upper_closed [THEN subsetD]) |
|
14551 | 309 |
next |
14693 | 310 |
from L show "insert x A \<subseteq> carrier L" by simp |
311 |
from least_s show "s \<in> carrier L" by simp |
|
14551 | 312 |
qed |
313 |
qed |
|
314 |
qed |
|
315 |
qed |
|
316 |
||
317 |
lemma (in lattice) finite_sup_least: |
|
14693 | 318 |
"[| finite A; A \<subseteq> carrier L; A ~= {} |] ==> least L (\<Squnion>A) (Upper L A)" |
14551 | 319 |
proof (induct set: Finites) |
14693 | 320 |
case empty |
321 |
then show ?case by simp |
|
14551 | 322 |
next |
15328 | 323 |
case (insert x A) |
14551 | 324 |
show ?case |
325 |
proof (cases "A = {}") |
|
326 |
case True |
|
327 |
with insert show ?thesis by (simp add: sup_of_singletonI) |
|
328 |
next |
|
329 |
case False |
|
14693 | 330 |
with insert have "least L (\<Squnion>A) (Upper L A)" by simp |
331 |
with _ show ?thesis |
|
332 |
by (rule sup_insertI) (simp_all add: insert [simplified]) |
|
14551 | 333 |
qed |
334 |
qed |
|
335 |
||
336 |
lemma (in lattice) finite_sup_insertI: |
|
337 |
assumes P: "!!l. least L l (Upper L (insert x A)) ==> P l" |
|
14693 | 338 |
and xA: "finite A" "x \<in> carrier L" "A \<subseteq> carrier L" |
14551 | 339 |
shows "P (\<Squnion> (insert x A))" |
340 |
proof (cases "A = {}") |
|
341 |
case True with P and xA show ?thesis |
|
342 |
by (simp add: sup_of_singletonI) |
|
343 |
next |
|
344 |
case False with P and xA show ?thesis |
|
345 |
by (simp add: sup_insertI finite_sup_least) |
|
346 |
qed |
|
347 |
||
348 |
lemma (in lattice) finite_sup_closed: |
|
14693 | 349 |
"[| finite A; A \<subseteq> carrier L; A ~= {} |] ==> \<Squnion>A \<in> carrier L" |
14551 | 350 |
proof (induct set: Finites) |
351 |
case empty then show ?case by simp |
|
352 |
next |
|
15328 | 353 |
case insert then show ?case |
14693 | 354 |
by - (rule finite_sup_insertI, simp_all) |
14551 | 355 |
qed |
356 |
||
357 |
lemma (in lattice) join_left: |
|
358 |
"[| x \<in> carrier L; y \<in> carrier L |] ==> x \<sqsubseteq> x \<squnion> y" |
|
14693 | 359 |
by (rule joinI [folded join_def]) (blast dest: least_mem) |
14551 | 360 |
|
361 |
lemma (in lattice) join_right: |
|
362 |
"[| x \<in> carrier L; y \<in> carrier L |] ==> y \<sqsubseteq> x \<squnion> y" |
|
14693 | 363 |
by (rule joinI [folded join_def]) (blast dest: least_mem) |
14551 | 364 |
|
365 |
lemma (in lattice) sup_of_two_least: |
|
14693 | 366 |
"[| x \<in> carrier L; y \<in> carrier L |] ==> least L (\<Squnion>{x, y}) (Upper L {x, y})" |
14551 | 367 |
proof (unfold sup_def) |
14693 | 368 |
assume L: "x \<in> carrier L" "y \<in> carrier L" |
14551 | 369 |
with sup_of_two_exists obtain s where "least L s (Upper L {x, y})" by fast |
370 |
with L show "least L (THE xa. least L xa (Upper L {x, y})) (Upper L {x, y})" |
|
371 |
by (fast intro: theI2 least_unique) (* blast fails *) |
|
372 |
qed |
|
373 |
||
374 |
lemma (in lattice) join_le: |
|
14693 | 375 |
assumes sub: "x \<sqsubseteq> z" "y \<sqsubseteq> z" |
376 |
and L: "x \<in> carrier L" "y \<in> carrier L" "z \<in> carrier L" |
|
14551 | 377 |
shows "x \<squnion> y \<sqsubseteq> z" |
378 |
proof (rule joinI) |
|
379 |
fix s |
|
380 |
assume "least L s (Upper L {x, y})" |
|
381 |
with sub L show "s \<sqsubseteq> z" by (fast elim: least_le intro: Upper_memI) |
|
382 |
qed |
|
14693 | 383 |
|
14551 | 384 |
lemma (in lattice) join_assoc_lemma: |
14693 | 385 |
assumes L: "x \<in> carrier L" "y \<in> carrier L" "z \<in> carrier L" |
386 |
shows "x \<squnion> (y \<squnion> z) = \<Squnion>{x, y, z}" |
|
14551 | 387 |
proof (rule finite_sup_insertI) |
14651 | 388 |
-- {* The textbook argument in Jacobson I, p 457 *} |
14551 | 389 |
fix s |
390 |
assume sup: "least L s (Upper L {x, y, z})" |
|
391 |
show "x \<squnion> (y \<squnion> z) = s" |
|
392 |
proof (rule anti_sym) |
|
393 |
from sup L show "x \<squnion> (y \<squnion> z) \<sqsubseteq> s" |
|
394 |
by (fastsimp intro!: join_le elim: least_Upper_above) |
|
395 |
next |
|
396 |
from sup L show "s \<sqsubseteq> x \<squnion> (y \<squnion> z)" |
|
397 |
by (erule_tac least_le) |
|
398 |
(blast intro!: Upper_memI intro: trans join_left join_right join_closed) |
|
399 |
qed (simp_all add: L least_carrier [OF sup]) |
|
400 |
qed (simp_all add: L) |
|
401 |
||
402 |
lemma join_comm: |
|
19783 | 403 |
fixes L (structure) |
14551 | 404 |
shows "x \<squnion> y = y \<squnion> x" |
405 |
by (unfold join_def) (simp add: insert_commute) |
|
406 |
||
407 |
lemma (in lattice) join_assoc: |
|
14693 | 408 |
assumes L: "x \<in> carrier L" "y \<in> carrier L" "z \<in> carrier L" |
14551 | 409 |
shows "(x \<squnion> y) \<squnion> z = x \<squnion> (y \<squnion> z)" |
410 |
proof - |
|
411 |
have "(x \<squnion> y) \<squnion> z = z \<squnion> (x \<squnion> y)" by (simp only: join_comm) |
|
14693 | 412 |
also from L have "... = \<Squnion>{z, x, y}" by (simp add: join_assoc_lemma) |
413 |
also from L have "... = \<Squnion>{x, y, z}" by (simp add: insert_commute) |
|
14551 | 414 |
also from L have "... = x \<squnion> (y \<squnion> z)" by (simp add: join_assoc_lemma) |
415 |
finally show ?thesis . |
|
416 |
qed |
|
417 |
||
14693 | 418 |
|
14551 | 419 |
subsubsection {* Infimum *} |
420 |
||
421 |
lemma (in lattice) meetI: |
|
422 |
"[| !!i. greatest L i (Lower L {x, y}) ==> P i; |
|
423 |
x \<in> carrier L; y \<in> carrier L |] |
|
424 |
==> P (x \<sqinter> y)" |
|
425 |
proof (unfold meet_def inf_def) |
|
14693 | 426 |
assume L: "x \<in> carrier L" "y \<in> carrier L" |
14551 | 427 |
and P: "!!g. greatest L g (Lower L {x, y}) ==> P g" |
428 |
with inf_of_two_exists obtain i where "greatest L i (Lower L {x, y})" by fast |
|
429 |
with L show "P (THE g. greatest L g (Lower L {x, y}))" |
|
430 |
by (fast intro: theI2 greatest_unique P) |
|
431 |
qed |
|
432 |
||
433 |
lemma (in lattice) meet_closed [simp]: |
|
434 |
"[| x \<in> carrier L; y \<in> carrier L |] ==> x \<sqinter> y \<in> carrier L" |
|
435 |
by (rule meetI) (rule greatest_carrier) |
|
436 |
||
14651 | 437 |
lemma (in partial_order) inf_of_singletonI: (* only reflexivity needed ? *) |
14551 | 438 |
"x \<in> carrier L ==> greatest L x (Lower L {x})" |
439 |
by (rule greatest_LowerI) fast+ |
|
440 |
||
441 |
lemma (in partial_order) inf_of_singleton [simp]: |
|
19783 | 442 |
"x \<in> carrier L ==> \<Sqinter> {x} = x" |
14551 | 443 |
by (unfold inf_def) (blast intro: greatest_unique greatest_LowerI inf_of_singletonI) |
444 |
||
445 |
text {* Condition on A: infimum exists. *} |
|
446 |
||
447 |
lemma (in lattice) inf_insertI: |
|
448 |
"[| !!i. greatest L i (Lower L (insert x A)) ==> P i; |
|
449 |
greatest L a (Lower L A); x \<in> carrier L; A \<subseteq> carrier L |] |
|
14693 | 450 |
==> P (\<Sqinter>(insert x A))" |
14551 | 451 |
proof (unfold inf_def) |
14693 | 452 |
assume L: "x \<in> carrier L" "A \<subseteq> carrier L" |
14551 | 453 |
and P: "!!g. greatest L g (Lower L (insert x A)) ==> P g" |
454 |
and greatest_a: "greatest L a (Lower L A)" |
|
455 |
from L greatest_a have La: "a \<in> carrier L" by simp |
|
456 |
from L inf_of_two_exists greatest_a |
|
457 |
obtain i where greatest_i: "greatest L i (Lower L {a, x})" by blast |
|
458 |
show "P (THE g. greatest L g (Lower L (insert x A)))" |
|
14693 | 459 |
proof (rule theI2) |
14551 | 460 |
show "greatest L i (Lower L (insert x A))" |
461 |
proof (rule greatest_LowerI) |
|
462 |
fix z |
|
14693 | 463 |
assume "z \<in> insert x A" |
464 |
then show "i \<sqsubseteq> z" |
|
465 |
proof |
|
466 |
assume "z = x" then show ?thesis |
|
467 |
by (simp add: greatest_Lower_above [OF greatest_i] L La) |
|
468 |
next |
|
469 |
assume "z \<in> A" |
|
470 |
with L greatest_i greatest_a show ?thesis |
|
471 |
by (rule_tac trans [where y = a]) (auto dest: greatest_Lower_above) |
|
472 |
qed |
|
473 |
next |
|
474 |
fix y |
|
475 |
assume y: "y \<in> Lower L (insert x A)" |
|
476 |
show "y \<sqsubseteq> i" |
|
477 |
proof (rule greatest_le [OF greatest_i], rule Lower_memI) |
|
478 |
fix z |
|
479 |
assume z: "z \<in> {a, x}" |
|
480 |
then show "y \<sqsubseteq> z" |
|
481 |
proof |
|
482 |
have y': "y \<in> Lower L A" |
|
483 |
apply (rule subsetD [where A = "Lower L (insert x A)"]) |
|
484 |
apply (rule Lower_antimono) apply clarify apply assumption |
|
485 |
done |
|
486 |
assume "z = a" |
|
487 |
with y' greatest_a show ?thesis by (fast dest: greatest_le) |
|
488 |
next |
|
489 |
assume "z \<in> {x}" |
|
490 |
with y L show ?thesis by blast |
|
491 |
qed |
|
492 |
qed (rule Lower_closed [THEN subsetD]) |
|
493 |
next |
|
494 |
from L show "insert x A \<subseteq> carrier L" by simp |
|
495 |
from greatest_i show "i \<in> carrier L" by simp |
|
14551 | 496 |
qed |
497 |
next |
|
498 |
fix g |
|
499 |
assume greatest_g: "greatest L g (Lower L (insert x A))" |
|
500 |
show "g = i" |
|
501 |
proof (rule greatest_unique) |
|
502 |
show "greatest L i (Lower L (insert x A))" |
|
503 |
proof (rule greatest_LowerI) |
|
14693 | 504 |
fix z |
505 |
assume "z \<in> insert x A" |
|
506 |
then show "i \<sqsubseteq> z" |
|
507 |
proof |
|
508 |
assume "z = x" then show ?thesis |
|
509 |
by (simp add: greatest_Lower_above [OF greatest_i] L La) |
|
510 |
next |
|
511 |
assume "z \<in> A" |
|
512 |
with L greatest_i greatest_a show ?thesis |
|
513 |
by (rule_tac trans [where y = a]) (auto dest: greatest_Lower_above) |
|
514 |
qed |
|
14551 | 515 |
next |
14693 | 516 |
fix y |
517 |
assume y: "y \<in> Lower L (insert x A)" |
|
518 |
show "y \<sqsubseteq> i" |
|
519 |
proof (rule greatest_le [OF greatest_i], rule Lower_memI) |
|
520 |
fix z |
|
521 |
assume z: "z \<in> {a, x}" |
|
522 |
then show "y \<sqsubseteq> z" |
|
523 |
proof |
|
524 |
have y': "y \<in> Lower L A" |
|
525 |
apply (rule subsetD [where A = "Lower L (insert x A)"]) |
|
526 |
apply (rule Lower_antimono) apply clarify apply assumption |
|
527 |
done |
|
528 |
assume "z = a" |
|
529 |
with y' greatest_a show ?thesis by (fast dest: greatest_le) |
|
530 |
next |
|
531 |
assume "z \<in> {x}" |
|
532 |
with y L show ?thesis by blast |
|
14551 | 533 |
qed |
14693 | 534 |
qed (rule Lower_closed [THEN subsetD]) |
14551 | 535 |
next |
14693 | 536 |
from L show "insert x A \<subseteq> carrier L" by simp |
537 |
from greatest_i show "i \<in> carrier L" by simp |
|
14551 | 538 |
qed |
539 |
qed |
|
540 |
qed |
|
541 |
qed |
|
542 |
||
543 |
lemma (in lattice) finite_inf_greatest: |
|
14693 | 544 |
"[| finite A; A \<subseteq> carrier L; A ~= {} |] ==> greatest L (\<Sqinter>A) (Lower L A)" |
14551 | 545 |
proof (induct set: Finites) |
546 |
case empty then show ?case by simp |
|
547 |
next |
|
15328 | 548 |
case (insert x A) |
14551 | 549 |
show ?case |
550 |
proof (cases "A = {}") |
|
551 |
case True |
|
552 |
with insert show ?thesis by (simp add: inf_of_singletonI) |
|
553 |
next |
|
554 |
case False |
|
555 |
from insert show ?thesis |
|
556 |
proof (rule_tac inf_insertI) |
|
14693 | 557 |
from False insert show "greatest L (\<Sqinter>A) (Lower L A)" by simp |
14551 | 558 |
qed simp_all |
559 |
qed |
|
560 |
qed |
|
561 |
||
562 |
lemma (in lattice) finite_inf_insertI: |
|
563 |
assumes P: "!!i. greatest L i (Lower L (insert x A)) ==> P i" |
|
14693 | 564 |
and xA: "finite A" "x \<in> carrier L" "A \<subseteq> carrier L" |
14551 | 565 |
shows "P (\<Sqinter> (insert x A))" |
566 |
proof (cases "A = {}") |
|
567 |
case True with P and xA show ?thesis |
|
568 |
by (simp add: inf_of_singletonI) |
|
569 |
next |
|
570 |
case False with P and xA show ?thesis |
|
571 |
by (simp add: inf_insertI finite_inf_greatest) |
|
572 |
qed |
|
573 |
||
574 |
lemma (in lattice) finite_inf_closed: |
|
14693 | 575 |
"[| finite A; A \<subseteq> carrier L; A ~= {} |] ==> \<Sqinter>A \<in> carrier L" |
14551 | 576 |
proof (induct set: Finites) |
577 |
case empty then show ?case by simp |
|
578 |
next |
|
15328 | 579 |
case insert then show ?case |
14551 | 580 |
by (rule_tac finite_inf_insertI) (simp_all) |
581 |
qed |
|
582 |
||
583 |
lemma (in lattice) meet_left: |
|
584 |
"[| x \<in> carrier L; y \<in> carrier L |] ==> x \<sqinter> y \<sqsubseteq> x" |
|
14693 | 585 |
by (rule meetI [folded meet_def]) (blast dest: greatest_mem) |
14551 | 586 |
|
587 |
lemma (in lattice) meet_right: |
|
588 |
"[| x \<in> carrier L; y \<in> carrier L |] ==> x \<sqinter> y \<sqsubseteq> y" |
|
14693 | 589 |
by (rule meetI [folded meet_def]) (blast dest: greatest_mem) |
14551 | 590 |
|
591 |
lemma (in lattice) inf_of_two_greatest: |
|
592 |
"[| x \<in> carrier L; y \<in> carrier L |] ==> |
|
593 |
greatest L (\<Sqinter> {x, y}) (Lower L {x, y})" |
|
594 |
proof (unfold inf_def) |
|
14693 | 595 |
assume L: "x \<in> carrier L" "y \<in> carrier L" |
14551 | 596 |
with inf_of_two_exists obtain s where "greatest L s (Lower L {x, y})" by fast |
597 |
with L |
|
598 |
show "greatest L (THE xa. greatest L xa (Lower L {x, y})) (Lower L {x, y})" |
|
599 |
by (fast intro: theI2 greatest_unique) (* blast fails *) |
|
600 |
qed |
|
601 |
||
602 |
lemma (in lattice) meet_le: |
|
14693 | 603 |
assumes sub: "z \<sqsubseteq> x" "z \<sqsubseteq> y" |
604 |
and L: "x \<in> carrier L" "y \<in> carrier L" "z \<in> carrier L" |
|
14551 | 605 |
shows "z \<sqsubseteq> x \<sqinter> y" |
606 |
proof (rule meetI) |
|
607 |
fix i |
|
608 |
assume "greatest L i (Lower L {x, y})" |
|
609 |
with sub L show "z \<sqsubseteq> i" by (fast elim: greatest_le intro: Lower_memI) |
|
610 |
qed |
|
14693 | 611 |
|
14551 | 612 |
lemma (in lattice) meet_assoc_lemma: |
14693 | 613 |
assumes L: "x \<in> carrier L" "y \<in> carrier L" "z \<in> carrier L" |
614 |
shows "x \<sqinter> (y \<sqinter> z) = \<Sqinter>{x, y, z}" |
|
14551 | 615 |
proof (rule finite_inf_insertI) |
616 |
txt {* The textbook argument in Jacobson I, p 457 *} |
|
617 |
fix i |
|
618 |
assume inf: "greatest L i (Lower L {x, y, z})" |
|
619 |
show "x \<sqinter> (y \<sqinter> z) = i" |
|
620 |
proof (rule anti_sym) |
|
621 |
from inf L show "i \<sqsubseteq> x \<sqinter> (y \<sqinter> z)" |
|
622 |
by (fastsimp intro!: meet_le elim: greatest_Lower_above) |
|
623 |
next |
|
624 |
from inf L show "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> i" |
|
625 |
by (erule_tac greatest_le) |
|
626 |
(blast intro!: Lower_memI intro: trans meet_left meet_right meet_closed) |
|
627 |
qed (simp_all add: L greatest_carrier [OF inf]) |
|
628 |
qed (simp_all add: L) |
|
629 |
||
630 |
lemma meet_comm: |
|
19783 | 631 |
fixes L (structure) |
14551 | 632 |
shows "x \<sqinter> y = y \<sqinter> x" |
633 |
by (unfold meet_def) (simp add: insert_commute) |
|
634 |
||
635 |
lemma (in lattice) meet_assoc: |
|
14693 | 636 |
assumes L: "x \<in> carrier L" "y \<in> carrier L" "z \<in> carrier L" |
14551 | 637 |
shows "(x \<sqinter> y) \<sqinter> z = x \<sqinter> (y \<sqinter> z)" |
638 |
proof - |
|
639 |
have "(x \<sqinter> y) \<sqinter> z = z \<sqinter> (x \<sqinter> y)" by (simp only: meet_comm) |
|
640 |
also from L have "... = \<Sqinter> {z, x, y}" by (simp add: meet_assoc_lemma) |
|
641 |
also from L have "... = \<Sqinter> {x, y, z}" by (simp add: insert_commute) |
|
642 |
also from L have "... = x \<sqinter> (y \<sqinter> z)" by (simp add: meet_assoc_lemma) |
|
643 |
finally show ?thesis . |
|
644 |
qed |
|
645 |
||
14693 | 646 |
|
14551 | 647 |
subsection {* Total Orders *} |
648 |
||
649 |
locale total_order = lattice + |
|
650 |
assumes total: "[| x \<in> carrier L; y \<in> carrier L |] ==> x \<sqsubseteq> y | y \<sqsubseteq> x" |
|
651 |
||
652 |
text {* Introduction rule: the usual definition of total order *} |
|
653 |
||
654 |
lemma (in partial_order) total_orderI: |
|
655 |
assumes total: "!!x y. [| x \<in> carrier L; y \<in> carrier L |] ==> x \<sqsubseteq> y | y \<sqsubseteq> x" |
|
656 |
shows "total_order L" |
|
19984
29bb4659f80a
Method intro_locales replaced by intro_locales and unfold_locales.
ballarin
parents:
19931
diff
changeset
|
657 |
proof intro_locales |
14551 | 658 |
show "lattice_axioms L" |
659 |
proof (rule lattice_axioms.intro) |
|
660 |
fix x y |
|
14693 | 661 |
assume L: "x \<in> carrier L" "y \<in> carrier L" |
14551 | 662 |
show "EX s. least L s (Upper L {x, y})" |
663 |
proof - |
|
664 |
note total L |
|
665 |
moreover |
|
666 |
{ |
|
14693 | 667 |
assume "x \<sqsubseteq> y" |
14551 | 668 |
with L have "least L y (Upper L {x, y})" |
14693 | 669 |
by (rule_tac least_UpperI) auto |
14551 | 670 |
} |
671 |
moreover |
|
672 |
{ |
|
14693 | 673 |
assume "y \<sqsubseteq> x" |
14551 | 674 |
with L have "least L x (Upper L {x, y})" |
14693 | 675 |
by (rule_tac least_UpperI) auto |
14551 | 676 |
} |
677 |
ultimately show ?thesis by blast |
|
678 |
qed |
|
679 |
next |
|
680 |
fix x y |
|
14693 | 681 |
assume L: "x \<in> carrier L" "y \<in> carrier L" |
14551 | 682 |
show "EX i. greatest L i (Lower L {x, y})" |
683 |
proof - |
|
684 |
note total L |
|
685 |
moreover |
|
686 |
{ |
|
14693 | 687 |
assume "y \<sqsubseteq> x" |
14551 | 688 |
with L have "greatest L y (Lower L {x, y})" |
14693 | 689 |
by (rule_tac greatest_LowerI) auto |
14551 | 690 |
} |
691 |
moreover |
|
692 |
{ |
|
14693 | 693 |
assume "x \<sqsubseteq> y" |
14551 | 694 |
with L have "greatest L x (Lower L {x, y})" |
14693 | 695 |
by (rule_tac greatest_LowerI) auto |
14551 | 696 |
} |
697 |
ultimately show ?thesis by blast |
|
698 |
qed |
|
699 |
qed |
|
700 |
qed (assumption | rule total_order_axioms.intro)+ |
|
701 |
||
14693 | 702 |
|
14551 | 703 |
subsection {* Complete lattices *} |
704 |
||
705 |
locale complete_lattice = lattice + |
|
706 |
assumes sup_exists: |
|
707 |
"[| A \<subseteq> carrier L |] ==> EX s. least L s (Upper L A)" |
|
708 |
and inf_exists: |
|
709 |
"[| A \<subseteq> carrier L |] ==> EX i. greatest L i (Lower L A)" |
|
710 |
||
711 |
text {* Introduction rule: the usual definition of complete lattice *} |
|
712 |
||
713 |
lemma (in partial_order) complete_latticeI: |
|
714 |
assumes sup_exists: |
|
715 |
"!!A. [| A \<subseteq> carrier L |] ==> EX s. least L s (Upper L A)" |
|
716 |
and inf_exists: |
|
717 |
"!!A. [| A \<subseteq> carrier L |] ==> EX i. greatest L i (Lower L A)" |
|
718 |
shows "complete_lattice L" |
|
19984
29bb4659f80a
Method intro_locales replaced by intro_locales and unfold_locales.
ballarin
parents:
19931
diff
changeset
|
719 |
proof intro_locales |
14551 | 720 |
show "lattice_axioms L" |
14693 | 721 |
by (rule lattice_axioms.intro) (blast intro: sup_exists inf_exists)+ |
14551 | 722 |
qed (assumption | rule complete_lattice_axioms.intro)+ |
723 |
||
14651 | 724 |
constdefs (structure L) |
725 |
top :: "_ => 'a" ("\<top>\<index>") |
|
726 |
"\<top> == sup L (carrier L)" |
|
14551 | 727 |
|
14651 | 728 |
bottom :: "_ => 'a" ("\<bottom>\<index>") |
729 |
"\<bottom> == inf L (carrier L)" |
|
14551 | 730 |
|
731 |
||
732 |
lemma (in complete_lattice) supI: |
|
733 |
"[| !!l. least L l (Upper L A) ==> P l; A \<subseteq> carrier L |] |
|
14651 | 734 |
==> P (\<Squnion>A)" |
14551 | 735 |
proof (unfold sup_def) |
736 |
assume L: "A \<subseteq> carrier L" |
|
737 |
and P: "!!l. least L l (Upper L A) ==> P l" |
|
738 |
with sup_exists obtain s where "least L s (Upper L A)" by blast |
|
739 |
with L show "P (THE l. least L l (Upper L A))" |
|
740 |
by (fast intro: theI2 least_unique P) |
|
741 |
qed |
|
742 |
||
743 |
lemma (in complete_lattice) sup_closed [simp]: |
|
14693 | 744 |
"A \<subseteq> carrier L ==> \<Squnion>A \<in> carrier L" |
14551 | 745 |
by (rule supI) simp_all |
746 |
||
747 |
lemma (in complete_lattice) top_closed [simp, intro]: |
|
748 |
"\<top> \<in> carrier L" |
|
749 |
by (unfold top_def) simp |
|
750 |
||
751 |
lemma (in complete_lattice) infI: |
|
752 |
"[| !!i. greatest L i (Lower L A) ==> P i; A \<subseteq> carrier L |] |
|
14693 | 753 |
==> P (\<Sqinter>A)" |
14551 | 754 |
proof (unfold inf_def) |
755 |
assume L: "A \<subseteq> carrier L" |
|
756 |
and P: "!!l. greatest L l (Lower L A) ==> P l" |
|
757 |
with inf_exists obtain s where "greatest L s (Lower L A)" by blast |
|
758 |
with L show "P (THE l. greatest L l (Lower L A))" |
|
759 |
by (fast intro: theI2 greatest_unique P) |
|
760 |
qed |
|
761 |
||
762 |
lemma (in complete_lattice) inf_closed [simp]: |
|
14693 | 763 |
"A \<subseteq> carrier L ==> \<Sqinter>A \<in> carrier L" |
14551 | 764 |
by (rule infI) simp_all |
765 |
||
766 |
lemma (in complete_lattice) bottom_closed [simp, intro]: |
|
767 |
"\<bottom> \<in> carrier L" |
|
768 |
by (unfold bottom_def) simp |
|
769 |
||
770 |
text {* Jacobson: Theorem 8.1 *} |
|
771 |
||
772 |
lemma Lower_empty [simp]: |
|
773 |
"Lower L {} = carrier L" |
|
774 |
by (unfold Lower_def) simp |
|
775 |
||
776 |
lemma Upper_empty [simp]: |
|
777 |
"Upper L {} = carrier L" |
|
778 |
by (unfold Upper_def) simp |
|
779 |
||
780 |
theorem (in partial_order) complete_lattice_criterion1: |
|
781 |
assumes top_exists: "EX g. greatest L g (carrier L)" |
|
782 |
and inf_exists: |
|
783 |
"!!A. [| A \<subseteq> carrier L; A ~= {} |] ==> EX i. greatest L i (Lower L A)" |
|
784 |
shows "complete_lattice L" |
|
785 |
proof (rule complete_latticeI) |
|
786 |
from top_exists obtain top where top: "greatest L top (carrier L)" .. |
|
787 |
fix A |
|
788 |
assume L: "A \<subseteq> carrier L" |
|
789 |
let ?B = "Upper L A" |
|
790 |
from L top have "top \<in> ?B" by (fast intro!: Upper_memI intro: greatest_le) |
|
791 |
then have B_non_empty: "?B ~= {}" by fast |
|
792 |
have B_L: "?B \<subseteq> carrier L" by simp |
|
793 |
from inf_exists [OF B_L B_non_empty] |
|
794 |
obtain b where b_inf_B: "greatest L b (Lower L ?B)" .. |
|
795 |
have "least L b (Upper L A)" |
|
796 |
apply (rule least_UpperI) |
|
14693 | 797 |
apply (rule greatest_le [where A = "Lower L ?B"]) |
14551 | 798 |
apply (rule b_inf_B) |
799 |
apply (rule Lower_memI) |
|
800 |
apply (erule UpperD) |
|
801 |
apply assumption |
|
802 |
apply (rule L) |
|
803 |
apply (fast intro: L [THEN subsetD]) |
|
804 |
apply (erule greatest_Lower_above [OF b_inf_B]) |
|
805 |
apply simp |
|
806 |
apply (rule L) |
|
807 |
apply (rule greatest_carrier [OF b_inf_B]) (* rename rule: _closed *) |
|
808 |
done |
|
809 |
then show "EX s. least L s (Upper L A)" .. |
|
810 |
next |
|
811 |
fix A |
|
812 |
assume L: "A \<subseteq> carrier L" |
|
813 |
show "EX i. greatest L i (Lower L A)" |
|
814 |
proof (cases "A = {}") |
|
815 |
case True then show ?thesis |
|
816 |
by (simp add: top_exists) |
|
817 |
next |
|
818 |
case False with L show ?thesis |
|
819 |
by (rule inf_exists) |
|
820 |
qed |
|
821 |
qed |
|
822 |
||
823 |
(* TODO: prove dual version *) |
|
824 |
||
825 |
subsection {* Examples *} |
|
826 |
||
827 |
subsubsection {* Powerset of a set is a complete lattice *} |
|
828 |
||
829 |
theorem powerset_is_complete_lattice: |
|
830 |
"complete_lattice (| carrier = Pow A, le = op \<subseteq> |)" |
|
831 |
(is "complete_lattice ?L") |
|
832 |
proof (rule partial_order.complete_latticeI) |
|
833 |
show "partial_order ?L" |
|
834 |
by (rule partial_order.intro) auto |
|
835 |
next |
|
836 |
fix B |
|
837 |
assume "B \<subseteq> carrier ?L" |
|
838 |
then have "least ?L (\<Union> B) (Upper ?L B)" |
|
839 |
by (fastsimp intro!: least_UpperI simp: Upper_def) |
|
840 |
then show "EX s. least ?L s (Upper ?L B)" .. |
|
841 |
next |
|
842 |
fix B |
|
843 |
assume "B \<subseteq> carrier ?L" |
|
844 |
then have "greatest ?L (\<Inter> B \<inter> A) (Lower ?L B)" |
|
845 |
txt {* @{term "\<Inter> B"} is not the infimum of @{term B}: |
|
846 |
@{term "\<Inter> {} = UNIV"} which is in general bigger than @{term "A"}! *} |
|
847 |
by (fastsimp intro!: greatest_LowerI simp: Lower_def) |
|
848 |
then show "EX i. greatest ?L i (Lower ?L B)" .. |
|
849 |
qed |
|
850 |
||
14751
0d7850e27fed
Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents:
14706
diff
changeset
|
851 |
text {* An other example, that of the lattice of subgroups of a group, |
0d7850e27fed
Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents:
14706
diff
changeset
|
852 |
can be found in Group theory (Section~\ref{sec:subgroup-lattice}). *} |
14551 | 853 |
|
14693 | 854 |
end |