module Order.Semilattice.Join.Subsemilattice where

Subsets of Join SemilatticesπŸ”—

Let be a predicate on a join semilattice If is closed under joins and the bottom element of then the subposet induced by is also a join semilattice.

module _ {o β„“} {A : Poset o β„“} (A-slat : is-join-semilattice A) where
  module A = Order.Semilattice.Join.Reasoning A-slat
  open is-join-semilattice
  open Join

  Subposet-is-join-semilattice
    : βˆ€ {β„“'} {P : A.Ob β†’ Prop β„“'}
    β†’ (βˆ€ {x y} β†’ x ∈ P β†’ y ∈ P β†’ (x A.βˆͺ y) ∈ P)
    β†’ A.bot ∈ P
    β†’ is-join-semilattice (Subposet A P)
  Subposet-is-join-semilattice {P = P} βˆͺ∈P bot∈P ._βˆͺ_ (x , x∈P) (y , y∈P) = record
    { fst = x A.βˆͺ y
    ; snd = βˆͺ∈P x∈P y∈P
    }
  Subposet-is-join-semilattice {P = P} βˆͺ∈P bot∈P .βˆͺ-joins (x , x∈P) (y , y∈P) =
    subposet-has-join _ _ _ (A.βˆͺ-joins x y)
  Subposet-is-join-semilattice {P = P} βˆͺ∈P bot∈P .has-bottom =
    subposet-bottom A.has-bottom bot∈P