37 Elements

C5 (the identity is the element of \(1\)). \(1\) is the right adjoint of \(\Delta _0\): for every \(X\) there is exactly one map \(X\to 1\). An element of \(A\) is a map \(1\to A\). The kind \(1\) has the element \(\mathrm {id}_1\), and no other, since every map \(1\to 1\) is the unique one. So

\begin{equation} 1=\{\mathrm {id}_1\}: \tag{752}\end{equation}
the one element is the identity itself. Two maps that agree at every element are equal (C2, \(\eta \)).

C6 (the elements of a sum are its tags). By the triangle \(\eta \) of \(\sqcup \dashv \Delta \), \(\mathrm {id}_{A\sqcup B}=[\mathrm {in}_1,\mathrm {in}_2]\). Let \(T\subseteq A\sqcup B\) be the part of elements of the form \(\mathrm {in}_1a\) or \(\mathrm {in}_2b\). Both tags land in \(T\), so the left adjunction gives a map \(u:A\sqcup B\to T\), and the inclusion \(\iota :T\to A\sqcup B\) has \(\iota \circ u\circ \mathrm {in}_k=\mathrm {in}_k\). By uniqueness, \(\iota \circ u=[\mathrm {in}_1,\mathrm {in}_2]=\mathrm {id}\), so every element lies in \(T\). Tags of different sides differ and each tag is injective (E2, from \(\ell \neq r\)). In particular

\begin{equation} 0=\text {the sum of no kinds has no element}. \tag{753}\end{equation}

C7 (equality is pulled back along the diagonal). The pairs \((x,y)\) of \(A\) with \(x=y\) are the pullback of the copy \(\delta _A\): \(\mathrm {refl}_a\) lies over \(\delta (a)=(a,a)\). A statement about every \((b,e)\) with \(e:a=b\) is fixed at \((a,\mathrm {refl}_a)\) (\(J\); I2). Equalities form a groupoid (R3).

C8 (decided equality). On \(0\) equality is decided vacuously, on \(1\) trivially. If it is decided on \(A\) and \(B\), it is decided on \(A\sqcup B\): by C6 two elements are tags, and comparing them is a case split into \(\mathbf 2\) (E2).

37.1 Numbers and the Peano laws

C9 (names). Kinds are marks: there is a kind of names with \(\mathrm {El}(\ulcorner A\urcorner )=A\), and two names are the same when their kinds are in bijection (E2).

C10 (zero and successor).

\begin{equation} z=\ulcorner 0\urcorner ,\qquad s(c)=\ulcorner \mathrm {El}(c)\sqcup 1\urcorner . \tag{754}\end{equation}
Zero names the kind with no element (C6). The successor adjoins one new element, the tag \(\mathrm {in}_2(\mathrm {id}_1)\): the identity of C5, placed beside what was there.

C11 (for every, and induction). Weakening is reading along a projection \(\pi :P\times X\to P\), which is a counit of \(\Delta \dashv \times \). Its right adjoint is for every:

\begin{equation} \mathrm {Hom}\bigl (\pi ^*Q,\ R\bigr )\cong \mathrm {Hom}\bigl (Q,\ \forall _XR\bigr ). \tag{755}\end{equation}
Call a part \(P\) of the names closed when \(z\in P\) and \(s(P)\subseteq P\), and let \(n\in \mathbb N\) when \(n\in P\) for every closed \(P\). The counit of \(\forall \), read at the identity of the family of closed parts, is
\begin{equation} \mathbb N\subseteq P\qquad \text {for every closed }P . \tag{756}\end{equation}
\(\mathbb N\) is itself closed: \(z\) lies in every closed part, and if \(n\) does, so does \(s(n)\).

C12 (the Peano laws are theorems).

law proof
PA1 \(z\in \mathbb N\) \(\mathbb N\) is closed (C11)
PA2 \(n\in \mathbb N\Rightarrow s(n)\in \mathbb N\) \(\mathbb N\) is closed (C11)
PA3 \(s(n)\neq z\) below
PA4 \(s(m)=s(n)\Rightarrow m=n\) below
PA5 a closed part of \(\mathbb N\) is all of \(\mathbb N\) counit of \(\forall \) (C11)

PA3. If \(s(n)=z\), the kinds \(\mathrm {El}(n)\sqcup 1\) and \(0\) are in bijection (C9), and the element \(\mathrm {in}_2(\mathrm {id}_1)\) would be sent to an element of \(0\). There is none (C6).

PA4. By PA5, every \(\mathrm {El}(n)\) has decided equality (C8: \(0\), and \(X\sqcup 1\) from \(X\)). Let \(f:\mathrm {El}(m)\sqcup 1\to \mathrm {El}(n)\sqcup 1\) be a bijection and \(t=f(\mathrm {in}_2\mathrm {id}_1)\). The swap \(\tau \) of \(t\) and \(\mathrm {in}_2\mathrm {id}_1\) is defined by a case split on decided equality, and \(\tau \circ f\) fixes the new element. By C6 it sends tags \(\mathrm {in}_1\) to tags \(\mathrm {in}_1\), so it restricts to a bijection \(\mathrm {El}(m)\to \mathrm {El}(n)\), and \(m=n\) (C9).

Every number is \(z\) or a successor. The part \(\{z\}\cup s(\mathbb N)\) is closed, so it is \(\mathbb N\) by PA5.

37.2 Recursion and arithmetic

C13 (algebras are pairs). An algebra is a kind \(X\) with a map \(1\sqcup X\to X\). By the left adjunction of \(\Delta \),

\begin{equation} \mathrm {Hom}(1\sqcup X,\,X)\cong \mathrm {Hom}(1,X)\times \mathrm {Hom}(X,X), \tag{757}\end{equation}
so an algebra is a pair: an element \(a\in X\) (C5) and a map \(g:X\to X\). \(\mathbb N\) is the algebra \((z,s)\).

C14 (\(\mathbb N\) is the initial algebra). For every algebra \((X,a,g)\) there is exactly one \(h\) with

\begin{equation} h(z)=a,\qquad h(s(n))=g\bigl (h(n)\bigr ). \tag{758}\end{equation}
Existence. Let \(R_0\subseteq \mathbb N\times X\) be the least relation containing \((z,a)\) and closed under \((n,x)\mapsto (s(n),g(x))\) (C11). The part of \(\mathbb N\) where \(R_0\) has exactly one value is closed: at \(z\) a second value could be removed without breaking closure, by PA3; at \(s(n)\) likewise, by PA4. By PA5, \(R_0\) is a map. Uniqueness. If \(h'\) satisfies the same equations, \(\{n\mid h(n)=h'(n)\}\) is closed, so \(h=h'\) by PA5 and C4. For \((X,a,g)=(\mathbb N,z,s)\) the unique map is \(\mathrm {id}\): the initial algebra reads itself at the identity.

C15 (addition and multiplication). By C14 there are unique maps with

\begin{equation} m+z=m,\quad m+s(n)=s(m+n);\qquad m\cdot z=z,\quad m\cdot s(n)=m\cdot n+m . \tag{759}\end{equation}
These are the remaining Peano laws, now as the equations that fix the two maps. Read on kinds, by PA5 on \(n\) and the regrouping of C16,
\begin{equation} \mathrm {El}(m+n)\cong \mathrm {El}(m)\sqcup \mathrm {El}(n),\qquad \mathrm {El}(m\cdot n)\cong \mathrm {El}(m)\times \mathrm {El}(n): \tag{760}\end{equation}
the step for \(+\) is \((\mathrm {El}(m)\sqcup \mathrm {El}(n))\sqcup 1\cong \mathrm {El}(m)\sqcup (\mathrm {El}(n)\sqcup 1)\), and for \(\cdot \) it is distributivity (G4). So addition is the sum and multiplication the product, read on sizes (E6), and every law of arithmetic is a bijection of kinds (E7). The order is \(m\leq n\) when \(n=m+d\) for some \(d\) (E5, E7).

37.3 Regrouping, rows and joining

C16 (regrouping, from the triple diagonal). Naturally in \(A\),

\begin{equation} \mathrm {Hom}\bigl ((B\sqcup C)\sqcup D,A\bigr )\cong \mathrm {Hom}(B,A)\times \mathrm {Hom}(C,A)\times \mathrm {Hom}(D,A)\cong \mathrm {Hom}\bigl (B\sqcup (C\sqcup D),A\bigr ), \tag{761}\end{equation}
maps out of a sum to \(\Delta _3(A)\) in both cases. By R0, a natural bijection of maps out of two kinds comes from an isomorphism of the kinds read at the identity: \((B\sqcup C)\sqcup D\cong B\sqcup (C\sqcup D)\) and, since \(\mathrm {Hom}(0,A)\) has one element, \(0\sqcup B\cong B\cong B\sqcup 0\). Dually for \(\times \) and \(1\). No induction is used.

C17 (rows). A row of length \(n\) in \(A\) is a map \(p:\mathrm {El}(n)\to A\). The empty row is the unique map out of \(\mathrm {El}(z)=0\). Since \(\mathrm {El}(s(n))=\mathrm {El}(n)\sqcup 1\), a row of length \(s(n)\) is a row of length \(n\) and one element (C13): rows are built one element at a time, by the same adjunction that builds the numbers.

C18 (joining is the sum adjunction). For rows \(p:\mathrm {El}(m)\to A\) and \(q:\mathrm {El}(n)\to A\),

\begin{equation} \mathrm {Hom}\bigl (\mathrm {El}(m)\sqcup \mathrm {El}(n),A\bigr )\cong \mathrm {Hom}(\mathrm {El}(m),A)\times \mathrm {Hom}(\mathrm {El}(n),A) \tag{762}\end{equation}
gives exactly one \(p\cdot q\) with \((p\cdot q)\circ \mathrm {in}_1=p\) and \((p\cdot q)\circ \mathrm {in}_2=q\). Through \(\mathrm {El}(m)\sqcup \mathrm {El}(n)\cong \mathrm {El}(m+n)\) (C15) it is a row of length \(m+n\): \(p\) followed by \(q\). Joining is the inverse of the bijection of \(\sqcup \dashv \Delta \).

C19 (associativity and units of joining). \((p\cdot q)\cdot t\) and \(p\cdot (q\cdot t)\) restrict to \(p,q,t\) on the three summands; under the regrouping \(\alpha \) of C16 they have the same restrictions, so by the uniqueness in C18

\begin{equation} (p\cdot q)\cdot t=\bigl (p\cdot (q\cdot t)\bigr )\circ \alpha . \tag{763}\end{equation}
\(()\cdot q=q=q\cdot ()\) under \(0\sqcup \mathrm {El}(n)\cong \mathrm {El}(n)\cong \mathrm {El}(n)\sqcup 0\). On lengths these are \((m+n)+k=m+(n+k)\) and \(0+n=n=n+0\).

C20 (rows of marks). For a graph with marks \(M\) and ends \(s,t:M\to \mathrm {Pl}\) (I4), a row of marks is a row \(p:\mathrm {El}(n)\to M\) with \(t(p(i))=s(p(i+1))\): an equality, so a pullback along the diagonal of \(\mathrm {Pl}\) (C7). Rows of marks are joined by C18 when the seam meets, again a pullback along \(\Delta \), with C19 for the laws. By C14 there is exactly one reading \(\llbracket \cdot \rrbracket \) with \(\llbracket ()\rrbracket =\mathrm {id}\) and \(\llbracket (m,p)\rrbracket =\llbracket p\rrbracket \circ \llbracket m\rrbracket \), and by uniqueness with C4, \(\llbracket p\cdot q\rrbracket =\llbracket q\rrbracket \circ \llbracket p\rrbracket \): joining rows is reading after reading.

C21 (every category). Rows of marks read the same are the same (E3). Places, rows up to this sameness, joining and empty rows form a category, whose laws hold because they hold for readings (C4). On all maps it is the category of kinds; every category is such a quotient; the groupoid of C7 is the case where every mark can be read back.

37.4 Everything reduced to the source

notion

what it is

reading of the source

\(0\), \(1\), \(\sqcup \), \(\times \)

adjoints of \(\Delta _0\), \(\Delta \)

two places of \(a=a\) (C1)

maps

right adjoint of \(-\times B\)

placing and reading (C2)

composition, its laws

read, read, place

triangles \(\beta \), \(\eta \) (C3, C4)

element

map from \(1\); \(1=\{\mathrm {id}_1\}\)

the identity as an element (C5)

elements of a sum

its tags; \(0\) has none

triangle \(\eta \) of \(\sqcup \dashv \Delta \) (C6)

equality, \(J\)

pullback of the copy

\(\mathrm {refl}\) over \(\delta (a)\) (C7)

zero, successor

\(\ulcorner 0\urcorner \); adjoin \(\mathrm {id}_1\)

C10

for every, induction

right adjoint of reading along \(\pi \); its counit

counit of \(\Delta \dashv \times \) (C11)

PA1–PA5

theorems

C6, C8, C11 (C12)

algebra

pair \((a,g)\)

\(\sqcup \dashv \Delta \) (C13)

initial algebra, recursion

unique map out of \(\mathbb N\)

PA3–PA5 (C14)

\(+\), \(\cdot \), order

unique solutions; \(\sqcup \), \(\times \) on sizes

C14, C16 (C15)

regrouping

triple diagonal

R0 (C16)

rows, joining

maps out of \(\mathrm {El}(n)\); inverse of \(\sqcup \dashv \Delta \)

C17, C18

laws of joining

uniqueness

C16, C18 (C19)

rows of marks, categories

seams pulled back along \(\Delta \); sameness

C20, C21