module Order.Diagram.Glb where
module _ {o ℓ} (P : Poset o ℓ) where
open Poset P
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
unquoteDecl H-Level-is-glb = declare-record-hlevel 1 H-Level-is-glb (quote is-glb)
module _ {o ℓ} {P : Poset o ℓ} where
open Poset P
open is-glb
glb-unique: ∀ {ℓᵢ} {I : Type ℓᵢ} {F : I → Ob} {x y}
→ is-glb P F x → is-glb P F y
→ x ≡ y
= ≤-antisym
glb-unique is is' (is' .greatest _ (is .glb≤fam))
(is .greatest _ (is' .glb≤fam))
Glb-is-prop: ∀ {ℓᵢ} {I : Type ℓᵢ} {F : I → Ob}
→ is-prop (Glb P F)
.Glb.glb =
Glb-is-prop p q i (Glb.has-glb p) (Glb.has-glb q) i
glb-unique {F = F} p q i .Glb.has-glb =
Glb-is-prop {B = λ i → is-glb P F (glb-unique (Glb.has-glb p) (Glb.has-glb q) i)}
is-prop→pathp (λ i → hlevel 1)
(Glb.has-glb p) (Glb.has-glb q) i
instance
H-Level-Glb: ∀ {ℓᵢ} {I : Type ℓᵢ} {F : I → Ob} {n}
→ H-Level (Glb P F) (suc n)
= prop-instance Glb-is-prop
H-Level-Glb
lift-is-glb: ∀ {ℓᵢ ℓᵢ'} {I : Type ℓᵢ} {F : I → Ob} {glb}
→ is-glb P F glb → is-glb P (F ⊙ lower {ℓ = ℓᵢ'}) glb
.glb≤fam (lift ix) = is .glb≤fam ix
lift-is-glb is .greatest ub' le = is .greatest ub' (le ⊙ lift)
lift-is-glb is
lift-glb: ∀ {ℓᵢ ℓᵢ'} {I : Type ℓᵢ} {F : I → Ob}
→ Glb P F → Glb P (F ⊙ lower {ℓ = ℓᵢ'})
.Glb.glb = Glb.glb glb
lift-glb glb .Glb.has-glb = lift-is-glb (Glb.has-glb glb)
lift-glb glb
lower-is-glb: ∀ {ℓᵢ ℓᵢ'} {I : Type ℓᵢ} {F : I → Ob} {glb}
→ is-glb P (F ⊙ lower {ℓ = ℓᵢ'}) glb → is-glb P F glb
.glb≤fam ix = is .glb≤fam (lift ix)
lower-is-glb is .greatest ub' le = is .greatest ub' (le ⊙ lower)
lower-is-glb is
lower-glb: ∀ {ℓᵢ ℓᵢ'} {I : Type ℓᵢ} {F : I → Ob}
→ Glb P (F ⊙ lower {ℓ = ℓᵢ'}) → Glb P F
.Glb.glb = Glb.glb glb
lower-glb glb .Glb.has-glb = lower-is-glb (Glb.has-glb glb) lower-glb glb
module _
{ℓᵢ ℓᵢ'} {Ix : Type ℓᵢ} {Im : Type ℓᵢ'}
{f : Ix → Im}
{F : Im → Ob}
(surj : is-surjective f)
where
: ∀ {glb} → is-glb P F glb → is-glb P (F ⊙ f) glb
cover-preserves-is-glb .glb≤fam i = g .glb≤fam (f i)
cover-preserves-is-glb g .greatest lb' le = g .greatest lb' λ i → ∥-∥-out! do
cover-preserves-is-glb g (i' , p) ← surj i
(≤-trans (le i') (≤-refl' (ap F p)))
pure
: Glb P F → Glb P (F ⊙ f)
cover-preserves-glb .Glb.glb = _
cover-preserves-glb g .Glb.has-glb = cover-preserves-is-glb (g .Glb.has-glb)
cover-preserves-glb g
: ∀ {glb} → is-glb P (F ⊙ f) glb → is-glb P F glb
cover-reflects-is-glb .glb≤fam i = ∥-∥-out! do
cover-reflects-is-glb g (y , p) ← surj i
(≤-trans (g .glb≤fam y) (≤-refl' (ap F p)))
pure .greatest lb' le = g .greatest lb' λ i → le (f i)
cover-reflects-is-glb g
: Glb P (F ⊙ f) → Glb P F
cover-reflects-glb .Glb.glb = _
cover-reflects-glb g .Glb.has-glb = cover-reflects-is-glb (g .Glb.has-glb) cover-reflects-glb g
As limits🔗
If a poset has all greatest lower bounds of size then it is complete when viewed as a category.
module _ {o ℓ} {P : Poset o ℓ} where
open Poset P
glbs→complete: ∀ {oκ ℓκ}
→ (∀ {I : Type oκ} (k : I → Ob) → Glb P k)
→ is-complete oκ ℓκ (poset→category P)
= to-limit (to-is-limit lim) where
glbs→complete glbs K open make-is-limit
module K = Functor K
open Glb (glbs K.₀)
: make-is-limit K glb
lim .ψ = glb≤fam
lim .commutes _ = prop!
lim .universal eps _ = greatest _ eps
lim .factors _ _ = prop!
lim .unique _ _ _ _ = prop! lim