{-# OPTIONS --safe #-}
module Cubical.Structures.TypeEqvTo where

open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv

open import Cubical.HITs.PropositionalTruncation
open import Cubical.Data.Sigma

open import Cubical.Foundations.SIP
open import Cubical.Foundations.Pointed
open import Cubical.Structures.Axioms
open import Cubical.Structures.Pointed

private
  variable
     ℓ' ℓ'' : Level

TypeEqvTo : ( : Level) (X : Type ℓ')  Type (ℓ-max (ℓ-suc ) ℓ')
TypeEqvTo  X = TypeWithStr   Y   Y  X ∥₁)

PointedEqvTo : ( : Level) (X : Type ℓ')  Type (ℓ-max (ℓ-suc ) ℓ')
PointedEqvTo  X = TypeWithStr   Y  Y ×  Y  X ∥₁)

module _ (X : Type ℓ') where

  PointedEqvToStructure : Type   Type (ℓ-max  ℓ')
  PointedEqvToStructure = AxiomsStructure PointedStructure  Y _   Y  X ∥₁)

  PointedEqvToEquivStr : StrEquiv PointedEqvToStructure ℓ''
  PointedEqvToEquivStr = AxiomsEquivStr PointedEquivStr  Y _   Y  X ∥₁)

  pointedEqvToUnivalentStr : UnivalentStr {} PointedEqvToStructure PointedEqvToEquivStr
  pointedEqvToUnivalentStr = axiomsUnivalentStr PointedEquivStr {axioms = λ Y _   Y  X ∥₁}
                                           _ _  squash₁) pointedUnivalentStr

  PointedEqvToSIP : (A B : PointedEqvTo  X)  A ≃[ PointedEqvToEquivStr ] B  (A  B)
  PointedEqvToSIP = SIP pointedEqvToUnivalentStr

  PointedEqvTo-sip : (A B : PointedEqvTo  X)  A ≃[ PointedEqvToEquivStr ] B  (A  B)
  PointedEqvTo-sip A B = equivFun (PointedEqvToSIP A B)