module Order.Diagram.Glb {o â} (P : Poset o â) where
Greatest 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
: â i â glb †F i
glbâ€fam : (lb' : Ob) â (â i â lb' †F i) â lb' †glb
greatest
record Glb {âᔹ} {I : Type âᔹ} (F : I â Ob) : Type (o â â â âᔹ) where
no-eta-equality
field
: Ob
glb : is-glb F glb
has-glb open is-glb has-glb public
Meetsđ
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
: glb †a
meetâ€l : glb †b
meetâ€r : (lb' : Ob) â lb' †a â lb' †b â lb' †glb
greatest
record Meet (a b : Ob) : Type (o â â) where
no-eta-equality
field
: Ob
glb : is-meet a b glb
has-meet open is-meet has-meet public
open is-meet
A shuffling of terms shows that being a meet is precisely being the greatest lower bound of a family of two elements.
: â {a b glb} â is-meet a b glb â is-glb (if_then a else b) glb
is-meetâis-glb .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-meetâis-glb meet
: â {F : Bool â Ob} {glb} â is-glb F glb â is-meet (F true) (F false) glb
is-glbâis-meet .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
is-glbâis-meet glb â lb'<a
true â lb'<b false
An important lemma about meets is that, if , then the greatest lower bound of and is just :
: â {a b} â a †b â is-meet a b a
leâis-meet .meetâ€l = â€-refl
leâis-meet aâ€b .meetâ€r = aâ€b
leâis-meet aâ€b .greatest lb' lb'â€a _ = lb'â€a
leâis-meet aâ€b
: â {a b l} â a †b â is-meet a b l â a ⥠l
le-meet = meet-unique (leâis-meet aâ€b) l le-meet aâ€b l
As 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
: â {a b glb : Ob} â is-meet a b glb â Product (posetâcategory P) a b
is-meetâproduct .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 =
is-meetâproduct glb .is-meet.greatest _ q<a q<b
glb .has-is-product .Ïââfactor = prop!
is-meetâproduct glb .has-is-product .Ïââfactor = prop!
is-meetâproduct glb .has-is-product .unique _ _ _ = prop! is-meetâproduct glb
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 .
: Ob â Type _
is-top = â x â x †top
is-top top
record Top : Type (o â â) where
field
: Ob
top : is-top top
has-top
: â {glb} {f : â„ â _} â is-top glb â is-glb f glb
is-topâis-glb .greatest x _ = is-top x
is-topâis-glb is-top
: â {glb} {f : â„ â _} â is-glb f glb â is-top glb
is-glbâis-top = glb .greatest x λ () is-glbâis-top glb 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!
: â {x} â is-top x â is-terminal (posetâcategory P) x
is-topâterminal .centre = is-top x
is-topâterminal is-top x .paths _ = â€-thin _ _
is-topâterminal is-top x
: â {x} â is-terminal (posetâcategory P) x â is-top x
terminalâis-top = terminal x .centre terminalâis-top terminal x