module Order.Lattice.Distributive {o β} {P : Poset o β} (l : is-lattice P) where
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 from-β© (β©-distribl : β {x y z} β x β© (y βͺ z) β‘ (x β© y) βͺ (x β© z)) where abstract β©-distribr : β {x y z} β (y βͺ z) β© x β‘ (y β© x) βͺ (z β© x) β©-distribr = β©-comm Β·Β· β©-distribl Β·Β· apβ _βͺ_ β©-comm β©-comm βͺ-distribl : β {x y z} β x βͺ (y β© z) β‘ (x βͺ y) β© (x βͺ z) βͺ-distribl {x} {y} {z} = sym $ (x βͺ y) β© (x βͺ z) β‘β¨ β©-distribl β©β‘ ((x βͺ y) β© x) βͺ ((x βͺ y) β© z) β‘β¨ apβ _βͺ_ β©-absorbr refl β©β‘ x βͺ ((x βͺ y) β© z) β‘β¨ apβ _βͺ_ refl β©-distribr β©β‘ x βͺ (x β© z βͺ y β© z) β‘β¨ βͺ-assoc β©β‘ (x βͺ x β© z) βͺ (y β© z) β‘β¨ apβ _βͺ_ βͺ-absorbl refl β©β‘ x βͺ (y β© z) β βͺ-distribr : β {x y z} β (y β© z) βͺ x β‘ (y βͺ x) β© (z βͺ x) βͺ-distribr = βͺ-comm Β·Β· βͺ-distribl Β·Β· apβ _β©_ βͺ-comm βͺ-comm
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 βͺ-distribr : β {x y z} β (y β© z) βͺ x β‘ (y βͺ x) β© (z βͺ x) βͺ-distribr = βͺ-comm Β·Β· βͺ-distribl Β·Β· apβ _β©_ βͺ-comm βͺ-comm β©-distribl : β {x y z} β x β© (y βͺ z) β‘ (x β© y) βͺ (x β© z) β©-distribl {x} {y} {z} = sym $ (x β© y) βͺ (x β© z) β‘β¨ βͺ-distribl β©β‘ ((x β© y) βͺ x) β© ((x β© y) βͺ z) β‘β¨ apβ _β©_ βͺ-absorbr refl β©β‘ x β© ((x β© y) βͺ z) β‘β¨ apβ _β©_ refl βͺ-distribr β©β‘ x β© (x βͺ z) β© (y βͺ z) β‘β¨ β©-assoc β©β‘ (x β© (x βͺ z)) β© (y βͺ z) β‘β¨ apβ _β©_ β©-absorbl refl β©β‘ x β© (y βͺ z) β β©-distribr : β {x y z} β (y βͺ z) β© x β‘ (y β© x) βͺ (z β© x) β©-distribr = β©-comm Β·Β· β©-distribl Β·Β· apβ _βͺ_ β©-comm β©-comm
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) distrib-leββ©-distribl β©-βͺ-distribβ€ = β€-antisym β©-βͺ-distribβ€ βͺ-β©-distribl-β€