{-# OPTIONS --without-K #-}
open import Base
open import Equality
open import EquationalReasoning
open import logic.Propositions
open import equality.FunctionExtensionality
open import equality.CartesianProduct
module logic.Sets where
isSet : ∀{ℓ} (A : Type ℓ) → Type ℓ
isSet A = (x y : A) → isProp (x == y)
hSet : ∀{ℓ} → Type (lsuc ℓ)
hSet {ℓ} = Σ (Type ℓ) isSet
isSet-prod : ∀{ℓᵢ ℓⱼ} {A : Type ℓᵢ} → {B : Type ℓⱼ}
→ isSet A → isSet B → isSet (A × B)
isSet-prod sa sb (a , b) (c , d) p q = begin
p ==⟨ inv (prodByCompInverse p) ⟩
prodByComponents (prodComponentwise p) ==⟨ ap prodByComponents (prodByComponents (sa a c _ _ , sb b d _ _)) ⟩
prodByComponents (prodComponentwise q) ==⟨ prodByCompInverse q ⟩
q
∎