292 Automata and Turing Machines from One Datum

An automaton and a Turing machine are the same structure with different monoids. Both consist of a state object, an action of a free monoid on it, and an observation arrow; the automaton takes \(M=\Sigma ^{\ast }\) and the machine takes \(M=\mathbb {N}\), which is \(\Sigma ^{\ast }\) for a one-letter alphabet. The monoid is itself a least fixed point, so nothing beyond \(\mu X\) and the arrows already available is required.

The common shape

Both are given by three arrows,

\begin{equation} I\xrightarrow {\ x_0\ }X, \qquad X\xrightarrow {\ \text {move}\ }X, \qquad X\xrightarrow {\ \text {obs}\ }O , \tag{19094}\end{equation}
instantiated as





state move observation




Automaton \(Q\) \(\delta :Q\times \Sigma \to Q\) \(\lambda :Q\to O\)
Turing machine \(\operatorname {Conf}\) \(\operatorname {step}:\operatorname {Conf}\to \operatorname {Conf}\) \(\operatorname {halt}:\operatorname {Conf}\to 1+1\)




Both are monoid actions

Iterating the move gives, in the first case,

\begin{equation} \delta ^{\ast }:Q\times \Sigma ^{\ast }\to Q, \qquad \delta ^{\ast }(q,\varepsilon )=q, \qquad \delta ^{\ast }(q,uv)=\delta ^{\ast }\bigl (\delta ^{\ast }(q,u),v\bigr ), \tag{19095}\end{equation}
and in the second,
\begin{equation} \operatorname {run}:\operatorname {Conf}\times \mathbb {N}\to \operatorname {Conf}, \qquad \operatorname {run}(c,0)=c, \qquad \operatorname {run}(c,m+n)=\operatorname {run}\bigl (\operatorname {run}(c,m),n\bigr ). \tag{19096}\end{equation}
Each satisfies the two action equations
\begin{equation} \alpha \circ (\operatorname {id}_X\times \eta )=\operatorname {id}_X, \qquad \alpha \circ (\alpha \times \operatorname {id}_M) =\alpha \circ (\operatorname {id}_X\times \mu ), \tag{19097}\end{equation}
with \((\eta ,\mu )\) the unit and multiplication of \(M\). The two presentations differ only in \(M\):
\begin{equation} M=\Sigma ^{\ast }\ \Longrightarrow \ \text {automaton}, \qquad M=\mathbb {N}\ \Longrightarrow \ \text {Turing machine}. \tag{19098}\end{equation}
The two monoids are one construction

The free monoid is a least fixed point,

\begin{equation} \Sigma ^{\ast }\ \cong \ \mu X.\bigl (1+\Sigma \times X\bigr ), \tag{19099}\end{equation}
the same construction used for the cone in Subsection 271.6. Taking \(\Sigma =1\),
\begin{equation} \mu X.(1+X)\ \cong \ \mathbb {N}, \tag{19100}\end{equation}
so
\begin{equation} \text {Turing machine}=\text {automaton with }|\Sigma |=1 : \tag{19101}\end{equation}
there is no input letter to read, only a step to take, and the alphabet collapses to the tick of the clock.
Where the monoid comes from

The idempotent gives a two-element monoid \(\{\operatorname {id},\Pi \}\) under composition, since \(\Pi \circ \Pi =\Pi \), and the involution gives \(\{\operatorname {id},\vartheta \}\cong \mathbb {Z}_2\). Taking the free monoid on the single generator \(\vartheta \) rather than imposing \(\vartheta ^{2}=\operatorname {id}\) yields \(\{\ast \}^{\ast }=\mathbb {N}\), and hence the clock of a Turing machine. The tape is the same construction applied twice,

\begin{equation} C=\Gamma ^{\ast }\sqcup \Gamma ^{\ast }, \qquad \Gamma ^{\ast }=\mu X.(1+\Gamma \times X), \tag{19102}\end{equation}
one copy on each side of the head.
Observation without exponentials

The behaviour map is usually written \(\operatorname {behavior}:\operatorname {Conf}\to (1+1)^{\mathbb {N}}\), which requires an exponential and is therefore unavailable in System \(\mathcal {L}\). It is replaced by the family

\begin{equation} \operatorname {obs}_n:=\operatorname {halt}\circ \operatorname {run}(-,n) :\operatorname {Conf}\to 1+1 , \tag{19103}\end{equation}
and the coalgebraic law \(\operatorname {behavior}\circ \operatorname {step} =\operatorname {shift}\circ \operatorname {behavior}\) becomes the family of equations
\begin{equation} \operatorname {obs}_n\circ \operatorname {step}=\operatorname {obs}_{n+1}, \tag{19104}\end{equation}
each of which is atomic in \(\mathcal {L}\).
Halting is not a statement of \(\mathcal {L}\)

The accepted language

\begin{equation} L_{\mathcal T} =\bigl \{w\ :\ \exists n,\ \operatorname {run}(\operatorname {Conf}_0(w),n)\in \{q_{\mathrm {acc}}\}\times C\bigr \} \tag{19105}\end{equation}
quantifies existentially over \(n\). Supplying a witness \(n\) turns the membership into the equation \(\operatorname {obs}_n\circ \operatorname {Conf}_0=\operatorname {inl}\), which is expressible; the unwitnessed claim is not. Halting is thus unstateable in \(\mathcal {L}\) for the same reason as \(\operatorname {Prov}\) in Subsection 241.2: both are \(\Sigma _1\), and \(\mathcal {L}\) has no quantifiers.
Morphisms and behavioural equivalence

A morphism of machines is an arrow \(h:X\to X'\) commuting with the data,

\begin{equation} h\circ x_0=x_0', \qquad h\circ \text {move}=\text {move}'\circ h, \qquad \operatorname {obs}'\circ h=\operatorname {obs} , \tag{19106}\end{equation}
which for the automaton is \(h\circ \delta =\delta '\circ (h\times \operatorname {id}_\Sigma )\) and for the machine is the corresponding condition on \(\delta _Q\), \(\delta _\Gamma \), \(\delta _D\) together with preservation of \(q_0,q_{\mathrm {acc}},q_{\mathrm {rej}}\). In either case
\begin{equation} \operatorname {obs}_n=\operatorname {obs}'_n\circ h \quad \text {for every }n, \tag{19107}\end{equation}
so a morphism forces equality of the observation families — the element-free form of \(L_{\mathcal T}=L_{\mathcal T'}\).
Summary
\begin{equation} \begin {aligned} \text {Machine} &=\bigl (X,\ \alpha :X\times M\to X,\ x_0:I\to X,\ \operatorname {obs}\bigr )\\ M&=\mu X.(1+\Sigma \times X)\\ |\Sigma |\ge 1 &\ \Longrightarrow \ \text {automaton}\\ |\Sigma |=1 &\ \Longrightarrow \ \text {Turing machine, } M=\mathbb {N} \end {aligned} \tag{19108}\end{equation}

Remark 292.1. The usual presentations differ in appearance because one is written algebraically, as an action of the word monoid, and the other coalgebraically, as a transition system observed over time. The two are the same datum: an action of a free monoid together with an observation, the algebraic reading taking \(M\) as input and the coalgebraic reading taking \(M\) as duration. Both fit in System \(\mathcal {L}\) without exponentials, and in both the only thing that fails to be expressible is the existential claim — acceptance for the machine, provability for the formal system — which is the same omission in both cases.

292.1 Monoids Are One-Object Categories

A monoid is not a set carrying an operation; it is a category with a single object, in which the operation is composition and the unit is the identity arrow. Once this identification is made, the free monoid, the adjunction, and the monad structure all follow from composition alone, and the condition \(\Pi \circ \Pi =\Pi \) used throughout this work is seen to be a statement in exactly this language.

The structure, arrow by arrow

A monoid is a triple

\begin{equation} \mathcal {M}=\bigl (M,\ 1\xrightarrow {\ e\ }M,\ M\times M\xrightarrow {\ \mu \ }M\bigr ) \tag{19109}\end{equation}
subject to three equations between arrows,
\begin{equation} \mu \circ (e\times \operatorname {id}_M)=\operatorname {id}_M, \qquad \mu \circ (\operatorname {id}_M\times e)=\operatorname {id}_M, \tag{19110}\end{equation}
\begin{equation} \mu \circ (\mu \times \operatorname {id}_M) =\mu \circ (\operatorname {id}_M\times \mu ), \tag{19111}\end{equation}
which in elementwise notation read \(e\cdot a=a\), \(a\cdot e=a\) and \((a\cdot b)\cdot c=a\cdot (b\cdot c)\). Only the arrow form is used below.
The free monoid

Set \(M^0=1\) and \(M^{n+1}=M^n\times M\), and let

\begin{equation} M^\ast =\coprod _{n\in \mathbb {N}}M^n, \qquad \eta :1\to M^\ast , \qquad \mu ^\ast :M^\ast \times M^\ast \to M^\ast \tag{19112}\end{equation}
be the empty word and concatenation. Then \((M^\ast ,\varepsilon ,\|)\) satisfies the same three equations,
\begin{equation} \varepsilon \|u=u, \qquad u\|\varepsilon =u, \qquad (u\|v)\|w=u\|(v\|w). \tag{19113}\end{equation}
The evaluation map is defined by recursion,
\begin{equation} \operatorname {fold}_{\mathcal {M}}(\varepsilon )=e, \qquad \operatorname {fold}_{\mathcal {M}}(ua) =\mu \bigl (\operatorname {fold}_{\mathcal {M}}(u),a\bigr ), \tag{19114}\end{equation}
and is a homomorphism,
\begin{equation} \operatorname {fold}_{\mathcal {M}}\circ \eta =e, \qquad \operatorname {fold}_{\mathcal {M}}\circ \mu ^\ast =\mu \circ \bigl (\operatorname {fold}_{\mathcal {M}} \times \operatorname {fold}_{\mathcal {M}}\bigr ), \tag{19115}\end{equation}
so \(\operatorname {fold}_{\mathcal {M}}\in \operatorname {Hom}_{\mathbf {Mon}}(M^\ast ,M)\).
Adjunction and monad

With \(U:\mathbf {Mon}\to \mathbf {Set}\) the forgetful functor and \(F(X)=X^\ast \),

\begin{equation} \operatorname {Hom}_{\mathbf {Mon}}(X^\ast ,M) \ \simeq \ \operatorname {Hom}_{\mathbf {Set}}\bigl (X,U(M)\bigr ), \qquad F\dashv U, \tag{19116}\end{equation}
and the induced monad is \(T(X)=X^\ast \), i.e.
\begin{equation} T(X)=1+X+X^2+\cdots , \qquad \eta _X:X\to T(X), \qquad \mu _X:T(T(X))\to T(X), \tag{19117}\end{equation}
with \(\mu _X[u_1,\dots ,u_n]=u_1\|\cdots \|u_n\). Its laws
\begin{equation} \mu _X\circ T(\mu _X)=\mu _X\circ \mu _{T(X)}, \qquad \mu _X\circ \eta _{T(X)}=\operatorname {id}_{T(X)} =\mu _X\circ T(\eta _X) \tag{19118}\end{equation}
are associativity and unitality one level up, and
\begin{equation} \mathbf {Mon}\ \simeq \ \operatorname {Alg}\bigl (X\mapsto X^\ast \bigr ). \tag{19119}\end{equation}
The identification

Take a category \(\mathcal {C}\) with

\begin{equation} \operatorname {Ob}(\mathcal {C})=\{\ast \}, \qquad \operatorname {Hom}_{\mathcal {C}}(\ast ,\ast )=M, \qquad \operatorname {id}_\ast =e, \qquad \circ =\mu . \tag{19120}\end{equation}
Composition
\begin{equation} \operatorname {Hom}_{\mathcal {C}}(\ast ,\ast ) \times \operatorname {Hom}_{\mathcal {C}}(\ast ,\ast ) \longrightarrow \operatorname {Hom}_{\mathcal {C}}(\ast ,\ast ), \qquad (g,f)\mapsto g\circ f, \tag{19121}\end{equation}
is total because there is only one object, its associativity is the monoid associativity, and the identity arrow is the unit. Hence
\begin{equation} (M,e,\mu )\ \cong \ \text {a category with one object}, \tag{19122}\end{equation}
and conversely every one-object category is a monoid. The three monoid equations are not additional axioms but the category axioms specialised to a single object.
Consequence for the framework

The conditions used throughout are statements in precisely this language. The idempotent

\begin{equation} \Pi \circ \Pi =\Pi \tag{19123}\end{equation}
is an equation in \(\operatorname {Hom}(A,A)\), which is a monoid under composition; the involution \(\vartheta \circ \vartheta =\operatorname {id}\) is another; and the identity \(A=A\) supplies the unit \(e\) of that monoid. Nothing in
\begin{equation} \Pi \circ \Pi =\Pi , \qquad \vartheta \circ \vartheta =\operatorname {id}, \qquad \Pi =B^\dagger \circ B \tag{19124}\end{equation}
mentions elements of \(A\); all three live in the endomorphism monoid, i.e. in the one-object category \(\operatorname {End}(A)\). This is why Subsection 271 could recover objects from identities, and why System \(\mathcal {L}\) can dispense with elements while retaining every construction used here: the arithmetic of the framework was always monoid arithmetic, and monoid arithmetic is composition.

“This arithmetic by 0 and 1 contains the mystery of creation.”
— G. W. Leibniz

“One is sufficient to derive all numbers from nothing.”
— G. W. Leibniz, Explication de l’Arithmétique Binaire, Mémoires de l’Académie Royale des Sciences (1703) [256]

292.2 Primitive Operators: An Adjoint Notation for the Calculus

Differentiation and integration are not two separate operations but an adjoint pair \(\blacktriangleleft \dashv \blacktriangleright \), the analytic realisation of the partition \(O\sqcup U\): one operator descends, the other ascends, and their composition returns the identity up to the constant \(C\) that measures the partition offset.

Primitive operators

We write the two primitive operators as

\begin{equation} \blacktriangleleft f \quad \text {(differentiation)}, \qquad \blacktriangleright f \quad \text {(integration)}. \tag{19125}\end{equation}
Axioms for \(\blacktriangleleft \)
\begin{align} \blacktriangleleft (c) &= 0, \tag{19126}\\ \blacktriangleleft (x) &= 1, \tag{19127}\\ \blacktriangleleft (f+g) &= \blacktriangleleft f + \blacktriangleleft g \qquad \text {(additivity)}, \tag{19128}\\ \blacktriangleleft (fg) &= (\blacktriangleleft f)\,g + f\,(\blacktriangleleft g) \qquad \text {(Leibniz rule)}, \tag{19129}\\ \blacktriangleleft (x^n) &= n\,x^{\,n-1} \qquad \text {(power rule)}. \tag{19130}\end{align}
Axioms for \(\blacktriangleright \)
\begin{align} \blacktriangleright (f+g) &= \blacktriangleright f + \blacktriangleright g \qquad \text {(additivity)}, \tag{19131}\\ \blacktriangleright (x^n) &= \frac {x^{\,n+1}}{n+1} \qquad (n\neq -1), \tag{19132}\\ \blacktriangleright (0) &= C \qquad \text {(partition offset)}. \tag{19133}\end{align}
Inverse laws
\begin{equation} \blacktriangleleft (\blacktriangleright f) = f, \qquad \blacktriangleright (\blacktriangleleft f) = f + C. \tag{19134}\end{equation}
The asymmetry is exactly the partition asymmetry: descending (\(\blacktriangleleft \)) destroys the constant sector; ascending (\(\blacktriangleright \)) cannot recover which constant was destroyed, and returns it only up to \(C\).
Fundamental relation
\begin{equation} F = \blacktriangleright f \;\iff \; \blacktriangleleft F = f. \tag{19135}\end{equation}
This is the fundamental theorem of the calculus in operator form.
Higher operators
\begin{equation} \blacktriangleleft ^{\,n} f = \underbrace {\blacktriangleleft \bigl (\cdots (\blacktriangleleft }_{n\text { times}} f)\cdots \bigr ), \qquad \blacktriangleright ^{\,n} f = \underbrace {\blacktriangleright \bigl (\cdots (\blacktriangleright }_{n\text { times}} f)\cdots \bigr ). \tag{19136}\end{equation}
Operator identities
\begin{equation} \blacktriangleleft \circ \blacktriangleright = \operatorname {id}, \qquad \blacktriangleright \circ \blacktriangleleft = \operatorname {id} + C. \tag{19137}\end{equation}
\begin{equation} \boxed {\blacktriangleleft \;\dashv \; \blacktriangleright .} \tag{19138}\end{equation}
Interpretation

The adjunction \(\blacktriangleleft \dashv \blacktriangleright \) is the analytic form of the partition \(T=O\sqcup U\):

\begin{equation} \ker \blacktriangleleft = \{c\} = U\text {-sector}, \qquad \operatorname {coker}\blacktriangleright = C. \tag{19139}\end{equation}
The constant of integration is not a technical annoyance. It is the partition offset \(dO=-dU\) made explicit: differentiation is \(O\)-directed and forgets \(U\); integration reverses the direction but must carry \(U\) back as an undetermined parameter.