Only arrows are given.
Objects are identity arrows, and endomorphisms and isomorphisms are defined from them.
Adjunctions are built from units, counits and triangle identities, and the hom-bijection is derived from these.
The diagonal and its adjoints give \(0\), \(1\), \(+\) and \(\times \).
The initial algebra is the left adjoint into the one-arrow category.
Lambek’s lemma, \(\mathbb N\cong 1+\mathbb N\), \(\mathsf {fold}\) and induction follow.
Every step rests on one fact: the only endomorphism of an initial object is the identity.
Arrows. There is a collection of arrows and a partial composition \(g\circ f\), associative where defined.
Identities. An arrow \(e\) is an identity if \(e\circ f=f\) and \(g\circ e=g\) whenever these composites are defined.
Objects are identities. Every arrow \(f\) has exactly one identity \(\mathrm {dom}(f)\) with \(f\circ \mathrm {dom}(f)=f\), and exactly one identity \(\mathrm {cod}(f)\) with \(\mathrm {cod}(f)\circ f=f\). Objects are not a second kind of thing: an object \(A\) is the identity arrow \(\mathrm {id}_A\). Write \(f:A\to B\) for \(\mathrm {dom}(f)=\mathrm {id}_A\) and \(\mathrm {cod}(f)=\mathrm {id}_B\).
Endomorphisms. An endomorphism is an arrow \(f\) with \(\mathrm {dom}(f)=\mathrm {cod}(f)\). The endomorphisms of \(A\) form a monoid \(\mathrm {End}(A)\) with unit \(\mathrm {id}_A\), which is itself an endomorphism and an idempotent: \(\mathrm {id}_A\circ \mathrm {id}_A=\mathrm {id}_A\).
Isomorphisms. \(f:A\to B\) is an isomorphism if there is \(g:B\to A\) with
The engine. If \(\mathrm {End}(A)=\{\mathrm {id}_A\}\) and there are arrows \(f:A\to B\) and \(g:B\to A\) with \(\mathrm {End}(B)=\{\mathrm {id}_B\}\), then \(f\) and \(g\) are mutually inverse: \(g\circ f\in \mathrm {End}(A)\) and \(f\circ g\in \mathrm {End}(B)\).
Definition. A functor sends arrows to arrows, identities to identities, and composites to composites:
Consequences. A functor sends endomorphisms to endomorphisms and isomorphisms to isomorphisms.
Data. Functors \(F:\mathbf C\to \mathbf D\) and \(G:\mathbf D\to \mathbf C\), with natural families
The transposes.
The bijection.
using naturality of \(\varepsilon \) and \(\eta \) in the middle step and a triangle identity in the last. So
Back to the identity.
Product category. Arrows of \(\mathbf C\times \mathbf C\) are pairs \((f,g)\), composed componentwise, with identities \((\mathrm {id}_A,\mathrm {id}_B)\).
The diagonal.
Coproduct: \(+\dashv \Delta \). The unit is the pair of injections \((\mathrm {inl},\mathrm {inr}):(A,B)\to (A+B,A+B)\), and the counit is the codiagonal \(\nabla =[\mathrm {id},\mathrm {id}]:A+A\to A\). The bijection of Step 3 reads
Product: \(\Delta \dashv \times \). Dually, \(\mathbf C(X,A\times B)\cong \mathbf C(X,A)\times \mathbf C(X,B)\).
Zero and one. Let \(\mathbf 1\) be the category with a single arrow, an identity. For the unique functor \(!:\mathbf C\to \mathbf 1\),
Disjoint, monic injections. In sets, toposes and the universe of types, \(\mathrm {inl}\) and \(\mathrm {inr}\) are monic with disjoint images. In sets this follows from the tags \(0\neq 1\), which is itself a consequence of identity (Section 18).
The functor.
Algebras and morphisms. An algebra is \((A,\alpha )\) with \(\alpha :F(A)\to A\). A morphism \(h:(A,\alpha )\to (X,\beta )\) satisfies
\(\mathbf {Alg}(F)\) is a category. The identity is a morphism because \(\mathrm {id}_A\circ \alpha =\alpha =\alpha \circ F(\mathrm {id}_A)\), by Step 2. Composites of morphisms are morphisms by functoriality. The endomorphisms of \((A,\alpha )\) in \(\mathbf {Alg}(F)\) are the endomorphisms \(h\) of \(A\) with \(h\circ \alpha =\alpha \circ F(h)\).
Definition by adjunction. An initial algebra is the value at the single object of a left adjoint to \(!:\mathbf {Alg}(F)\to \mathbf 1\):
Its endomorphisms. In particular, \(\mathrm {End}_{\mathbf {Alg}(F)}(A,\alpha )=\{\mathrm {id}_A\}\).
Uniqueness. By the engine of Step 1, two initial algebras are related by a unique isomorphism.
Existence (the declaration). The forgetful functor \(U:\mathbf {Alg}(F)\to \mathbf C\) has a left adjoint \(\mathrm {Free}\). Then, by Steps 3 and 4,
Statement. \(\alpha :F(A)\to A\) is an isomorphism.
Proof.
\(\square \)
The isomorphism.
Zero and successor. By the coproduct bijection of Step 4,
Peano facts. \(\alpha \) is an isomorphism (Step 7), and the injections are monic and disjoint (Step 4). Hence
A target algebra. By Step 4, an algebra \((X,\beta )\) is a pair
Definition.
Equations. Precompose the square \(\mathsf {fold}_\beta \circ [0,S]=\beta \circ (\mathrm {id}_1+\mathsf {fold}_\beta )\) with each injection:
Uniqueness. If \(h\) satisfies both equations, the coproduct bijection gives the square, so \(h\) is a morphism. Then \(\varphi (h)\) is an arrow \(0\to X\), hence \(\varphi (h)=!_X\), and \(h=\psi (\varphi (h))=\psi (!_X)=\mathsf {fold}_\beta \).
Subalgebras. If \(m:P\hookrightarrow \mathbb N\) is closed under \(0\) and \(S\), then \(m\) is a morphism. Step 9 gives \(u:\mathbb N\to P\), and \(m\circ u\in \mathrm {End}(\mathbb N,\alpha )=\{\mathrm {id}\}\). So \(m\) is surjective, and \(P=\mathbb N\).
Dependent form. For \(Q(n)\) with \(q_0\) and \(q_S\), \(\mathsf {fold}\) into the total algebra \(\sum _nQ(n)\) gives \(H\). Since \(\mathrm {pr}_1\) is a morphism, \(\mathrm {pr}_1\circ H\in \mathrm {End}(\mathbb N,\alpha )=\{\mathrm {id}\}\), and \(\mathrm {pr}_2\circ H\) is the required section.
| Step | Derived | From |
| 0 | objects | identity arrows |
| 1 | endomorphisms, isomorphisms, engine | \(\mathrm {dom}=\mathrm {cod}\); \(g\circ f=\mathrm {id}\) |
| 2 | functors | preserve \(\mathrm {id}\) and \(\circ \) |
| 3 | adjunction bijection | triangle identities: transposing twice is \(\mathrm {id}\) |
| 4 | \(\Delta \), \(+\), \(\times \), \(0\), \(1\) | \((f,f)\), and adjoints of \(\Delta \) and \(!\) |
| 5 | \(\mathbf {Alg}(1+X)\) | \(F(\mathrm {id})=\mathrm {id}\) |
| 6 | initial algebra, \(\mathrm {End}=\{\mathrm {id}\}\) | left adjoint into \(\mathbf 1\); \(\mathrm {Free}(0)\) |
| 7 | Lambek | \(\alpha \circ u\in \mathrm {End}=\{\mathrm {id}\}\) |
| 8 | \(\mathbb N\cong 1+\mathbb N\), \(0\), \(S\), Peano | Lambek, \(+\dashv \Delta \) |
| 9 | \(\mathsf {fold}\), its equations, uniqueness | transpose \(\psi (!_X)\) |
| 10 | induction | \(m\circ u\in \mathrm {End}=\{\mathrm {id}\}\) |
Only the existence of \(\mathrm {Free}\) is declared. At Steps 6, 7, 9 and 10 the decisive move is the same: an endomorphism of the initial algebra is the identity.