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.

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≤∪))

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