module Order.Semilattice.Meet.NAry where

n-Ary meetsπŸ”—

Let be a meet semilattice, and let be a finite family of elements of We can compute meets of in via induction on the size of the family.

  β‹‚αΆ  : βˆ€ {n} (f : Fin n β†’ Ob) β†’ Ob
  β‹‚αΆ  {0}           f = top
  β‹‚αΆ  {1}           f = f fzero
  β‹‚αΆ  {suc (suc n)} f = f fzero ∩ β‹‚αΆ  (Ξ» i β†’ f (fsuc i))

  β‹‚αΆ -proj : βˆ€ {n} {f : Fin n β†’ Ob} (i : Fin n) β†’ β‹‚αΆ  f ≀ f i
  β‹‚αΆ -proj {1}           fzero    = ≀-refl
  β‹‚αΆ -proj {suc (suc n)} fzero    = βˆ©β‰€l
  β‹‚αΆ -proj {suc (suc n)} (fsuc i) = ≀-trans βˆ©β‰€r (β‹‚αΆ -proj i)

  β‹‚αΆ -universal
    : βˆ€ {n} {f : Fin n β†’ Ob} (x : Ob)
    β†’ (βˆ€ i β†’ x ≀ f i) β†’ x ≀ β‹‚αΆ  f
  β‹‚αΆ -universal {n = 0} {f = f} x p = !
  β‹‚αΆ -universal {n = 1} {f = f} x p = p fzero
  β‹‚αΆ -universal {n = suc (suc n)} {f = f} x p =
    ∩-universal _ (p fzero) (β‹‚αΆ -universal x (p βŠ™ fsuc))

  Finite-glbs : βˆ€ {n} (f : Fin n β†’ Ob) β†’ Glb P f
  Finite-glbs f .Glb.glb = β‹‚αΆ  f
  Finite-glbs f .Glb.has-glb .is-glb.glb≀fam = β‹‚αΆ -proj
  Finite-glbs f .Glb.has-glb .is-glb.greatest = β‹‚αΆ -universal

Furthermore, must also have meets 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 meet. Furthermore, is surjective, so it must reflect the meet.

  opaque
    Finitely-indexed-glbs
      : βˆ€ {β„“α΅’} {I : Type β„“α΅’}
      β†’ is-finitely-indexed I
      β†’ (f : I β†’ Ob)
      β†’ Glb P f
    Finitely-indexed-glbs {I = I} fin-indexed f = case fin-indexed of Ξ» cov β†’
      cover-reflects-glb (cov .is-cover) (Finite-glbs (f βŠ™ cov .cover))
      where open Finite-cover

Meet semilattice homomorphisms must also preserve finite meets. This follows from another induction on the size of the family we are taking a meet over.

module
  _ {o β„“ o' β„“'} {P : Poset o β„“} {Q : Poset o' β„“'} {f : Monotone P Q} {Pl Ql}
    (hom : is-meet-slat-hom f Pl Ql) where abstract

  private
    module Pβ‚— = is-meet-semilattice Pl
    module Qβ‚— = is-meet-semilattice Ql

  open is-meet-slat-hom hom

  pres-β‹‚αΆ  : βˆ€ {n} (k : Fin n β†’ ⌞ P ⌟) β†’ f # (β‹‚αΆ  Pl k) ≑ β‹‚αΆ  Ql (apply f βŠ™ k)
  pres-β‹‚αΆ  {n = 0} k = pres-top
  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)                      ∎