module Order.Diagram.Lub {o â} (P : Poset o â) where
Least 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
: â i â F i †lub
famâ€lub : (ub' : Ob) â (â i â F i †ub') â lub †ub'
least
record Lub {âᔹ} {I : Type âᔹ} (F : I â Ob) : Type (o â â â âᔹ) where
no-eta-equality
field
: Ob
lub : is-lub F lub
has-lub open is-lub has-lub public
open is-lub
Let 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â€lub = ge
fam-boundâis-lub i ge .least y le = le i fam-boundâis-lub i ge
If 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
{F = F} is-const x-lub i =
lub-of-const-fam
â€-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
{I = I} {F = F} {x = x} is-const =
const-inhabited-famâis-lub where
â„-â„-rec is-lub-is-prop mk-is-lub : I â is-lub F x
mk-is-lub .is-lub.famâ€lub j = pathâ†(is-const j)
mk-is-lub i .is-lub.least y le =
mk-is-lub i
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
{I = I} {F = F} is-const =
const-inhabited-famâlub where
â„-â„-rec Lub-is-prop mk-lub : I â Lub F
mk-lub .Lub.lub = F i
mk-lub i .Lub.has-lub =
mk-lub i (λ j â is-const j i) (inc i) const-inhabited-famâis-lub
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
: a †lub
lâ€join : b †lub
râ€join : (ub' : Ob) â a †ub' â b †ub' â lub †ub'
least
record Join (a b : Ob) : Type (o â â) where
no-eta-equality
field
: Ob
lub : is-join a b lub
has-join open is-join has-join public
open is-join
: â {a b lub} â is-join a b lub â is-lub (if_then a else b) lub
is-joinâis-lub .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-joinâis-lub join
: â {F : Bool â Ob} {lub} â is-lub F lub â is-join (F true) (F false) lub
is-lubâis-join .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
is-lubâis-join lub â a<ub'
true â b<ub' false
An important lemma about joins is that, if , then the least upper bound of and is just :
: â {a b} â a †b â is-join a b b
gtâis-join .lâ€join = aâ€b
gtâis-join aâ€b .râ€join = â€-refl
gtâis-join aâ€b .least ub' _ bâ€ub' = bâ€ub'
gtâis-join aâ€b
: â {a b l} â a †b â is-join a b l â b ⥠l
gt-join = join-unique (gtâis-join aâ€b) l gt-join aâ€b l
As 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
: â {a b lub : Ob} â is-join a b lub â Coproduct (posetâcategory P) a b
is-joinâcoproduct .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 =
is-joinâcoproduct lub .is-join.least _ a<q b<q
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! is-joinâcoproduct lub
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 .
: Ob â Type _
is-bottom = â x â bot †x
is-bottom bot
record Bottom : Type (o â â) where
no-eta-equality
field
: Ob
bot : is-bottom bot
has-bottom
: â {x} â bot †x
ÂĄ = has-bottom _
ÂĄ
: â {lub} {f : â„ â _} â is-bottom lub â is-lub f lub
is-bottomâis-lub .least x _ = is-bot x
is-bottomâis-lub is-bot
: â {lub} {f : â„ â _} â is-lub f lub â is-bottom lub
is-lubâis-bottom = lub .least x λ () is-lubâis-bottom lub 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!
: â {x} â is-bottom x â is-initial (posetâcategory P) x
is-bottomâinitial .centre = is-bot x
is-bottomâinitial is-bot x .paths _ = â€-thin _ _
is-bottomâinitial is-bot x
: â {x} â is-initial (posetâcategory P) x â is-bottom x
initialâis-bottom = initial x .centre initialâis-bottom initial x