In homotopy type theory the identity is itself a type. For \(a,b:A\) there is a type \(a=b\) whose canonical element is \(\mathsf {refl}_a:a=a\). Everything in Section 9 is rebuilt from this type and its elimination rule.
The engine. The type of paths out of a point, \(\sum _{x:A}(a=x)\), is contractible: the identity is the only element of its kind.
Yoneda. Path induction is the Yoneda lemma.
Univalence. Equivalence is identity, so pairing two collections is identifying them, and numbers are the connected components of the type of finite types.
The natural numbers. \(\mathbb N\) is the initial algebra of \(X\mapsto 1+X\) in a strong sense: the type of such initial algebras is contractible. So "unique up to unique isomorphism" becomes "unique", and Benacerraf’s question dissolves.
Sets. Order, segments, the von Neumann successor, Zermelo numerals, Foundation and anti-foundation follow, with the cumulative hierarchy as a higher inductive type.
Formation and introduction.
Path induction (J). To define or prove something for all \(x:A\) and \(p:a=x\), it suffices to do so for \(x\equiv a\) and \(p\equiv \mathsf {refl}_a\):
Consequences. From \(\mathsf J\) alone:
composition \(p\cdot q\), inverses \(p^{-1}\), and the groupoid laws up to higher paths;
transport \(p_{*}:P(a)\to P(b)\) along \(p:a=b\), which is substitution;
the action of functions on paths, \(\mathsf {ap}_f:(a=b)\to (fa=fb)\).
Every type is an \(\infty \)-groupoid generated by \(\mathsf {refl}\).
Contractibility.
Lemma (paths out of a point). For \(a:A\), the type \(\sum _{x:A}(a=x)\) is contractible, with centre \((a,\mathsf {refl}_a)\).
Proof. By \(\mathsf J\), it suffices to give a path \((a,\mathsf {refl}_a)=(x,p)\) when \(x\equiv a\) and \(p\equiv \mathsf {refl}_a\), and that path is \(\mathsf {refl}\). \(\square \)
This is the type-theoretic form of "the identity is the only arrow of its kind". Every universal property below is the contractibility of some type of maps.
Yoneda. For a type family \(P:A\to \mathcal U\) and \(a:A\),
Reading. The representable functor is \(x\mapsto (a=x)\). A family of maps out of it is determined by its value on \(\mathsf {refl}_a\), which is what \(\mathsf J\) says. The Yoneda lemma is not a theorem added to the identity type: it is the rule for using that type.
Truncation levels.
| Level | Condition |
| contractible | \(\mathsf {isContr}(A)\) |
| proposition | \(\prod _{x,y:A}(x=y)\), any two elements equal |
| set | each \(x=y\) is a proposition |
| \(n\)-type | each \(x=y\) is an \((n-1)\)-type |
Truncation as idempotent closure. Propositional truncation \(A\mapsto \|A\|\) reflects types into propositions. It is idempotent, \(\|\,\|A\|\,\|\simeq \|A\|\), and monotone. More generally, a modality is an idempotent reflection onto a subclass of types: the idempotent closure of Section 26.
Logic. The propositions of \(\mathcal U\) form a Heyting algebra:
| Connective | Type |
| \(P\wedge Q\) | \(P\times Q\) |
| \(P\Rightarrow Q\) | \(P\to Q\) |
| \(P\vee Q\) | \(\|P+Q\|\) |
| \(\bot \) | \(\mathbf 0\) |
| \(\neg P\) | \(P\to \mathbf 0\) |
Excluded middle \(\prod _P(P\vee \neg P)\) is not provable. Double negation \(\neg \neg \) is a modality on propositions whose fixed points form a Boolean algebra: the Boolean core.
Each type is characterised by an equivalence of mapping types.
| Type | Universal property |
| \(\mathbf 0\) | \((\mathbf 0\to C)\) is contractible |
| \(\mathbf 1\) | \((C\to \mathbf 1)\) is contractible; \(\mathbf 1\simeq \sum _x(a=x)\) |
| \(A+B\) | \((A+B\to C)\simeq (A\to C)\times (B\to C)\) |
| \(A\times B\) | \((C\to A\times B)\simeq (C\to A)\times (C\to B)\) |
The unit type is, up to equivalence, the based path space: the identity with nothing else. Products and coproducts are the right and left adjoints of the diagonal \(x\mapsto (x,x)\).
Univalence. For types \(A,B\) in a universe,
Pairing. Two collections are paired when there is an equivalence between them. By univalence, a pairing is a path in the universe: to pair is to identify.
Finite types.
Numbers as components.
Pigeonhole.
Dedekind infinity. \(\mathbb N\simeq \mathbb N+\mathbf 1\), by \(n\mapsto n+1\) with the new point sent to \(0\), while \(\mathrm {Fin}(n)\not \simeq \mathrm {Fin}(n)+\mathbf 1\) by pigeonhole. This is the Hilbert hotel.
Algebras. For \(F(X)=\mathbf 1+X\), an algebra is a type \(X\) with a point \(x_0:X\) and a map \(f:X\to X\). Morphisms are maps \(h\) with paths \(h(x_0)=y_0\) and \(h\circ f=g\circ h\).
The inductive type. \(\mathbb N\) has constructors \(0:\mathbb N\) and \(\mathsf {succ}:\mathbb N\to \mathbb N\), with dependent elimination: induction.
Homotopy initiality. For every algebra \((X,x_0,f)\), the type of algebra morphisms \(\mathbb N\to X\) is contractible (Awodey–Gambino–Sojakova). This is recursion, with uniqueness given by a path rather than by a separate axiom.
Lambek. \([0,\mathsf {succ}]:\mathbf 1+\mathbb N\to \mathbb N\) is an equivalence. The proof is that of Section 9, Level 7, with "only endomorphism" replaced by "contractible type of endomorphisms".
Peano’s conditions by encode–decode. Define \(\mathsf {code}:\mathbb N\to \mathbb N\to \mathcal U\) by recursion:
\(0\neq \mathsf {succ}\,n\), since \(\mathsf {code}(0,\mathsf {succ}\,n)=\mathbf 0\);
\(\mathsf {succ}\) is injective, since \((\mathsf {succ}\,m=\mathsf {succ}\,n)\simeq \mathsf {code}(m,n)\simeq (m=n)\);
\(\mathbb N\) is a set, since each \(\mathsf {code}(m,n)\) is a proposition.
Uniqueness, not up to isomorphism. The type of homotopy-initial \((\mathbf 1+X)\)-algebras is a proposition, and it is inhabited by \(\mathbb N\), hence contractible. By univalence, two initial algebras are not merely isomorphic: they are equal, by a unique path. There is exactly one natural numbers type.
The declaration. The formation rule for \(\mathbb N\) is where the completed infinite is declared (Subsection 458). The finite stages \(\mathrm {Fin}(n)\) are the Adámek chain \(\mathbf 0\to \mathbf 1\to \mathbf 1+\mathbf 1\to \cdots \), and \(\mathbb N\) is its colimit taken as one type.
Order.
reflexivity is \((0,\mathsf {refl})\);
transitivity adds the witnesses;
antisymmetry: \(m+k=n\) and \(n+l=m\) give \(k+l=0\), so \(k=l=0\);
irreflexivity: \(\mathsf {succ}\,m\le m\) gives \(m+1+k=m\), which \(\mathsf {code}\) refutes.
Segments.
The successor.
Definition. \(V\) is the higher inductive type with
a point constructor \(\mathsf {set}(A,f):V\) for every \(A:\mathcal U\) and \(f:A\to V\), the set of the values of \(f\);
a path constructor identifying \(\mathsf {set}(A,f)\) and \(\mathsf {set}(B,g)\) whenever every value of \(f\) is a value of \(g\) and conversely;
set-truncation.
The path constructor is extensionality, built into identity on \(V\).
Membership.
Numerals. By recursion on \(\mathbb N\):
Equivalently,
Benacerraf. There is one \(\mathbb N\), unique by contractibility, and two algebra morphisms \(v,z:\mathbb N\to V\) for the two algebra structures on \(V\), \(x\mapsto x\cup \{x\}\) and \(x\mapsto \{x\}\). "\(1\in 3\)" is a question about the morphism and its target, not about \(\mathbb N\), which has no membership relation at all.
Foundation. The induction principle of \(V\) proves
Anti-foundation. Coinductive types (M-types), the final coalgebras, are constructed from limits of the dual chain. A final coalgebra for the power-set functor contains a unique \(\Omega \) with \(\Omega =\{\Omega \}\). Foundation and anti-foundation are induction and coinduction, initial and final.
Collapse. For a well-founded extensional relation on a set \(X\), recursion along it defines \(f:X\to V\) with \(f(x)=\mathsf {set}\bigl (\sum _yyRx,\ f\bigr )\), injective by extensionality: the Mostowski collapse. For the order on \(\mathbb N\), \(f=v\).
| Section 9 | Identity type | Rule |
| identity arrow | \(\mathsf {refl}_a:a=a\) | introduction |
| universality forces identity | \(\sum _x(a=x)\) contractible | \(\mathsf J\) |
| Yoneda | \(\bigl (\prod _x(a=x)\to Px\bigr )\simeq P(a)\) | \(\mathsf J\) |
| idempotent closure | truncation, modalities | reflection |
| Heyting logic, Boolean core | \(\mathrm {Prop}\), \(\neg \neg \) | — |
| \(\mathbf 0,\mathbf 1,+,\times \) | mapping-type equivalences | universal properties |
| pairing | \(A\simeq B\), which is \(A=B\) | univalence |
| numbers | \(\|\mathrm {FinSet}\|_0\simeq \mathbb N\) | univalence, truncation |
| Dedekind infinity | \(\mathbb N\simeq \mathbb N+\mathbf 1\) | — |
| \(\mathbb N\) | inductive type, h-initial | induction |
| Peano | encode–decode | \(\mathsf {code}\) |
| categoricity | initial algebras contractible | univalence |
| order, irreflexivity | \(\sum _k(m+k=n)\) | \(\mathsf {code}\) |
| successor | \(\mathrm {seg}(n+1)\simeq \mathrm {seg}(n)+\mathbf 1\), new point \(\mathsf {refl}_n\) | — |
| \(V\), von Neumann, Zermelo | HIT, two algebra maps | recursion |
| Foundation | induction principle of \(V\) | initiality |
| anti-foundation | M-types | finality |
Every entry is a statement about the identity type: its introduction \(\mathsf {refl}\), its elimination \(\mathsf J\), the contractibility of paths out of a point, and univalence, which makes identity of types the same as equivalence.