Free Cornering with Protocol Choice
- Free cornering with protocol choice extends a monoidal category model by incorporating branching constructors, enriching the interaction protocols between processes.
- It introduces left-controlled (U+W) and right-controlled (U×W) choices that affect resource exchanges in a strict single-object monoidal double category.
- The framework employs term rewriting with terminating and confluent β-rules, supporting a coherence theorem that uniquely aligns vertical 2-cells with base morphisms.
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, and , 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 (Nester et al., 2023, Nester et al., 1 Aug 2025), building on the original free-cornering framework used to study optics and comb diagrams (Boisseau et al., 2022).
1. Free cornering as a double-categorical process theory
The free cornering of a strict monoidal category is a single-object double category whose horizontal edge-monoid is and whose vertical edges are generated by exchange data (Nester et al., 1 Aug 2025). In the earlier formulation for a strict monoidal category , horizontal edges are the objects of , while vertical edges are polarized objects
that is, the free strict monoid on symbols and (Boisseau et al., 2022). 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
while in the optics-oriented presentation they appear as corner cells satisfying the usual yanking identities (Nester et al., 1 Aug 2025, Boisseau et al., 2022). 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 0 and vertical boundaries given by exchanges 1 and 2 describes a process transforming 3 to 4 while interacting along its left and right boundaries according to those protocols (Nester et al., 1 Aug 2025). 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 (Boisseau et al., 2022).
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
- 5,
- 6 and 7 for each 8,
- sequential composition 9,
- internal choice 0,
- external choice 1,
subject only to associativity and unit for 2 (Nester et al., 1 Aug 2025). The intended meaning is asymmetric: 3 is the protocol in which the left participant first chooses whether to do 4 or 5, whereas 6 is the protocol in which the right participant first chooses whether to do 7 or 8 (Nester et al., 2023). A common misconception is to treat 9 and 0 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 to
2
and the horizontal edge-monoid remains unchanged (Nester et al., 2023). 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 3, 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 |
|---|---|---|
| 4 | projections from 5 | 6, 7 |
| 8 | reacts to right choice | cell into 9 |
| 0 | injections into 1 | 2, 3 |
| 4 | reacts to left choice | cell out of 5 |
For the 2023 formulation, these constructions require 6 to be a distributive monoidal category with distributive binary coproducts 7, and under that hypothesis the free cornering with choice 8 is again a strict monoidal double category (Nester et al., 2023).
3. Syntax and operational dynamics
The dynamic presentation of free cornering with protocol choice is given by a typed term language 9 whose terms have judgments
0
with 1 and 2 (Nester et al., 1 Aug 2025). The grammar contains:
- 3 for each morphism 4,
- 5,
- 6,
- vertical composition 7,
- horizontal composition 8,
- corner cells,
- injections 9 into 0,
- branching terms 1 and 2,
- projections 3 from 4.
Basic equations 5 are imposed so that 6 becomes a single-object double category. These include
7
together with identities, associativities, and interchange (Nester et al., 1 Aug 2025). 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 8-rewrite rules: 9
0
These rules encode two forms of interaction: send–receive cancellation through corner cells, and branch selection through the choice constructors (Nester et al., 1 Aug 2025). The rewriting system is defined modulo the congruence 1, 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 2-equations: 3
4
The resulting congruence 5 is the smallest congruence containing the reflexive–transitive–symmetric closure of 6 together with these 7-laws, and the 2-cells of the free cornering with protocol choice are precisely 8 (Nester et al., 1 Aug 2025).
4. Termination, confluence, and coherence
The rewriting theory of Nester and Voorneveld establishes that the 9-system is terminating modulo 0 by means of a simple combinatorial measure (Nester et al., 1 Aug 2025). For a term 1, let 2 be the number of “special” constructors, namely corners, 3, 4, 5, and 6. Every 7-step strictly decreases 8, and 9 preserves this measure. Since the system is finitely branching, this yields termination modulo 0.
Local confluence is obtained from the observation that there are no critical overlaps among the four 1-rules 2–3 (Nester et al., 1 Aug 2025). By Newman’s Lemma, termination plus local confluence implies confluence, so 4 is confluent modulo 5. The same paper also states that if the base monoidal category 6 carries a finitely-branching monoidal rewrite relation 7, then 8 and 9 commute up to 00, and their union remains confluent and terminating modulo 01.
The central structural result is the coherence theorem. Let 02 denote the vertical monoidal category of cells of 03 of type 04, with tensor given by horizontal composition. Then the canonical functor
05
is an isomorphism of monoidal categories (Nester et al., 1 Aug 2025). Equivalently, every vertical 2-cell is uniquely 06-equal to one arising from a single parallel-noninteracting morphism of 07.
The proof proceeds by normalization, characterization of normal forms, fullness, and faithfulness. Every vertical term 08 rewrites to a 09-normal form; any such normal form has no corners, sums, or products and is therefore 10-equal to a pure 11-term; every morphism in 12 thus comes from some 13 in 14; and if 15, then both are already normal, forcing 16 (Nester et al., 1 Aug 2025). The paper explicitly notes that the 17-equations are only needed to identify different nested 18-normal forms yielding the same pure 19-term.
5. Examples of branching interaction
The most detailed worked example is a vending-machine protocol (Nester et al., 1 Aug 2025). Let 20 be the free symmetric monoidal category generated by the objects
21
and morphisms
22
The exchange protocol is
23
This means that the left participant chooses between a cigarettes branch and two gum branches: pay \$U\times W$242 and receive gum plus \$1 change.
A machine term
25
implements the three branches by combining corner cells with the base morphisms 26, 27, and 28 (Nester et al., 1 Aug 2025). Three customer behaviors 29, 30, and 31 then represent, respectively, “insert \$U\times W$321 for Gum,” and “insert \$2, get gum+change.” Their interactions satisfy
33
The first reduction is displayed explicitly: 34 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 (Nester et al., 2023). One example uses a protocol 35, interpreted as a left choice between sending bread and sending dough, to define a process 36 that yields bread in either branch. A second example uses 37 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 (Boisseau et al., 2022). A horizontal cell with vertical boundary 38 is exactly an optic, while a right comb of depth 39 corresponds to a horizontal cell with 40 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 (Nester et al., 2023). For a cartesian closed category 41 whose cartesian product distributes over coproducts, the single-object double category 42 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 43 and 44, and there is a strict double-functor
45
sending
46
The paper states that 47 provides a fully faithful model of 48 and interprets the protocol constructors in computational-effects terms: 49 may be identified with the reader monad, 50 with the writer comonad, 51 as nondeterministic choice between two effects, and 52 as environment-driven choice (Nester et al., 2023).
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 (Nester et al., 1 Aug 2025). The result is a formalism in which branching interaction can be expressed operationally without losing the categorical identity of the underlying process theory.