open import 1Lab.Underlying
open import 1Lab.Type hiding (Σ-syntax)
module 1Lab.Membership where
record Membership {ℓ ℓe} (A : Type ℓe) (ℙA : Type ℓ) ℓm : Type (ℓ ⊔ lsuc (ℓe ⊔ ℓm)) where
field _∈_ : A → ℙA → Type ℓm
infix 30 _∈_
open Membership ⦃ ... ⦄ using (_∈_) public
instance
Membership-pow
: ∀ {ℓ ℓ'} {A : Type ℓ} {P : Type ℓ'} ⦃ u : Underlying P ⦄
→ Membership A (A → P) _
Membership-pow = record { _∈_ = λ x S → ⌞ S x ⌟ }
_∉_ : ∀ {ℓ ℓ' ℓ''} {A : Type ℓ} {ℙA : Type ℓ'} ⦃ m : Membership A ℙA ℓ'' ⦄
→ A → ℙA → Type ℓ''
x ∉ y = ¬ (x ∈ y)
_⊆_ : ∀ {ℓ ℓ' ℓ''} {A : Type ℓ} {ℙA : Type ℓ'} ⦃ m : Membership A ℙA ℓ'' ⦄
→ ℙA → ℙA → Type (ℓ ⊔ ℓ'')
_⊆_ {A = A} S T = (a : A) → a ∈ S → a ∈ T
∫ₚ
: ∀ {ℓ ℓ' ℓ''} {X : Type ℓ} {ℙX : Type ℓ'} ⦃ m : Membership X ℙX ℓ'' ⦄
→ ℙX → Type _
∫ₚ {X = X} P = Σ[ x ∈ X ] (x ∈ P)
infix 30 _∉_ _⊆_