Mar 2, 2026
A group is a set \(G\) with:
such that
A group is a set \(G\) with:
such that:
This is an equivalent presentation of groups, but as an “algebraic theory”.
A lattice is a poset \((L, \leq)\) such that:
Lower bounds and upper bounds are unique.
We can write \(x \wedge y\) and \(x \vee y\) for the meet and join of \(x\) and \(y\).
A lattice is a set \(L\) with:
such that
\(\forall x, y, z : L,\, (x \wedge y) \wedge z = x \wedge (y \wedge z)\);
\(\forall x, y, z : L,\, (x \vee y) \vee z = x \vee (y \vee z)\); and
\(\forall x, y : L,\, x \wedge y = y \wedge x\);
\(\forall x, y : L,\, x \vee y = y \vee x\); and
\(\forall x, y : L,\, x \wedge x = x\); and
\(\forall x, y : L,\, x \vee x = x\).
These presentations are equivalent because \(a \leq b \iff a \wedge b = a\) and \(a \vee b = b\).
A torsion group is a group \(G\) such that every element has finite order:
This is not an algebraic theory.
We could add \(\mathrm{ord} : G \to \mathbb{N}\) such that:
Algebraic operations can be turned into typing rules.
For example, monoids can be written in two different ways:
A (left) monoid action of a monoid \(M\) on a set \(A\) is:
such that
The exception monad for a set of errors \(E\): \[T(X)=E+X\]
as an algebraic theory with operations:
for each error \(e:E\), and no equations.
The state monad for a set of states \(S\):
\[T(X)=(S\times X)^S\]
The global state monad has \(S = V^L\), for countable values \(V\) and finite locations \(L\):
\[T(X) = (V^L\times X)^{V^L}\]
as an algebraic theory with operations:
satisfying seven equations:
For \(L=1\) and \(V=2\), the operations are:
satisfying the equations:
\[ \begin{align*} \text{(LL)} \quad & \mathrm{lk}(\mathrm{lk}(a,b),\, \mathrm{lk}(c,d)) = \mathrm{lk}(a,\, d) \\ \text{(UU)} \quad & \mathrm{upd}_v(\mathrm{upd}_w(x)) = \mathrm{upd}_w(x) \\ \text{(UL)} \quad & \mathrm{upd}_v(\mathrm{lk}(x_0, x_1)) = \mathrm{upd}_v(x_v) \\ \text{(LU)} \quad & \mathrm{lk}(\mathrm{upd}_0(x),\, \mathrm{upd}_1(x)) = x \end{align*} \]
The continuation monad for a set of responses \(R\) is given by the adjunction
\[T_R(X)=R^{R^X}\]
What operations does this monad have?
Control operators allow programs to jump
and produce control effects:
C-NAT: \[\Gamma, f : \sigma \to \tau \vdash f(\mathcal{C}_\sigma(M)) = \mathcal{C}_\tau(\lambda \kappa : \tau \to 0.\, M(\lambda x : \sigma.\, \kappa(f\, x)))\]
C-APP: \[\Gamma \vdash \mathcal{C}_\sigma(\lambda \kappa : \sigma \to 0.\, \kappa\, M) = M\]
A-ABS: \[\Gamma \vdash V \mathcal{A}_\sigma(M)=_\mathcal{C}\mathcal{A}_\tau(M)\]
A-ID: \[\mathcal{A}_0(M)=\mathcal{C}M\]
\[\mathsf{colam}(x.M[]) = \mathsf{inr}(M[])\]
\[\mathsf{colam}\bigl(x.\textsf{let }y=\mathsf{coapp}(\mathsf{inr}(M[]),x)\textsf{ in }N[y]\bigr)=\textsf{let }y=M[]\textsf{ in }N[y]\]
\[\mathsf{colam}\bigl(x.\textsf{let }y=\mathsf{coapp}(\mathsf{inl}(M[]),x)\textsf{ in }N[y]\bigr)=M[]\]
\[ \mathsf{case}\bigl(\mathsf{colam}(x.V[x])\bigr)\mathsf{of} \begin{cases}\mathsf{inl}(a)\rightarrow M[a]\\\mathsf{inr}(b)\rightarrow N[b]\end{cases} \\\\ \;=\; \\\\ \mathsf{case}\bigl(\mathsf{colam}(x.N\bigl[V[x]\bigr])\bigr)\textsf{of} \begin{cases}\mathsf{inl}(a)\rightarrow M[a]\\\mathsf{inr}(b)\rightarrow b\end{cases} \]
A \(V\)-substitution algebra is an object \(X\) with:
such that the following axioms hold:
\[M[N/x]=M,\text{ if }x\notin\operatorname{fv}(M)\]
\[x[N/x]=N\]
\[M[y/x][N/y]=M[N/x]\]
where \(\varphi\) is the composition:
\[ (X_1^{V_1}\times X_2)^{V_2}\times X_3 \xrightarrow{\operatorname{id}\times\Delta_{X_3}} (X_1^{V_1}\times X_1)^{V_2}\times X_3\times X_3 \] \[ \xrightarrow{\operatorname{id}\times\pi_1^\flat\times\operatorname{id}} (X_1^{V_1}\times X_2)^{V_2}\times X_3^{V_1}\times X_3 \xrightarrow{\cong} (X_1^{V_2}\times X_3)^{V_1}\times(X_2^{V_2}\times X_3) \]
\[ M[N/x][L/y]=M[L/y]\bigl[N[L/y]/x\bigr] \]
Typing rules:
\[\begin{prooftree} \AxiomC{$\Gamma\vdash_v V:\mathbb{V}$} \RightLabel{(\textup{var})} \UnaryInfC{$\Gamma\vdash_c\operatorname{\mathsf{var}}_\tau(V):\tau$} \end{prooftree}\] \[\begin{prooftree} \AxiomC{$\Gamma,a:\mathbb{V}\vdash_c M:\tau$} \AxiomC{$\Gamma\vdash_c N:\tau$} \RightLabel{(\textup{sub})} \BinaryInfC{$\Gamma\vdash_c\operatorname{\mathsf{sub}}(a.M,N):\tau$} \end{prooftree}\]Equations:
\[ \begin{align*} \operatorname{\mathsf{sub}}(a.M[],N[]) &= M[] & (\textup{weakening}) \\ \operatorname{\mathsf{sub}}(a.\operatorname{\mathsf{var}}_\tau(a), N) &= N & (\textup{substitution}) \\ \operatorname{\mathsf{sub}}(a.M[a], \operatorname{\mathsf{var}}(b)) &= M[b] & (\textup{extensionality}) \\ \operatorname{\mathsf{sub}}(a.\operatorname{\mathsf{sub}}(b.L[a,b],M[a]),N[]) &= \operatorname{\mathsf{sub}}(b.\operatorname{\mathsf{sub}}(a.L[a,b],N[]), \\ & \qquad\qquad \operatorname{\mathsf{sub}}(a.M[a],N[])) & (\textup{associativity}) \end{align*} \]
Algebraicity equations:
\(\textsf{let }x=\operatorname{\mathsf{var}}(a)\textsf{ in }P[x]=\operatorname{\mathsf{var}}(a)\);
\(\textsf{let }x=\operatorname{\mathsf{sub}}(a,M[a],N[])\textsf{ in }P[x] = \\ \qquad \operatorname{\mathsf{sub}}(a.\textsf{let }x=M[a]\textsf{ in }P[x],\textsf{let }x=N[]\textsf{ in }P[x])\).
A \((V,P)\)-inception algebra is an object \(X\) with:
such that the following axioms hold:
where \(\vartheta\) is the composition:
\[ (X_1^{V_1}\times X_2^{P_1})^{V_2}\times X_3^{P_2} \xrightarrow{\operatorname{id}\times\Delta_{X_3^{P^2}}} (X_1^{V_1}\times X_2^{P_1})^{V_1}\times X_3^{P_2}\times X_3^{P_2} \] \[ \xrightarrow{\operatorname{id}\times\pi_1^\flat\times\pi_1^\flat} {(X_1^{V_1}\times X_2^{P_1})^{V_2}\times X_1^{P_2\times V_1}\times X_3^{P_2\times P_1}} \xrightarrow{\cong} (X_1^{V_2}\times X_3^{P_2})^{V_1}\times(X_2^{V_2}\times X_3^{P_2})^{P_1} \]
Typing rules:
\[\begin{prooftree} \AxiomC{$\Gamma\vdash_v V:\mathbb{V}$} \AxiomC{$\Gamma\vdash_v P:\mathbb{P}$} \RightLabel{(\textup{rec})} \BinaryInfC{$\Gamma\vdash_c\operatorname{\mathsf{rec}}_\tau(V,P):\tau$} \end{prooftree}\] \[\begin{prooftree} \AxiomC{$\Gamma,a:\mathbb{V}\vdash_c M:\tau$} \AxiomC{$\Gamma,x:\mathbb{P}\vdash_c N:\tau$} \RightLabel{(\textup{inc})} \BinaryInfC{$\Gamma\vdash_c\operatorname{\mathsf{inc}}(a.M,x.N):\tau$} \end{prooftree}\]Equations:
\[ \begin{align*} \operatorname{\mathsf{inc}}(a.M[],x.N[]) &= M & (\textup{weakening}) \\ \operatorname{\mathsf{inc}}(a.\operatorname{\mathsf{rec}}_\tau(a,P[]),x.N[x]) &= N[P] & (\textup{substitution}) \\ \operatorname{\mathsf{inc}}(a.M[a],x.\operatorname{\mathsf{rec}}(k,x)) &= M[k] & (\textup{extensionality}) \\ \operatorname{\mathsf{inc}}(a.\operatorname{\mathsf{inc}}(b.P[a,b],x.K[a,x]),y.L[y]) &= \operatorname{\mathsf{inc}}(b.\operatorname{\mathsf{inc}}(a.P[a,b],y.L[y]), \\ & \qquad\qquad x.\operatorname{\mathsf{inc}}(a.K[a,x],y.L[y])) & (\textup{associativity}) \end{align*} \]
Algebraicity equations:
\(\textsf{let }z=\operatorname{\mathsf{rec}}(a,x)\textsf{ in }P[z]=\operatorname{\mathsf{rec}}(a,x)\);
\(\textsf{let }z=\operatorname{\mathsf{inc}}(a,M[a],x.N[x])\textsf{ in }P[z] = \\ \qquad \operatorname{\mathsf{inc}}( a.\textsf{let }z=M[a]\textsf{ in }P[z], x.\textsf{let }z=N[x]\textsf{ in }P[z] )\).
Thank you!