module Order.Diagram.Lub.Subset where

Joins of subsetsπŸ”—

Imagine you have a poset whose carrier has size which furthermore has least upper bounds for families of elements. But imagine that you have a second universe and you have a predicate Normally, you’d be out of luck: there is no reason for to admit joins.

But since we’ve assumed propositional resizing, we can resize (pointwise) to be valued in the universe That way we can turn the total space into a type! By projecting the first component, we have a family of elements, which has a join. This is a good definition for the join of the subset .

  opaque
    ⋃˒ : βˆ€ (P : ⌞ F ⌟ β†’ Ξ©) β†’ ⌞ F ⌟
    ⋃˒ P = ⋃ {I = Ξ£[ t ∈ F ] β–‘ (t ∈ P)} fst

    ⋃˒-inj
      : βˆ€ {P : ⌞ F ⌟ β†’ Ξ©} {x}
      β†’ x ∈ P β†’ x ≀ ⋃˒ P
    ⋃˒-inj x = P.⋃-inj (_ , (inc x))

    ⋃˒-universal
      : βˆ€ {P : ⌞ F ⌟ β†’ Ξ©} {x}
      β†’ (βˆ€ i β†’ i ∈ P β†’ i ≀ x)
      β†’ ⋃˒ P ≀ x
    ⋃˒-universal f = P.⋃-universal _ Ξ» (i , w) β†’ f i (β–‘-out! w)