---
title: Free Cornering with Protocol Choice
url: https://www.emergentmind.com/topics/free-cornering-with-protocol-choice
type: topic
---

# Free Cornering with Protocol Choice

Free cornering with protocol choice is an extension of the free cornering of a monoidal category in which interaction protocols may branch. In the underlying free-cornering construction, objects of a strict monoidal category represent resources, morphisms represent processes, horizontal composition tensors independent processes in parallel, and vertical composition synchronizes interactions through “corner” cells that pass resources between processes. Protocol choice enriches the vertical exchange language with two branching constructors, $U+W$ and $U\times W$, corresponding respectively to left-controlled and right-controlled choice. The resulting structure is presented as a strict single-object monoidal double category, admits an operational semantics by term rewriting, and satisfies a coherence theorem identifying closed vertical cells with ordinary morphisms of the base category [2305.16899], [2508.00633], building on the original free-cornering framework used to study optics and comb diagrams [2205.00842].

## 1. Free cornering as a double-categorical process theory

The free cornering of a strict monoidal category $A$ is a single-object double category whose horizontal edge-monoid is $(\mathrm{Ob}\,A,\otimes,I)$ and whose vertical edges are generated by exchange data [2508.00633]. In the earlier formulation for a strict monoidal category $C$, horizontal edges are the objects of $C$, while vertical edges are polarized objects
\[
\mathrm{Corner}(C)_V=\bigl(C_0\times\{\circ,\bullet\}\bigr)^*,
\]
that is, the free strict monoid on symbols $A^\circ$ and $A^\bullet$ [2205.00842]. These polarized generators encode directed resource passage along the vertical boundary.

The generating 2-cells consist of ordinary morphisms of the base category, treated as cells with trivial exchange boundaries, together with corner cells that expose or absorb one resource token. In the notation of the rewriting presentation, these are
\[
A⌜,\;A⌝,\;A⊏,\;A⊐,
\]
while in the optics-oriented presentation they appear as corner cells satisfying the usual yanking identities [2508.00633], [2205.00842]. These yanking equations are the key coherence axioms ensuring that corner cells behave as companion–conjoint structure for resource exchange.

This construction is motivated as a model of interacting processes. A 2-cell with horizontal boundary $A\Rightarrow B$ and vertical boundaries given by exchanges $U$ and $W$ describes a process transforming $A$ to $B$ while interacting along its left and right boundaries according to those protocols [2508.00633]. The graphical significance of this viewpoint was already visible before protocol choice was added: horizontal cells with no top or bottom wires recover optics, and more general horizontal cells with alternating polarized boundaries represent comb diagrams [2205.00842].

## 2. Adding branching communication protocols

Protocol choice extends the vertical exchange language by adjoining two binary constructors. In the 2025 rewriting presentation, the exchange monoid is generated by
- $I$,
- $A^\circ$ and $A^\bullet$ for each $A\in \mathrm{Ob}\,A$,
- sequential composition $U\cdot V$,
- internal choice $U+V$,
- external choice $U\times V$,

subject only to associativity and unit for $\cdot$ [2508.00633]. The intended meaning is asymmetric: $U+W$ is the protocol in which the left participant first chooses whether to do $U$ or $W$, whereas $U\times W$ is the protocol in which the right participant first chooses whether to do $U$ or $W$ [2305.16899]. A common misconception is to treat $+$ and $\times$ as formally interchangeable branching operators; the construction does not do so, because the polarity of the chooser is part of the protocol semantics.

In the 2023 construction, the vertical monoid is enlarged from $\#_1(A)$ to
\[
\#_1(A)_\oplus=\langle \#_1(A),-\times-,-+-\rangle,
\]
and the horizontal edge-monoid remains unchanged [2305.16899]. The new double category retains the same resource theory horizontally and changes only the interaction language vertically. This distinction is structurally important: protocol choice is not a coproduct on ordinary morphisms of $A$, but an extension of the exchange boundary calculus.

The new generators introduced for branching are projections, injections, pairing, and copairing. Their universal-property behavior can be summarized as follows.

| Constructor | Boundary role | Characteristic equation |
|---|---|---|
| $\pi_0,\pi_1$ | projections from $U\times W$ | $\pi_0\mid(\alpha\times\beta)=\alpha$, $\pi_1\mid(\alpha\times\beta)=\beta$ |
| $\alpha\times\beta$ | reacts to right choice | cell into $U\times W$ |
| $\iota_0,\iota_1$ | injections into $U+W$ | $(\alpha+\beta)\mid\iota_0=\alpha$, $(\alpha+\beta)\mid\iota_1=\beta$ |
| $\alpha+\beta$ | reacts to left choice | cell out of $U+W$ |

For the 2023 formulation, these constructions require $A$ to be a distributive monoidal category with distributive binary coproducts $\oplus$, and under that hypothesis the free cornering with choice ${A}^\oplus$ is again a strict monoidal double category [2305.16899].

## 3. Syntax and operational dynamics

The dynamic presentation of free cornering with protocol choice is given by a typed term language $\mathcal{T}(A)$ whose terms have judgments
\[
a:U\;A\;B\;W
\]
with $A,B\in \mathrm{Ob}\,A$ and $U,W\in \mathrm{Exch}$ [2508.00633]. The grammar contains:
- $f:I\,A\,B\,I$ for each morphism $f\in A(A,B)$,
- $1_A:I\,A\,A\,I$,
- $id_U:U\,I\,I\,U$,
- vertical composition $a\cdot b$,
- horizontal composition $a\mid b$,
- corner cells,
- injections $180^0,180^1$ into $U+W$,
- branching terms $a+b$ and $a\times b$,
- projections $\pi_0,\pi_1$ from $U\times W$.

Basic equations $\simeq$ are imposed so that $\mathcal{T}(A)/\simeq$ becomes a single-object double category. These include
\[
f\cdot g \simeq f;g,\qquad f\mid g \simeq f\otimes g,
\]
together with identities, associativities, and interchange [2508.00633]. In effect, these equations identify the structural syntax with the categorical composition laws already present in the free cornering.

Operational behavior is then introduced by four $\beta$-rewrite rules:
\[
A⌏ \mid A⌜ \to_\beta 1_A,\qquad
A⊏ \mid A⊐ \to_\beta 1_A,
\]
\[
(a\times b)\mid \pi_i \to_\beta a_i,\qquad
180^i\mid (a+b)\to_\beta a_i.
\]
These rules encode two forms of interaction: send–receive cancellation through corner cells, and branch selection through the choice constructors [2508.00633]. The rewriting system is defined modulo the congruence $\simeq$, so operational steps are taken up to the structural equations of the double category.

To obtain the quotient corresponding to the free cornering with protocol choice, one also adds $\eta$-equations:
\[
A⌜\cdot A⌏ =_\eta id_{A^\circ},\qquad
A⊐\cdot A⊏ =_\eta id_{A^\bullet},
\]
\[
(h\mid \pi_0)\times(h\mid \pi_1)=_\eta h,\qquad
(180^0\mid h)+(180^1\mid h)=_\eta h.
\]
The resulting congruence $\equiv$ is the smallest congruence containing the reflexive–transitive–symmetric closure of $\to_\beta$ together with these $\eta$-laws, and the 2-cells of the free cornering with protocol choice are precisely $\mathcal{T}(A)/\equiv$ [2508.00633].

## 4. Termination, confluence, and coherence

The rewriting theory of Nester and Voorneveld establishes that the $\beta$-system is terminating modulo $\simeq$ by means of a simple combinatorial measure [2508.00633]. For a term $a$, let $\#a$ be the number of “special” constructors, namely corners, $+$, $\times$, $\pi$, and $180$. Every $\beta$-step strictly decreases $\#$, and $\simeq$ preserves this measure. Since the system is finitely branching, this yields termination modulo $\simeq$.

Local confluence is obtained from the observation that there are no critical overlaps among the four $\beta$-rules $R1$–$R4$ [2508.00633]. By Newman’s Lemma, termination plus local confluence implies confluence, so $\to_\beta$ is confluent modulo $\simeq$. The same paper also states that if the base monoidal category $A$ carries a finitely-branching monoidal rewrite relation $\to_A$, then $\to_A$ and $\to_\beta$ commute up to $\simeq$, and their union remains confluent and terminating modulo $\simeq$.

The central structural result is the coherence theorem. Let $V⌜A⌝$ denote the vertical monoidal category of cells of $⌜A⌝$ of type $I\;A\to B\;I$, with tensor given by horizontal composition. Then the canonical functor
\[
A\to V⌜A⌝,\qquad f\mapsto [f],
\]
is an isomorphism of monoidal categories [2508.00633]. Equivalently, every vertical 2-cell is uniquely $\equiv$-equal to one arising from a single parallel-noninteracting morphism of $A$.

The proof proceeds by normalization, characterization of normal forms, fullness, and faithfulness. Every vertical term $a:I\,A\,B\,I$ rewrites to a $\beta$-normal form; any such normal form has no corners, sums, or products and is therefore $\simeq$-equal to a pure $A$-term; every morphism in $V⌜A⌝$ thus comes from some $f$ in $A$; and if $[f]\equiv[g]$, then both are already normal, forcing $f=g$ [2508.00633]. The paper explicitly notes that the $\eta$-equations are only needed to identify different nested $\beta$-normal forms yielding the same pure $A$-term.

## 5. Examples of branching interaction

The most detailed worked example is a vending-machine protocol [2508.00633]. Let $\mathcal{M}$ be the free symmetric monoidal category generated by the objects
\[
\$1,\;\$2,\;\mathrm{Gum},\;\mathrm{Cig}
\]
and morphisms
\[
g:\$1\to\mathrm{Gum},\qquad
c:\$2\to\mathrm{Cig},\qquad
g':\$2\to\mathrm{Gum}\otimes \$1.
\]
The exchange protocol is
\[
V=(\$2^\circ\cdot \mathrm{Cig}^\bullet)+[(\$1^\circ\cdot \mathrm{Gum}^\bullet)+(\$2^\circ\cdot \mathrm{Gum}^\bullet\cdot \$1^\bullet)].
\]
This means that the left participant chooses between a cigarettes branch and two gum branches: pay \$1 for gum, or pay \$2 and receive gum plus \$1 change.

A machine term
\[
M:V\;I\to I\;I
\]
implements the three branches by combining corner cells with the base morphisms $c$, $g$, and $g'$ [2508.00633]. Three customer behaviors $C_1$, $C_2$, and $C_3$ then represent, respectively, “insert \$2 for Cig,” “insert \$1 for Gum,” and “insert \$2, get gum+change.” Their interactions satisfy
\[
C_1\mid M \to^* c,\qquad
C_2\mid M \to g,\qquad
C_3\mid M \to g'.
\]
The first reduction is displayed explicitly:
\[
C_1\mid M \to_\beta \cdots \to_\beta (\$2⌐\mid \$2⌜)\cdot c\cdot(\mathrm{Cig}⌜\mid \mathrm{Cig}⌐)\to_\beta 1\cdot c\cdot 1 \simeq c.
\]
The significance of the example is that the protocol layer disappears under normalization, leaving precisely the intended resource transformation in the base category.

The 2023 construction also provides string-diagram examples illustrating the asymmetry of left and right branching [2305.16899]. One example uses a protocol $bread^\circ + dough^\circ$, interpreted as a left choice between sending bread and sending dough, to define a process $react$ that yields bread in either branch. A second example uses $\times$ to describe a right-branching protocol in which the opponent determines whether dough or oven is supplied first; the constructed process responds by baking in either case. These examples clarify that protocol choice is not merely additive syntax but a control structure for interactive scheduling.

## 6. Relation to optics, strong-functor models, and later developments

Free cornering predates protocol choice and already had a substantive categorical role. In “Cornering Optics,” the free cornering of a monoidal category is shown to provide a natural setting for optics, and more general horizontal cells encode comb diagrams of arbitrary depth [2205.00842]. A horizontal cell with vertical boundary $X^\bullet\otimes Y^\circ$ is exactly an optic, while a right comb of depth $n$ corresponds to a horizontal cell with $n$ alternating teeth. This places free cornering with protocol choice inside a broader diagrammatic program: branching protocols enrich the same double-categorical environment in which optics and combs are already expressible.

The 2023 paper also gives a model of protocol choice in terms of strong functors and strong natural transformations [2305.16899]. For a cartesian closed category $C$ whose cartesian product distributes over coproducts, the single-object double category $\mathsf{S}(C)$ has strong endofunctors as vertical edges and strong natural transformations as squares. In this setting, coproducts and products of strong functors realize the injections, projections, pairings, and copairings required for $+$ and $\times$, and there is a strict double-functor
\[
D:{C}^\oplus\longrightarrow \mathsf{S}(C)
\]
sending
\[
A^\circ =(-\otimes A),\qquad
A^\bullet =(-)^A,\qquad
U+W\mapsto DU+DW,\qquad
U\times W\mapsto DU\times DW.
\]
The paper states that $\mathsf{S}(C)$ provides a fully faithful model of ${C}^\oplus$ and interprets the protocol constructors in computational-effects terms: $A^\bullet$ may be identified with the reader monad, $A^\circ$ with the writer comonad, $F+G$ as nondeterministic choice between two effects, and $F\times G$ as environment-driven choice [2305.16899].

A plausible implication is that free cornering with protocol choice sits at a junction of three lines of work: process interaction via double categories, diagrammatic reasoning for optics and combs, and effectful semantics via strong functors. The 2025 rewriting system adds a dynamic and proof-theoretic layer to that junction by showing that the protocol machinery is confluent, terminating, and coherent [2508.00633]. The result is a formalism in which branching interaction can be expressed operationally without losing the categorical identity of the underlying process theory.

Source: https://www.emergentmind.com/topics/free-cornering-with-protocol-choice