equivalence of categories

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Category theory
+-- {: .hide}
[[!include category theory - contents]]
=--
#### Equality and Equivalence
+--{: .hide}
[[!include equality and equivalence - contents]]
=--
=--
=--

# Equivalence of categories
* table of contentshttps://ncatlab.org/nlab/edit/equivalence+of+categories
{: toc}

## Idea

The concept of _equivalence of categories_ is the correct [[category theory|category theoretic]] notion of "sameness" of [[categories]].

Concretely, an equivalence between two categories is a pair of [[functors]] between them which are [[inverse]] to each other _up to_ [[natural isomorphism]] of functors ([[inverse functors]]).

This is like an [[isomorphism]], but weakened such as to accomodate for the fact that the correct ambient context for categories is not iself a 1-category, but is the [[2-category]] [[Cat]] of all categories. Hence abstractly an equivalence of categories is just the special case of an [[equivalence in a 2-category]] specialized to [[Cat]].

If some foundational fine print is taken care of, then a functor exhibits an equivalence of categories precisely if it is both [[essentially surjective functor|essentially surjective]] and [[fully faithful functor|fully faithful]]. This is true in [[classical mathematics]] if the [[axiom of choice]] is assumed. It remains true non-classically, say for [[internal categories]], if the concept of functor is suitably adapted ("[[anafunctors]]"), or the concept of essentially surjective is suitably adapted ("[[split essentially surjective]]").

From the point of view of [[logic]] one may say that two [[categories]] are _equivalent_ if they have the same [[properties]] — although this only applies (by definition) to properties that obey the _[[principle of equivalence]]_.

Just as equivalence of categories is the generalization of [[isomorphism]] of [[sets]] from sets to categories, so the concept generalizes further
to [[higher category theory|higher categories]] (see e.g. _[[equivalence of 2-categories]]_, _[[equivalence of (∞,1)-categories]]_) and ultimately to equivalence of $\infty$-[[infinity-category|categories]].

## Definitions

+-- {: .num_defn #EquivalenceViaInverseFunctor}
###### Definition

An **equivalence** between two [[categories]] $\mathcal{C}$ and $\mathcal{D}$ is an [[equivalence in a 2-category|equivalence in the 2-category]] [[Cat]] of all [[categories]], hence a pair of [[inverse functors]], hence it is

1. a pair of [[functors]]

   $$
     \mathcal{C}
       \underoverset
         {\underset{\phantom{AA}F \phantom{AA}}{\longrightarrow}}
         {\overset{\phantom{AA}G\phantom{AA}}{\longleftarrow}}
         {}
     \mathcal{D},
   $$

1. [[natural isomorphisms]]

   $$
     F \circ G \cong Id_{\mathcal{D}}
   $$

   and

   $$
     G \circ F \cong Id_{\mathcal{C}}
     \,.
   $$

This is called an **[[adjoint equivalence]]** if the natural isomorphisms above satisfy the [[triangle identities]], thus exhibiting $F$ and $G$ as a pair of [[adjoint functors]].

Two categories are called **equivalent** if there exists an equivalence between them.

=--

+-- {: .num_prop #ViaSplitEssentiallySurjectiveAndFullyFaithful}
###### Proposition

Let $F \colon \mathcal{C} \to \mathcal{D}$ be a [[functor]]. Then the following are equivalent:

1. $F$ is part of an equivalence of categories in the sense of def. \ref{EquivalenceViaInverseFunctor}

2. $F$ is

   1. a [[split essentially surjective functor]] and

   2. a [[fully faithful functor]].
=--

\begin{proof}
This proof is from the [[HoTT book]], and is set in the context of [[homotopy type theory]]. The categories here are what the HoTT book calls "precategories", i.e. not [[univalent categories]]:

Suppose $F$ is an equivalence of categories with $G,\eta,\epsilon$ specified. Then we have the function

$$
\begin{aligned}
  hom_B(F a, F b) &\to hom_A(a,b), \\
  g &\mapsto \eta_b^{-1}\circ G(g) \circ \eta_a.
\end{aligned}
$$

For $f:hom_A(a,b)$, we have

$$\eta_b^{-1} \circ G(F(f)) \circ \eta_a = \eta_b^{-1} \circ \eta_b \circ f = f$$
while for $g: hom_B(F a, F b)$ we have

$$
  \begin{aligned}
    F(\eta_b^{-1} \circ G(g) \circ \eta_a) &= F(\eta_b^{-1}) \circ F(G(g)) \circ F(\eta_a) \\
    &= \epsilon_{F b} \circ F(G(g)) \circ F(\eta_a) \\
    &= g \circ \epsilon_{F a} \circ F(\eta_a) \\
    &= g
  \end{aligned}
$$

using [[natural transformation|naturality]] of $\epsilon$, and the triangle identities twice. Thus, $F_{a,b}$ is an equivalence, so $F$ is [[fully faithful]]. Finally, for any $b:B$, we have $G b : A$ and $\epsilon_b : F G b \cong b$.

On the other hand, suppose $F$ is [[fully faithful]] and [[split essentially surjective]]. Define $G_0:B_0\to A_0$ by sending $b:B$ to the $a:A$ given by the specified essential splitting, and write $\epsilon_b$ for the likewise specified [[isomorphism]] $F G b \cong b$.

Now for any $g: hom_B(b,b')$, define $G(g): hom_A(G b, G b')$ to be the unique morphism such that $F(G(g))=(\epsilon_{b'})^{-1} \circ g \circ \epsilon_b$ which exists since $F$ is [[fully faithful]]. Finally for $a:A$ define $\eta_a : hom_A(a,G F a)$ to be the unique morphism such that $F \eta_a = \epsilon^{-1}_{F a}$. It is easy to verify that $G$ is a functor and that $(G,\eta \epsilon)$ exhibit $F$ as an equivalence of categories.

We clearly recover the same function $G_0 : B_0 \to A_0$. For the action of $F$ on hom-sets, we must show that for $g:hom_B (b,b')$, $G(g)$ is the necessarily unique morphism such taht $F(G(g))=(\epsilon_{b'})^{-1} \circ g \circ \epsilon_b$.

But this holds by [[natural transformation|naturality]] of $\epsilon$. Then we show $(2) \to (1) \to (2)$ gives the same data hence $(1)\simeq (2)$.
\end{proof}

## Variants {#Variants}

We discuss some possible variants of the definition of equivalence of categories, each of which comes naturally from a different view of [[Cat]].

The first, _isomorphism_, comes from viewing $Cat$ as a mere [[1-category]]; it is too strong and is really only of interest for [[strict categories]].  The next, _strong equivalence_, comes from viewing $Cat$ as a [[strict 2-category]]; it is the most common definition given and is correct if and only if the [[axiom of choice]] holds.  The next definition, _weak equivalence_, comes from viewing $Cat$ as a [[model category]]; it is correct with or without choice and is about as simple to define as strong equivalence. The third, _anaequivalence_, comes from viewing $Cat$ as a [[bicategory]] that is not (without the axiom of choice) equivalent (as a bicategory!) to the strict $2$-category that defines strong equivalence; it is also always correct.

It is also possible to define 'category' in such a way that only a correct definition can be stated, but here we use the usual algebraic definitions of category, [[functor]], and [[natural isomorphism]].

### Isomorphism {#Isomorphism}

Two [[strict categories]] $C$ and $D$ are __isomorphic__ if there exist [[strict functors]] $F\colon C \to D$ and $G\colon D \to C$ such that $F G$ and $G F$ are each [[equality|equal]] to the appropriate [[identity functor]].  In this case, we say that $F$ is an __isomorphism__ from $C$ to $D$ (so $G$ is an isomorphism from $D$ to $C$) and call the pair $(F,G)$ an __isomorphism__ between $C$ and $D$.  The functor $G$ is called the __strict inverse__ of $F$ (so $F$ is the strict inverse of $G$).

If you think of $Cat$ as the category of (strict) categories and functors, then this is the usual notion of [[isomorphism]] in a category.  This is the most obvious notion of equivalence of categories and the first to be considered, but it is simply too strong for the purposes to which [[category theory]] is put.  For example, here are some basic and important equivalences of categories that are not isomorphisms:

* Let $C$ be the category of [[pointed sets]], and let $D$ be the category of sets and [[partial functions]].  The functor $F:C\to D$ takes a pointed set to its subset of non-basepoint elements, and a pointed function to the induced partial function on these (which is defined on those elements not sent to the basepoint).  See the section "The category of sets and partial functions" in [[partial function]] for this equivalence.

* Let $C$ be the category of finite-dimensional [[vector spaces]] over a [[field]] $k$, and let $D$ be the category whose objects are [[natural numbers]] and whose morphisms $n\to m$ are $m\times n$ matrices of elements of $k$ (which is equivalently the full subcategory of $C$ spanned by the specific vector spaces $k^n$).  Note in particular that here $D$ is a [[small category]], while $C$ is not (though it is [[essentially small category|essentially small]], being equivalent to $D$).

### Strong equivalence {#StrongEquivalence}

Two [[strict categories]] $C$ and $D$ are __strongly equivalent__ if there exist strict functors $F\colon C \to D$ and $G\colon D \to C$ such that $F G$ and $G F$ are each [[natural isomorphism|naturally isomorphic]] ([[isomorphism|isomorphic]] in the relevant [[functor category]]) to the appropriate [[identity functor]].  In this case, we say that $F$ is a __strong equivalence__ from $C$ to $D$ (so $G$ is a strong equivalence from $D$ to $C$).  The functor $G$ is called a __weak inverse__ of $F$ (so $F$ is a weak inverse of $G$).

Note that an isomorphism is precisely a strong equivalence in which the natural isomorphisms are [[identity natural transformation]]s.

If you think of $Cat$ as the [[strict 2-category]] of (strict) categories, functors, and [[natural transformation]]s, then this is the usual notion of [[equivalence]] in a $2$-[[2-category|category]].  This is the first 'correct' definition of equivalence to be considered and the one most often seen today; it is only correct using the axiom of choice.

+-- {: .query}
If possible, use or modify the counterexample to isomorphism to show how choice follows if strong equivalence is assumed correct.
=--

### Weak equivalence {#WeakEquivalence}

Two categories $C$ and $D$ are __weakly equivalent__ if there exist a category $X$ and functors $F\colon X \to D$ and $G\colon X \to C$ that are [[essentially surjective functor|essentially surjective]] and [[full and faithful functor|fully faithful]].  In this case, we say that $F$ is a __weak equivalence__ from $X$ to $D$ (so $G$ is a weak equivalence from $X$ to $C$) and call the [[span]] $(X,F,G)$ a __weak equivalence__ between $C$ and $D$.  (It is not entirely trivial to check that such spans can be composed, but they can be.)

A strict functor with a weak inverse is necessarily essentially surjective and fully faithful; the converse is equivalent to the axiom of choice.  Thus any strong equivalence becomes a weak equivalence in which $X$ is taken to be either $C$ or $D$ (or even built symmetrically out of $C$ and $D$ if you\'re so inclined); a weak equivalence becomes a strong equivalence using the axiom of choice to find weak inverses and composing across $X$.

If you think of $Cat$ as the model category of categories and functors with the [[canonical model structure]], then this is the usual notion of [[weak equivalence]] in a model category.

### Anaequivalence {#Anaequivalence}

Two categories $C$ and $D$ are __anaequivalent__ if there exist [[anafunctors]] $F\colon C \to D$ and $G\colon D \to C$ such that $F G$ and $G F$ are each ananaturally isomorphic (isomorphic in the relevant [[anafunctor category]]) to the appropriate [[identity anafunctor]].  In this case, we say that $F$ is an __anaequivalence__ from $C$ to $D$ (so $G$ is an anaequivalence from $D$ to $C$).  The functor $G$ is called an __anainverse__ of $F$ (so $F$ is an anainverse of $G$). See also _[[weak equivalence of internal categories]]_.

Any strict functor is an anafunctor, so any strong equivalence is an anaequivalence.  Using the axiom of choice, any anafunctor is [[ananatural isomorphism|ananaturally isomorphic]] to a strict functor, so any anaequivalence defines a strong equivalence.  Using the definition of an anafunctor as an appropriate span of strict functors, a weak equivalence defines two anafunctors which form an anaequivalence; conversely, either anafunctor in an anaequivalence is (as a span) a weak equivalence.

If you think of $Cat$ as the [[bicategory]] of categories, anafunctors, and [[ananatural transformation]]s, then this is the usual notion of [[equivalence]] in a $2$-category.  It\'s fairly straightforward to turn any discussion of functors and strong equivalences in a context where the axiom of choice is assumed into a discussion of anafunctors and anaequivalences in a more general context.

We can also regard the $2$-category $Cat$ above as obtained from the $2$-category $Str Cat$ of strict categories, strict functors, and natural transformations by formally inverting the weak equivalences as in [[homotopy theory]].

### Fully faithful essentially surjective functors

Finally, there are [[fully faithful]] and [[essentially surjective functors]]. However, while in general, these are not the same as equivalences in all mathematical foundations, they are the same under certain restrictions:

+-- {: .num_prop #ViaEssentiallySurjectiveAndFullyFaithful}
###### Proposition

Assume the ambient context is one of the following:

* [[classical mathematics]] with the [[axiom of choice]];

* [[constructive mathematics|constructive]] or [[internal category|internal]] category theory with "functor" meaning _[[anafunctor]]_;

* [[higher-level foundations]] with "category" meaning [[univalent category]].

Let $F \colon \mathcal{C} \to \mathcal{D}$ be a [[functor]]. Then the following are equivalent:

1. $F$ is part of an equivalence of categories in the sense of def. \ref{EquivalenceViaInverseFunctor}

2. $F$ is

   1. an [[essentially surjective functor]] and

   2. a [[fully faithful functor]].

=--

### Remarks

Note that *weak* inverses go with *strong* equivalences.  The terminology isn\'t entirely inconsistent (weak inverses contrast with *strict* ones, while weak equivalences contrast with *strong* ones) but developed at different times.  The prefix 'ana‑' developed last and is perfectly consistent.

If you accept the axiom of choice, then you don\'t have to worry about the different kinds of equivalence (as long as you don\'t use isomorphism).  This is not just a question of [[foundations]], however, since the axiom of choice usually fails in [[internalization|internal contexts]].

It\'s also possible to use foundations (such as [[homotopy type theory]], some other forms of [[type theory]], or [[FOLDS]]) in which isomorphism and strong equivalence are impossible to state.  In such a case, one usually drops the prefixes 'weak' and 'ana‑'.  In the $n$-Lab, we prefer to remain agnostic about foundations but usually drop these prefixes as well, leaving it up to the reader to insert them if necessary.

## Adjoint equivalence

Any equivalence can be improved to an __[[adjoint equivalence]]__: a strong equivalence or anaequivalence whose natural isomorphisms satisfy the [[adjoint functor|triangle identities]].  In that case, $G$ is called [[generalized the|the]] __adjoint inverse__ of $F$ (so $F$ is the adjoint inverse of $G$).  When working in the $2$-category $Cat$, a good rule of thumb is that it is okay to consider either

*  a functor with the _property_ of being a _general_ equivalence or
*  a functor with the _structure_ of being an _adjoint_ equivalence (that is, a functor $G$ and a pair of natural isomorphisms $F G \cong 1$ and $1 \cong G F$ satisfying the triangle identities),

whereas considering

* a functor with the _structure_ of being a _general_ equivalence (that is, merely a functor $G$ and a pair of natural isomorphisms $F G \cong 1$ and $1 \cong G F$)

is fraught with peril.  For instance, an adjoint inverse is unique up to unique isomorphism (much as a strict inverse is unique up to equality), while a weak inverse or anainverse is not.  Including adjoint equivalences is also the only way to make a higher-categorical structure completely _[[algebraic definition of higher category|algebraic]]_.

### An example of a non-adjoint equivalence

Identify a group $H$ with its [[delooping]]. One can check the following:

* Any equivalence $F : H \leftrightarrows H : G$ of a group with itself comprises two automorphisms $F, G$, such that $F G$ and $G F$ are inner. The unit and counit are the group elements $g_{\rho}$ such that $GF(k) = g_{\rho} k g_{\rho}^{-1}$ and  $g_{\sigma}$ such that $FG(k) = g_{\sigma}^{-1} k g_{\sigma}$ for any $k \in H$.

* Any equivalence of $H$ with itself where $F$ and $G$ are themselves also inner is an adjoint equivalence.

* If $H$ has trivial center, then any equivalence of $H$ with itself is an adjoint equivalence.

* To obtain a non-adjoint equivalence, we therefore need a group $H$ with nontrivial center and nontrivial outer automorphisms, such that we can pick two whose products are inner.

* So take $H = K$ the Klein 4-group. This is a product of abelian groups, so abelian, so is its own center. In fact, it's $\mathbb{Z}/2 \mathbb{Z} \times \mathbb{Z} / 2 \mathbb{Z}$, so let $F = G$ the automorphism which interchanges coordinates. $FG = GF = \operatorname{id}_{K}$, which is given by conjugation by any element.

* If this were adjoint, the triangle equality for $F$ will stipulate that $F(g_{\rho}) = g_{\sigma}^{-1}$. We can pick $g_{\rho}$ and $g_{\sigma}$ to break this. For example, let $g_{\rho}$ be $(1,1)$ and let $g_{\sigma}$ be $(0,1)$.

This is a special case of the fact that, given a non-adjoint equivalence, you can always replace its unit with another unit (which determines the counit) to improve the equivalence to an [[adjoint equivalence]].

## In higher categories

All of the above types of equivalence make sense for $n$-[[n-category|categories]] and $\infty$-categories defined using an [[algebraic definition of higher category]]; again, it is the weak notion that is usually wanted.  When using a [[geometric definition of higher category]], often isomorphism cannot even be written down, so equivalence comes more naturally.

In particular, one expects (although a proof depends on the exact definition and hasn\'t always been done) that in any $(n+1)$-category of $n$-categories, every [[equivalence]] (in the sense of an $(n+1)$-category) will be essentially $k$-[[k-surjective functor|surjective]] for all $0\le k\le n+1$; this is the $n$-version of "full, faithful, and essentially surjective."  The converse should be true assuming that

*  we have an axiom of choice and use weak (pseudo) $n$-[[n-functor|functors]], or
*  we use $n$-[[n-anafunctor|anafunctors]] (which are automatically weak).

If we use too strict a notion of $n$-functor, then we will not get the correct notion of equivalence; if we use weak $n$-functors but not anafunctors, then we will get the correct notion of equivalence only if the axiom of choice holds, although again this can be corrected by moving to a span.  Note that even strict $n$-categories need weak $n$-functors to get the correct notion of equivalence between them!

For example, assuming choice, a [[strict 2-functor]] between strict $2$-categories is an equivalence in $Bicat$ if and only if it is essentially (up to equivalence) surjective on objects, locally essentially surjective, and [[locally fully faithful 2-functor|locally fully faithful]]. However, its weak inverse may not be a _strict_ $2$-functor, and even if it is, the equivalence transformations need not be strictly $2$-natural.  Thus, it need not be an equivalence in the [[strict 3-category]] $Str 2 Cat$ of $2$-categories, strict $2$-functors, and strict $2$-natural transformations, or even in the [[semi-strict 3-category]] $Gray$ of strict $2$-categories, strict $2$-functors, and pseudonatural transformations.

As with $Cat$, we can recover $Bicat$ as a [[full subcategory|full]] sub[[tricategory]] of $Gray$ by formally inverting all such weak equivalences.  Note that even with the axiom of choice, $Bicat$ is *not* equivalent (as a tricategory) to $Gray$, even though by the coherence theorem for tricategories it is equivalent to *some* $Gray$-category; see [here](http://arxiv.org/abs/math/0612299).

## Related concepts

[[!include properties of functors -- contents]]

* [[equality]], [[isomorphism]], [[equivalence]]

* [[weak equivalence]], [[homotopy equivalence]], [[weak homotopy equivalence]]

* [[homotopy equivalence of toposes]]

* [[equivalence in an (∞,1)-category]]

* **equivalence of categories**, [[weak equivalence of internal categories]]

* [[adjoint functor]]

* [[equivalence of 2-categories]], [[2-adjunction]]

* [[equivalence of (∞,1)-categories]], [[adjoint (∞,1)-functor]]

[[!redirects equivalence of categories]]
[[!redirects equivalences of categories]]
[[!redirects equivalent category]]
[[!redirects equivalent categories]]

[[!redirects isomorphism of categories]]
[[!redirects isomorphisms of categories]]
[[!redirects isomorphic category]]
[[!redirects isomorphic categories]]

[[!redirects adjoint equivalence of categories]]
[[!redirects adjoint equivalences of categories]]

[[!redirects equivalence of n-categories]]
[[!redirects equivalences of n-categories]]
[[!redirects equivalence of infinity-categories]]
[[!redirects equivalences of infinity-categories]]
[[!redirects equivalence of higher categories]]
[[!redirects equivalences of higher categories]]

[[!redirects equivalence of groupoids]]
[[!redirects equivalences of groupoids]]
[[!redirects equivalent groupoid]]
[[!redirects equivalent groupoids]]

[[!redirects isomorphism of groupoids]]
[[!redirects isomorphisms of groupoids]]
[[!redirects isomorphic groupoid]]
[[!redirects isomorphic groupoids]]

[[!redirects adjoint equivalence of groupoids]]
[[!redirects adjoint equivalences of groupoids]]

[[!redirects equivalence of n-groupoids]]
[[!redirects equivalences of n-groupoids]]
[[!redirects equivalence of infinity-groupoids]]
[[!redirects equivalences of infinity-groupoids]]
[[!redirects equivalence of higher groupoids]]
[[!redirects equivalences of higher groupoids]]


equivalence of dg-categories

## Idea

An equivalence of dg-categories is in an [[equivalence in an (infinity,1)-category|equivalence]] in the [[(infinity,1)-category of dg-categories]]. They are analogous to [[Dwyer-Kan equivalences of simplicial categories]].

## Definition

Let $u : C \to D$ be a functor of [[dg-categories]].

+-- {: .un_defn}
###### Definition
The functor $u$ is called **fully faithful** if for all objects $x,y \in C$ the canonical morphisms of [[mapping complexes]]
  $$ Map(x,y) \longrightarrow Map(u(x), u(y)) $$
are [[quasi-isomorphisms]] of [[chain complexes]].

The functor $u$ is called **essentially surjective** if the induced functor on the [[homotopy category of a dg-category|homotopy categories]] is [[essentially surjective]].

The functor $u$ is called an **equivalence** or **Dwyer-Kan equivalence** if it is fully faithful and essentially surjective.
=--

In the literature the term _quasi-equivalence_ is often used for this notion.

Equivalences are [[dg-categories]] are precisely the [[equivalences in an (infinity,1)-category|equivalences]] in the [[(infinity,1)-category of dg-categories]], which is presented by the [[Dwyer-Kan model structure on dg-categories]].

## References

See the references at [[dg-category]].

[[!redirects equivalences of dg-categories]]
[[!redirects quasi-equivalence of dg-categories]]
[[!redirects quasi-equivalences of dg-categories]]
[[!redirects Dwyer-Kan equivalence of dg-categories]]
[[!redirects Dwyer-Kan equivalences of dg-categories]]


equivalence of infinity-groupoids

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Homotopy theory
+--{: .hide}
[[!include homotopy - contents]]
=--
#### Equality and Equivalence
+--{: .hide}
[[!include equality and equivalence - contents]]
=--
=--
=--

An [[equivalence in an (∞,1)-category]] in [[∞Grpd]], hence ann [[equivalence of (∞,1)-categories]] between [[(∞,1)-categories]] that happen to be [[∞-groupoids]].

In terms of presentation by [[topological spaces]] or [[simplicial sets]] (see at _[[homotopy hypothesis]]_) this is a [[weak homotopy equivalence]].

In terms of presentation by [[CW-complexes]] or [[Kan complexes]], it is a [[homotopy equivalence]].

[[!redirects equivalence of ∞-groupoids]]

[[!redirects equivalences of ∞-groupoids]]
[[!redirects equivalences of infinity-groupoids]]


equivalence of types

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
#### Equality and Equivalence
+--{: .hide}
[[!include equality and equivalence - contents]]
=--
=--
=--

\tableofcontents

## Idea
 {#Idea}

In ([[dependent type theory|dependent]]) [[type theory]] and in particular in [[homotopy type theory]], two [[types]] $D$, $C$ are called (homotopy-)*[[isomorphism|isomorphic]]*

> [[Rittri (1989)](#Rittri89), [Cosmo (1995, §1.8)](#Cosmo95), [Hofmann & Streicher (1998, §5.4)](#HofmannStreicher98), [Kapulkin & Lumsdaine (2012, 2021, Def. 3.1.1)](#KapulkinLumsdaine21), but see [below](#HistoricalNote)]

or *[[equivalence|equivalent]]* [[UFP13, §4](#UFP13)] (for fine-print see the definitions [below](#Definition)) if there exists a transformation $D \to C$ which may be [[inverse|inverted]] (up to the relevant re-[[identification type|indentifications]]), hence if any program operating on data of type $A$ may be transformed into a program operating on data of type $B$, and vice versa (see practical examples referenced [below](#ApplicationsInProofReuse)).

Alternatively, a [[function type|function]] $D \to C$ may be called a *[[bijection]]* if all its [[pre-images]] are essentially unique, namely if all its [[fiber types]] are [[contractible types]]. In the [[categorical semantics]] this is called a *[[weak homotopy equivalence]]*, whence this term is also used for the type-theoretic notion [[Voevodsky (2010), p. 8, 10](#Voevodsky10)].

These two notions are in fact equivalent [[UFP13, around Thm. 4.4.5](#UFP13)].

In the special case of [[0-truncated]] types ([[h-sets]]), hence in [[dependent type theories]] with *[[axiom K]]* or the axiom imposing *[[uniqueness of identity proofs]]*, the notion of  type equivalence corresponds essentially to the notion of *[[bijection]]* or *[[one-to-one correspondence]]* in [[set theory]].

In the special case of [[1-truncated]] types ([[h-groupoids]]), type equivalence corresponds essentially to the notion of *[[equivalence of groupoids]]* in [[category theory]].

In full [[homotopy type theory]] the [[categorical semantics]] of type equivalence is *[[homotopy equivalence]]* and that of type bijection is *[[weak homotopy equivalence]]*. That these notions coincide corresponds to the [[categorical semantics]] of types being as [[cofibrant object|co]]-/[[fibrant objects]], on which [[weak homotopy equivalences]] coincide with [[homotopy equivalences]] (by the [[Whitehead theorem]]).

Finally, the notion of equivalence/bijection of types is *a priori* different from that of *[[identification type|identification]]* of types in the [[type universe]]. To assert that the two notions do agree after all is to impose the [[univalence axiom]].

## Definitions
 {#Definition}

In [[dependent type theory]], a [[type]] $A$ is a [[contractible type]] if it comes with an element $a:A$ and a family of identities $x:A \vdash c(x):a =_A x$ indicating that $a$ is a [[center of contraction]]. A type family $x:A \vdash B(x)$ is [[uniquely quantified]] if the [[dependent sum type]] $\sum_{x:A} B(x)$ is a [[contractible type]]. In dependent type theory with [[identity types]] and [[dependent sum types]], an **equivalence** between types $A$ and $B$ could be defined as

* a [[function]] with contractible fibers, a family of elements $x:A \vdash f(x):B$ for which the type family $x:A \vdash f(x) =_B y$ is [[uniquely quantified]] for all $y:B$
* a [[span]] $(C; z:C \vdash g(z):A; z:C \vdash h(z):B)$ for which the type family $z:C \vdash g(z) =_A x$ is [[uniquely quantified]] for all $x:A$ and the type family $z:C \vdash h(z) =_B y$ is [[uniquely quantified]] for all $y:B$
* a [[multivalued partial function]] $(x:A \vdash P(x); x:A, p:P(x) \vdash f(x, p):B)$ for which the dependent type $P(x)$ is a [[contractible type]] for all $x:A$ and the type family $x:A \vdash \sum_{p:P(x)} f(x, p) =_B y$ is [[uniquely quantified]] for all $y:B$
* a [[one-to-one correspondence]], a [[correspondence]] $x:A, y:B \vdash R(x, y)$ for which the type family $y:B \vdash R(x, y)$ is [[uniquely quantified]] for all $x:A$ and the type family $x:A \vdash R(x, y)$ is [[uniquely quantified]] for all $y:B$
* an element of the [[equivalence type]] $f:A \simeq B$, in dependent type theories with [[equivalence types]] given directly by rules.
* a *bi-invertible function* or *homotopy isomorphism*, a family of elements $x:A \vdash f(x):B$ with families of elements $y:B \vdash g(y):A$ and $y:B \vdash h(y):A$ and families of identities $x:A \vdash G(x):g(f(x)) =_A x$ and $y:B \vdash H(y):f(h(y)) =_B y$.
* a *coherently invertible function* or *half adjoint equivalence*, a family of elements $x:A \vdash f(x):B$ with a family of elements $y:B \vdash g(y):A$ and families of identities $x:A \vdash G(x):g(f(x)) =_A x$; $y:B \vdash H(y):f(g(y)) =_B y$; and $x:A \vdash K(x):\mathrm{ap}_f(H(x)) =_{g(f(x)) =_A x} G(f(x))$.
* a *quasi-invertible function* or *homotopy equivalence*, a family of elements $x:A \vdash f(x):B$ with a family of elements $y:B \vdash g(y):A$ and families of identities $x:A \vdash G(x):g(f(x)) =_A x$ and $y:B \vdash H(y):f(g(y)) =_B y$.
* A function $f:A \to B$ which satisfies [[copy induction]], which makes the type $B$ satisfy the [[universal property]] of a [[copy]] of $A$.

### Strict equivalences

There is also a notion of **strict equivalence** between two types $A$ and $B$, where given families of elements $x:A \vdash f(x)B$ and $y:B \vdash g(y):A$, instead of having families of identities $G(x):g(f(x)) =_A x$ and $H(y):f(g(y)) =_B y$, one has [[judgmental equalities]] $g(f(a)) \equiv a:A$ and $b \equiv f(g(b)):B$ or [[propositional equalities]] $g(f(a)) \equiv_A a \; \mathrm{true}$ and $b \equiv_B f(g(b)) \; \mathrm{true}$, making the families of elements into **judgmentally strict equivalences** and **propositionally strict equivalences** respectively.

Judgmentally strict equivalences are used in defining [[judgmentally strict equivalence types]], which in turn are used to define [[univalent universes]] in [[Mike Shulman]]'s model of [[higher observational type theory]].

### The isEquiv type family and equivalence types

{#OutlookOnEquivalenceOfDefinitions} As (eventually to be) discussed in the *[Properties](#Properties)*-section below,
the evident types formed by these definitions are co-inhabited: we have a function from any one of them to any of the others.  Moreover, at least if we assume [[function extensionality]], the evident types of "homotopy isomorphisms" and of functions with contractible fibers are equivalent and are [[h-propositions]].
This is only true for the evident type of homotopy equivalences if we assume [[axiom K]] or [[uniqueness of identity proofs]] (as discussed [below](#TheIssueWithQuasiInverses)); in [[dependent type theories]] without either axiom, the isEquiv type family is not in general a [[mere proposition]] for homotopy equivalences. However, often the most convenient way to show that $f$ is an equivalence is by exhibiting it as a term of the type of homotopy equivalences.

#### Rules for isEquiv

Given types $A$ and $B$ and [[function]] $f:A \to B$, $f$ is an [[equivalence of types]] if $f$ has a [[quasi-inverse function]] and $B$ satisfies the [[universal property]] of a [[copy type]] of $A$ with copy function $f:A \to B$. This means that one could define the family of [[h-propositions]] $f:A \to B \vdash \mathrm{isEquiv}(f)$ using very similar natural deduction rules to the rules for [[copy types]], but where the [[introduction rule]] states that given a function $f:A \to B$ and evidence that $f$ has a quasi-inverse function, one could form a witness of $\mathrm{isEquiv}(f)$:

Defining

$$f:A \to B \vdash \mathrm{qInv}(f) \equiv \sum_{g:B \to A} \left(\prod_{y:B} \mathrm{Id}_B(f(g(y)), y)\right) \times \left(\prod_{x:A} \mathrm{Id}_A(g(f(x)), x)\right)$$

and

$$\mathrm{isProp}(A) \equiv \prod_{x:A} \prod_{y:A} x =_A y$$

the formation and introduction rules for isEquiv state that that the type family $f:A \to B \vdash \mathrm{isEquiv}(f)$ comes with

* a family of functions
$$f:A \to B \vdash \mathrm{qinvtoisEquiv}(f):\mathrm{qInv}(f) \to \mathrm{isEquiv}(f)$$

* a family of identifications
$$f:A \to B \vdash \mathrm{proptruncisEquiv}(f):\mathrm{isProp}(\mathrm{isEquiv}(f))$$

Formation rules for isEquiv:
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, f:A \to B}{\Gamma \vdash \mathrm{isEquiv}(f) \; \mathrm{type}}$$

Introduction rules for isEquiv:
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, f:A \to B}{\Gamma \vdash \mathrm{qInvToIsEquiv}(f):\mathrm{qInv}(f) \to \mathrm{isEquiv}(f)}$$

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B}{\Gamma \vdash \mathrm{proptruncisEquiv}(f):\mathrm{isProp}(\mathrm{isEquiv}(f))}$$

The elimination, computation, and uniqueness rules depend upon whether $B$ behaves like a [[positive copy type]] or a [[negative copy type]]:

##### As a negative type

Elimination rules for isEquiv:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B}{\Gamma \vdash f^{-1}:B \to A}$$

Computation rules for isEquiv:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B}{\Gamma, y:B \vdash \beta_{\mathrm{isEquiv}(f)}(y):f(f^{-1}(y)) =_B y}$$

Uniqueness rules for isEquiv:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash f:A \to B}{\Gamma, x:A \vdash \eta_{\mathrm{isEquiv}(f)}(x):f^{-1}(f(x)) =_A x}$$

Using [[dependent sum types]] and [[product types]], this could be reduced to the following inference rule

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma, f:A \to B \vdash \mathrm{isEquivtoqinv}(f):\mathrm{isEquiv}(f) \to \mathrm{qInv}(f)}$$

##### As a positive type

Elimination rules for isEquiv:
$$\frac{
    \begin{array}{l}
      \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, f:A \to B \quad \Gamma \vdash p:\mathrm{isEquiv}(f) \\
      \Gamma, y:B \vdash C(y) \; \mathrm{type} \quad \Gamma \vdash c_f:\prod_{x:A} C(f(x)) \quad \Gamma \vdash b:B
    \end{array}
  }{\Gamma \vdash \mathrm{ind}_{\mathrm{isEquiv}(f)}^C(f, p, c_f, b):C(b)}$$

Computation rules for isEquiv:
$$\frac{
    \begin{array}{l}
      \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, f:A \to B \quad \Gamma \vdash p:\mathrm{isEquiv}(f) \\
      \Gamma, y:B \vdash C(y) \; \mathrm{type} \quad \Gamma \vdash c_f:\prod_{x:A} C(f(x)) \quad \Gamma \vdash a:A
    \end{array}
  }{\Gamma \vdash \beta_{\mathrm{isEquiv}(f)}(f, p, c_f, a):\mathrm{ind}_{\mathrm{isEquiv}(f)}^C(f, p, c_f, f(a)) =_{C(f(a))} c_f(a)}$$

Uniqueness rules for isEquiv:
$$\frac{
    \begin{array}{l}
      \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, f:A \to B \quad \Gamma \vdash p:\mathrm{isEquiv}(f) \\
      \Gamma, y:B \vdash C(y) \; \mathrm{type} \quad \Gamma \vdash c:\prod_{y:B} C(y) \quad \Gamma \vdash b:B
    \end{array}
  }{\Gamma \vdash \eta_{\mathrm{isEquiv}(f)}(f, p, c, b):c(b) =_{C(b)} \mathrm{ind}_{\mathrm{isEquiv}(f)}^C(f, p, c, b)}$$

#### Defining isEquiv from other type formers

In dependent type theories with [[dependent product types]], the [[isContr]] modality is defined as
$$\mathrm{isContr}(A) \coloneqq \sum_{x:A} \prod_{y:A} x =_A y$$
and the [[uniqueness quantifier]] on a type family $x:A \vdash B(x)$, is defined as
$$\exists!x:A.B(x) \coloneqq \mathrm{isContr}\left(\sum_{x:A} B(x)\right)$$

Assuming [[function extensionality]], one could define $\mathrm{isEquiv}$ type family and the [[equivalence type]] for the first and fifth definition:

* We define the property that a function $f:A \to B$ is an equivalence as the property that the function has contractible fibers:
$$f:A \to B \vdash \mathrm{isEquiv}(f) \coloneqq \prod_{y:B} \exists!x:A.f(x) =_B y$$
  and the [[equivalence type]] for the first definition:
$$A \simeq B \coloneqq \sum_{f:A \to B} \mathrm{isEquiv}(f)$$

* We define the property that an equivalence $f:A \simeq B$ is an equivalence as true, represented in dependent type theory by the [[unit type]], because $f:A \simeq B$ is always an equivalence:
$$f:A \simeq B \vdash \mathrm{isEquiv}(f) \coloneqq \mathbb{1}$$
  and there is no need to define $A \simeq B$ because the type is already defined. However, there is an equivalence between the types
$$\delta:(A \simeq B) \simeq \sum_{f:A \simeq B} \mathrm{isEquiv}(f)$$

If the dependent type theory came with a [[Tarski universe]] $(U, \mathrm{El})$, one could additionally define the $\mathrm{isEquiv}_U$ type family and the locally $U$-small [[equivalence type]] for the second, third, and fourth definitions above, but only for $U$-small structures:

* The type of $U$-small [[spans]] between $A$ and $B$ is the type
$$\mathrm{Span}_U(A, B) \coloneqq \sum_{C:U} (\mathrm{El}(C) \to A) \times (\mathrm{El}(C) \to B)$$
We define the property that a $U$-small span $f:\mathrm{Span}_U(A, B)$ is an equivalence as the property that both functions $\pi_1(\pi_2(f)):\mathrm{El}(C) \to A$ and $\pi_2(\pi_2(f)):\mathrm{El}(C) \to B$ have contractible fibers:
$$f:\mathrm{Span}_U(A, B) \vdash \mathrm{isEquiv}_U(f) \coloneqq \left(\prod_{x:A} \exists!z:\mathrm{El}(C).\pi_1(\pi_2(f))(z) =_A x\right) \times \left(\prod_{y:B} \exists!z:\mathrm{El}(C).\pi_2(\pi_2(f))(z) =_B y\right)$$
The locally $U$-small [[equivalence type]] is defined as
$$A \simeq_U B \coloneqq \sum_{f:\mathrm{Span}_U(A, B)} \mathrm{isEquiv}(f)$$

* The type of $U$-small [[multivalued partial functions]] between $A$ and $B$ is the type
$$\mathrm{MultiPartFunc}_U(A, B) \coloneqq \sum_{P:A \to U} \left(\sum_{x:A} \mathrm{El}(P(x))\right) \to B$$
We define the property that a $U$-small multivalued partial function $f:\mathrm{MultiPartFunc}_U(A, B)$ is an equivalence as the property that the dependent type $\mathrm{El}(\pi_1(f)(x))$ is a [[contractible type]] for all $x:A$ and the function $\pi_2(f)$ has contractible fibers for all $y:B$:
$$f:\mathrm{MultiPartFunc}_U(A, B) \vdash \mathrm{isEquiv}_U(f) \coloneqq \left(\prod_{x:A} \mathrm{isContr}\left(\mathrm{El}(\pi_1(f)(x))\right)\right) \times \left(\prod_{y:B} \exists!x:A.\sum_{p:\mathrm{El}(\pi_1(f)(x))} \pi_2(f)(x, p) =_B y\right)$$
The locally $U$-small [[equivalence type]] is defined as
$$A \simeq_U B \coloneqq \sum_{f:\mathrm{MultiPartFunc}_U(A, B)} \mathrm{isEquiv}(f)$$

* The type of $U$-small [[correspondences]] between $A$ and $B$ is the type
$$\mathrm{Corr}_U(A, B) \coloneqq A \times B \to U$$
We define the property that a $U$-small correspondence $R:\mathrm{Corr}_U(A, B)$ is an equivalence as being a [[one-to-one correspondence]]:
$$R:\mathrm{Corr}_U(A, B) \vdash \mathrm{isEquiv}_U(R) \coloneqq \left(\prod_{x:A} \exists!y:B.\mathrm{El}(R(x,y))\right) \times \left(\prod_{y:B} \exists!x:A.\mathrm{El}(R(x,y))\right)$$
The locally $U$-small [[equivalence type]] is defined as
$$A \simeq_U B \coloneqq \sum_{f:\mathrm{Corr}_U(A, B)} \mathrm{isEquiv}(f)$$

If the dependent type theory also has [[function extensionality]], then one could define the $\mathrm{isEquiv}$ type family and the [[equivalence type]] for the sixth and seventh definitions above:

* For homotopy isomorphisms, given a function $f:A \to B$, we define the $\mathrm{isEquiv}(f)$ type family as the product type of the type of [[sections]] of $f$ and the type of [[retractions]] of $f$.
$$f:A \to B \vdash \mathrm{isEquiv}(f) \coloneqq \left(\sum_{g:B \to A} \prod_{x:A} g(f(x)) =_A x\right) \times \left(\sum_{h:B \to A} \prod_{y:B} f(h(y)) =_B y\right)$$
* For half adjoint equivalences, given a function $f:A \to B$, we define the $\mathrm{isEquiv}(f)$ type family as the type of quasi-inverse functions with a coherence condition.
$$f:A \to B \vdash \mathrm{isEquiv}(f) \coloneqq \sum_{g:B \to A} \left(\prod_{x:A} g(f(x)) =_A x\right) \times \left(\prod_{y:B} f(g(y)) =_B y\right) \times \left(\prod_{x:A} \mathrm{ap}_f(H(x)) =_{g(f(x)) =_A x} G(f(x))\right)$$
* For invertible functions, given a function $f:A \to B$, we define the $\mathrm{isEquiv}(f)$ type family as the proposition that the function merely has a [[quasi-inverse function]]:
$$f:A \to B \vdash \mathrm{isEquiv}(f) \coloneqq \exists g:B \to A.(\Pi x:A.g(f(x)) =_A x) \times (\Pi y:B.f(g(y)) =_B y)$$
  and the [[equivalence type]] for the first definition:
$$A \simeq B \coloneqq \sum_{f:A \to B} \mathrm{isEquiv}(f)$$

Finally, if the dependent type theory has [[axiom K]] or [[uniqueness of identity proofs]], then one could define the $\mathrm{isEquiv}$ type family and the [[equivalence type]] directly for homotopy equivalences above; the coherence condition follows from the fact that the type $g(f(x)) =_A x$ is always a [[mere proposition]] in the presence of axiom K or UIP:
$$f:A \to B \vdash \mathrm{isEquiv}(f) \coloneqq \sum_{g:B \to A} \left(\prod_{x:A} g(f(x)) =_A x\right) \times \left(\prod_{y:B} f(g(y)) =_B y\right)$$

In all three cases, by [[function extensionality]] for the first two and additionally by [[axiom K]] or [[UIP]] for the third case, the $\mathrm{isEquiv}(f)$ type family is a [[mere proposition]] for all $f:A \to B$. Thus, we can define the [[equivalence type]] as
$$A \simeq B \coloneqq \sum_{f:A \to B} \mathrm{isEquiv}(f)$$

### Historical note
 {#HistoricalNote}

The first attempt at a definition of an equivalence of type was the definition of a quasi-invertible function by [Hofmann & Streicher (1998), §5.4](#HofmannStreicher98). In the absence of [[axiom K]] or [[uniqueness of identity proofs]], this definition suffers from a subltety in the construction of equivalence types, see [below](#TheIssueWithQuasiInverses).

Later on, the following definitions of equivalences were constructed:

* as a function with contractible fibers, first proposed by [Voevodsky (2010), p. 8, 10](#Voevodsky10)

* as a homotopy isomorphism, first proposed by [[André Joyal]] in a 2011 Oberwolfach meeting, recorded in [Kapulkin & Lumsdaine (2012, 2021), Def. 3.1.1](#KapulkinLumsdaine21),

* as a one-to-one correspondence, first proposed in [Shulman 2022](#Shulman22)

However, these definitions are only equivalent to one another in the presence of [[function extensionality]].

## Properties
 {#Properties}

\linebreak

Most of the following claims may be found proven in [UFP13, §2.4 & §4](#UFP13).

### Functions with contractible fibers and one-to-one correspondences

We define an [[anafunction]] to be a type family $R :A \times B \to \mathcal{U}$ with a witness

$$p:\prod_{a:A} \exists!b:B.R(a,b)$$

The [[principle of unique choice]] holds in [[dependent type theory]]. This means that given any anafunction $R :A \times B \to \mathcal{U}$, there is function $f:A \to B$. Similarly, for any function $f:A \to B$, there is an anafunction $R :A \times B \to \mathcal{U}$ defined by $R(a,b) \coloneqq f(a) =_B b$.

A function with contractible fibers comes with a witness

$$q:\prod_{b:B} \exists!a:A.f(a) =_A b$$

while an one-to-one correspondence is an anafunction which comes with a witness

$$q:\prod_{b:B} \exists!a:A.R(a, b)$$

Since we established that the types $f(a) =_A b$ and $R(a, b)$ are the same for function $f$ and anafunction $R$, functions with contractible fibers are equivalent to one-to-one correspondences.

### The issue with two-sided quasi-inverses
 {#TheIssueWithQuasiInverses}

The definition of equivalences as two-sided [[quasi-inverse functions]] (Def. \ref{FunctionWithTwoSidedInverse}) suffers from the drawback that the type

$$
  f \colon A \to B
  \;\;\;\;\;\;
  \vdash
  \;\;\;\;\;\;
  qinv(f)
  \coloneqq
  \underset{
    \overline{f} \colon B \to A
  }{\sum}
  \;\;
  Id_{(A \to A)}
  \big(
    \overline{f} \circ f
    ,\,
    (a \mapsto a)
  \big)
  \;\times\;
  Id_{(B \to B)}
  \big(
    f \circ \overline{f}
    ,\,
    (b \mapsto b)
  \big)
  \,,
$$

which may naively look like it merely detects whether $f$ is an equivalence, is in fact *not* a [[mere proposition]] ([UFP13, Thm. 4.1.3](#UFP13)).

This means that the type

\[
  \label{TheSubtlyWrongTypeOfEquivalences}
  \underset{
    f \colon A \to B
  }{\sum}
  \;
  \underset{
    \overline{f} \colon B \to A
  }{\sum}
  \;\;
  Id_{(A \to A)}
  \big(
    \overline{f} \circ f
    ,\,
    (a \mapsto a)
  \big)
  \;\times\;
  Id_{(B \to B)}
  \big(
    f \circ \overline{f}
    ,\,
    (b \mapsto b)
  \big)
\]

is --- despite its possible superficial appearance (cf. [[Hofmann & Streicher (1998),  §5.4](#HofmannStreicher98)]) -- *not* in fact equivalent to the correct type of equivalences $Equiv(A,B)$, which is instead obtained from this expression by including a [[0-truncation]] $[-]_{0}$:

$$
  Equiv(A,B)
  \;\simeq\;
  \underset{
    f \colon A \to B
  }{\sum}
  \Bigg[
  \underset{
    \overline{f} \colon B \to A
  }{\sum}
  \;\;
  Id_{(A \to A)}
  \big(
    \overline{f} \circ f
    ,\,
    (a \mapsto a)
  \big)
  \;\times\;
  Id_{(B \to B)}
  \big(
    f \circ \overline{f}
    ,\,
    (b \mapsto b)
  \big)
  \Bigg]_0
  \,.
$$

\linebreak

One could also use [[propositional truncations]] instead of [[0-truncation]]; this turns the [[dependent sum type]] in the definition into an [[existential quantifier]], and is the proper translation of one of the definitions of [[bijection]] in [[set theory]] into type theory in the [[propositions as some types]]: A function $f:A \to B$ is an equivalence if there (merely) exists a function $\overline{f}:B \to A$ such that $\overline{f} \circ f$ is equal to $(a \mapsto a)$ and $f \circ \overline{f}$ is equal to $(b \mapsto b)$:

$$
  Equiv(A,B)
  \;\simeq\;
  \underset{
    f \colon A \to B
  }{\sum}
  \exists \overline{f} \colon B \to A.
  Id_{(A \to A)}
  \big(
    \overline{f} \circ f
    ,\,
    (a \mapsto a)
  \big)
  \;\times\;
  Id_{(B \to B)}
  \big(
    f \circ \overline{f}
    ,\,
    (b \mapsto b)
  \big)
  \,.
$$

### Constructing the inverse function
 {#ConstructingTheInverseFunction}

For every function $f \colon A \to B$ with contractible fibers (Def. \ref{FunctionWithContractibleFiber}),
there exists a function $g \colon B \to A$ which is an [[inverse function]].

The [[principle of unique choice]] implies that given a function $f:A \to B$, if for all $b:B$ the fiber of $f$ at $b$ is contractible, then for all $b:B$ there is an element $g(b):\mathrm{fiber}(f, b)$.

$$\prod_{b:B} \mathrm{isContr}\left(\sum_{a:A} f(a) =_A b\right) \to \prod_{b:B} \sum_{a:A} f(a) =_A b$$

The [[type theoretic axiom of choice]] then states that for all elements $b:B$ one has the structure of an element $a:A$ such that $f(a) =_A b$, then one has a function $g:B \to A$ such that $f(g(b)) =_A b$.

$$\prod_{b:B} \sum_{a:A} f(a) =_A b \to \sum_{g:B \to A} \prod_{b:B} f(g(b)) =_A b$$

There is also another definition of contractible type, which uses the notion of [[center of contraction]]; namely, that a type $A$ is a contractible type if it comes with a element $a:A$ and a witness that for all elements $b:A$, $a =_A b$

$$\prod_{b:A} a =_A b$$

Since the fiber of $f$ at $b$ is contractible, $g(b)$ is the [[center of contraction]] for the fiber of $f$ at $b$.

Thus, for all elements $a:A$ and $b:B$ and a witness $q(a, b):f(a) =_B b$, there is a witness $r(a, b, q(a, b)):a =_A g(b)$. Since the type $a =_A g(b)$ doesn't depend on $q(a, b)$, by the rules of [[function types]], the latter condition is the same as for all elements $a:A$ and $b:B$, a function $r(a, b):f(a) =_B b \to a =_A g(b)$.

...

still to prove: that the function above is an equivalence of types for all $a:A$ and $b:B$.

## Semantics
 {#Semantics}

We discuss the [[categorical semantics]] of equivalences in homotopy type theory.

Let $\mathcal{C}$ be a [[locally cartesian closed category]] which is a [[model category]], in which the (acyclic cofibration, fibration) [[weak factorization system]] has [[stable path objects]], and acyclic cofibrations are preserved by pullback along fibrations between fibrant objects.  (We ignore questions of coherence, which are not important for this discussion.) For instance $\mathcal{C}$ could be a [[type-theoretic model category]].

### Of $isEquiv(-)$

+-- {: .num_prop }
###### Proposition

For $A, B$ two [[cofibrant object|cofibrant]]-[[fibrant objects]] in $\mathcal{C}$,
a morphism $f\colon A\to B$ is a [[weak equivalence]] or equivalently a [[homotopy equivalence]] in $\mathcal{C}$ precisely when the interpretation of $isEquiv(f)$ has a [[generalized element|global point]] $* \to hasContrFibers(f)$.

=--

+-- {: .proof}
###### Proof

For $f\colon A\to B$, the [[categorical semantics]] of the [[dependent type]]

$$
  b\colon B
   \;\vdash\;
  hfiber(f,b)\colon Type
$$

is by the rules for the [[categorical semantics|interpretation]] of [[identity types]] and [[substitution]]
the [[mapping path space]] construction $P f$, given by the [[pullback]]

$$
  \array{
    [b : B \vdash  hfiber(f,b)] &\coloneqq & P f  &\to& A
    \\
    && \downarrow && \downarrow^{\mathrlap{f}}
    \\
    && B^I &\to& B
    \\
    && \downarrow
    \\
    && B
  }
$$

which, by the [[factorization lemma]], is one way to factor $f$ as an [[acyclic cofibration]] followed by a [[fibration]]

$$
  f : A \stackrel{\simeq}{\to} P f \to B
  \,.
$$

By definition and the semantics of [[contractible types]], therefore, if $A$ and $B$ are cofibrant, then $isEquiv(f)$ has a [[global element]]

$$
  * \to \prod_{b} isContr(hfiber(f,b))
$$

precisely when in this factorization, the fibration $P f \to B$ is an acyclic fibration.  (See for instance ([Shulman, page 49](http://www.sandiego.edu/~shulman/hottminicourse2012/03models.pdf#page=49)) for more details.)

But by the [[2-out-of-3 property]], this is equivalent to $f$ being a weak equivalence --- and hence a homotopy equivalence, since it is a map between fibrant-cofibrant objects.

=--

+-- {: .num_remark #InterpretationIfIsEquivAsDependentType}
###### Remark

In the above we fixed one function $f : A \to X$. But the type $isEquiv$ is actually a [[dependent type]]

$$
  f : A \to B \vdash isEquiv(f)
$$

on the [[function type|type of all functions]]. To obtain the [[categorical semantics]] of this general dependent $hasContrFibers$-construction, first notice that the interpretation of

$f : A \to B,\; a : A,\; b : B \;\vdash\; (f(a) = b)  \colon Type$

is by the rules for interpretation of [[identity types]], [[evaluation]] and [[substitution]] the left vertical morphism in the [[pullback]] [[diagram]]

$$
  \array{
    Q &\to&  B^I
    \\
    \downarrow && \downarrow
    \\
    [A,B] \times A \times B &\stackrel{(eval, id_B)}{\to}& B \times B
  }
  \,,
$$

where $eval : [A, B] \times A \to B$ is the [[evaluation map]] for the [[internal hom]].
This means that the interpretation of further [[dependent sum]] yielding $hfib$

$$
  f : A \to B,\; b : B
   \; \vdash \;
  \left(
    \sum_{a : A } (f(a) = b)
  \right)
  \colon Type
$$

is the composite left vertical morphism in

$$
  \array{
    Q &\to& B^I
    \\
    \downarrow && \downarrow
    \\
    [A,B] \times A \times B &\stackrel{(eval, id_B)}{\to}& B \times B
    \\
    \downarrow^{\mathrlap{p_{1,3}}}
    \\
    [A,B] \times B
  }
$$

=--

### Of $Equiv(-)$

(...)

## Related concepts

* **isEquiv**

* [[isContr]]

* [[isProp]]

* [[homotopy equivalence]]

  * [[weak homotopy equivalence]]

  * [[stable weak homotopy equivalence]]

* [[equivalence type]]

* [[embedding in type theory]]

## References
 {#References}

### General

The notion of two-sided homotopy equivalence of types in [[homotopy type theory]] appears (together with the formulation of the [[univalence axiom]]) already in

* {#HofmannStreicher98} [[Martin Hofmann]], [[Thomas Streicher]], §5.4 of:  _The groupoid interpretation of type theory_, in: [[Giovanni Sambin]] et al. (eds.), *Twenty-five years of constructive type theory*, Proceedings of a congress, Venice, Italy, October 19-21, 1995. Oxford: Logic Guides. **36**, Clarendon Press (1998) 83-111 [[ISBN:9780198501275](https://global.oup.com/academic/product/twenty-five-years-of-constructive-type-theory-9780198501275), [ps](http://www.mathematik.tu-darmstadt.de/~streicher/venedig.ps.gz), [[HofmannStreicherGroupoidInterpretation.pdf:file]]]

except that these authors refer to the subtly incorrect type (eq:TheSubtlyWrongTypeOfEquivalences) of all such equivalences.

The notion of equivalences as [[function type|functions]] with [[contractible type|contractible]] [[fiber type|homotopy fibers]] (and thereby the fix of the [[univalence axiom]] of [Hofmann & Streicher (1998), §5.4](#HofmannStreicher98)) is due to:

* {#Voevodsky10} [[Vladimir Voevodsky]], p. 10 of: *Univalent Foundations Project* (2010) [[pdf](http://www.math.ias.edu/~vladimir/Site3/Univalent_Foundations_files/univalent_foundations_project.pdf), [[Voevodsky-UFP2010.pdf:file]]]

The notion of "homotopy isomorphisms" (functions with left- and right-quasi inverses) was proposed by [[André Joyal]] in a 2011 Oberwolfach meeting, recorded in:

* {#KapulkinLumsdaine21} [[Chris Kapulkin]], [[Peter LeFanu Lumsdaine]], Def. 3.1.1 in: *The Simplicial Model of Univalent Foundations (after Voevodsky)*, Journal of the European Mathematical Society **23** (2021) 2071–2126  [[arXiv:1211.2851](https://arxiv.org/abs/1211.2851), [doi:10.4171/jems/1050](https://doi.org/10.4171/jems/1050)]

The notion of equivalences as [[one-to-one correspondences]] is due to:

* {#Shulman22} [[Mike Shulman]], Towards a Third-Generation HOTT Part 1 ([slides](https://www.cmu.edu/dietrich/philosophy/hott/slides/shulman-2022-04-28.pdf), [video](https://www.youtube.com/watch?v=FrxkVzItMzA))

Introduction and exposition:

* [[Andrej Bauer]], *HoTT equivalences*, talk (2011) [[webpage](https://math.andrej.com/2011/12/07/hott-equivalences/), [video](https://www.youtube.com/watch?v=V3YUsZx_fmo)]

* {#Shulman} [[Mike Shulman]], from [slide 60 of part 2](https://home.sandiego.edu/~shulman/hottminicourse2012/02hott.pdf#page=60), [slide 49 of part 3](https://home.sandiego.edu/~shulman/hottminicourse2012/03models.pdf#page=49) in: _Minicourse in homotopy type theory_ (2012) [[web](https://home.sandiego.edu/~shulman/hottminicourse2012/)]

* [[Andrej Bauer]], *Equivalences* [[video](https://www.youtube.com/watch?v=BuI62-o3Ds8)], Part 4 of: *[Introduction to homotopy type theory](https://www.youtube.com/playlist?list=PL-47DDuiZOMCRDiXDZ1fI0TFLQgQqOdDa)*, lecture series (2019)

Textbook account:

* {#UFP13} [[Univalent Foundations Project]], §2.4 and §4 in: *[[Homotopy Type Theory -- Univalent Foundations of Mathematics]]* (2013) [[web](http://homotopytypetheory.org/book/), [pdf](http://hottheory.files.wordpress.com/2013/03/hott-online-323-g28e4374.pdf)]

Implementation of equivalences in [[proof assistants]]:

in [[Coq]]:

* [github.com/HoTT/HoTT/blob/master/theories/Basics/Equivalences.v](https://github.com/HoTT/HoTT/blob/master/theories/Basics/Equivalences.v)

in [[Agda]]:

* [agda.github.io/agda-stdlib/v1.1/Function.Equivalence.html](https://agda.github.io/agda-stdlib/v1.1/Function.Equivalence.html)

On equivalences as one-to-one correspondences in homotopy type theory:

* Mike Shulman, *Towards a Third-Generation HOTT* Part 1 [[slides](https://www.cmu.edu/dietrich/philosophy/hott/slides/shulman-2022-04-28.pdf), [video](https://www.youtube.com/watch?v=FrxkVzItMzA)]

### Applications
 {#ApplicationsInProofReuse}

Origin of the notion of type isomorphy in and application to [[programming language]]-theory and -practice:

* {#Rittri89} Mikael Rittri, *Using types as search keys in function libraries*, in: *FPCA '89: Proceedings of the fourth international conference on Functional programming languages and computer architecture* (1989) 174–183 [[doi:10.1145/99370.99384](https://doi.org/10.1145/99370.99384), [pdf](https://dl.acm.org/doi/pdf/10.1145/99370.99384)]

* {#Cosmo95} [[Roberto Di Cosmo]], *Isomorphisms of Types -- from $\lambda$-calculus to information retrieval and language design*, Progress in Theoretical Computer Science, Birkhäuser (1995) [[doi:10.1007/978-1-4612-2572-0](https://doi.org/10.1007/978-1-4612-2572-0)]

* [[Gilles Barthe]], [[Olivier Pons]], *Type Isomorphisms and Proof Reuse in Dependent Type Theory*, in *Foundations of Software Science and Computation Structures. FoSSaCS 2001*, Lecture Notes in Computer Science **2030**, Springer (2001) [[doi:10.1007/3-540-45315-6_4](https://doi.org/10.1007/3-540-45315-6_4)]

* [[Roberto Di Cosmo]], *A short survey of isomorphisms of types*, Mathematical Structures in Computer Science **15** 5  (2005) 825-838 [[doi:10.1017/S0960129505004871](https://doi.org/10.1017/S0960129505004871), [pdf](https://www.dicosmo.org/Articles/mscs-survey.pdf)]

* [[Talia Ringer]], RanDair Porter, Nathaniel Yazdani, John Leo, Dan Grossman, *Proof Repair across Type Equivalences* [[arXiv:2010.00774](https://arxiv.org/abs/2010.00774)]

* [[Talia Ringer]], *Proof repair along type equivalences*, §4 in: *Proof Repair*, Univ. Washington (2021) [[proquest:2568297410](https://www.proquest.com/docview/2568297410), [video](https://www.youtube.com/watch?v=_BkTrp44uBU)]

[[!redirects equivalence of types]]
[[!redirects equivalences of types]]

[[!redirects weak equivalence of types]]
[[!redirects weak equivalences of types]]

[[!redirects strict equivalence of types]]
[[!redirects strict equivalences of types]]

[[!redirects judgmentally strict equivalence of types]]
[[!redirects judgmentally strict equivalences of types]]

[[!redirects propositionally strict equivalence of types]]
[[!redirects propositionally strict equivalences of types]]

[[!redirects strict equivalence]]
[[!redirects strict equivalences]]

[[!redirects judgmentally strict equivalence]]
[[!redirects judgmentally strict equivalences]]

[[!redirects propositionally strict equivalence]]
[[!redirects propositionally strict equivalences]]

[[!redirects isEquiv]]

[[!redirects equivalence in homotopy type theory]]
[[!redirects equivalences in homotopy type theory]]
[[!redirects equivalence in type theory]]
[[!redirects equivalences in type theory]]
[[!redirects equivalence in HoTT]]
[[!redirects equivalences in HoTT]]

[[!redirects adjoint equivalence in homotopy type theory]]
[[!redirects adjoint equivalences in homotopy type theory]]
[[!redirects adjoint equivalence in type theory]]
[[!redirects adjoint equivalences in type theory]]
[[!redirects adjoint equivalence in HoTT]]
[[!redirects adjoint equivalences in HoTT]]

[[!redirects weak equivalence in homotopy type theory]]
[[!redirects weak equivalences in homotopy type theory]]
[[!redirects weak equivalence in type theory]]
[[!redirects weak equivalences in type theory]]
[[!redirects weak equivalence in HoTT]]
[[!redirects weak equivalences in HoTT]]

[[!redirects strict equivalence in homotopy type theory]]
[[!redirects strict equivalences in homotopy type theory]]
[[!redirects strict equivalence in type theory]]
[[!redirects strict equivalences in type theory]]
[[!redirects strict equivalence in HoTT]]
[[!redirects strict equivalences in HoTT]]

[[!redirects judgmentally strict equivalence in homotopy type theory]]
[[!redirects judgmentally strict equivalences in homotopy type theory]]
[[!redirects judgmentally strict equivalence in type theory]]
[[!redirects judgmentally strict equivalences in type theory]]
[[!redirects judgmentally strict equivalence in HoTT]]
[[!redirects judgmentally strict equivalences in HoTT]]

[[!redirects propositionally strict equivalence in homotopy type theory]]
[[!redirects propositionally strict equivalences in homotopy type theory]]
[[!redirects propositionally strict equivalence in type theory]]
[[!redirects propositionally strict equivalences in type theory]]
[[!redirects propositionally strict equivalence in HoTT]]
[[!redirects propositionally strict equivalences in HoTT]]

[[!redirects homotopy isomorphism]]
[[!redirects h-isomorphism]]

[[!redirects type equivalence]]
[[!redirects type equivalences]]

[[!redirects equivalence in type theory]]
[[!redirects equivalences in type theory]]


equivalence principle (physics)

## Idea

An idea/principle that inspired/underlies the [[theory (physics)]] of [[gravity]] called _[[general relativity]]_.

## Related concepts

* [[general covariance]]

## References

* Wikipedia, _[Equivalence principle](http://en.wikipedia.org/wiki/Equivalence_principle)_

* at 4:18 in this [video](https://www.youtube.com/watch?v=E43-CfukEgs)


equivalence relation

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Relations
+-- {: .hide}
[[!include relations - contents]]
=--
=--
=--

# Equivalence relations
* table of contents
{: toc}

## Definition

An __equivalence relation__ on a set $S$ is a binary [[relation]] $\equiv$ on $S$ that is:

* [[reflexive relation|reflexive]]: $x \equiv x$ for all $x: S$;
* [[symmetric relation|symmetric]]: $x \equiv y$ if $y \equiv x$; and
* [[transitive relation|transitive]]: $x \equiv z$ if $x \equiv y \equiv z$.

Thus, an equivalence relation is a **symmetric [[preorder]]**.

(One can also define it as a relation that is both reflexive and [[euclidean relation|euclidean]].)  The [[de Morgan duality|de Morgan dual]] of an equivalence relation is an [[apartness relation]].

If $R$ is any relation on $S$, there is a smallest equivalence relation containing $R$ (noting that an intersection of an arbitrary family of equivalence relations is again such; see also [[Moore closure]]), called the equivalence relation *generated by* $R$.

## In homotopy type theory

In homotopy type theory, since [[propositions]] are [[subsingletons]], an equivalence relation on a type $T$ is a type family $x \equiv y$ indexed by elements $x:T$ and $y:T$ with witnesses of reflexivity, transitivity, and symmetry, and propositional truncation:

$$\mathrm{refl}(x):x \equiv x$$

$$\mathrm{trans}(x, y, z):x \equiv y \times y \equiv z \to x \equiv z$$

$$\mathrm{sym}(x, y):x \equiv y \to y \equiv x$$

$$\mathrm{proptrunc}(x, y):\prod_{p:x \equiv y} \prod_{q:x \equiv y} p = q$$

One then further distinguishes between a [[type]] with an equivalence relation (a symmetric preordered type) and an [[h-set]] with an equivalence relation (a symmetric [[proset]]).

### Extensional functions

Let $A \coloneqq (A_0, \equiv_A)$ and $B:\coloneqq (B_0, \equiv_B)$ be two symmetric preordered types. An **[[extensional function]]** $f:A \to B$ consists of a function $f_0:A_0 \to B_0$ and for all elements $a:A_0$ and $b:A_0$ a function $f_\equiv(a, b):(a \equiv_A b) \to (f_0(a) \equiv_B f_0(b))$.

The identity function $id_A:A \to A$ is an extensional function which consists of the identity function $id_{A_0}:A_0 \to A_0$ for all elements $a:A_0$ and $b:A_0$, the identity function $id_\equiv(a, b):(a \equiv_A b) \to (a \equiv_A b))$.

Given symmetric preordered types $A \coloneqq (A_0, \equiv_A)$, $B:\coloneqq (B_0, \equiv_B)$, and $C \coloneqq (C_0, \equiv_C)$, the composition $g \circ f:A \to C$ of extensional functions $f:A \to B$ and $g:B \to C$ is defined as
$$(g \circ f)_0 \coloneqq g_0 \circ f_0$$
and for all objects $a:A_0$ and $b:A_0$,
$$(g \circ f)_\equiv(a, b) \coloneqq g_equiv(f_0(a), f_0(b)) \circ f_equiv(a, b)$$

### Injections, surjections, and bijections

An extensional function $f:A \to B$ is a **[[injection]]** if for all elements $b:B_0$ the type of elements $a:A_0$ with a witness $p(a, b):f_0(a) \equiv b$ is a [[subsingleton]].

An extensional function $f:A \to B$ is a **[[surjection]]** if for all elements $b:B_0$ the type of elements $a:A_0$ with a witness $p(a, b):f_0(a) \equiv b$ is a [[pointed type]].

An extensional function $f:A \to B$ is a **[[bijection]]** if it is both an [[injection]] and a [[surjection]]; i.e. for all elements $b:B_0$ the type of elements $a:A_0$ with a witness $p(a, b):f_0(a) \equiv b$ is a pointed subsingleton, or a [[singleton]].

### Bijections, isomorphisms, and equivalences

An extensional function $f:A \to B$ is a **[[bijection]]** if for all elements $b:B_0$ the type of elements $a:A_0$ with a witness $p(a, b):f_0(a) \equiv b$ is a [[singleton]].

An extensional function $f:A \to B$ is an **[[isomorphism]]** if there exist an extensional functiom $g:B \to A$ with witnesses $\mathrm{ret}(f, g):g \circ f = id_{A}$ and $\mathrm{sec}(f, g):f \circ g = id_{B}$.

An extensional function $f:A \to B$ is an **[[equivalence]]** if the function $f_0:A_0 \to B_0$ is an equivalence of types and for all elements $a:A_0$ and $b:A_0$ the function $f_\equiv(a, b):(a \equiv_A b) \to (f_0(a) \equiv_B f_0(b))$ is an equivalence of types.

The only symmetric preordered types for which bijection, isomorphism, and equivalence are the same are the symmetric posets, which are the [[h-sets]].

## A categorical view

A set equipped with an equivalence relation can be regarded as a [[groupoid]] [[enriched category|enriched]] over the [[cartesian monoidal category]] of [[truth values]].  Equivalently, it is a [[groupoid]] that is [[0-truncated]].  Then the equivalence relation on $S$ is a way of making $S$ into the set of objects of such a groupoid.  Equivalently, a set with an equivalence relation is a [[(0,1)-category]] whose each morphism is iso, or a [[symmetric relation|symmetric]] [[preordered set]].

It may well be useful to consider several possible equivalence relations on a given set.  When considering a single equivalence relation once and for all, however, it is common to take the [[quotient set]] $S/_{\equiv}$ and use that instead.  As a groupoid, any set with an equivalence relation is [[equivalence of categories|equivalent]] to a [[set]] in this way (although in the absence of the [[axiom of choice]], it is only a "weak" or [[anafunctor|ana-equivalence]]).

A set equipped with an equivalence relation is sometimes called a __[[setoid]]__, see there for more.

## Variants and generalizations

* A _[[partial equivalence relation]]_ is a symmetric and transitive relation.

* A _[[congruence]]_ is a notion of equivalence relation [[internalization|internal]] to a suitable [[category]].

* The generalization of this to [[(∞,1)-category theory]] is that of _[[groupoid object in an (∞,1)-category]]_.

## Related concepts

* [[Bishop set]]

* [[congruence]]

* [[complete loop graph]]

* [[stable equivalence relation]]

* [[pseudo-equivalence relation]]

* [[quotient equivalence relation]]

* [[enriched set]]

* [[monoidal symmetric proset]]

* [[set-like structure in homotopy type theory]]

* [[tolerance relation]]

## References

For the history of the notion of equivalence relation see _[this MO discussion](http://mathoverflow.net/questions/135347/who-introduced-the-terms-equivalence-relation-and-equivalence-class)_.

[[!redirects equivalence relation]]
[[!redirects equivalence relations]]
[[!redirects relation of equivalence]]

[[!redirects symmetric preorder]]
[[!redirects symmetric preorders]]
[[!redirects symmetric proset]]
[[!redirects symmetric prosets]]
[[!redirects symmetric preordered set]]
[[!redirects symmetric preordered sets]]
[[!redirects symmetric preordered type]]
[[!redirects symmetric preordered types]]

[[!redirects thin groupoid]]
[[!redirects thin groupoids]]


equivalence type

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
#### Equality and Equivalence
+--{: .hide}
[[!include equality and equivalence - contents]]
=--
=--
=--

\tableofcontents

## 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 $A$ and $B$ is the type $A \simeq B$ whose terms are [[equivalence of types|equivalences]] between $A$ and $B$. 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 $A$ and $B$, one could define the type of [[strict equivalences]] betwen $A$ and $B$. These are given by the following rules:

Formation rule for strict equivalence types:
$$\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:
$$\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:
$$\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}$$

$$\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:
$$\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}$$

$$\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:

$$\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 $A \to B$, the equivalence type is defined by

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

#### Locally small equivalence types

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

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

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

#### Rules for weak equivalence types

Formation rules for equivalence types:
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma \vdash A \simeq B \; \mathrm{type}}$$

Introduction rules for equivalence types:
$$\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:

$$\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}$$

$$\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}$$

$$\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}$$

$$\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}$$

$$\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

$$\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}$$

$$\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}$$

$$\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}$$

$$\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}$$

$$\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

$$\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}$$

$$\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}$$

$$\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}$$

$$\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}$$

$$\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

$$\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

$$\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 $A$ and $B$ and two functions $f:A \to B$ and $g:B \to A$, $f$ and $g$ are inverses of each other if for every element $a:A$ and $b:A$, there is an equivalence of types between $f(a) =_B b$ and $a =_A g(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

$$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:
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma \vdash A \simeq B \; \mathrm{type}}$$

Introduction rule for equivalence types:
$$\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:
$$\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}$$

$$\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:
$$\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))}$$

$$\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)}$$

$$\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 $A$ and $B$ and an equivalence $f:A \simeq B$, one could define the dependent type $x:\mathbb{I} \vdash C(x)$ indexed by the [[interval type]] $\mathbb{I}$ as $C(0) \equiv A$, $C(1) \equiv B$, and $\mathrm{tr}_C(0, 1, p) \equiv f$.

### One-to-one correspondences

Given types $A$ and $B$ and an equivalence $f:A \simeq B$, one could define a [[correspondence]] $x:A, y:B \vdash R(x, y)$ as the [[dependent identity type]]
$$R(x, y) \coloneqq x =_C^p y$$
where $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 \simeq B$, one could derive functions $\rho(R):A \to B$ and $\lambda(R):B \to A$. One could show that these functions are [[quasi-inverse functions]] of each other: for all $x:A$ and $y:B$ and equivalences $R:A \simeq B$, there are identities
$$\rho_\kappa(R, \lambda(R, y), y, \lambda_\tau(R, y)):\rho(R)(\lambda(R)(y)) =_B y$$
$$\lambda_\kappa(R, x, \rho(R)(x), \rho_\tau(R, x)^{-1}):\lambda(R)(\rho(R)(x)) =_A x$$
where $p^{-1}:b =_A a$ is the inverse identity of $p:a =_A b$. By the introduction rule for dependent product types, there are [[homotopies]]
$$\lambda y.\rho_\kappa(R, \lambda(R, y), y, \lambda_\tau(R, y)):\prod_{y:B} \rho(R)(\lambda(R)(y)) =_B y$$
$$\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 $\rho(R)$ and $\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

$$\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 $A$ is defined as an equivalence $\mathrm{id}_A:A \simeq A$ such that for all elements $a:A$,

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

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

$$\rho(R^{-1}, a) \coloneqq \lambda(R, a)$$
$$\lambda(R^{-1}, b) \coloneqq \rho(R, b)$$
$$b =_{B, A}^{R^{-1}} a \coloneqq a =_{A, B}^R b$$

Given equivalences $R:A \simeq B$ and $S:B \simeq C$, the composite of $R$ and $S$ is an equivalence $S \circ R:A \simeq C$ such that for all elements $a:A$ and $c:C$,

$$\lambda(S \circ R, a) \coloneqq \lambda(R, \lambda(S, a))$$
$$\rho(S \circ R, c) \coloneqq \rho(S, \rho(R, c))$$
$$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]] $U$, there are two ways to say that types $A:U$ and $B:U$ are equal: by the [[identity type]] $A =_U B$, and the equivalence type $A \simeq B$. The [[univalence axiom]] says that these two types $A =_U B$ and $A \simeq B$ are the same, which is represented by an equivalence between the two types

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

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

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

### Action on equivalences

We introduce a [[modal operator]] $L$ to the type theory, which we assume in general not to be [[idempotent]] or [[monadic]]; this is given by the formation rule
$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash L(A) \; \mathrm{type}}$$
$L$ preserves equivalences: given types $A$ and $B$, there is a function $\mathrm{ae}_L:(A \simeq B) \to L(A) \simeq L(B)$, called the action on equivalences for $L$.

### Categorical semantics

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

## See also

* [[bijection set]], [[object of isomorphisms]]

* [[equivalence in type theory]]

* [[identity type]], [[heterogeneous identity type]]

* [[autoequivalence type]]

* [[function type]], [[embedding type]]

* [[equivalence extensionality]]

## References

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

* {#UFP13} [[Univalent Foundations Project]], §2.4 and §4 in: *[[Homotopy Type Theory -- Univalent Foundations of Mathematics]]* (2013) [[web](http://homotopytypetheory.org/book/), [pdf](http://hottheory.files.wordpress.com/2013/03/hott-online-323-g28e4374.pdf)]

[[!redirects equivalence type]]
[[!redirects equivalence types]]

[[!redirects type of equivalences]]
[[!redirects types of equivalences]]

[[!redirects locally small equivalence type]]
[[!redirects locally small equivalence types]]

[[!redirects type of locally small equivalences]]
[[!redirects types of locally small equivalences]]

[[!redirects weak equivalence type]]
[[!redirects weak equivalence types]]

[[!redirects type of weak equivalences]]
[[!redirects types of weak equivalences]]

[[!redirects strict equivalence type]]
[[!redirects strict equivalence types]]

[[!redirects type of strict equivalences]]
[[!redirects types of strict equivalences]]

[[!redirects judgmentally strict equivalence type]]
[[!redirects judgmentally strict equivalence types]]

[[!redirects type of judgmentally strict equivalences]]
[[!redirects types of judgmentally strict equivalences]]

[[!redirects propositionally strict equivalence type]]
[[!redirects propositionally strict equivalence types]]

[[!redirects type of propositionally strict equivalences]]
[[!redirects types of propositionally strict equivalences]]


equivalent-on-objects functor

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Category theory
+-- {: .hide}
[[!include category theory - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Idea

In [[type theory]], the concept of a [[bijective-on-objects functor]] is only valid for [[categories]] whose type forms a [[set]], i.e. [[strict categories]]. However, we would want a similar notion for general categories. Thus, comes the concept of equivalent-on-objects functor.

## Definition

A function $f:A \to B$ between two types $A$ and $B$ is an [[equivalence in homotopy type theory|equivalence]] if for all elements $b:B$ the fiber of $f$ at $b$ is a singleton. This suggests the following definition of an identity-on-objects functor:

\begin{definition}
An **identity-on-objects [[functor]]** $F: A\to B$ between [[categories]] $A$ and $B$ is a [[functor]] whose underlying object function $F_{ob}: ob(A) \to ob(B)$ is an [[equivalence in homotopy type theory|equivalence of types]] $F_{ob}: ob(A) \simeq ob(B)$.
\end{definition}

## Properties

### Relation to identity-on-objects functors

If both categories live in a [[univalent universe]] $\mathcal{U}$, an equivalent-on-objects functor also becomes an [[identity-on-objects functor]] due to the [[univalence axiom]]:

For types $A:\mathcal{U}$ and $B:\mathcal{U}$, there is an [[identity type]] $A =_\mathcal{U} B$ and a type of equivalences between $A$ and $B$, $A \simeq_\mathcal{U} B$, as well as a canonical function $\mathrm{IdtoEquiv}:A =_\mathcal{U} B \to A \simeq_\mathcal{U} B$. Since $\mathcal{U}$ is univalent, $\mathrm{IdtoEquiv}$ is an equivalence of types $\mathrm{IdtoEquiv}:A =_\mathcal{U} B \simeq A \simeq_\mathcal{U} B$ and thus there is a homotopy inverse $\mathrm{EquivtoId}:A \simeq_\mathcal{U} B \to A =_\mathcal{U} B$. Thus, in an univalent universe, equivalent-on-objects functors and identity-on-objects functors are the same:

\begin{definition}
An **identity-on-objects [[functor]]** $F: A\to B$ between [[categories]] $A$ and $B$ in a [[univalent universe]] $\mathcal{U}$ is a [[functor]] with an [[identification]] $\mathrm{EquivtoId}(F_{ob}):ob(A) =_\mathcal{U} ob(B)$, where $F_{ob}: ob(A) \to ob(B)$ is the underlying object function of the functor $F$.
\end{definition}

### Relation to bijective-on-objects functors

For [[strict categories]], an equivalent-on-objects functor is a [[bijective-on-objects functor]], as equivalence of sets is [[bijection]] of sets, and the type of objects for strict categories is a set.

### Relation to essentially surjective functors.

For [[univalent categories]], an equivalent-on-objects functor is a [[essentially surjective functor]]. This is because the type of objects of every [[univalent category]] is a [[groupoid]]/[[1-truncated]], which means that equivalence of the object types is [[equivalence of groupoids]] and thus essentially surjective.

An isomorphism of categories is a [[fully faithful functor|fully faithful]] equivalent-on-objects functor. As a result, every [[adjoint equivalence]] of [[univalent categories]] is an isomorphism of univalent categories, since every adjoint equivalence is essentially surjective.

## See also

* [[identity-on-objects functor]]
* [[bijective-on-objects functor]]
* [[essentially surjective functor]]

## References

For the definition of isomorphism of categories and adjoint equivalence of univalent categories, and equivalence of the two definitions for functors between univalent categories:

* Univalent Foundations Project, [[HoTT book|Homotopy Type Theory – Univalent Foundations of Mathematics]] (2013)

[[!redirects equivalent-on-objects]]
[[!redirects equivalent on objects]]

[[!redirects equivalent on objects functor]]
[[!redirects equivalent on objects functors]]

[[!redirects equivalent-on-objects functor]]
[[!redirects equivalent-on-objects functors]]


equivariance

#Contents#
* table of contents
{:toc}

## Idea

*Equivariance* is compatibility (of [[functions]]/[[maps]]/[[morphisms]]) with a [[group action]]. See also at _[[equivariant structure]]_.

## Related concepts

* [[general covariance]], [[gauge invariance]], [[principle of equivalence]]

* [[equivariant cohomology]]

* [[equivariant homotopy theory]]

* [[equivariant stable homotopy theory]]

* [[global equivariant stable homotopy theory]]

* [[rational equivariant stable homotopy theory]]

[[!redirects equivariant]]


equivariance group

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Representation theory
+-- {: .hide}
[[!include representation theory - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Idea

Given a [[category]] of

* [[topological G-spaces]] or of [[(infinity,1)-presheaves]] on the $G$-[[orbit category]], hence in the context of $G$-[[equivariant homotopy theory]];

* [[G-manifolds]], hence in the context of $G$-[[equivariant differential topology]];

where all [[morphisms]] are (represented by) $G$-[[equivariant functions]], the [[group]] $G$ may be called the underlying _equivariance group_.

## Related concepts

* [[structure group]], [[gauge group]]

* [[equivariant bundle]]

[[!redirects equivariance groups]]