module Order.Diagram.Lub {o â} (P : Poset o â) whereLeast upper boundsđ
A lub (short for least upper bound) for a family of elements is, as the name implies, a least elemnet among the upper boudns of the . Being an upper bound means that we have for all ; Being the least upper bound means that if weâre given some other satisfying (for each ), then we have .
The same observation about the naming of glbs vs meets applies to lubs, with the binary name being join.
record is-lub
{âᔹ} {I : Type âᔹ} (F : I â Ob) (lub : Ob)
: Type (o â â â âᔹ)
where
no-eta-equality
field
famâ€lub : â i â F i †lub
least : (ub' : Ob) â (â i â F i †ub') â lub †ub'
record Lub {âᔹ} {I : Type âᔹ} (F : I â Ob) : Type (o â â â âᔹ) where
no-eta-equality
field
lub : Ob
has-lub : is-lub F lub
open is-lub has-lub public
open is-lubLet be a family. If there is some such that for all , , then is the least upper bound of .
fam-boundâis-lub
: â {âᔹ} {I : Type âᔹ} {F : I â Ob}
â (i : I) â (â j â F j †F i)
â is-lub F (F i)
fam-boundâis-lub i ge .famâ€lub = ge
fam-boundâis-lub i ge .least y le = le iIf is the least upper bound of a constant family, then must be equal to every member of the family.
lub-of-const-fam
: â {âᔹ} {I : Type âᔹ} {F : I â Ob} {x}
â (â i j â F i ⥠F j)
â is-lub F x
â â i â F i ⥠x
lub-of-const-fam {F = F} is-const x-lub i =
â€-antisym
(famâ€lub x-lub i)
(least x-lub (F i) λ j â pathââ„ (is-const i j))Furthermore, if is a constant family and is merely inhabited, then has a least upper bound.
const-inhabited-famâis-lub
: â {âᔹ} {I : Type âᔹ} {F : I â Ob} {x}
â (â i â F i ⥠x)
â â„ I â„
â is-lub F x
const-inhabited-famâis-lub {I = I} {F = F} {x = x} is-const =
â„-â„-rec is-lub-is-prop mk-is-lub where
mk-is-lub : I â is-lub F x
mk-is-lub i .is-lub.famâ€lub j = pathâ†(is-const j)
mk-is-lub i .is-lub.least y le =
x =Ëâš is-const i â©
F i â€âš le i â©
y â€â
const-inhabited-famâlub
: â {âᔹ} {I : Type âᔹ} {F : I â Ob}
â (â i j â F i ⥠F j)
â â„ I â„
â Lub F
const-inhabited-famâlub {I = I} {F = F} is-const =
â„-â„-rec Lub-is-prop mk-lub where
mk-lub : I â Lub F
mk-lub i .Lub.lub = F i
mk-lub i .Lub.has-lub =
const-inhabited-famâis-lub (λ j â is-const j i) (inc i)Joinsđ
In the binary case, a least upper bound is called a join. A short computation shows that being a join is precisely being the lub of a family of two elements.
record is-join (a b : Ob) (lub : Ob) : Type (o â â) where
no-eta-equality
field
lâ€join : a †lub
râ€join : b †lub
least : (ub' : Ob) â a †ub' â b †ub' â lub †ub'
record Join (a b : Ob) : Type (o â â) where
no-eta-equality
field
lub : Ob
has-join : is-join a b lub
open is-join has-join public
open is-join
is-joinâis-lub : â {a b lub} â is-join a b lub â is-lub (if_then a else b) lub
is-joinâis-lub join .famâ€lub true = join .lâ€join
is-joinâis-lub join .famâ€lub false = join .râ€join
is-joinâis-lub join .least ub' x = join .least ub' (x true) (x false)
is-lubâis-join : â {F : Bool â Ob} {lub} â is-lub F lub â is-join (F true) (F false) lub
is-lubâis-join lub .lâ€join = lub .famâ€lub true
is-lubâis-join lub .râ€join = lub .famâ€lub false
is-lubâis-join lub .least ub' a<ub' b<ub' = lub .least ub' λ where
true â a<ub'
false â b<ub'An important lemma about joins is that, if , then the least upper bound of and is just :
gtâis-join : â {a b} â a †b â is-join a b b
gtâis-join aâ€b .lâ€join = aâ€b
gtâis-join aâ€b .râ€join = â€-refl
gtâis-join aâ€b .least ub' _ bâ€ub' = bâ€ub'
gt-join : â {a b l} â a †b â is-join a b l â b ⥠l
gt-join aâ€b l = join-unique (gtâis-join aâ€b) lAs coproductsđ
Joins are the âthinningâ of coproducts; Put another way, when we allow a set of relators, rather than insisting on a propositional relation, the concept of join needs to be refined to that of coproduct.
open is-coproduct
open Coproduct
is-joinâcoproduct : â {a b lub : Ob} â is-join a b lub â Coproduct (posetâcategory P) a b
is-joinâcoproduct lub .coapex = _
is-joinâcoproduct lub .inâ = lub .is-join.lâ€join
is-joinâcoproduct lub .inâ = lub .is-join.râ€join
is-joinâcoproduct lub .has-is-coproduct .[_,_] a<q b<q =
lub .is-join.least _ a<q b<q
is-joinâcoproduct lub .has-is-coproduct .inââfactor = prop!
is-joinâcoproduct lub .has-is-coproduct .inââfactor = prop!
is-joinâcoproduct lub .has-is-coproduct .unique _ _ _ = prop!Bottom elementsđ
A bottom element in a partial order is an element that is smaller than any other element of . This is the same as being a least upper upper bound for the empty family .
is-bottom : Ob â Type _
is-bottom bot = â x â bot †x
record Bottom : Type (o â â) where
no-eta-equality
field
bot : Ob
has-bottom : is-bottom bot
ÂĄ : â {x} â bot †x
ÂĄ = has-bottom _
is-bottomâis-lub : â {lub} {f : â„ â _} â is-bottom lub â is-lub f lub
is-bottomâis-lub is-bot .least x _ = is-bot x
is-lubâis-bottom : â {lub} {f : â„ â _} â is-lub f lub â is-bottom lub
is-lubâis-bottom lub x = lub .least x λ ()As initial objectsđ
Bottoms are the decategorifcation of initial objects; we donât need to require the uniqueness of the universal morphism, as weâve replaced our hom-sets with hom-props!
is-bottomâinitial : â {x} â is-bottom x â is-initial (posetâcategory P) x
is-bottomâinitial is-bot x .centre = is-bot x
is-bottomâinitial is-bot x .paths _ = â€-thin _ _
initialâis-bottom : â {x} â is-initial (posetâcategory P) x â is-bottom x
initialâis-bottom initial x = initial x .centre