module Order.Semilattice.Join.NAry where
open is-lub open Lub module _ {o β} {P : Poset o β} (l : is-join-semilattice P) where open is-join-semilattice l open Poset P
n-Ary joinsπ
Let be a join semilattice, and let be a finite family of elements of We can compute joins of in via induction on the size of the family.
βαΆ : β {n} (f : Fin n β Ob) β Ob βαΆ {0} f = bot βαΆ {1} f = f fzero βαΆ {suc (suc n)} f = f fzero βͺ βαΆ (Ξ» i β f (fsuc i)) βαΆ -inj : β {n} {f : Fin n β Ob} β (i : Fin n) β f i β€ βαΆ f βαΆ -inj {1} fzero = β€-refl βαΆ -inj {suc (suc n)} fzero = lβ€βͺ βαΆ -inj {suc (suc n)} (fsuc i) = β€-trans (βαΆ -inj i) rβ€βͺ βαΆ -universal : β {n} {f : Fin n β Ob} (x : Ob) β (β i β f i β€ x) β βαΆ f β€ x βαΆ -universal {0} x p = Β‘ βαΆ -universal {1} x p = p fzero βαΆ -universal {suc (suc n)} x p = βͺ-universal _ (p fzero) (βαΆ -universal x (p β fsuc)) Finite-lubs : β {n} (f : Fin n β Ob) β Lub P f Finite-lubs f .lub = βαΆ f Finite-lubs f .has-lub .famβ€lub = βαΆ -inj Finite-lubs f .has-lub .least = βαΆ -universal
Furthermore, must also have joins of finitely indexed sets. Let be a finitely indexed set with enumeration and let be an family in is a finite family in so it must have a least upper bound. Furthermore, is surjective, so it must reflect the least upper bound.
opaque Finitely-indexed-lubs : β {βα΅’} {I : Type βα΅’} β is-finitely-indexed I β (f : I β Ob) β Lub P f Finitely-indexed-lubs {I = I} fin-indexed f = case fin-indexed of Ξ» cov β cover-reflects-lub (cov .is-cover) (Finite-lubs (f β cov .cover)) where open Finite-cover
Join semilattice homomorphisms must also preserve finite joins. This follows from another induction on the size of the family we are taking a join over.
module _ {o β o' β'} {P : Poset o β} {Q : Poset o' β'} {f : Monotone P Q} {Pl Ql} (hom : is-join-slat-hom f Pl Ql) where abstract private module Pβ = is-join-semilattice Pl module Qβ = is-join-semilattice Ql open is-join-slat-hom hom pres-βαΆ : β {n} (k : Fin n β β P β) β f # (βαΆ Pl k) β‘ βαΆ Ql (apply f β k) pres-βαΆ {n = 0} k = pres-bot pres-βαΆ {n = 1} k = refl pres-βαΆ {n = suc (suc n)} k = f # (k fzero Pβ.βͺ βαΆ Pl (k β fsuc)) β‘β¨ pres-βͺ _ _ β©β‘ f # (k fzero) Qβ.βͺ f # (βαΆ Pl (k β fsuc)) β‘β¨ apβ Qβ._βͺ_ refl (pres-βαΆ (k β fsuc)) β©β‘ βαΆ Ql (apply f β k) β pres-fin-lub : β {n} (k : Fin n β β P β) (x : β P β) β is-lub P k x β is-lub Q (Ξ» x β f # (k x)) (f # x) pres-fin-lub k x lub = done where remβ : x β‘ βαΆ Pl k remβ = lub-unique lub (Finite-lubs Pl k .has-lub) remβ : f # x β‘ βαΆ Ql (apply f β k) remβ = ap (apply f) remβ β pres-βαΆ k done : is-lub Q (Ξ» x β f # k x) (f # x) done = subst (is-lub Q (apply f β k)) (sym remβ) (Finite-lubs Ql _ .has-lub) pres-finite-lub : β {βα΅’} {I : Type βα΅’} β Finite I β (k : I β β P β) β (x : β P β) β is-lub P k x β is-lub Q (Ξ» x β f # (k x)) (f # x) pres-finite-lub I-finite k x P-lub = case I-finite .enumeration of Ξ» enum β cast-is-lub (enum eβ»ΒΉ) (Ξ» _ β refl) $ pres-fin-lub (k β Equiv.from enum) x $ cast-is-lub enum (Ξ» x β sym (ap k (Equiv.Ξ· enum x))) P-lub
As a corollary, join semilattice homomorphisms must also preserve joins of finitely-indexed sets.
pres-finitely-indexed-lub : β {βα΅’} {I : Type βα΅’} β is-finitely-indexed I β (k : I β β P β) β (x : β P β) β is-lub P k x β is-lub Q (Ξ» x β f # (k x)) (f # x) pres-finitely-indexed-lub I-fin-indexed k x P-lub = case I-fin-indexed of Ξ» cov β cover-reflects-is-lub (Finite-cover.is-cover cov) $ pres-fin-lub (k β Finite-cover.cover cov) x $ cover-preserves-is-lub (Finite-cover.is-cover cov) P-lub