Formal bridges and comparison discipline

String diagrams and process theories

Rajesh Ranjan Mahapatra

A process picture becomes a proof only when its wires and deformations are governed by a typed compositional theory, so every visible move has a replayable algebraic warrant.

© 2026 Rajesh Ranjan Mahapatra. 30 min read

Formal bridges and comparison discipline

String diagrams and process theories

A process picture becomes a proof only when its wires and deformations are governed by a typed compositional theory, so every visible move has a replayable algebraic warrant.

TLDR

  1. Boxes and wires become formal only after their input and output types are declared.
  2. Stacking is sequential composition, juxtaposition is parallel composition, and interchange links the two.
  3. Crossing, copying, discarding and feedback each require extra structure; none is free ink.
  4. Soundness says permitted rewrites preserve meaning; completeness asks whether all valid equalities are reachable.
  5. Use a Diagram Proof Contract and deformation receipt before accepting a visual refactor.

Draw two lines that cross. In an electrical schematic, the crossing may mean the conductors pass without contact. Add a dot and it becomes a junction. In a knot diagram, one strand passes over another. In a subway map, the lines may share a station only if a symbol says so. The same mark can mean four incompatible things.

Now replace the lines with information flows and the mark with a neat redraw. A reviewer slides one process past another to remove clutter. The inputs and outputs remain in the same places. The boxes have the same names. The picture looks cleaner, so the reviewer calls the two systems equivalent.

Are they? Perhaps the processes act on independent records and may truly run in either order. Perhaps they share an audit counter, so the first changes what the second sees. Perhaps the crossing itself swaps two ordered values. Perhaps that swap is forbidden. The ink does not decide the algebra. A diagram carries a proof only after a theory states what the marks denote and which movements preserve denotation.

The crossed-wire puzzle

A useful diagram suppresses detail. A proof-bearing diagram suppresses only detail that the declared theory has proved irrelevant.

A picture of a process is not yet process syntax

A conventional architecture diagram may use arrows for data, control, dependency, time, trust or mere visual grouping. Two arrows may cross because the drawing tool needed space. A box may mean a function, a service, a team, a database, a policy or a whole organisation. Such pictures can be excellent communication devices. They are not automatically terms in a formal language.

It also helps to distinguish a string diagram from a commutative diagram. In a commutative diagram, points usually denote objects and arrows denote morphisms; the claim is that different paths with the same endpoints compose to the same morphism. A string diagram instead depicts the internal assembly of one composite morphism. Wires are more than arrows between labelled points. They are the typed systems that persist between process events. To prove two string diagrams equal is to show that two assemblies denote the same composite under the laws of the process theory.

This is why a diagram can be formal without being fully semantic. Start with a signature containing types and primitive boxes. Generate every well-typed diagram obtainable by sequence and tensor. That gives a free syntax in which no accidental domain equations have yet been imposed. Then quotient by declared equations such as a particular rewrite, a symmetry law or an algebraic identity. Finally, interpret the resulting theory in a target model. Keeping these stages separate prevents a property of one implementation from being mistaken for a universal law of composition.

A string diagram makes a sharper bargain. Wires denote systems or types. Boxes denote processes with ordered input and output boundaries. Joining a wire to a box is legal only when the types match. Placing one box after another denotes sequential composition. Placing boxes beside one another denotes parallel composition. A complete diagram denotes one composite process from its exposed input boundary to its exposed output boundary. This idea was formalised for monoidal categories by Joyal and Street, building on earlier graphical tensor notation, and developed into a hierarchy of graphical languages for different categorical structures [1] [2].

A string diagram is a typed term drawn spatially. The drawing is not a mnemonic pasted onto an equation. Its spatial operations are the language's constructors. This changes the burden of proof. We no longer ask whether two pictures look similar. We ask whether one well-typed term can be transformed into another by moves licensed by the theory.

One crossing under four structural regimes Four interpretations of a crossing are shown: no connection in a schematic, over-under order in a braid, a swap in a symmetric process theory, and an illegal move in a planar theory. The same X does not carry the same theorem Schematic pass without joining Braided over and under matter σ Symmetric an explicit swap process Planar crossing may be unavailable
One crossing, four worlds.The visual mark inherits meaning from the declared graphical language. A redraw valid in a symmetric theory can be meaningless in a planar one and non-trivial in a braided one. Illustrative.

The hidden contract beneath the page

Every proof-bearing diagram rests on four layers. The first is a signature: the available wire types and primitive boxes. The second is a composition grammar: how boxes connect sequentially and in parallel. The third is a structural regime: whether wires may cross, bend, copy or disappear. The fourth is an equational theory: named local patterns that may be replaced by other patterns. An interpretation then maps this syntax into actual functions, matrices, stochastic maps, circuits, protocols or other target processes.

Remove any layer and the visual argument weakens. Untyped wires permit impossible connections. An unspecified structural regime smuggles in swaps or feedback. Rewrite rules without semantics may manipulate marks consistently while saying nothing about the intended system. A semantic model without a proof calculus can show that two particular composites happen to agree, but not that the agreement follows from the general process laws.

Decisive mechanism

Geometry carries proof only within a declared structural regime. Continuous bending or sliding is not intrinsically truth-preserving. It becomes truth-preserving when a coherence result or explicit axiom identifies that deformation with equality in the chosen process theory.

The proof surface beneath a string diagram A river-like pair of wires crosses four translucent layers labelled typed boundary, composition grammar, structural permissions and declared equations before reaching an interpretation. 1. Typed boundary Every exposed and connected wire has a declared object or system type. 2. Composition grammar Joining means sequence; juxtaposition means parallel composition. 3. Structural permissions Planarity, braiding, symmetry, trace, compactness or copying are explicit. 4. Declared equations Each non-geometric replacement cites a rule whose models must satisfy it. Interpretation into the target process category
The proof surface.A visible wire path is supported by invisible commitments. The diagram can suppress parentheses and coordinates because coherence handles them, but it cannot suppress types, structural permissions or domain equations. Illustrative synthesis.
Thought experiment 1 · Change only the crossing rule

Keep the same boxes, wire labels and boundary. In world P, wires live in a planar monoidal theory and cannot cross. In world S, the theory is symmetric, so an explicit swap process exchanges adjacent systems. A candidate proof straightens a crossing into two uncrossed wires. In world S this may simplify two consecutive swaps because swapping twice is the identity. In world P the initial diagram may not even be a legal term. The visual difference is identical; the theorem changes because one causal property, the structural regime, changed.

The argument in one pass
Chart · flow
flowchart TD
  A["The crossed-wire puzzle"] --> B["The proof surface"]
  B --> C["Four moves that are not free"]
  C --> D["From visual argument to<br/>checked artefact"]
  D -. "re-test" .-> A
  classDef first fill:#0a1424,stroke:#5B5CF6,stroke-width:2px,color:#e6f3ff
  classDef step fill:#0a1424,stroke:#3f7da0,stroke-width:1px,color:#e6f3ff
  class A first
  class B,C,D step
A structural route through String diagrams and process theories: from The crossed-wire puzzle to Review transformations, not resemblance. Reading use: follow the relation, then return to the surrounding argument for evidence and limits.

The proof surface

The core geometry is modest: processes can happen one after another or side by side. Its force comes from making those two forms of composition interact lawfully.

From two compositions to one process theory

Let A, B, C name system types. A process f : A → B transforms an input of type A into an output of type B. If g : B → C, then connecting the output of f to the input of g forms the sequential composite g ∘ f : A → C. The identity process 1A leaves an A wire unchanged.

Now add a tensor product. If f : A → B and h : X → Y, their parallel composite is f ⊗ h : A ⊗ X → B ⊗ Y. The unit object I represents no exposed system. A state is a process I → A; an effect is A → I. These ingredients form a monoidal category, often called a process theory when read operationally [3] [4].

The smallest useful equation is the interchange law. Suppose f : A → B, f′ : B → C, h : X → Y and h′ : Y → Z. Then:

(f′ ⊗ h′) ∘ (f ⊗ h) = (f′ ∘ f) ⊗ (h′ ∘ h)

The left side says: perform two parallel processes, then another parallel pair. The right side says: compose the complete left lane and the complete right lane, then place those lane composites in parallel. Interchange is the first place where space becomes algebra. It licenses sliding independent boxes vertically past each other without changing the total process, provided their wires remain separate.

The proviso matters more than the equation's elegance. “Beside one another” is not a statement about screen coordinates. It asserts that the two components form a tensor product and that each box acts only on its own factor. A database write and a cache refresh drawn in separate columns are not thereby independent. A neural module and a monitoring hook on different lanes may still share parameters, randomness or clocks. Before interchange applies, the modeller must show that every relevant dependency is either absent or represented by a wire.

The interchange law as two views of one process On the left two pairs of boxes are shown in two horizontal layers. On the right each wire has its boxes grouped into a lane. An equality sign connects them. Layer view Lane view = fhf′h′ parallel layers ff′hh′ f′ ∘ fh′ ∘ h Independent wires preserve their order and never share state.
Interchange makes independence visible.The equality is not inferred from visual resemblance. It follows from bifunctoriality of the tensor product, provided the two lanes are genuinely separate. Illustrative.
Worked example 1 · Two independent approvals

A document lane has r : D → D for redaction followed by v : D → D for validation. A payment lane has n : P → P for normalisation followed by s : P → P for signing. One designer writes (v ⊗ s) ∘ (r ⊗ n). Another groups by lane and writes (v ∘ r) ⊗ (s ∘ n). The interchange law proves equality without inspecting how any box works. The proof is parametric in every interpretation that respects the monoidal structure.

Why bending can replace parenthesising

Text forces choices that often have no operational content. Is (A ⊗ B) ⊗ C written before A ⊗ (B ⊗ C)? Is an identity wire inserted on the left or right? A general monoidal category carries associator and unitor isomorphisms that relate these presentations. Coherence results show that diagrams built from these structural isomorphisms agree whenever their formal shape requires them to agree. This is why string diagrams can usually omit a forest of parentheses and canonical reshufflings [5].

Joyal and Street's geometric account identifies morphisms in the freely generated monoidal setting with well-typed progressive plane graphs modulo the appropriate deformation. Modern work continues to refine this relation, including non-strict and effectful settings where apparently harmless spatial moves may cease to be valid [6] [7]. The practical lesson is not that topology magically proves algebra. It is that a coherence theorem has already paid for certain topological freedoms.

A proof is a trajectory, not a final picture.The final diagrams may look convincingly alike, but auditability comes from the sequence of typed, warranted local moves between them. Illustrative process trajectory.

Soundness, completeness and scope

Suppose a signature and equation set generate a diagrammatic theory. An interpretation assigns each wire type to a target system and each primitive box to a target process, preserving identities, sequence and tensor. Categorically, this is a suitable monoidal functor from the syntactic process theory into the target category. Once the generators are interpreted, every composite diagram receives a compositional meaning.

A rewrite system is sound when every permitted diagram transformation preserves that meaning in every model satisfying the rules. If DL rewrites to DR, then:

for every model M: ⟦D_L⟧_M = ⟦D_R⟧_M

Completeness asks the converse at a declared scope. If two diagrams have equal meaning in all relevant models, can the rules transform one into the other? A calculus can be sound but incomplete. Its derivations are trustworthy, yet some true equalities remain unreachable. Completeness results are therefore local achievements, not a generic property of visual reasoning. The ZX-calculus, for example, has completeness results for specified fragments of quantum theory, not a licence to treat every quantum-looking sketch as a proof [8].

Soundness and completeness answer different questions. Soundness protects every accepted move. Completeness measures whether the rule set can find every equality in the stated domain. A tool that evaluates two diagrams on a few examples supplies neither by itself. It may discover a counterexample, or increase confidence in a particular model, but sampled agreement is not a general derivation.

There is a third practical question: can the proof search be made usable? A rewrite system may be sound and complete yet still wander forever if rules can fire in cycles. Orienting equalities from complicated patterns towards simpler ones may create a terminating normalisation procedure, but termination alone does not guarantee that different rewrite choices meet at the same result. Confluence supplies that assurance. When both properties hold, equality can often be decided by reducing both diagrams to a common normal form. When they do not, an interactive prover may still be reliable because each local move is checked, even though search requires strategy or human guidance.

Target-specific equality sits beside, not above, this generic calculus. Two matrices can happen to be equal because their entries cancel, even if the equality is not derivable from bare monoidal laws. Conversely, a generic diagram equation may hold in every model of the theory without any numerical evaluation. A disciplined tool therefore reports which route established the result: coherence, a named rewrite theorem, exhaustive evaluation in a finite model, symbolic algebra in one interpretation or a proof-assistant derivation. Collapsing those routes into a single green tick hides the most important part of the evidence.

Worked example 2 · The smallest computational check

Let the left wire carry values modulo three. Define f(x)=x+1 mod 3 and f′(x)=2x mod 3. Let the right wire carry a bit, with h(y)=1-y and h′(y)=y. On input (1,0), the layer view gives (1,1): first (2,1), then (1,1). The lane view gives the same pair because each lane composes independently. Exhausting all six inputs confirms equality in this finite model. The interchange law explains why the check succeeds for every choice of the four functions.

Evidence status

Coherence for standard monoidal structures, sound graphical calculi and formal rewriting frameworks are established mathematical results within their stated assumptions [9] [10] [11]. The claim that a particular engineering diagram instantiates one of those structures remains a modelling decision that must be justified separately.

Four moves that are not free

Most invalid graphical arguments do not misuse composition. They import an extra capability by drawing it as if space itself supplied it.

Four tempting but structurally loaded diagram moves Four panels show wire crossing, copying, deletion and feedback. Each is paired with the additional structure required to use it lawfully. Do not let the drawing tool grant an operation Cross needs braid or symmetry not planar by default Copy needs a copier or diagonal not generic monoidal structure Discard needs an effect or terminal map loss is an operation f Feed back needs trace or fixed-point law a loop is not mere curvature Each move may be legitimate, but only after the theory names the required capability.
Four capabilities often smuggled in as layout.Crossing, copying, deleting and feeding back extend what the language can express. A proof must cite the corresponding structure or an explicit process. Illustrative adversarial-path view.
Declared structureGeneric crossingGeneric copy or discardGeneric feedbackWhat geometry may forget
Planar monoidalNoNoNoParentheses and unit wires covered by coherence
Braided monoidalYes, with over-under orderNoNoDeformation preserving braid topology
Symmetric monoidalYes, as coherent swapsNoNoPermutation routing, including swap cancellation
CartesianYesYes, canonicallyNot in generalStructural duplication and deletion of values
Traced symmetricYesNoYes, by trace axiomsDeclared cyclic routing subject to trace laws
Compact closedUsually symmetric in common usageNoLoops via cups and capsWire bending with duals and compact coherence

The rows are not a single ladder of increasing realism. Cartesian structure and compact closure add different powers. A theory may support feedback without canonical copying, or copying without a trace. The right question is therefore not “which diagram language is strongest?” It is “which operations are justified by the target processes, and which equations follow from that choice?” Adding structure makes more pictures legal, but it also makes a stronger modelling claim.

Crossing: exchange is an operation

In a symmetric monoidal category, a symmetry morphism σA,B : A ⊗ B → B ⊗ A swaps adjacent systems. The graphical language allows wires to cross, and two consecutive crossings cancel. In a braided category, crossings retain over-under information and a braid need not equal its inverse. In a merely planar monoidal category, there may be no generic crossing at all. Selinger's survey catalogues how these different structures change the legal geometry and the equations it represents [2].

A crossing is a process, not empty decoration. This matters whenever order carries meaning: a tensor product of typed resources, a sequence of tokens, a queue of obligations or a spatial arrangement. A symmetric model declares that adjacent systems can be exchanged coherently. It does not say that the exchange is physically free, temporally instantaneous or authorised in a deployed system. Those are properties of the interpretation, not of symmetry alone.

Thought experiment 2 · Replace labels, preserve the geometry

Begin with two bits and permit a generic swap. Now relabel the wires as “signed payment order” and “customer identity evidence”. The same crossing is well-typed only if the combined system treats these as freely reorderable positions. Change one causal property again: make the boundary an ordered legal dossier in which position fixes evidential role. The geometry is unchanged, but the generic symmetry is no longer an innocent model. The experiment tests whether order is structural noise or part of the system's meaning.

Copying and discarding: classical convenience is not universal

Ordinary programming encourages a strong intuition: any value can be duplicated, ignored or logged. General monoidal process theories do not grant those operations automatically. A copying box would have type ΔA : A → A ⊗ A. A discarding effect would have type !A : A → I. They may be supplied as explicit processes or arise canonically in a cartesian category, where products support natural diagonals and terminal maps. Outside that setting, they are additional structure with equations of their own.

This restraint is not ceremonial. Copying an immutable classical record differs from cloning an unknown quantum state, duplicating a live database transaction or forking an agent whose future state will diverge. Discarding a local scratch value differs from deleting the only effect receipt after a consequential action. Copying is data-specific power. A diagram that forks a wire must state what can be copied, under which semantics and with which aliasing or conservation consequences.

Discarding deserves equal scrutiny. A terminal map in a cartesian theory says every value can be ignored in one canonical way. Operational systems often distinguish several forms of “not using” something: suppress a display, revoke access, erase storage, retain under legal hold or aggregate into an audit statistic. Those effects are not interchangeable. Drawing a wire into empty space can conceal a consequential process whose failure modes, permissions and receipts belong inside the model.

Thought experiment 3 · Move the candidate-system boundary

A box receives an agent state and emits two identical wires. At a narrow boundary, the wire denotes a serialised snapshot, so byte-for-byte copying is available. Expand the boundary to include live tool sessions, expiring credentials, external locks and a changing world. The same Y-shaped fork no longer creates two identical operational agents. One branch may inherit a stale capability; both may contend for the same resource. By moving state and authority into the candidate system, the structural copier turns into a complex, fallible process.

Feedback: a loop needs an equation, not just curvature

Bending an output wire back into an input suggests recurrence, iteration, a fixed point or a trace. These are related but not interchangeable notions. Traced monoidal categories provide an abstract trace operation satisfying specific axioms; compact closed categories support cups and caps that bend wire orientation in a stronger geometry [10] [9]. Other settings allow only guarded or delayed feedback because an instantaneous loop would be undefined.

A loop is not licensed by the fact that it fits on the page. In software, x = f(x) may have no solution, several solutions or a least fixed point under a chosen order. In control, feedback can stabilise or destabilise depending on gain and delay. In probabilistic models, cyclic dependencies require a defined semantics. The graphical curve hides all of these obligations unless the process theory exposes them.

Thought experiment 4 · Remove one unit of delay

A controller reads yesterday's state, chooses an action and writes today's state. The feedback wire contains a one-step delay, so the recurrence is executable. Now remove only that delay while preserving every box and connection. The loop asks the action to depend on the state that depends on the same action at the same instant. Some theories can solve such equations; others cannot. The apparent topological tweak changes the causal problem from recurrence to simultaneous fixed-point selection.

Sliding effectful boxes: hidden state breaks interchange

The most dangerous false proof is often a legitimate monoidal move applied to processes that are not independent. Consider two operations that look as if they act on separate data wires. Operation A increments a hidden audit counter. Operation B reads that counter and appends its value to an output. Draw only the visible data and the boxes appear disjoint. Slide A past B, and the output changes.

Premonoidal and effectful categorical models exist precisely because arbitrary effectful computations need not interchange. Recent work gives a useful graphical discipline: add a runtime wire that passes through effectful boxes, making their shared dependency visible. Pure boxes can float around that wire; effectful boxes remain ordered along it [6]. Hidden state turns apparent parallelism into order dependence.

A causal intervention that reveals hidden order dependence The upper half shows two processes on separate wires that may slide past one another. The lower half adds a coral runtime wire through both boxes, making their order fixed and showing different outputs when reversed. Add the hidden runtime and the false commutation disappears Visible-only model Runtime-explicit model A B slide A B A counter + 1 B read counter runtime s not free B read counter A counter + 1 different read value
A boundary intervention exposes the missing dependency.When shared runtime state is outside the diagram, the boxes appear independent. Bringing that state into the boundary blocks the interchange and predicts an observable order effect. Illustrative, informed by effectful string-diagram models.
Worked example 3 · A concrete counterexample

Let runtime state be s ∈ {0,1} and output bit be x. Process A replaces s by 1-s. Process B replaces x by x ⊕ s. Starting from (s,x)=(0,0), A then B yields (1,1). B then A yields (1,0). A single counterexample defeats the proposed commutation. The repair is to expose the runtime wire or to prove that the actual effects commute.

Strongest boundary

String diagrams do not tell us which process theory the world uses. A modeller chooses the objects, boundaries, primitive processes and equations. Different choices can each be internally coherent while making different predictions. Graphical proof begins after that modelling choice; it does not remove the need to defend it.

How the claim changes under pressure
Chart · state
stateDiagram-v2
  [*] --> Claim
  state "A picture of a process is not<br/>yet process syntax" as Claim
  state "The hidden contract beneath<br/>the page" as Test
  state "From two compositions to one<br/>process theory" as Revision
  Claim --> Test: expose mechanism
  Test --> Decision: evidence survives
  Test --> Revision: rival survives
  Revision --> Claim: narrow or rebuild
  Decision --> [*]
The revision loop begins with A picture of a process is not yet… and keeps counterexamples inside the reasoning path. Reading use: follow the relation, then return to the surrounding argument for evidence and limits.

From visual argument to checked artefact

The practical problem is not drawing diagrams. It is knowing what conclusion a proposed deformation is allowed to carry.

The Diagram Proof Contract

The following contract is a practitioner synthesis, not a new coherence theorem. It packages the minimum information needed to audit a visual process argument across mathematics, software architecture and AI system design. The contract makes the picture auditable.

Apply it in a fixed order. First compare the exposed boundaries, because different interfaces cannot denote the same typed process. Next expand hidden state, authority, randomness and environmental interaction until proposed independence is credible. Then select the least permissive structural regime that can express the system. List domain equations separately from coherence laws. Only after those steps should a reviewer attempt the deformation. The final receipt names each local move and the scope of the conclusion.

This order makes countermodel search cheap. Before investing in a polished derivation, try to construct one small interpretation in which the proposed equality fails. Finite functions, Boolean state machines and tiny matrices are often enough. A countermodel shows that the equality does not follow from the current axioms. It may reveal a missing premise, a hidden shared resource or an over-broad structural declaration. Failure to find a countermodel is not a proof, but finding one is decisive.

Proof strength rises with structural declaration and semantic coverage A two-dimensional illustrative chart has structural declaration on the horizontal axis and semantic coverage on the vertical axis. Four regions progress from suggestive sketch to checked instance, theory-level derivation and proof with target interpretation. What conclusion does the evidence support? Structural declaration → Semantic coverage → Suggestive sketch no proof claim Checked instance one model or test set Theory derivation all models of rules Interpreted proof typed target + receipt implicitfully declared sampledall stated models
The proof-strength surface.A diagram can be useful at every region, but the conclusion must match the contract. More visual polish does not move a sketch upward; declared structure, semantics and replayable steps do. Illustrative ordinal surface, not measured data.
Contract fieldQuestion to answerPass evidenceFailure means
1. SignatureWhat are the wire types and primitive boxes?Named generators with ordered domains and codomainsThe marks are not well-defined syntax
2. BoundaryDo both diagrams expose the same typed interface?Exact input and output lists, including state and authorityThey are different candidate processes
3. StructureWhich crossings, bends, copies or discards are legal?Planar, braided, symmetric, traced, compact or cartesian commitmentsA layout move may import an operation
4. EquationsWhich local replacements are axioms or proven lemmas?Versioned rewrite set with direction and side conditionsSimilarity is being mistaken for equality
5. InterpretationWhat target processes do the generators denote?A composition-preserving mapping into functions, circuits or configured systemsThe proof may not concern the intended system
6. ReceiptHow did the left diagram become the right?Typed local steps, warrants, scope and optional countermodel searchThe result cannot be replayed or audited
The Diagram Proof Contract.Passing all six fields does not prove that the chosen model is the only correct one. It does make the claimed equality explicit, scoped and challengeable. Practitioner synthesis.

Executable lab: assess a proposed move

The lab below evaluates five common moves against five structural profiles. It does not solve arbitrary diagram equality. It makes hidden assumptions visible, returns a machine-readable deformation receipt and includes one semantic counterexample for shared-state commutation.

Process-diagram proof lab

How to read the result

A positive result under generic scope permits the move only as a structural equality in every model of the selected theory. A positive configured result establishes equality only for the finite semantics implemented by the lab. A warning means that the move could be lawful after adding an explicit box or rule. A negative result means the current contract does not support the inference; it does not prove that the two real-world systems differ. A positive lab result licenses only the scope printed in its receipt.

The lab cannot establish that the selected category is an adequate model of an organisation, a biological system or a conscious process. It also does not prove completeness, termination or confluence of a rewrite system. Its job is narrower: catch category errors before visual confidence hardens into a design decision.

For a real review, replace the lab's assumed boundary with a typed manifest. Record port order, provenance, mutability, ownership and whether each wire denotes data, capability, world state or evidence. Attach side conditions to rewrites, such as “boxes touch disjoint state” or “swap is authorised for these record types”. A receipt should remain valid only against the versioned signature, equation set and interpretation that produced it. Change any of those inputs and the equality must be rechecked.

Optional depth: runnable Python version of the lab

The following dependency-free script mirrors the permission logic and runs the shared-state counterexample. Save it as process_diagram_lab.py, then run python process_diagram_lab.py symmetric interchange generic.

Python · process_diagram_lab.py
from __future__ import annotations

from dataclasses import asdict, dataclass
import json
import sys

PROFILES = {
    "planar": {"interchange"},
    "symmetric": {"interchange", "swap"},
    "cartesian": {"interchange", "swap", "copy", "discard"},
    "traced": {"interchange", "swap", "feedback"},
    "effectful": set(),
}

@dataclass(frozen=True)
class Receipt:
    profile: str
    move: str
    scope: str
    status: str
    warrant: str
    semantic_check: dict[str, object] | None = None


def shared_state_counterexample() -> dict[str, object]:
    # State is (audit_bit, output_bit).
    def a(state: tuple[int, int]) -> tuple[int, int]:
        s, x = state
        return 1 - s, x

    def b(state: tuple[int, int]) -> tuple[int, int]:
        s, x = state
        return s, x ^ s

    start = (0, 0)
    a_then_b = b(a(start))
    b_then_a = a(b(start))
    return {
        "start": start,
        "A_then_B": a_then_b,
        "B_then_A": b_then_a,
        "equal": a_then_b == b_then_a,
    }


def assess(profile: str, move: str, scope: str) -> Receipt:
    if profile not in PROFILES:
        raise ValueError(f"unknown profile: {profile}")

    if move == "effect-commute":
        check = shared_state_counterexample()
        return Receipt(
            profile, move, scope, "rejected",
            "Shared runtime orders the boxes; interchange is unavailable.",
            check,
        )

    if move in PROFILES[profile]:
        return Receipt(
            profile, move, scope, "permitted",
            f"The {profile} profile declares this structural operation.",
        )

    required = {
        "swap": "braiding or symmetry",
        "copy": "an explicit copier or cartesian diagonal",
        "feedback": "a trace, compact structure, or fixed-point operator",
        "interchange": "independence from shared runtime effects",
    }.get(move, "an explicit rule")
    return Receipt(
        profile, move, scope, "unsupported",
        f"Add {required}; the drawing alone is not a warrant.",
    )


if __name__ == "__main__":
    profile = sys.argv[1] if len(sys.argv) > 1 else "symmetric"
    move = sys.argv[2] if len(sys.argv) > 2 else "interchange"
    scope = sys.argv[3] if len(sys.argv) > 3 else "generic"
    print(json.dumps(asdict(assess(profile, move, scope)), indent=2))

A configured-system example: which refactor is actually safe?

Consider a synthetic AI action path. A model proposes an action. One branch checks evidence sufficiency; another formats a human-readable explanation. An authority kernel then decides whether the typed action may execute. The external system applies the action, and a readback produces an effect receipt.

The explanation formatter and an evidence-index formatter may commute if both are pure transformations on separate copies of already authorised input. The authority decision and the execution box do not commute: executing first changes the world before permission is established. Nor may the effect receipt be discarded merely because the diagram remains visually connected. Its presence changes recoverability and auditability.

A process-theoretic view of a governed AI action path A synthetic AI workflow shows a model proposal splitting into evidence and explanation preparation, recombining at an authority kernel, then proceeding to a typed action, external effect and readback receipt. A green bracket marks a safe pure refactor and a coral barrier marks a forbidden authority-execution swap. A refactor is safe only where the process contract permits it Modelproposal Evidencesufficiency Explanationformat Authoritykernel Typedaction Externaleffect Readbackreceipt pure branch may be regrouped if types and data independence hold authority boundary Solid arrows are executed paths. The green bracket marks a conditional structural refactor. The coral barrier marks a non-commuting control boundary.
A governed action path as a process theory.String-diagram discipline separates pure proposal preparation from authority, action and evidence. The useful conclusion is not that every AI workflow is monoidal, but that each claimed refactor must declare the boundary that makes interchange valid. Synthetic configured-system example.
Worked example 4 · A failure that looks like simplification

An architect removes the readback box and connects the external effect directly to “done”. The boundary still has one success output, so the new picture looks equivalent. Under a process theory that treats receipts as optional logging, the rewrite may be allowed. Under a governed-execution theory, the receipt is the only evidence that the external state matches the authorised action. Deleting it changes the output type from VerifiedOutcome to UnverifiedCompletion. Type the boundary honestly and the false equivalence becomes impossible to state.

Tooling, formalisation and the remaining human judgement

Diagrammatic proof can be mechanised at several levels. DisCoPy supplies Python data structures for constructing, composing, drawing, rewriting and interpreting string diagrams across multiple categorical structures [12] [13]. Hypergraph-based rewriting gives sound and complete correspondences for specified diagrammatic theories with Frobenius structure, supporting automated local transformations rather than freehand resemblance [11]. Recent Rocq work couples a graphical editor with formal tactics so graphical rewriting steps can be translated into textual proof objects checked by a proof assistant [14].

These tools reduce clerical error. They do not choose the right system boundary, decide whether two business operations are independent or justify treating a biological or phenomenological description as a monoidal process theory. The modelling decision remains a substantive claim. For convergence research, this is the crucial restraint: a string diagram can prove an equality inside a formal mapping, but it cannot by itself prove that machine attention is awareness, that a cognitive episode is a tensor network or that two traditions share an ontology.

Open research hypothesis · Deformation receipts for design review

Teams that require typed deformation receipts for architecture refactors may detect more invalid equivalence claims than teams using free-form diagrams, while imposing less burden than full theorem proving. The smallest useful study would seed twenty diagrams with crossings, hidden state, illegal copying and boundary changes, then compare review accuracy and time across sketch-only, checklist and receipt-assisted conditions. More detected structural violations with manageable review time would strengthen the proposal. No improvement over a simple checklist would weaken it. A rival explanation is that any forced pause, rather than categorical structure specifically, improves attention. The method should not be imposed on early ideation sketches whose purpose is exploration rather than equivalence.

Decision rule: accept a visual process equality only when the two diagrams share a typed boundary and every transformation step is either a coherence move, a declared structural operation or a named equation with stated semantic scope.

The evidence conversation
Chart · sequence
sequenceDiagram
  participant Q as Question
  participant M as Mechanism
  participant E as Evidence
  participant D as Decision
  Q->>M: The crossed-wire puzzle
  M->>E: A picture of a process is not yet process syntax
  E-->>M: compare rival explanations
  E->>D: Review transformations, not resemblance
  D-->>Q: revise scope or act
Question, mechanism, evidence and decision exchange the burdens developed in String diagrams and process theories. Reading use: follow the relation, then return to the surrounding argument for evidence and limits.

Review transformations, not resemblance

When a diagram is offered as evidence that two systems, explanations or architectures are “the same”, do not begin by debating the final pictures. Ask for the process theory underneath them. What are the wire types? Which state, authority and environment lie inside the boundary? Does the language permit crossing, copying, discarding or feedback? Which local rules connect the left diagram to the right? Into what configured system are the generators interpreted?

If those questions have no answers, treat the picture as an illustration. It may still organise discussion, reveal dependencies or suggest an experiment. It simply does not yet carry equality. If the answers exist but the move lacks a warrant, request a countermodel or add the missing process explicitly. If the answers and receipt pass, accept the conclusion at exactly the declared scope, no wider.

This discipline also changes how disagreement is handled. Instead of arguing over visual intuition, reviewers can locate the dispute in one field: the boundary, the structural regime, a rewrite equation or the target interpretation. A failed proof then becomes informative. It tells the team which assumption must be added, tested or rejected, rather than leaving the issue at “the diagrams feel different”.

The changed decision is to review transformations, not resemblance. A convincing diagram is no longer the endpoint of reasoning. It is a compressed proof object whose omitted details have been earned by typing, coherence, equations and interpretation. That standard is demanding enough to block decorative analogy, yet practical enough to guide refactoring, protocol design and formal comparison.

Glossary

Coherence
A result showing that canonical structural isomorphisms agree, permitting certain syntactic details to be suppressed safely.
Diagram interpretation
A composition-preserving mapping from a syntactic process theory into a target category of functions, matrices, circuits or configured processes.
Interchange law
The equation relating composition of parallel layers to parallel composition of sequential lanes.
Monoidal category
A category with a tensor product and unit, supporting sequential and parallel composition subject to coherence laws.
Process theory
An operational reading of a monoidal category in which objects are systems and morphisms are processes.
Rewrite receipt
A replayable record of local diagram transformations, their warrants, side conditions and claimed scope.
Soundness
The property that every derivable diagram equality is semantically valid in the stated class of models.
Completeness
The property that every equality valid in the stated semantic scope can be derived using the calculus.

References

  1. Joyal, A., & Street, R. (1991). The geometry of tensor calculus, I. Advances in Mathematics, 88(1), 55–112.
  2. Selinger, P. (2011). A survey of graphical languages for monoidal categories. In New Structures for Physics, 289–355.
  3. Coecke, B., & Kissinger, A. (2017). Picturing quantum processes. Cambridge University Press.
  4. Baez, J. C., & Stay, M. (2011). Physics, topology, logic and computation: A Rosetta Stone. In New Structures for Physics, 95–174.
  5. Mac Lane, S. (1998). Categories for the working mathematician (2nd ed.). Springer.
  6. Román, M., & Sobociński, P. (2025). String diagrams for premonoidal categories. Logical Methods in Computer Science, 21(2), 9:1–9:20.
  7. Wilson, P., Ghica, D., & Zanasi, F. (2023). String diagrams for non-strict monoidal categories. CSL 2023, Article 37.
  8. Backens, M. (2016). Completeness and the ZX-calculus. Doctoral thesis, University of Oxford.
  9. Kelly, G. M., & Laplaza, M. L. (1980). Coherence for compact closed categories. Journal of Pure and Applied Algebra, 19, 193–213.
  10. Joyal, A., Street, R., & Verity, D. (1996). Traced monoidal categories. Mathematical Proceedings of the Cambridge Philosophical Society, 119(3), 447–468.
  11. Bonchi, F., Gadducci, F., Kissinger, A., Sobociński, P., & Zanasi, F. (2022). String diagram rewrite theory I: Rewriting with Frobenius structure. Journal of the ACM, 69(2), Article 14.
  12. DisCoPy contributors. DisCoPy documentation. Python toolkit for computing with string diagrams.
  13. de Felice, G., Toumi, A., & Coecke, B. (2021). DisCoPy: Monoidal categories in Python. EPTCS, 333, 183–197.
  14. Pous, D. (2026). String diagrams for monoidal categories, in Rocq. ITP 2026, Article 28.
  15. Bonchi, F., Sobociński, P., & Zanasi, F. (2017). Interacting Hopf algebras. Journal of Pure and Applied Algebra, 221(1), 144–184.