Monoidal & process categories
Monoidal categories and string diagrams; premonoidal/effectful categories for path-dependence; resource theories; a blueprint process category of paint-making. (Beyond the book.)
A plain category gives you one way to combine arrows: end-to-end, \(g\circ f\) — “do \(f\), then \(g\).” Engineering a system needs a second, orthogonal way: side-by-side, running two operations on two separate channels at once. The structure that houses both is the monoidal category — and its deliberately weakened refinement, the premonoidal / effectful category, is the centerpiece of this whole reference: the precise mathematical home of path-dependence, hidden state, and irreversibility.
Two directions of composition
In the category modules every diagram composed in one direction only — along arrows, in time. A monoidal category adds a second, independent direction. Objects are system states (or signal types), morphisms are processes (blocks). Sequential composition \(g\circ f\) chains blocks (filter, then amplify, then quantize); the tensor product \(\otimes\) encodes “while” — run two processes on disjoint wires at once; the unit object \(I\) is the empty system, nothing to do.
Intuition. \(\circ\) is later; \(\otimes\) is alongside. Reading a block diagram or signal-flow graph, vertical is time and horizontal is “things happening at once on separate wires.” A monoidal category is the algebra of exactly that picture.
Formally, a monoidal category equips \(\mathsf C\) with a functor \(\otimes:\mathsf C\times\mathsf C\to\mathsf C\), a unit \(I\), and natural isomorphisms — the associator \(\alpha_{A,B,C}:(A\otimes B)\otimes C\xrightarrow{\sim}A\otimes(B\otimes C)\) and unitors \(\lambda,\rho\) — subject to coherence. On morphisms, \(f\otimes g:A\otimes B\to A'\otimes B'\) runs \(f\) and \(g\) in parallel. This is a categorified monoid: one law of combination with a unit, one level up. Standard examples: \((\mathsf{Set},\times,\{*\})\), \((\mathsf{Vect},\otimes,k)\). A morphism \(I\to A\) is a state / preparation; \(A\to I\) an effect / discard.
In the synthesis. The tensor \(\otimes\) is P8: parallel composition — multi-batch, multi-component coupling. A monoidal category is the first-pass formalization of “a manufacturing route is a diagram of processes.” First-pass only: we will see it is too strong for dispersed materials.
Pitfall. \(A\otimes B\) is not a combined signal. It is two wires merely present together, a priori not interacting. Actual combining (a mixer, an adder) is a morphism \(A\otimes B\to C\) — never the object \(A\otimes B\) itself.
Coherence, the swap, and string diagrams
Two conveniences make the algebra usable. The first is coherence. A monoidal category is strict if \((A\otimes B)\otimes C\) literally equals \(A\otimes(B\otimes C)\), and weak if they are only canonically isomorphic. Mac Lane’s coherence theorem settles the bookkeeping.
Theorem (Mac Lane coherence). Every diagram built from associators and unitors commutes, and every monoidal category is monoidally equivalent to a strict one. So we may reason — and draw — as if \(\otimes\) is strictly associative and unital, with no ambiguity from how brackets are placed.
The second convenience is the swap. Relabeling “wire 1 / wire 2” — physically crossing two channels — should not matter to the formalism of running things in parallel. A braided monoidal category supplies a natural \(\sigma_{A,B}:A\otimes B\xrightarrow{\sim}B\otimes A\) (the hexagon axioms); a symmetric monoidal category (SMC) adds \(\sigma_{B,A}\circ\sigma_{A,B}=\mathrm{id}\), so two crossings cancel.
Pitfall — keep these apart. Symmetry is a statement about positions of parallel systems (\(A\otimes B\cong B\otimes A\), “which wire is on the left”). It is logically independent of whether two processes commute. Symmetry does not say “the order of two operations is irrelevant.” That stronger — and for us false — claim is the interchange law below. This separation is the conceptual key to the whole part.
Coherence is what legitimizes the working notation: string diagrams. Boxes are processes, wires are systems; vertical = sequential (\(\circ\)), horizontal = parallel (\(\otimes\)). Read top-to-bottom for time, left-to-right for things alongside. A mixer fed two input signals and emitting one output is a box with two in-wires and one out-wire — a block diagram that is now a rigorous algebraic expression. By the Joyal–Street theorem the calculus is sound and complete: an equation holds in every monoidal category iff the diagrams agree up to planar isotopy (symmetry adds wire-crossings). Signal-flow graphs, circuit schematics, dataflow graphs, and ML tensor-network (Penrose) diagrams are all string diagrams.
The interchange law and why it must break
Here is the equation everything turns on. In a monoidal category, \[ (g\otimes g')\circ(f\otimes f')=(g\circ f)\otimes(g'\circ f'). \] Read it as: do \(f\) then \(g\) on wire 1, and independently \(f'\) then \(g'\) on wire 2; it makes no difference whether you parse this as two parallel steps stacked or as two pipelines side by side. When two things are genuinely independent, the relative timing of their sub-steps is immaterial.
This equation is functoriality. “Interchange holds” and “\(\otimes:\mathsf C\times\mathsf C\to\mathsf C\) is a bifunctor (functorial in both arguments jointly)” are the same statement. So weakening interchange means weakening the bifunctoriality of \(\otimes\) — nothing more exotic than that.
For ideal, isolated wires, interchange is correct. But real systems run on a shared global state: a block of mutable memory, an I/O device, a shared register the whole pipeline reads and writes. Two “parallel” operations both touch this state, so their order changes the outcome — incrementing then doubling a shared accumulator differs from doubling then incrementing, and two writes through aliased pointers race. That violates interchange. An honest formalism must drop it.
In the synthesis. This is the crux for P1 (path-dependence / non-commutativity). The commutative model says “either order, same result”; the plant says otherwise. The fix is not to patch examples but to remove the law that forbids them.
Pitfall. Failure of interchange is not failure of symmetry — a perfectly symmetric \(\otimes\) (relabel wires at will) can still violate interchange, because operations couple through hidden state. Do not “fix” path-dependence by breaking the swap; the swap is fine.
Premonoidal & effectful categories — the precise structure
Drop interchange and keep everything else, and you get exactly the right object. A premonoidal category is “a monoidal category without the interchange law”: \(\otimes\) is functorial in each variable separately but not jointly. An effectful category adds the missing bookkeeping — a marked sub-collection of “pure” morphisms that do interchange.
Intuition. Every operation silently threads through one global resource — a runtime / state wire carrying the contents of shared memory, the I/O world, the program’s hidden store (think the State or IO monad). Because both of two “parallel” operations touch this single wire, they are secretly in series through it, so you may not slide one past the other. A few operations are genuinely inert toward the global state — a pure arithmetic step, a read with no side effect — and those can be reordered. An effectful category is precisely the bookkeeping of “stateful (order matters) versus pure (order free).”
As the figure shows, the runtime wire is a real wire in the diagram that every effectful box must touch — non-interchange made visible. Two boxes on that wire cannot be slid past each other, because doing so would reorder their reads and writes of the shared state.
The formal machinery (Power–Robinson; Román; Earnshaw)
In a premonoidal category \(\otimes\) is only a sesquifunctor: each whiskering \(A\otimes(-)\) and \((-)\otimes A\) is a functor, but the joint assignment is not — so \(f\otimes f'\) is genuinely ambiguous (“\(f\) first, threading state, then \(f'\)” versus “\(f'\) first”), and the two readings need not be equal. A morphism is central if it interchanges with everything; the central morphisms form the monoidal centre. An effectful category (Román) is an identity-on-objects functor \(\mathsf V\to\mathsf C\) from a monoidal category \(\mathsf V\) of pure / value morphisms into a premonoidal \(\mathsf C\), with image landing in the centre. Power–Robinson introduced premonoidal categories to model computational side-effects — a stateful program reads and writes a global store and so cannot be freely reordered. Earnshaw–Sobociński / Earnshaw–Román supply the string-diagram calculus with the explicit runtime wire drawn above.
The slogan: premonoidal / effectful = monoidal (+ symmetric) − interchange (+ a marked centre). Every ordinary monoidal category is the degenerate case where everything is pure and central. The runtime wire is the formal carrier of the global state; hide it and you recover ordinary — wrong-for-us — monoidal reasoning. The framework is established (Power–Robinson 1997; Román 2022; Earnshaw 2023) and, per a literature search, not yet applied to materials processing — which is the opening.
In the synthesis. This is the exact tool for RD1: an effectful process category in which performance is a functor. Its two components are P1 (order matters → drop interchange) and P2 (irreversibility → non-invertible morphisms; see below). The “global state” is the right hidden variable of RD3 — the latent dispersion state plus cumulative thermal/shear history. No commutative, or even plain symmetric-monoidal, model can express this.
Pitfall — the state-passing temptation. You can “fix” order-dependence by enlarging objects to carry the full state and staying monoidal (the state-passing trick). It works formally but defeats the purpose: it forces the hidden state to be an explicit, fully specified object, whereas the entire modeling challenge is that the state is latent and only partially observable. The premonoidal stance keeps it implicit on the runtime wire — exactly where RD3 wants it.
Irreversibility, open systems, and behaviour-as-a-functor
Three further layers complete the toolkit; each speaks to a distinct synthesis problem.
Resource theory — irreversibility (P2). A resource theory (Coecke–Fritz–Spekkens) is a symmetric monoidal category: objects are resources (bits, energy, entanglement), morphisms are allowed transformations, \(\otimes\) is “having both,” with a sub-SMC of free operations. The key move: a morphism with no inverse is an irreversible process — you cannot un-erase a bit (Landauer) or recover the input of a one-way hash. Convertibility \(A\succeq B\) (“\(B\) reachable from \(A\) by free steps”) is a preorder, and \(\otimes\) makes resources an ordered commutative monoid. A monotone is an order-preserving homomorphism to \((\mathbb{R},+,\ge)\) — a figure of merit that cannot increase under free conversion: a target with a higher monotone than your input is unreachable for free. Resource theories are deliberately commutative — they track what is reachable, not in which order; ordering is the premonoidal layer’s job.
Two layers, two jobs. Premonoidal/effectful = order and hidden state (P1, RD1, RD3); resource-theoretic = feasibility and cost via monotones (P2). The clean picture is layered: an effectful category for sequencing, graded by monotones for what each route costs.
Open systems — composing subsystems. Engineering systems are open (inlet, outlet, interface). A cospan \(X\to S\leftarrow Y\) is “a system \(S\) with input boundary \(X\), output boundary \(Y\)”; two compose by gluing along a shared boundary via a pushout. Decorated cospans (Fong) attach a decoration of the internals to the apex; structured cospans (Baez–Courser) take \(L(a)\to x\leftarrow L(b)\). Both yield symmetric monoidal hypergraph categories of open systems, underpinning open Petri nets and open reaction networks. The supporting syntax: a PROP is a strict SMC on objects \(0,1,2,\dots\) with \(m\otimes n=m+n\), so a morphism \(m\to n\) is a box with \(m\) inputs and \(n\) outputs — generators-and-relations for a process theory (Gale–Lobski–Zanasi’s retrosynthesis uses layered PROPs). A hypergraph category lets wires split, merge, and be created or discarded — the algebra of fan-out, bus joins, and feedback loops. Spivak’s operad of wiring diagrams has boxes-with-ports as objects and wirings (composed by nesting) as operations; an algebra for it assigns admissible fillings — the mathematics of modular, hierarchically nested systems.
Pitfall. The hypergraph copy map duplicates a system formally, not matter for free; forcing full hypergraph structure on a resource theory (where copying is not free) can trivialize it. And decorated and structured cospans coincide in many cases but are not interchangeable in general — choose deliberately.
Behaviour as a functor — performance (P7). Two worlds sit side by side: syntax (string diagrams of what you do) and semantics (what they effect — measured performance). A structure-preserving functor \(F\) sends each process to its behaviour, respecting both compositions: behaviour of “\(g\) after \(f\)” is the composite of behaviours, behaviour of “\(f\) beside \(g\)” the parallel composite. After Lawvere, a theory is a category (often monoidal) and a model is such a functor into a semantic category. Black-boxing is the special case sending an open system to only its externally observable input–output behaviour — computing the overall transfer function of an interconnection from its subsystems; Baez et al. build symmetric monoidal black-box functors for open circuits, Markov processes, and reaction networks (system \(\mapsto\) steady-state I/O relation). The symmetry of that functor is the claim that behaviour composes.
In the synthesis. “Performance is a functor” is P7, and load-bearing for RD1 and RD4 (transfer / behaviour functors). It is a strong, falsifiable hypothesis: performance is genuinely compositional — no globally emergent term unreconstructible from parts plus wiring. Where path-dependent hidden state matters, this functor must be defined on the premonoidal/effectful process category (carrying the runtime wire), or functoriality simply fails — which is itself the signal that the model is wrong. A transfer functor (RD4) is then a structure-preserving comparison between two semantic worlds: lab- versus plant-scale, or a change of measurement.
Prior art, and the blueprint for paint-making
Categorical process modeling already exists, so “processes as a monoidal category” is not novel. A map of what is mature, and where the gap lies:
| Ingredient | Who | What it gives — and what it defers |
|---|---|---|
| Process planning for manufacturing | Breiner–Jones–Subrahmanian (NIST) | Process plans as string diagrams with abstraction-level functors. Closest prior art to RD1; defers irreversibility, hidden state, properties. |
| Categorical retrosynthesis | Gale–Lobski–Zanasi | Retrosynthetic analysis in layered PROPs. |
| Open reaction networks / Petri nets | Baez–Pollard, Baez–Courser | Composable open networks with black-box semantics. |
| Resource theories | Coecke–Fritz–Spekkens | Irreversibility and monotones (P2). |
| Premonoidal / effectful categories | Power–Robinson, Román, Earnshaw | Order-and-state with a string-diagrammatic runtime (RD1). |
One established model deserves a sharp caveat — almost what we want, yet wrong for paint.
Petri nets are free commutative monoidal categories (Meseguer–Montanari). A Petri net freely generates a commutative monoidal category: objects are markings (the free commutative monoid on places, so \(\otimes\) adds token counts) and morphisms are concurrent firing sequences. Being commutative, concurrent firings interchange — the model deliberately encodes order-independence.
Pitfall — do not adopt this wholesale for paint. Precisely because Petri-net / reaction-network categories are commutative, firing “add dispersant” and “high-shear mill” in either order gives the same morphism. That is exactly the assumption that fails for path-dependent dispersed systems — and the formal justification for moving to premonoidal/effectful categories.
Bridge — to materials. The objects below are the material states catalogued in microstructure as hidden state; the morphisms are the unit operations of processing, and the runtime wire is that module’s “latent dispersion state + thermal/shear history.” This math module is the abstract skeleton; those two materials modules supply the flesh — what the wire actually carries, and why milling order rewrites it.
Putting every layer together gives the blueprint — an effectful process category of paint-making (the materials instantiation of the same machinery the shared-memory pipeline illustrated above, now with physical state on the runtime wire):
- Objects = material states, each implicitly carrying hidden state: resin solution, pigment powder, millbase, reduced paint, wet film, cured coating (hidden part = particle-size distribution, degree of wetting, thermal/shear history).
- Morphisms = unit operations (disperse, let down, coat, dry/cure, handling): they act on the explicit material and read/write the implicit state, so they live on the runtime wire.
- \(\otimes\) = handling batches in parallel (P8). The category is symmetric (relabel batches freely) but premonoidal/effectful: most operations touch the runtime wire, so they do not interchange (P1), and via non-invertible morphisms encode P2 irreversibility; a small central subcategory of pure operations may be reordered.
- Open-systems layer: operations as boxes in a layered PROP, stages made open via structured/decorated cospans, lines assembled with wiring/hypergraph structure — the effectful semantics becomes an algebra over the wiring operad.
- Performance = a functor to measurable outcomes (gloss, opacity, viscosity profile, defect rate, durability), composing sequentially and in parallel (P7, RD1); monotones grade outcomes by feasibility and cost (P2); a transfer functor (RD4) relates lab- and plant-scale semantics.
The thesis of this part. The process category must be effectful, not merely (symmetric) monoidal. Only by dropping the interchange law and carrying an explicit runtime wire for the hidden dispersion state can the formalism honestly say that, in paint-making, order matters for every operation.
Recap
- Two compositions. \(\circ\) is sequential (in time); \(\otimes\) is parallel (alongside, = P8). A monoidal category houses both; Mac Lane coherence lets us draw it as bracket-free string diagrams.
- Symmetry ≠ interchange. The swap \(A\otimes B\cong B\otimes A\) reorders which wire is on the left; the interchange law (= bifunctoriality of \(\otimes\)) claims sub-step timing is immaterial. These are independent, and only the second one fails for us.
- Premonoidal / effectful = monoidal − interchange (+ centre). Every operation threads a runtime wire of hidden state; touching it forbids reordering. This is the exact home of P1 (order), P2 (non-invertibility), RD1 (performance = functor), and RD3 (the wire = the right hidden variable).
- Three supporting layers. Resource theories quantify irreversibility via monotones (P2); decorated/structured cospans and PROPs/operads make subsystems open and composable; behaviour-as-a-functor makes “performance is compositional” a falsifiable claim (P7, RD4).
- Corrected fact. Petri nets / reaction networks are free commutative monoidal categories — order-independent by construction — which is exactly why they are insufficient for path-dependent paint, and why RD1 moves to effectful categories.
Part of a four-document set: the ARiSE draft (problem + AI solution), this modular Mathematics reference, the companion materials reference, and the synthesis. Generated from modular Markdown with a custom static-site builder.
Mathematics is typeset with MathJax (loaded once from a CDN with Subresource Integrity; needs network on first view). Diagrams are inline SVG and follow the light/dark theme. Keyboard: / search · [ ] prev/next · t theme.