module Order.Lattice.Reasoning {o β} {P : Poset o β} (lat : is-lattice P) where
Reasoning in latticesπ
This module provides some basic reasoning combinators for lattices.
open Order.Semilattice.Meet.Reasoning has-meet-slat using (β©-idl; β©-idr; module β©) public open Order.Semilattice.Join.Reasoning has-join-slat using (βͺ-idl; βͺ-idr; module βͺ) public
First, we show that we have half of a distributive law that states that meets distribute over joins. For the converse to hold, must be a distributive lattice.
abstract βͺ-β©-distribl-β€ : β {x y z} β (x β© y) βͺ (x β© z) β€ x β© (y βͺ z) βͺ-β©-distribl-β€ = βͺ-universal _ (β©-universal _ β©β€l (β€-trans β©β€r lβ€βͺ)) (β©-universal _ β©β€l (β€-trans β©β€r rβ€βͺ))
We can prove a dual result for joins distributing over meets.
β©-βͺ-distribl-β€ : β {x y z} β x βͺ (y β© z) β€ (x βͺ y) β© (x βͺ z) β©-βͺ-distribl-β€ = βͺ-universal _ (β©-universal _ lβ€βͺ lβ€βͺ) (β©-universal _ (β€-trans β©β€l rβ€βͺ) (β€-trans β©β€r rβ€βͺ))
βͺ-β©-distribr-β€ : β {x y z} β (x β© z) βͺ (y β© z) β€ (x βͺ y) β© z βͺ-β©-distribr-β€ = βͺ-universal _ (β©-universal _ (β€-trans β©β€l lβ€βͺ) β©β€r) (β©-universal _ (β€-trans β©β€l rβ€βͺ) β©β€r) β©-βͺ-distribr-β€ : β {x y z} β (x β© y) βͺ z β€ (x βͺ z) β© (y βͺ z) β©-βͺ-distribr-β€ = βͺ-universal _ (β©-universal _ (β€-trans β©β€l lβ€βͺ) (β€-trans β©β€r lβ€βͺ)) (β©-universal _ rβ€βͺ rβ€βͺ)
We also have absorptive laws for meets over joins (and joins over meets).
β©-absorbr : β {x y} β (x βͺ y) β© x β‘ x β©-absorbr = β€-antisym β©β€r (β©-universal _ lβ€βͺ β€-refl) β©-absorbl : β {x y} β x β© (x βͺ y) β‘ x β©-absorbl = β©-comm β β©-absorbr βͺ-absorbr : β {x y} β (x β© y) βͺ x β‘ x βͺ-absorbr = β€-antisym (βͺ-universal _ β©β€l β€-refl) rβ€βͺ βͺ-absorbl : β {x y} β x βͺ (x β© y) β‘ x βͺ-absorbl = βͺ-comm β βͺ-absorbr