module Order.Lattice.Distributive {o β} {P : Poset o β} (l : is-lattice P) where
open Pos P
open Lat l
Distributive latticesπ
A distributive lattice, as the name implies, is a lattice where the operations of meet and join distribute over each other: that is, for any triple of elements
Rather remarkably, it turns out that either equation implies the other. We provide a pair of parametrised modules which quantifies over one of the equations and proves the other. For convenience, these modules also define distributivity on the right, too; this is a consequence of both meets and joins being commutative operators.
module Distributive where
module from-β© (β©-distribl : β {x y z} β x β© (y βͺ z) β‘ (x β© y) βͺ (x β© z)) where abstract
: β {x y z} β (y βͺ z) β© x β‘ (y β© x) βͺ (z β© x)
β©-distribr = β©-comm ββ β©-distribl ββ apβ _βͺ_ β©-comm β©-comm
β©-distribr
: β {x y z} β x βͺ (y β© z) β‘ (x βͺ y) β© (x βͺ z)
βͺ-distribl {x} {y} {z} = sym $
βͺ-distribl (x βͺ y) β© (x βͺ z) β‘β¨ β©-distribl β©
((x βͺ y) β© x) βͺ ((x βͺ y) β© z) β‘β¨ apβ _βͺ_ β©-absorbr refl β©
((x βͺ y) β© z) β‘β¨ apβ _βͺ_ refl β©-distribr β©
x βͺ (x β© z βͺ y β© z) β‘β¨ βͺ-assoc β©
x βͺ (x βͺ x β© z) βͺ (y β© z) β‘β¨ apβ _βͺ_ βͺ-absorbl refl β©
(y β© z) β
x βͺ
: β {x y z} β (y β© z) βͺ x β‘ (y βͺ x) β© (z βͺ x)
βͺ-distribr = βͺ-comm ββ βͺ-distribl ββ apβ _β©_ βͺ-comm βͺ-comm βͺ-distribr
The construction assuming that join distributes over meet is formally dual.
module from-βͺ (βͺ-distribl : β {x y z} β x βͺ (y β© z) β‘ (x βͺ y) β© (x βͺ z)) where abstract
: β {x y z} β (y β© z) βͺ x β‘ (y βͺ x) β© (z βͺ x)
βͺ-distribr = βͺ-comm ββ βͺ-distribl ββ apβ _β©_ βͺ-comm βͺ-comm
βͺ-distribr
: β {x y z} β x β© (y βͺ z) β‘ (x β© y) βͺ (x β© z)
β©-distribl {x} {y} {z} = sym $
β©-distribl (x β© y) βͺ (x β© z) β‘β¨ βͺ-distribl β©
((x β© y) βͺ x) β© ((x β© y) βͺ z) β‘β¨ apβ _β©_ βͺ-absorbr refl β©
((x β© y) βͺ z) β‘β¨ apβ _β©_ refl βͺ-distribr β©
x β© (x βͺ z) β© (y βͺ z) β‘β¨ β©-assoc β©
x β© (x β© (x βͺ z)) β© (y βͺ z) β‘β¨ apβ _β©_ β©-absorbl refl β©
(y βͺ z) β
x β©
: β {x y z} β (y βͺ z) β© x β‘ (y β© x) βͺ (z β© x)
β©-distribr = β©-comm ββ β©-distribl ββ apβ _βͺ_ β©-comm β©-comm β©-distribr
As a further weakening of the preconditions, it turns out that it suffices for distributivity to hold as an inequality, in the direction
since the other direction always holds in a lattice.
distrib-leββ©-distribl: (β {x y z} β x β© (y βͺ z) β€ (x β© y) βͺ (x β© z))
β β {x y z} β x β© (y βͺ z) β‘ (x β© y) βͺ (x β© z)
= β€-antisym β©-βͺ-distribβ€ βͺ-β©-distribl-β€ distrib-leββ©-distribl β©-βͺ-distribβ€