nLab equivalence type

Context

Type theory

natural deduction metalanguage, practical foundations

  1. type formation rule
  2. term introduction rule
  3. term elimination rule
  4. computation rule

type theory (dependent, intensional, observational type theory, homotopy type theory)

syntax object language

computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory

logicset theory (internal logic of)category theorytype theory
propositionsetobjecttype
predicatefamily of setsdisplay morphismdependent type
proofelementgeneralized elementterm/program
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
introduction rule for implicationcounit for hom-tensor adjunctionlambda
elimination rule for implicationunit for hom-tensor adjunctionapplication
cut elimination for implicationone of the zigzag identities for hom-tensor adjunctionbeta reduction
identity elimination for implicationthe other zigzag identity for hom-tensor adjunctioneta conversion
truesingletonterminal object/(-2)-truncated objecth-level 0-type/unit type
falseempty setinitial objectempty type
proposition, truth valuesubsingletonsubterminal object/(-1)-truncated objecth-proposition, mere proposition
logical conjunctioncartesian productproductproduct type
disjunctiondisjoint union (support of)coproduct ((-1)-truncation of)sum type (bracket type of)
implicationfunction set (into subsingleton)internal hom (into subterminal object)function type (into h-proposition)
negationfunction set into empty setinternal hom into initial objectfunction type into empty type
universal quantificationindexed cartesian product (of family of subsingletons)dependent product (of family of subterminal objects)dependent product type (of family of h-propositions)
existential quantificationindexed disjoint union (support of)dependent sum ((-1)-truncation of)dependent sum type (bracket type of)
logical equivalencebijection setobject of isomorphismsequivalence type
support setsupport object/(-1)-truncationpropositional truncation/bracket type
n-image of morphism into terminal object/n-truncationn-truncation modality
equalitydiagonal function/diagonal subset/diagonal relationpath space objectidentity type/path type
completely presented setsetdiscrete object/0-truncated objecth-level 2-type/set/h-set
setset with equivalence relationinternal 0-groupoidBishop set/setoid with its pseudo-equivalence relation an actual equivalence relation
equivalence class/quotient setquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
presettype without identity types
set of truth valuessubobject classifiertype of propositions
domain of discourseuniverseobject classifiertype universe
modalityclosure operator, (idempotent) monadmodal type theory, monad (in computer science)
linear logic(symmetric, closed) monoidal categorylinear type theory/quantum computation
proof netstring diagramquantum circuit
(absence of) contraction rule(absence of) diagonalno-cloning theorem
synthetic mathematicsdomain specific embedded programming language

homotopy levels

semantics

Equality and Equivalence

Contents

Idea

In dependent type theory, the equivalence type is to types what the identity type is to terms: it represents the collection of “equalities” between types (equality of types being given by the notion of equivalence in type theory), in the same way that the identity type represents the collection of equalities between terms (equality of terms being given by the notion of identity/identification/path).

Definition

In dependent type theory, the equivalence type between two types AA and BB is the type ABA \simeq B whose terms are equivalences between AA and BB. Like any other notion of type in dependent type theory, there are two different notions of equivalence types in type theory: strict and weak equivalence types. Strict equivalence types use judgmental equality in the conversion rules, while weak equivalence types use identity types in the conversion rules. Weak equivalence types could also be defined analytically from other type formers in the type theory.

Strict equivalence types

Given types AA and BB, one could define the type of strict equivalences betwen AA and BB. These are given by the following rules:

Formation rule for strict equivalence types:

ΓAtypeΓBtypeΓABtype\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma \vdash A \simeq B \; \mathrm{type}}

Introduction rule for strict equivalence types:

ΓAtypeΓBtypeΓ,x:Af(x):BΓ,y:Bg(y):AΓ,x:Ag(f(x))x:AΓ,y:Bf(g(y))y:BΓtoequiv(x:A.f(x),y:B.g(y)):AB\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, x:A \vdash f(x):B \quad \Gamma, y:B \vdash g(y):A \quad \Gamma, x:A \vdash g(f(x)) \equiv x:A \quad \Gamma, y:B \vdash f(g(y)) \equiv y:B}{\Gamma \vdash \mathrm{toequiv}(x:A.f(x), y:B.g(y)):A \simeq B}

Elimination rules for strict equivalence types:

ΓAtypeΓBtypeΓ,e:AB,x:Ae(x):BΓAtypeΓBtypeΓ,e:AB,y:Be(x):A\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma, e:A \simeq B, x:A \vdash \overrightarrow{e}(x):B} \qquad \frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma, e:A \simeq B, y:B \vdash \overleftarrow{e}(x):A}
ΓAtypeΓBtypeΓ,e:AB,x:Ae(e(x))x:AΓAtypeΓBtypeΓ,e:AB,y:Be(e(y))y:B\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma, e:A \simeq B, x:A \vdash \overleftarrow{e}(\overrightarrow{e}(x)) \equiv x:A} \qquad \frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma, e:A \simeq B, y:B \vdash \overrightarrow{e}(\overleftarrow{e}(y)) \equiv y:B}

Computation rules for strict equivalence types:

ΓAtypeΓBtypeΓ,x:Af(x):BΓ,y:Bg(y):AΓ,x:Ag(f(x))x:AΓ,y:Bf(g(y))y:BΓ,x:Atoequiv(x:A.f(x),y:B.g(y))(x)f(x):B\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, x:A \vdash f(x):B \quad \Gamma, y:B \vdash g(y):A \quad \Gamma, x:A \vdash g(f(x)) \equiv x:A \quad \Gamma, y:B \vdash f(g(y)) \equiv y:B}{\Gamma, x:A \vdash \overrightarrow{\mathrm{toequiv}(x:A.f(x), y:B.g(y))}(x) \equiv f(x):B}
ΓAtypeΓBtypeΓ,x:Af(x):BΓ,y:Bg(y):AΓ,x:Ag(f(x))x:AΓ,y:Bf(g(y))y:BΓ,y:Btoequiv(x:A.f(x),y:B.g(y))(y)g(y):A\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, x:A \vdash f(x):B \quad \Gamma, y:B \vdash g(y):A \quad \Gamma, x:A \vdash g(f(x)) \equiv x:A \quad \Gamma, y:B \vdash f(g(y)) \equiv y:B}{\Gamma, y:B \vdash \overleftarrow{\mathrm{toequiv}(x:A.f(x), y:B.g(y))}(y) \equiv g(y):A}

Uniqueness rules for strict equivalence types:

ΓAtypeΓBtypeΓ,e:ABtoequiv(x:A.e(x),y:B.e(y))e:AB\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma, e:A \simeq B \vdash \mathrm{toequiv}(x:A.\overrightarrow{e}(x), y:B.\overleftarrow{e}(y)) \equiv e:A \simeq B}

Weak equivalence types

As a dependent sum type of the isEquiv type family

Given a notion of the isEquiv type family on the function type ABA \to B, the equivalence type is defined by

AB f:ABisEquiv(f)A \simeq B \coloneqq \sum_{f:A \to B} \mathrm{isEquiv}(f)

Locally small equivalence types

Given a type universe UU and a notion of a UU-small isEquiv type family for some type F U(A,B)F_U(A, B), the locally UU-small equivalence type is defined by

A UB f:F U(A,B)isEquiv U(f)A \simeq_U B \coloneqq \sum_{f:F_U(A, B)} \mathrm{isEquiv}_U(f)

F U(A,B)F_U(A, B) could be the type of UU-small spans, the type of UU-small multivalued partial functions, or the type of UU-small correspondences.

Rules for weak equivalence types

Formation rules for equivalence types:

ΓAtypeΓBtypeΓABtype\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma \vdash A \simeq B \; \mathrm{type}}

Introduction rules for equivalence types:

ΓAtypeΓBtypeΓf:ABΓg:BA ΓG: x:Ag(f(x))= AxΓH: y:Bf(g(y))= By ΓK: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))cΓtoEquiv(f,g,G,H,K):AB\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B \quad \Gamma \vdash g:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(g(y)) =_{B} y \\ \Gamma \vdash K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) \end{array}{c} }{\Gamma \vdash \mathrm{toEquiv}(f, g, G, H, K):A \simeq B}

Elimination rules for equivalence types:

ΓAtypeΓBtypeΓe:ABΓfunc(e):AB\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \mathrm{func}(e):A \to B}
ΓAtypeΓBtypeΓe:ABΓfinv(e):BA\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \mathrm{finv}(e):B \to A}
ΓAtypeΓBtypeΓe:ABΓsec(e): x:Afinv(e)(func(e)(x))= Ax\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \mathrm{sec}(e):\prod_{x:A} \mathrm{finv}(e)(\mathrm{func}(e)(x)) =_A x}
ΓAtypeΓBtypeΓe:ABΓret(e): y:Bfunc(e)(finv(e)(y)= By\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \mathrm{ret}(e):\prod_{y:B} \mathrm{func}(e)(\mathrm{finv}(e)(y) =_{B} y}
ΓAtypeΓBtypeΓe:ABΓcoh(e): x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \mathrm{coh}(e):\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x))}

Computation rules for equivalence types:

  • Judgmental computation rules
ΓAtypeΓBtypeΓf:ABΓg:BA ΓG: x:Ag(f(x))= AxΓH: y:Bf(g(y))= By ΓK: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))Γfunc(toEquiv(f,g,G,H,K))f:AB\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B \quad \Gamma \vdash g:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(g(y)) =_{B} y \\ \Gamma \vdash K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) \end{array} }{\Gamma \vdash \mathrm{func}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv f:A \to B}
ΓAtypeΓBtypeΓf:ABΓg:BA ΓG: x:Ag(f(x))= AxΓH: y:Bf(g(y))= By ΓK: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))Γfinv(toEquiv(f,g,G,H,K))g:BA\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B \quad \Gamma \vdash g:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(g(y)) =_{B} y \\ \Gamma \vdash K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) \end{array} }{\Gamma \vdash \mathrm{finv}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv g:B \to A}
ΓAtypeΓBtypeΓf:ABΓg:BA ΓG: x:Ag(f(x))= AxΓH: y:Bf(g(y))= By ΓK: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))Γsec(toEquiv(f,g,G,H,K))G: y:Bf(g(y))= By\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B \quad \Gamma \vdash g:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(g(y)) =_{B} y \\ \Gamma \vdash K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) \end{array} }{\Gamma \vdash \mathrm{sec}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv G:\prod_{y:B} f(g(y)) =_{B} y}
ΓAtypeΓBtypeΓf:ABΓg:BA ΓG: x:Ag(f(x))= AxΓH: y:Bf(g(y))= By ΓK: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))Γret(toEquiv(f,g,G,H,K))H: x:Ag(f(x))= Ax\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B \quad \Gamma \vdash g:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(g(y)) =_{B} y \\ \Gamma \vdash K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) \end{array} }{\Gamma \vdash \mathrm{ret}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv H:\prod_{x:A} g(f(x)) =_{A} x}
ΓAtypeΓBtypeΓf:ABΓg:BA ΓG: x:Ag(f(x))= AxΓH: y:Bf(g(y))= By ΓK: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))Γcoh(toEquiv(f,g,G,H,K))K: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B \quad \Gamma \vdash g:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(g(y)) =_{B} y \\ \Gamma \vdash K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) \end{array} }{\Gamma \vdash \mathrm{coh}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x))}
  • Typal computation rules
ΓAtypeΓBtypeΓf:ABΓg:BA ΓG: x:Ag(f(x))= AxΓH: y:Bf(g(y))= By ΓK: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))Γβ AB func(f,g,G,H,K):func(toEquiv(f,g,G,H,K))= ABf\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B \quad \Gamma \vdash g:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(g(y)) =_{B} y \\ \Gamma \vdash K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) \end{array} }{\Gamma \vdash \beta_{A \simeq B}^\mathrm{func}(f, g, G, H, K):\mathrm{func}(\mathrm{toEquiv}(f, g, G, H, K)) =_{A \to B} f}
ΓAtypeΓBtypeΓf:ABΓg:BA ΓG: x:Ag(f(x))= AxΓH: y:Bf(g(y))= By ΓK: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))Γβ AB finv(f,g,G,H,K):finv(toEquiv(f,g,G,H,K))= BAg\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B \quad \Gamma \vdash g:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(g(y)) =_{B} y \\ \Gamma \vdash K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) \end{array} }{\Gamma \vdash \beta_{A \simeq B}^\mathrm{finv}(f, g, G, H, K):\mathrm{finv}(\mathrm{toEquiv}(f, g, G, H, K)) =_{B \to A} g}
ΓAtypeΓBtypeΓf:ABΓg:BA ΓG: x:Ag(f(x))= AxΓH: y:Bf(g(y))= By ΓK: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))Γβ AB sec(f,g,G,H,K):sec(toEquiv(f,g,G,H,K))= y:Bf(g(y))= ByG\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B \quad \Gamma \vdash g:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(g(y)) =_{B} y \\ \Gamma \vdash K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) \end{array} }{\Gamma \vdash \beta_{A \simeq B}^\mathrm{sec}(f, g, G, H, K):\mathrm{sec}(\mathrm{toEquiv}(f, g, G, H, K)) =_{\prod_{y:B} f(g(y)) =_{B} y} G}
ΓAtypeΓBtypeΓf:ABΓg:BA ΓG: x:Ag(f(x))= AxΓH: y:Bf(g(y))= By ΓK: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))Γβ AB ret(f,g,G,H,K):ret(toEquiv(f,g,G,H,K))= x:Ag(f(x))= AxH\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B \quad \Gamma \vdash g:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(g(y)) =_{B} y \\ \Gamma \vdash K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) \end{array} }{\Gamma \vdash \beta_{A \simeq B}^\mathrm{ret}(f, g, G, H, K):\mathrm{ret}(\mathrm{toEquiv}(f, g, G, H, K)) =_{\prod_{x:A} g(f(x)) =_{A} x} H}
ΓAtypeΓBtypeΓf:ABΓg:BA ΓG: x:Ag(f(x))= AxΓH: y:Bf(g(y))= By ΓK: x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))Γβ AB coh(f,g,G,H,K):coh(toEquiv(f,g,G,H,K))= x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))K\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B \quad \Gamma \vdash g:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(g(y)) =_{B} y \\ \Gamma \vdash K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) \end{array} }{\Gamma \vdash \beta_{A \simeq B}^\mathrm{coh}(f, g, G, H, K):\mathrm{coh}(\mathrm{toEquiv}(f, g, G, H, K)) =_{\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x))} K}

Uniqueness rules for equivalence types:

  • Judgmental uniqueness rules
ΓAtypeΓBtypeΓe:ABΓtoEquiv(func(e),finv(e),sec(e),ret(e),coh(e))e:AB\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \mathrm{toEquiv}(\mathrm{func}(e), \mathrm{finv}(e), \mathrm{sec}(e), \mathrm{ret}(e), \mathrm{coh}(e)) \equiv e:A \simeq B}
  • Typal uniqueness rules
ΓAtypeΓBtypeΓe:ABΓη AB(e):toEquiv(func(e),finv(e),sec(e),ret(e),coh(e))= ABe\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \eta_{A \simeq B}(e):\mathrm{toEquiv}(\mathrm{func}(e), \mathrm{finv}(e), \mathrm{sec}(e), \mathrm{ret}(e), \mathrm{coh}(e)) =_{A \simeq B} e}

Coinductive definition

Given two types AA and BB and two functions f:ABf:A \to B and g:BAg:B \to A, ff and gg are inverses of each other if for every element a:Aa:A and b:Ab:A, there is an equivalence of types between f(a)= Bbf(a) =_B b and a= Ag(b)a =_A g(b):

isInv(f,g) a:A b:B(f(a)= Bb)(a= Ag(b))\mathrm{isInv}(f, g) \coloneqq \prod_{a:A} \prod_{b:B} (f(a) =_B b) \simeq (a =_A g(b))

This leads to a coinductive definition of the type of equivalences

AB f:AB g:BA a:A b:B(f(a)= Bb)(a= Ag(b))A \simeq B \coloneqq \sum_{f:A \to B} \sum_{g:B \to A} \prod_{a:A} \prod_{b:B} (f(a) =_B b) \simeq (a =_A g(b))

Formation rule for equivalence types:

ΓAtypeΓBtypeΓABtype\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma \vdash A \simeq B \; \mathrm{type}}

Introduction rule for equivalence types:

ΓAtypeΓa:AΓb:AΓp:a= AbΓ,x:AB(x)typeΓtr B(a,b,p):B(a)B(b)type\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:a =_A b \quad \Gamma, x:A \vdash B(x) \; \mathrm{type}}{\Gamma \vdash \mathrm{tr}_B(a, b, p):B(a) \simeq B(b) \; \mathrm{type}}

Elimination rules for equivalence types:

ΓAtypeΓBtypeΓf:ABΓx:AΓf(x):BΓAtypeΓBtypeΓf:ABΓy:BΓf 1(y):A\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \simeq B \quad \Gamma \vdash x:A}{\Gamma \vdash f(x):B} \qquad \frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \simeq B \quad \Gamma \vdash y:B}{\Gamma \vdash f^{-1}(y):A}
ΓAtypeΓBtypeΓf:ABΓx:AΓy:BΓcoh(f,x,y):(f(x)= By)(x= Af 1(y))\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \simeq B \quad \Gamma \vdash x:A \quad \Gamma \vdash y:B}{\Gamma\vdash \mathrm{coh}(f, x, y):(f(x) =_B y) \simeq (x =_A f^{-1}(y))}

Computation rules for equivalence types:

ΓAtypeΓa:AΓb:AΓp:a= AbΓ,x:AB(x)typeΓ,x:Aw:B(x)Γapdl B(a,b,p,w):w(a)= B(a)tr B(a,b,p) 1(w(b))\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:a =_A b \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma, x:A \vdash w:B(x)}{\Gamma \vdash \mathrm{apdl}_B(a, b, p, w):w(a) =_{B(a)} \mathrm{tr}_B(a, b, p)^{-1}(w(b))}
ΓAtypeΓa:AΓb:AΓp:a= AbΓ,x:AB(x)typeΓ,x:Aw:B(x)Γapdr B(a,b,p,w):tr B(a,b,p)(w(a))= B(b)w(b)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:a =_A b \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma, x:A \vdash w:B(x)}{\Gamma \vdash \mathrm{apdr}_B(a, b, p, w):\mathrm{tr}_B(a, b, p)(w(a)) =_{B(b)} w(b)}
ΓAtypeΓa:AΓb:AΓp:a= AbΓ,x:AB(x)typeΓ,x:Aw:B(x)Γcohapd B(a,b,p,w):(coh(tr B(a,b,p),w(a),w(b))(apdr B(a,b,p,w))= w(a)= B(a)tr B(a,b,p) 1(w(b))apdl B(a,b,p,w))(apdr B(a,b,p,w)= tr B(a,b,p)(w(a))= B(b)w(b)coh(tr B(a,b,p),w(a),w(b)) 1(apdl B(a,b,p,w)))\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:a =_A b \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma, x:A \vdash w:B(x)}{\Gamma \vdash \mathrm{cohapd}_B(a, b, p, w):\left(\mathrm{coh}(\mathrm{tr}_B(a, b, p), w(a), w(b))(\mathrm{apdr}_B(a, b, p, w)) =_{w(a) =_{B(a)} \mathrm{tr}_B(a, b, p)^{-1}(w(b))} \mathrm{apdl}_B(a, b, p, w)\right) \simeq \left(\mathrm{apdr}_B(a, b, p, w) =_{\mathrm{tr}_B(a, b, p)(w(a)) =_{B(b)} w(b)} \mathrm{coh}(\mathrm{tr}_B(a, b, p), w(a), w(b))^{-1}(\mathrm{apdl}_B(a, b, p, w))\right)}

Properties

Relation to interval types

Given types AA and BB and an equivalence f:ABf:A \simeq B, one could define the dependent type x:𝕀C(x)x:\mathbb{I} \vdash C(x) indexed by the interval type 𝕀\mathbb{I} as C(0)AC(0) \equiv A, C(1)BC(1) \equiv B, and tr C(0,1,p)f\mathrm{tr}_C(0, 1, p) \equiv f.

One-to-one correspondences

Given types AA and BB and an equivalence f:ABf:A \simeq B, one could define a correspondence x:A,y:BR(x,y)x:A, y:B \vdash R(x, y) as the dependent identity type

R(x,y)x= C pyR(x, y) \coloneqq x =_C^p y

where x:𝕀C(x)x:\mathbb{I} \vdash C(x) is defined as in the previous section. By the properties of dependent identity types, the correspondence is always a one-to-one correspondence.

Quasi-inverse functions with contractible fibers

By the rules for function types, given an equivalence R:ABR:A \simeq B, one could derive functions ρ(R):AB\rho(R):A \to B and λ(R):BA\lambda(R):B \to A. One could show that these functions are quasi-inverse functions of each other: for all x:Ax:A and y:By:B and equivalences R:ABR:A \simeq B, there are identities

ρ κ(R,λ(R,y),y,λ τ(R,y)):ρ(R)(λ(R)(y))= By\rho_\kappa(R, \lambda(R, y), y, \lambda_\tau(R, y)):\rho(R)(\lambda(R)(y)) =_B y
λ κ(R,x,ρ(R)(x),ρ τ(R,x) 1):λ(R)(ρ(R)(x))= Ax\lambda_\kappa(R, x, \rho(R)(x), \rho_\tau(R, x)^{-1}):\lambda(R)(\rho(R)(x)) =_A x

where p 1:b= Aap^{-1}:b =_A a is the inverse identity of p:a= Abp:a =_A b. By the introduction rule for dependent product types, there are homotopies

λy.ρ κ(R,λ(R,y),y,λ τ(R,y)): y:Bρ(R)(λ(R)(y))= By\lambda y.\rho_\kappa(R, \lambda(R, y), y, \lambda_\tau(R, y)):\prod_{y:B} \rho(R)(\lambda(R)(y)) =_B y
λx.λ κ(R,x,ρ(R)(x),ρ τ(R,x) 1): x:Aλ(R)(ρ(R)(x))= Ax\lambda x.\lambda_\kappa(R, x, \rho(R)(x), \rho_\tau(R, x)^{-1}):\prod_{x:A} \lambda(R)(\rho(R)(x)) =_A x

which indicate that ρ(R)\rho(R) and λ(R)\lambda(R) are quasi-inverse functions of each other.

By the rules for dependent sum types and dependent product types, one could show that the above functions each have contractible fibers, making both of them coherent inverse functions of each other.

Heterogeneous identity types

Given the definition of the equivalence type as the type of encodings for one-to-one correspondences, the heterogeneous identity type is defined by the rule

ΓAtypeΓa:AΓb:AΓp:a= AbΓ,x:ABtypeΓ(x= B py)(x= B(a),B(b) tr B(p)y)type\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:a =_A b \quad \Gamma, x:A \vdash B \; \mathrm{type}}{\Gamma \vdash (x =_B^p y) \equiv (x =_{B(a), B(b)}^{\mathrm{tr}_B(p)} y) \; \mathrm{type}}

Identity equivalences, inverse equivalences, and composition of equivalences

The identity equivalence on a type AA is defined as an equivalence id A:AA\mathrm{id}_A:A \simeq A such that for all elements a:Aa:A,

λ(id A,a)a\lambda(\mathrm{id}_A, a) \coloneqq a
ρ(id A,a)a\rho(\mathrm{id}_A, a) \coloneqq a
(a= A,A id Ab)(a= Ab)(a =_{A, A}^{\mathrm{id}_A} b) \coloneqq (a =_A b)

Given an equivalence R:ABR:A \simeq B, the inverse equivalence of RR is an equivalence R 1:BAR^{-1}:B \simeq A such that for all elements a:Aa:A and b:Bb:B,

ρ(R 1,a)λ(R,a)\rho(R^{-1}, a) \coloneqq \lambda(R, a)
λ(R 1,b)ρ(R,b)\lambda(R^{-1}, b) \coloneqq \rho(R, b)
b= B,A R 1aa= A,B Rbb =_{B, A}^{R^{-1}} a \coloneqq a =_{A, B}^R b

Given equivalences R:ABR:A \simeq B and S:BCS:B \simeq C, the composite of RR and SS is an equivalence SR:ACS \circ R:A \simeq C such that for all elements a:Aa:A and c:Cc:C,

λ(SR,a)λ(R,λ(S,a))\lambda(S \circ R, a) \coloneqq \lambda(R, \lambda(S, a))
ρ(SR,c)ρ(S,ρ(R,c))\rho(S \circ R, c) \coloneqq \rho(S, \rho(R, c))
a= A,C SRc b:B(a= A,B Rb)×(b= B,C Rc)a =_{A, C}^{S \circ R} c \coloneqq \sum_{b:B} (a =_{A, B}^R b) \times (b =_{B, C}^R c)

Relation to universes and univalence

Given a Russell universe UU, there are two ways to say that types A:UA:U and B:UB:U are equal: by the identity type A= UBA =_U B, and the equivalence type ABA \simeq B. The univalence axiom says that these two types A= UBA =_U B and ABA \simeq B are the same, which is represented by an equivalence between the two types

ua(A,B):(A= UB)(AB)\mathrm{ua}(A, B):(A =_U B) \simeq (A \simeq B)

For Tarski universes (U,El)(U, \mathrm{El}), one instead says that A= UBA =_U B is the same as El(A)El(B)\mathrm{El}(A) \simeq \mathrm{El}(B), represented as

ua(A,B):(A= UB)(El(A)El(B))\mathrm{ua}(A, B):(A =_U B) \simeq (\mathrm{El}(A) \simeq \mathrm{El}(B))

Action on equivalences

We introduce a modal operator LL to the type theory, which we assume in general not to be idempotent or monadic; this is given by the formation rule

ΓAtypeΓL(A)type\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash L(A) \; \mathrm{type}}

LL preserves equivalences: given types AA and BB, there is a function ae L:(AB)L(A)L(B)\mathrm{ae}_L:(A \simeq B) \to L(A) \simeq L(B), called the action on equivalences for LL.

 Categorical semantics

The categorical semantics of an equivalence type is an object of isomorphisms.

 See also

 References

For the definition of the equivalence type as a dependent sum type, see:

Last revised on November 30, 2023 at 14:45:30. See the history of this page for a list of all contributions to it.