module Order.Diagram.Glb {o â} (P : Poset o â) whereGreatest lower boundsđ
A glb (short for greatest lower bound) for a family of elements is, as the name implies, a greatest element among the lower bounds of the . Being a lower bound means that we have for all ; Being the greatest lower bound means that if weâre given some other satisfying (for each ), then we have .
A more common word to use for âgreatest lower boundâ is
âmeetâ. But since âmeetâ is a fairly uninformative name, and âglbâ
(pronounced âglibâ) is just plain fun to say, we stick with the non-word
for the indexed concept. However, if weâre talking about the glb of a
binary family, then we use the word âmeetâ. The distinction
here is entirely artificial, and itâs just because we canât reuse the
identifier is-glb for these two
slightly different cases. Summing up: to us, a meet is a glb of two
elements.
record is-glb {âᔹ} {I : Type âᔹ} (F : I â Ob) (glb : Ob)
: Type (o â â â âᔹ) where
no-eta-equality
field
glbâ€fam : â i â glb †F i
greatest : (lb' : Ob) â (â i â lb' †F i) â lb' †glb
record Glb {âᔹ} {I : Type âᔹ} (F : I â Ob) : Type (o â â â âᔹ) where
no-eta-equality
field
glb : Ob
has-glb : is-glb F glb
open is-glb has-glb publicMeetsđ
As mentioned before, in the binary case, we refer to glbs as meets: The meet of and is, if it exists, the greatest element satisfying and .
record is-meet (a b : Ob) (glb : Ob) : Type (o â â) where
no-eta-equality
field
meetâ€l : glb †a
meetâ€r : glb †b
greatest : (lb' : Ob) â lb' †a â lb' †b â lb' †glb
record Meet (a b : Ob) : Type (o â â) where
no-eta-equality
field
glb : Ob
has-meet : is-meet a b glb
open is-meet has-meet public
open is-meetA shuffling of terms shows that being a meet is precisely being the greatest lower bound of a family of two elements.
is-meetâis-glb : â {a b glb} â is-meet a b glb â is-glb (if_then a else b) glb
is-meetâis-glb meet .glbâ€fam true = meet .meetâ€l
is-meetâis-glb meet .glbâ€fam false = meet .meetâ€r
is-meetâis-glb meet .greatest glb' x = meet .greatest glb' (x true) (x false)
is-glbâis-meet : â {F : Bool â Ob} {glb} â is-glb F glb â is-meet (F true) (F false) glb
is-glbâis-meet glb .meetâ€l = glb .glbâ€fam true
is-glbâis-meet glb .meetâ€r = glb .glbâ€fam false
is-glbâis-meet glb .greatest lb' lb'<a lb'<b = glb .greatest lb' λ where
true â lb'<a
false â lb'<bAn important lemma about meets is that, if , then the greatest lower bound of and is just :
leâis-meet : â {a b} â a †b â is-meet a b a
leâis-meet aâ€b .meetâ€l = â€-refl
leâis-meet aâ€b .meetâ€r = aâ€b
leâis-meet aâ€b .greatest lb' lb'â€a _ = lb'â€a
le-meet : â {a b l} â a †b â is-meet a b l â a ⥠l
le-meet aâ€b l = meet-unique (leâis-meet aâ€b) lAs productsđ
When passing from posets to categories, meets become products: coming from the other direction, if a category has each a proposition, then products in are simply meets.
open is-product
open Product
is-meetâproduct : â {a b glb : Ob} â is-meet a b glb â Product (posetâcategory P) a b
is-meetâproduct glb .apex = _
is-meetâproduct glb .Ïâ = glb .is-meet.meetâ€l
is-meetâproduct glb .Ïâ = glb .is-meet.meetâ€r
is-meetâproduct glb .has-is-product .âš_,_â© q<a q<b =
glb .is-meet.greatest _ q<a q<b
is-meetâproduct glb .has-is-product .Ïââfactor = prop!
is-meetâproduct glb .has-is-product .Ïââfactor = prop!
is-meetâproduct glb .has-is-product .unique _ _ _ = prop!Top elementsđ
A top element in a partial order is an element that is larger than any other element in . This is the same as being a greatest lower bound for the empty family .
is-top : Ob â Type _
is-top top = â x â x †top
record Top : Type (o â â) where
field
top : Ob
has-top : is-top top
is-topâis-glb : â {glb} {f : â„ â _} â is-top glb â is-glb f glb
is-topâis-glb is-top .greatest x _ = is-top x
is-glbâis-top : â {glb} {f : â„ â _} â is-glb f glb â is-top glb
is-glbâis-top glb x = glb .greatest x λ ()As terminal objectsđ
Bottoms are the decategorifcation of terminal objects; we donât need to require the uniqueness of the universal morphism, as weâve replaced our hom-sets with hom-props!
is-topâterminal : â {x} â is-top x â is-terminal (posetâcategory P) x
is-topâterminal is-top x .centre = is-top x
is-topâterminal is-top x .paths _ = â€-thin _ _
terminalâis-top : â {x} â is-terminal (posetâcategory P) x â is-top x
terminalâis-top terminal x = terminal x .centre