module Order.Heyting where
Heyting algebrasπ
A Heyting algebra is a lattice which is equipped to handle implication: it has a binary operation for which we have an equivalence between and Reading this from the perspective of logic, we may interpret the parameter as a context, so that our equivalence says we have inference rules
When we enrich our poset of propositions to a category of contexts, the notion of Heyting algebra is generalised to that of Cartesian closed category (with finite coproducts).
record is-heyting-algebra {o β} (P : Poset o β) : Type (o β β) where open Poset P field has-top : Top P has-bottom : Bottom P _βͺ_ : Ob β Ob β Ob βͺ-joins : β x y β is-join P x y (x βͺ y) _β©_ : Ob β Ob β Ob β©-meets : β x y β is-meet P x y (x β© y) _β¨_ : β P β β β P β β β P β Ζ : β {x y z} β x β© y β€ z β x β€ y β¨ z ev : β {x y z} β x β€ y β¨ z β x β© y β€ z
infixr 23 _β¨_ infixr 24 _βͺ_ infixr 25 _β©_ has-is-lattice : is-lattice P has-is-lattice .is-lattice.has-bottom = has-bottom has-is-lattice .is-lattice.has-top = has-top has-is-lattice .is-lattice._β©_ = _β©_ has-is-lattice .is-lattice.β©-meets = β©-meets has-is-lattice .is-lattice._βͺ_ = _βͺ_ has-is-lattice .is-lattice.βͺ-joins = βͺ-joins
Elementary propertiesπ
module _ {o β} {P : Poset o β} (heyt : is-heyting-algebra P) where open is-heyting-algebra heyt open Lat has-is-lattice hiding (_βͺ_ ; _β©_) open Pos P
The first thing we note about Heyting algebras is that they are distributive lattices. This is because, for an arbitrary we can reduce the problem of showing
by adjointness, to showing
where the universal property of the join is actually applicable β allowing us further reductions to showing showing and The following calculation formalises this sketch:
β©-βͺ-distribβ€ : β {x y z} β x β© (y βͺ z) β€ (x β© y) βͺ (x β© z) β©-βͺ-distribβ€ {x} {y} {z} = let caseβ : y β© x β€ (x β© y) βͺ (x β© z) caseβ = β€-trans (β€-refl' β©-comm) lβ€βͺ caseβ : z β© x β€ (x β© y) βͺ (x β© z) caseβ = β€-trans (β€-refl' β©-comm) rβ€βͺ body : (y βͺ z) β€ x β¨ (x β© y) βͺ (x β© z) body = βͺ-universal _ (Ζ caseβ) (Ζ caseβ) in x β© (y βͺ z) =β¨ β©-comm β©= (y βͺ z) β© x β€β¨ ev body β©β€ x β© y βͺ x β© z β€β