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 i with fin-view i
  ⋂ᶠ-proj {1}           .fzero    | zero  = ≤-refl
  ⋂ᶠ-proj {suc (suc n)} .fzero    | zero  = ∩≤l
  ⋂ᶠ-proj {suc (suc n)} .(fsuc i) | suc 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
  ⋂ᶠˢ : Finset  P    P 
  ⋂ᶠˢ []       = top
  ⋂ᶠˢ (x  xs) = x  ⋂ᶠˢ xs
  ⋂ᶠˢ (∷-dup x xs i) = along i $
    x  x  ⋂ᶠˢ xs ≡⟨ ∩.pulll ∩-idem 
    x  ⋂ᶠˢ xs     
  ⋂ᶠˢ (∷-swap x y xs i) = along i $
    x  y  ⋂ᶠˢ xs ≡⟨ ∩.extendl ∩-comm 
    y  x  ⋂ᶠˢ xs 
  ⋂ᶠˢ (squash x y p q i j) = hlevel 2 (⋂ᶠˢ x) (⋂ᶠˢ y)  i  ⋂ᶠˢ (p i))  i  ⋂ᶠˢ (q i)) i j

  abstract
    ⋂ᶠˢ-proj : {x :  P } (xs : Finset  P )  x  xs  ⋂ᶠˢ xs  x
    ⋂ᶠˢ-proj {x} xs = ∈ᶠˢ-elim  xs _  ⋂ᶠˢ xs  x) ∩≤l  q r  ≤-trans ∩≤r r) xs

    ⋂ᶠˢ-univ
      : (xs : Finset  P ) {o :  P }
       ((x :  P )  x ∈ᶠˢ xs  o  x)
       o  ⋂ᶠˢ xs
    ⋂ᶠˢ-univ xs {o} = Finset-elim-prop  xs  ((x :  P )  x ∈ᶠˢ xs  o  x)  o  ⋂ᶠˢ xs)
       _  !)
       x ih le  ∩-universal o (le x hereₛ) (ih  y w  le y (thereₛ w))))
      xs

    ⋂ᶠˢ-union : (xs ys : Finset  P )  ⋂ᶠˢ (xs <> ys)  (⋂ᶠˢ xs  ⋂ᶠˢ ys)
    ⋂ᶠˢ-union xs ys = ≤-antisym
      (∩-universal _
        (⋂ᶠˢ-univ xs λ x m  ⋂ᶠˢ-proj (xs <> ys) (unionl-∈ᶠˢ _ xs ys m))
        (⋂ᶠˢ-univ ys λ y m  ⋂ᶠˢ-proj (xs <> ys) (unionr-∈ᶠˢ _ xs ys m)))
      (⋂ᶠˢ-univ (xs <> ys) λ x m  case ∈ᶠˢ-union _ xs ys m of λ where
        (inl x)  ≤-trans ∩≤l (⋂ᶠˢ-proj xs x)
        (inr x)  ≤-trans ∩≤r (⋂ᶠˢ-proj ys x))

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)                      

  pres-⋂ᶠˢ :  xs  f · ⋂ᶠˢ Pl xs  ⋂ᶠˢ Ql (map (f ·_) xs)
  pres-⋂ᶠˢ = Finset-elim-prop _ pres-top  x ih  pres-∩ _ _  ap₂ Qₗ._∩_ refl ih)