253 end |
251 end |
254 |
252 |
255 |
253 |
256 subsubsection {* Equational laws *} |
254 subsubsection {* Equational laws *} |
257 |
255 |
258 sublocale semilattice_inf < inf!: semilattice inf |
256 context semilattice_inf |
|
257 begin |
|
258 |
|
259 sublocale inf!: semilattice inf |
259 proof |
260 proof |
260 fix a b c |
261 fix a b c |
261 show "(a \<sqinter> b) \<sqinter> c = a \<sqinter> (b \<sqinter> c)" |
262 show "(a \<sqinter> b) \<sqinter> c = a \<sqinter> (b \<sqinter> c)" |
262 by (rule antisym) (auto intro: le_infI1 le_infI2) |
263 by (rule antisym) (auto intro: le_infI1 le_infI2) |
263 show "a \<sqinter> b = b \<sqinter> a" |
264 show "a \<sqinter> b = b \<sqinter> a" |
264 by (rule antisym) auto |
265 by (rule antisym) auto |
265 show "a \<sqinter> a = a" |
266 show "a \<sqinter> a = a" |
266 by (rule antisym) auto |
267 by (rule antisym) auto |
267 qed |
268 qed |
268 |
269 |
269 sublocale semilattice_sup < sup!: semilattice sup |
270 sublocale inf!: semilattice_order inf less_eq less |
|
271 by default (auto simp add: le_iff_inf less_le) |
|
272 |
|
273 lemma inf_assoc: "(x \<sqinter> y) \<sqinter> z = x \<sqinter> (y \<sqinter> z)" |
|
274 by (fact inf.assoc) |
|
275 |
|
276 lemma inf_commute: "(x \<sqinter> y) = (y \<sqinter> x)" |
|
277 by (fact inf.commute) |
|
278 |
|
279 lemma inf_left_commute: "x \<sqinter> (y \<sqinter> z) = y \<sqinter> (x \<sqinter> z)" |
|
280 by (fact inf.left_commute) |
|
281 |
|
282 lemma inf_idem: "x \<sqinter> x = x" |
|
283 by (fact inf.idem) (* already simp *) |
|
284 |
|
285 lemma inf_left_idem: "x \<sqinter> (x \<sqinter> y) = x \<sqinter> y" |
|
286 by (fact inf.left_idem) (* already simp *) |
|
287 |
|
288 lemma inf_right_idem: "(x \<sqinter> y) \<sqinter> y = x \<sqinter> y" |
|
289 by (fact inf.right_idem) (* already simp *) |
|
290 |
|
291 lemma inf_absorb1: "x \<sqsubseteq> y \<Longrightarrow> x \<sqinter> y = x" |
|
292 by (rule antisym) auto |
|
293 |
|
294 lemma inf_absorb2: "y \<sqsubseteq> x \<Longrightarrow> x \<sqinter> y = y" |
|
295 by (rule antisym) auto |
|
296 |
|
297 lemmas inf_aci = inf_commute inf_assoc inf_left_commute inf_left_idem |
|
298 |
|
299 end |
|
300 |
|
301 context semilattice_sup |
|
302 begin |
|
303 |
|
304 sublocale sup!: semilattice sup |
270 proof |
305 proof |
271 fix a b c |
306 fix a b c |
272 show "(a \<squnion> b) \<squnion> c = a \<squnion> (b \<squnion> c)" |
307 show "(a \<squnion> b) \<squnion> c = a \<squnion> (b \<squnion> c)" |
273 by (rule antisym) (auto intro: le_supI1 le_supI2) |
308 by (rule antisym) (auto intro: le_supI1 le_supI2) |
274 show "a \<squnion> b = b \<squnion> a" |
309 show "a \<squnion> b = b \<squnion> a" |
275 by (rule antisym) auto |
310 by (rule antisym) auto |
276 show "a \<squnion> a = a" |
311 show "a \<squnion> a = a" |
277 by (rule antisym) auto |
312 by (rule antisym) auto |
278 qed |
313 qed |
279 |
314 |
280 sublocale semilattice_inf < inf!: semilattice_order inf less_eq less |
315 sublocale sup!: semilattice_order sup greater_eq greater |
281 by default (auto simp add: le_iff_inf less_le) |
|
282 |
|
283 sublocale semilattice_sup < sup!: semilattice_order sup greater_eq greater |
|
284 by default (auto simp add: le_iff_sup sup.commute less_le) |
316 by default (auto simp add: le_iff_sup sup.commute less_le) |
285 |
|
286 context semilattice_inf |
|
287 begin |
|
288 |
|
289 lemma inf_assoc: "(x \<sqinter> y) \<sqinter> z = x \<sqinter> (y \<sqinter> z)" |
|
290 by (fact inf.assoc) |
|
291 |
|
292 lemma inf_commute: "(x \<sqinter> y) = (y \<sqinter> x)" |
|
293 by (fact inf.commute) |
|
294 |
|
295 lemma inf_left_commute: "x \<sqinter> (y \<sqinter> z) = y \<sqinter> (x \<sqinter> z)" |
|
296 by (fact inf.left_commute) |
|
297 |
|
298 lemma inf_idem: "x \<sqinter> x = x" |
|
299 by (fact inf.idem) (* already simp *) |
|
300 |
|
301 lemma inf_left_idem: "x \<sqinter> (x \<sqinter> y) = x \<sqinter> y" |
|
302 by (fact inf.left_idem) (* already simp *) |
|
303 |
|
304 lemma inf_right_idem: "(x \<sqinter> y) \<sqinter> y = x \<sqinter> y" |
|
305 by (fact inf.right_idem) (* already simp *) |
|
306 |
|
307 lemma inf_absorb1: "x \<sqsubseteq> y \<Longrightarrow> x \<sqinter> y = x" |
|
308 by (rule antisym) auto |
|
309 |
|
310 lemma inf_absorb2: "y \<sqsubseteq> x \<Longrightarrow> x \<sqinter> y = y" |
|
311 by (rule antisym) auto |
|
312 |
|
313 lemmas inf_aci = inf_commute inf_assoc inf_left_commute inf_left_idem |
|
314 |
|
315 end |
|
316 |
|
317 context semilattice_sup |
|
318 begin |
|
319 |
317 |
320 lemma sup_assoc: "(x \<squnion> y) \<squnion> z = x \<squnion> (y \<squnion> z)" |
318 lemma sup_assoc: "(x \<squnion> y) \<squnion> z = x \<squnion> (y \<squnion> z)" |
321 by (fact sup.assoc) |
319 by (fact sup.assoc) |
322 |
320 |
323 lemma sup_commute: "(x \<squnion> y) = (y \<squnion> x)" |
321 lemma sup_commute: "(x \<squnion> y) = (y \<squnion> x)" |
467 |
465 |
468 |
466 |
469 subsection {* Bounded lattices and boolean algebras *} |
467 subsection {* Bounded lattices and boolean algebras *} |
470 |
468 |
471 class bounded_semilattice_inf_top = semilattice_inf + top |
469 class bounded_semilattice_inf_top = semilattice_inf + top |
472 |
470 begin |
473 sublocale bounded_semilattice_inf_top < inf_top!: semilattice_neutr inf top |
471 |
|
472 sublocale inf_top!: semilattice_neutr inf top |
474 + inf_top!: semilattice_neutr_order inf top less_eq less |
473 + inf_top!: semilattice_neutr_order inf top less_eq less |
475 proof |
474 proof |
476 fix x |
475 fix x |
477 show "x \<sqinter> \<top> = x" |
476 show "x \<sqinter> \<top> = x" |
478 by (rule inf_absorb1) simp |
477 by (rule inf_absorb1) simp |
479 qed |
478 qed |
480 |
479 |
|
480 end |
|
481 |
481 class bounded_semilattice_sup_bot = semilattice_sup + bot |
482 class bounded_semilattice_sup_bot = semilattice_sup + bot |
482 |
483 begin |
483 sublocale bounded_semilattice_sup_bot < sup_bot!: semilattice_neutr sup bot |
484 |
|
485 sublocale sup_bot!: semilattice_neutr sup bot |
484 + sup_bot!: semilattice_neutr_order sup bot greater_eq greater |
486 + sup_bot!: semilattice_neutr_order sup bot greater_eq greater |
485 proof |
487 proof |
486 fix x |
488 fix x |
487 show "x \<squnion> \<bottom> = x" |
489 show "x \<squnion> \<bottom> = x" |
488 by (rule sup_absorb1) simp |
490 by (rule sup_absorb1) simp |
489 qed |
491 qed |
|
492 |
|
493 end |
490 |
494 |
491 class bounded_lattice_bot = lattice + bot |
495 class bounded_lattice_bot = lattice + bot |
492 begin |
496 begin |
493 |
497 |
494 subclass bounded_semilattice_sup_bot .. |
498 subclass bounded_semilattice_sup_bot .. |