equivalence type in nLab
Context
Type theory
natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
Equality and Equivalence
-
equality (definitional, propositional, computational, judgemental, extensional, intensional, decidable)
-
identity type, equivalence of types, definitional isomorphism
-
isomorphism, weak equivalence, homotopy equivalence, weak homotopy equivalence, equivalence in an (∞,1)-category
-
Examples.
Contents
- Idea
- Definition
- As a dependent sum type of the isEquiv type family
- Locally small equivalence types
- Rules for equivalence types
- Properties
- Relation to interval types
- One-To-One correspondences
- Quasi-inverse functions with contractible fibers
- Heterogeneous identity types
- Identity equivalences, inverse equivalences, and composition of equivalences
- Relation to universes and univalence
- Action on equivalences
- Categorical semantics
- See also
- References
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 A≃BA \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.
As a dependent sum type of the isEquiv type family
Given a notion of the isEquiv type family on the function type A→BA \to B, the equivalence type is defined by
A≃B≔∑ f:A→BisEquiv(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 equivalence types
There are various different rules one can use for equivalence types, depending upon what notion of equivalence one wishes to use:
- One-To-One correspondences
- Half-adjoint equivalences
- Biinvertible functions
- Functions with contractible fibers
One-To-One correspondence types
Let isContr(A)\mathrm{isContr}(A) denote the isContr modality which says whether the type AA is a contractible type, and let
∃!x:A.B(x)≔isContr(∑ x:AB(x))\exists!x:A.B(x) \coloneqq \mathrm{isContr}\left(\sum_{x:A} B(x)\right)
be the uniqueness quantifier over the type family x:A⊢B(x)x:A \vdash B(x). A binary correspondence between types AA and BB is simply a binary type family x:A,y:B⊢R(x,y)x:A, y:B \vdash R(x, y). A binary correspondence x:A,y:B⊢R(x,y)x:A, y:B \vdash R(x, y) is one-to-one if
-
for all x:Ax:A there is a unique y:By:B such that R(x,y)R(x, y), and
-
for all y:By:B there is a unique x:Ax:A such that R(x,y)R(x, y).
Written out in the language of dependent type theory, one has
isOneToOne(χ.γ.R)≔(∏ x:A∃!y:B.R(x,y))×(∏ y:B∃!x:A.R(x,y))\mathrm{isOneToOne}(\chi.\gamma.R) \coloneqq \left(\prod_{x:A} \exists!y:B.R(x, y)\right) \times \left(\prod_{y:B} \exists!x:A.R(x, y)\right)
In the presence of some form of function extensionality, the type isOneToOne(χ.γ.R)\mathrm{isOneToOne}(\chi.\gamma.R) is guaranteed to be a mere proposition.
The rules for equivalence types then state that equivalences, the elements of equivalence types, are (codes for) one-to-one correspondences (in the same way that functions, the elements of function types, are (codes for) families of elements):
Formation rules for equivalence types:
Γ⊢AtypeΓ⊢BtypeΓ⊢A≃Btype\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Γ,x:A,y:A⊢R(x,y)typeΓ⊢p:isOneToOne(χ.γ.R)Γ⊢toEquiv χ.γ.R(p):A≃B\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, x:A, y:A \vdash R(x, y) \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isOneToOne}(\chi.\gamma.R)}{\Gamma \vdash \mathrm{toEquiv}_{\chi.\gamma.R}(p):A \simeq B}
Elimination rules for equivalence types:
Γ⊢AtypeΓ⊢BtypeΓ⊢e:A≃BΓ,x:A,y:B⊢toCorr(e,x,y)type\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma, x:A, y:B \vdash \mathrm{toCorr}(e, x, y) \; \mathrm{type}}
Γ⊢AtypeΓ⊢BtypeΓ⊢e:A≃BΓ⊢121witn(e):isOneToOne(χ.γ.toCorr(e))\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash 121\mathrm{witn}(e):\mathrm{isOneToOne}(\chi.\gamma.\mathrm{toCorr}(e))}
Computation rules for equivalence types:
Γ⊢AtypeΓ⊢BtypeΓ,x:A,y:A⊢R(x,y)typeΓ⊢p:isOneToOne(χ.γ.R)Γ,x:A,y:B⊢toCorr(toEquiv χ.γ.R(p),x,y)≡R(x,y)type\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, x:A, y:A \vdash R(x, y) \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isOneToOne}(\chi.\gamma.R)}{\Gamma, x:A, y:B \vdash \mathrm{toCorr}(\mathrm{toEquiv}_{\chi.\gamma.R}(p), x, y) \equiv R(x, y) \; \mathrm{type}}
Γ⊢AtypeΓ⊢BtypeΓ,x:A,y:A⊢R(x,y)typeΓ⊢p:isOneToOne(χ.γ.R)Γ⊢121witn(toEquiv χ.γ.R(p))≡p:isOneToOne(χ.γ.R)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, x:A, y:A \vdash R(x, y) \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isOneToOne}(\chi.\gamma.R)}{\Gamma \vdash 121\mathrm{witn}(\mathrm{toEquiv}_{\chi.\gamma.R}(p)) \equiv p:\mathrm{isOneToOne}(\chi.\gamma.R)}
Uniqueness rules for equivalence types:
Γ⊢AtypeΓ⊢BtypeΓ⊢e:A≃BΓ,x:A,y:B⊢toEquiv χ.γ.toCorr(e)(121witn(e))≡e:A≃B\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma, x:A, y:B \vdash \mathrm{toEquiv}_{\chi.\gamma.\mathrm{toCorr}(e)}(121\mathrm{witn}(e)) \equiv e:A \simeq B}
Half-adjoint equivalence types
A half-adjoint equivalence between types AA and BB is a record consisting of the following fields:
-
a function f:A→Bf:A \to B
-
a function g:B→Ag:B \to A
-
a homotopy G:∏ x:Ag(f(x))= AxG:\prod_{x:A} g(f(x)) =_{A} x
-
a homotopy H:∏ y:Bf(g(y))= ByH:\prod_{y:B} f(g(y)) =_{B} y
-
a homotopy K:∏ x:AH(f(x))= f(g(f(x))= Bf(x)ap f(f(g(x)),x,G(x))K:\prod_{x:A} H(f(x)) =_{f(g(f(x)) =_{B} f(x)} \mathrm{ap}_f(f(g(x)), x, G(x)) expressing the coherence law for equivalences, where ap f(f(g(x)),x,G(x))\mathrm{ap}_f(f(g(x)), x, G(x)) is the function application of f f to the identification G(x)G(x).
Thus, the rules for half-adjoint equivalence types state that half-adjoint equivalence types are record types with the above fields:
Formation rules for half-adjoint equivalence types:
Γ⊢AtypeΓ⊢BtypeΓ⊢A≃Btype\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma \vdash A \simeq B \; \mathrm{type}}
Introduction rules for half-adjoint equivalence types:
Γ⊢AtypeΓ⊢BtypeΓ⊢f:A→BΓ⊢g:B→A Γ⊢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))Γ⊢toEquiv(f,g,G,H,K):A≃B\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{toEquiv}(f, g, G, H, K):A \simeq B}
Elimination rules for half-adjoint equivalence types:
Γ⊢AtypeΓ⊢BtypeΓ⊢e:A≃BΓ⊢func(e):A→B\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:A≃BΓ⊢finv(e):B→A\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:A≃BΓ⊢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:A≃BΓ⊢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:A≃BΓ⊢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 half-adjoint equivalence types:
Γ⊢AtypeΓ⊢BtypeΓ⊢f:A→BΓ⊢g:B→A Γ⊢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:A→B\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:A→BΓ⊢g:B→A Γ⊢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:B→A\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:A→BΓ⊢g:B→A Γ⊢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:∏ 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{sec}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv G:\prod_{x:A} g(f(x)) =_{A} x}
Γ⊢AtypeΓ⊢BtypeΓ⊢f:A→BΓ⊢g:B→A Γ⊢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:∏ 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{ret}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv H:\prod_{y:B} f(g(y)) =_{B} y}
Γ⊢AtypeΓ⊢BtypeΓ⊢f:A→BΓ⊢g:B→A Γ⊢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))}
Uniqueness rules for half-adjoint equivalence types:
Γ⊢AtypeΓ⊢BtypeΓ⊢e:A≃BΓ⊢toEquiv(func(e),finv(e),sec(e),ret(e),coh(e))≡e:A≃B\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}
Bi-invertible function types
A bi-invertible function between types AA and BB is a record consisting of the following fields:
-
a function f:A→Bf:A \to B
-
a function g:B→Ag:B \to A
-
a function h:B→Ah:B \to A
-
a homotopy G:∏ x:Ag(f(x))= AxG:\prod_{x:A} g(f(x)) =_{A} x
-
a homotopy H:∏ y:Bf(h(y))= ByH:\prod_{y:B} f(h(y)) =_{B} y
Thus, the rules for bi-invertible function types state that bi-invertible function types are record types with the above fields:
Formation rules for bi-invertible function types:
Γ⊢AtypeΓ⊢BtypeΓ⊢A≃Btype\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma \vdash A \simeq B \; \mathrm{type}}
Introduction rules for bi-invertible function types:
Γ⊢AtypeΓ⊢BtypeΓ⊢f:A→BΓ⊢g:B→AΓ⊢h:B→A Γ⊢G:∏ x:Ag(f(x))= AxΓ⊢H:∏ y:Bf(h(y))= By Γ⊢toEquiv(f,g,h,G,H):A≃B\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 \quad \Gamma \vdash h:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(h(y)) =_{B} y \\ \end{array} }{\Gamma \vdash \mathrm{toEquiv}(f, g, h, G, H):A \simeq B}
Elimination rules for bi-invertible function types:
Γ⊢AtypeΓ⊢BtypeΓ⊢e:A≃BΓ⊢func(e):A→B\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:A≃BΓ⊢fsec(e):B→A\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \mathrm{fsec}(e):B \to A}
Γ⊢AtypeΓ⊢BtypeΓ⊢e:A≃BΓ⊢fret(e):B→A\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \mathrm{fret}(e):B \to A}
Γ⊢AtypeΓ⊢BtypeΓ⊢e:A≃BΓ⊢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:A≃BΓ⊢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}
Computation rules for bi-invertible function types:
Γ⊢AtypeΓ⊢BtypeΓ⊢f:A→BΓ⊢g:B→AΓ⊢h:B→A Γ⊢G:∏ x:Ag(f(x))= AxΓ⊢H:∏ y:Bf(h(y))= By Γ⊢func(toEquiv(f,g,G,H,K))≡f:A→B\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 \quad \Gamma \vdash h:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(h(y)) =_{B} y \\ \end{array} }{\Gamma \vdash \mathrm{func}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv f:A \to B}
Γ⊢AtypeΓ⊢BtypeΓ⊢f:A→BΓ⊢g:B→AΓ⊢h:B→A Γ⊢G:∏ x:Ag(f(x))= AxΓ⊢H:∏ y:Bf(h(y))= By Γ⊢fsec(toEquiv(f,g,G,H,K))≡g:B→A\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 \quad \Gamma \vdash h:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(h(y)) =_{B} y \\ \end{array} }{\Gamma \vdash \mathrm{fsec}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv g:B \to A}
Γ⊢AtypeΓ⊢BtypeΓ⊢f:A→BΓ⊢g:B→AΓ⊢h:B→A Γ⊢G:∏ x:Ag(f(x))= AxΓ⊢H:∏ y:Bf(h(y))= By Γ⊢frec(toEquiv(f,g,G,H,K))≡h:B→A\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 \quad \Gamma \vdash h:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(h(y)) =_{B} y \\ \end{array} }{\Gamma \vdash \mathrm{frec}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv h:B \to A}
Γ⊢AtypeΓ⊢BtypeΓ⊢f:A→BΓ⊢g:B→AΓ⊢h:B→A Γ⊢G:∏ x:Ag(f(x))= AxΓ⊢H:∏ y:Bf(h(y))= By Γ⊢sec(toEquiv(f,g,G,H,K))≡G:∏ 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 \quad \Gamma \vdash h:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(h(y)) =_{B} y \\ \end{array} }{\Gamma \vdash \mathrm{sec}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv G:\prod_{x:A} g(f(x)) =_{A} x}
Γ⊢AtypeΓ⊢BtypeΓ⊢f:A→BΓ⊢g:B→AΓ⊢h:B→A Γ⊢G:∏ x:Ag(f(x))= AxΓ⊢H:∏ y:Bf(h(y))= By Γ⊢ret(toEquiv(f,g,G,H,K))≡H:∏ y:Bf(h(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 \quad \Gamma \vdash h:B \to A \\ \Gamma \vdash G:\prod_{x:A} g(f(x)) =_{A} x \quad \Gamma \vdash H:\prod_{y:B} f(h(y)) =_{B} y \\ \end{array} }{\Gamma \vdash \mathrm{ret}(\mathrm{toEquiv}(f, g, G, H, K)) \equiv H:\prod_{y:B} f(h(y)) =_{B} y}
Uniqueness rules for bi-invertible function types:
Γ⊢AtypeΓ⊢BtypeΓ⊢e:A≃BΓ⊢toEquiv(func(e),fsec(e),fret(e),sec(e),ret(e))≡e:A≃B\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{fsec}(e), \mathrm{fret}(e), \mathrm{sec}(e), \mathrm{ret}(e)) \equiv e:A \simeq B}
Properties
Relation to interval types
Given types AA and BB and an equivalence f:A≃Bf: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:A≃Bf:A \simeq B, one could define a correspondence x:A,y:B⊢R(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:A≃BR:A \simeq B, one could derive functions ρ(R):A→B\rho(R):A \to B and λ(R):B→A\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:A≃BR: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:A⊢BtypeΓ⊢(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:A≃A\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:A≃BR:A \simeq B, the inverse equivalence of RR is an equivalence R −1:B≃AR^{-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 −1a≔a= A,B Rbb =_{B, A}^{R^{-1}} a \coloneqq a =_{A, B}^R b
Given equivalences R:A≃BR:A \simeq B and S:B≃CS:B \simeq C, the composite of RR and SS is an equivalence S∘R:A≃CS \circ R:A \simeq C such that for all elements a:Aa:A and c:Cc:C,
λ(S∘R,a)≔λ(R,λ(S,a))\lambda(S \circ R, a) \coloneqq \lambda(R, \lambda(S, a))
ρ(S∘R,c)≔ρ(S,ρ(R,c))\rho(S \circ R, c) \coloneqq \rho(S, \rho(R, c))
a= A,C S∘Rc≔∑ 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 A≃BA \simeq B. The univalence axiom says that these two types A= UBA =_U B and A≃BA \simeq B are the same, which is represented by an equivalence between the two types
ua(A,B):(A= UB)≃(A≃B)\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:(A≃B)→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:
- Univalent Foundations Project, §2.4 and §4 in: Homotopy Type Theory – Univalent Foundations of Mathematics (2013) [web, pdf]
Last revised on May 18, 2024 at 22:46:42. See the history of this page for a list of all contributions to it.