Skip to content

Principia · companion · polygraphic computation

Mathematics that runs. How a law becomes a machine.

Category theory says what composes. A polygraph writes those laws as rules. Rules that fire locally, in any order, are a computer, and a computer built from proved rules does what the mathematics says, on whatever hardware runs it. This is how we carry abstract mathematics into the physical world.

Four stages left to right: a commuting square (the law), the same square as a two-cell rewrite (the rule), two interaction-net agents reacting (the machine), and a chip computing the result (the matter), threaded by a stream of glyphs that turns from mathematics to agents to bits.
4 · 5agents and rules: the whole of our rewriting kernel
360 → 1ways to run the lab’s net below, and the one place they all end
10,000Mathlib declarations, run as nets, agreeing with an independent checker
4 → 1hardware substrates, one byte-equal answer

01 · Why rules

A description informs. A rule acts.

Mathematics that only describes the world leaves it as it is. To govern machines, matter and the systems we depend on, a law has to run, and keep its guarantee while it does. Rewriting is that bridge.

Category theory is the mathematics of composition: which parts fit, and why fitting them together in different orders gives the same whole. David Spivak describes it as an accounting system for collective sense-making. A commuting square is a law. A polygraph, a presentation by generators and rewrite rules in every dimension, writes the same law as a rule that turns one path into the other.

And rules are computation. Each one is local: it touches only the two things that meet, so rules can fire everywhere at once, and confluence guarantees that the answer does not depend on which fired first. Proved laws become local rules; local rules become parallel machines; the machine’s answer is the law’s answer. What carries a rule is a polynomial comonoid, by an equivalence we proved, building on Niu and Spivak’s polynomial functors.

The rules are not arbitrary. The distinction Principia begins with returns here as an operator: the boundary of a state, ∂a = a ∧ ∼a, is exactly what a reduction erases, and the kernel below is built from the operators of that logic.


02 · The machine

Four agents. Five rules. Fire them in any order.

This is Boundary, our rewriting kernel, running its real rules in your browser. Each verdigris wire is an active pair: two agents meeting principal to principal. Click any of them, in any order you like, and watch where the net ends up.

  • α

    Alpha

    meet

    a ⊓ b
  • ν

    Nu

    closure (a nucleus)

    a ≤ ν a, ν(a ⊓ b) = ν a ⊓ ν b
  • τ

    Tau

    interior: the check

    τ a ≤ a, τ(a ⊓ b) = τ a ⊓ τ b
  • ε

    Eps

    erasure

    ε a = ⊥
5 active pairs · fire any of them
Annihilateν ▷◁ ν
two closures cancel; their data wires join, their witnesses are erased
Commuteν ▷◁ α
closure distributes across meet: the net grows by four agents
Eraseε ▷◁ ·
erasure dominates and spreads to everything its opponent held
Checkτ ▷◁ ·
the verifier passes its opponent on, or stops the run with a reason
Associateα ▷◁ α
two meets rewire in one local step

Each agent’s meaning is proved in Lean: α is meet, ν a closure that preserves meets, τ an interior that checks, ε erasure to ⊥, and ν and τ both respect α and ε. The net above has exactly 360 complete runs; the button beside it runs every one with the kernel and reports what it finds.


03 · Every system is rules

Give us the rules a system follows. We tell you whether its parts make a whole.

A controller’s mode table, a protocol’s messages, a device’s command set: each is a polygraph. The Gluing Engine reads it and answers four questions, each with a certificate a small proof kernel checks without trusting the program that found it.

  1. Q1

    Which states are really the same?

    Congruence holds
    normal forms index the classes
    When it fails
    ambiguity
  2. Q2

    Does the order of events change the outcome?

    Confluence holds
    one normal form, in any schedule
    When it fails
    a race
  3. Q3

    What is protected when parts fail?

    Factorisation holds
    noise moves only what does not matter
    When it fails
    a protected twist (a code)
  4. Q4

    Can every local view agree?

    Synchronisation holds
    a global section; a reset word
    When it fails
    curvature around a loop

Every answer is a construction (here is how) or a refutation (here is the conserved quantity that makes it impossible), in the sense of constructor theory. The same system is then compiled, from the proofs, into code that runs on hardware.


04 · One way a whole fails

Every failure is a zigzag. Some of them are races.

Two things that must stay distinct get joined. Where it happens decides the remedy. A twist lives in how the system is read, and is reframed or deliberately kept, like an error-correcting code. A race lives in the system itself, and only a new rule repairs it. Here is a real one, from a home with solar, wind and a battery.

Pboth events pendingAstart first: full powerBreserve firstUover the grid limitSwithin the headroom

An EV asks to start at the instant the battery reaches its reserve

Run both schedules.


05 · Proofs run

There is no compiler.

A proof checker is itself a rewriting machine. Every success of Lean’s kernel corresponds, in both directions, to reductions on a four-cell interaction net. Proofs do not need translating into computation. They already are computation.

THE PROOF CHECKERTHE NEThead normalisationdefinitional equalitytype inferencesort inferencetype checkinglift, by recursion on the proofreflect, by induction on the net · nothing forgotten either way
10,000 declarations from Mathlib agree, family by family, with an independent reference checker.

06 · Same answer, any machine

Confluence survives the substrate.

If the answer cannot depend on the order of steps, it cannot depend on the hardware either. The same reducer runs on processors and graphics cards and returns the same bytes, and where it runs is chosen by measurement.

ONE REDUCER, FOUR SUBSTRATESCPU · manycoreCUDA · managed memoryCUDA · device memoryGB10 · unified memorynormal formbyte-equal
On the calibrated corpus the four agree byte for byte. Which one runs is decided by measurement: across six measured workload classes the manycore CPU path led, so the router sends work there, and only a new sealed measurement can change that.

07 · Coherence with a receipt

Not only that branches meet. That they meet lawfully.

When two rules apply at once, their results must be reconciled. We draw each such critical pair as a square in cubical type theory: only a lawful reconciliation can fill it, so coherence arrives with its own receipt, and a scheduler learns exactly how freely it may reorder work.

⊢a legal join: the square fills∅an illegal one: no filler exists
A diamond asks only whether two branches meet. A square asks whether their meeting is lawful, and carries the receipt. The type checker refuses the second square before anything runs.

And reduction loses nothing it cannot account for. A confluent calculus normalizes, which erases; its unused second negation splits every state into a reversible core and its boundary, and that boundary is at once a reverse, a derivative and a clock.



09 · From the page to the physical world

This is how mathematics takes command of matter.

A proved law, written as rules, run by a machine, checked on every step: each of our research records is this method meeting real hardware, in service of the people who depend on it.

Our technology is ontological · Our engineering is constructive

Software = Mathematics · Hardware = Physics

Discover ⇒ Build ⇒ Grow ⇒ Learn ⇒ Teach


10 · The library

Ten papers. Read them in full.

From the kernel to the systems it checks, in the order the work was done. Every result is machine-checked, and every paper is open.

  1. Boundary

    A four-agent interaction-style rewriting kernel with a Lean 4 reference semantics

    Four agents, five rules, one rule per pair, and a total dispatch table: the machine every later result runs on.

    the machine · April 2026 · 13 pages · PDF ↗

  2. Confluent by Construction

    Seven cross-kernel demonstrations of knot topology in the Heyting substrate

    Knots built two ways meet in one certified result, across six verification kernels and a runtime.

    knots · May 2026 · 24 pages · PDF ↗

  3. There Is No Compiler

    Lean’s kernel as an active-pair interaction net

    Every success of a proof checker is a reduction on a net, and back; 10,000 Mathlib declarations agree.

    proofs run · May 2026 · 17 pages · PDF ↗

  4. Polygraphic Computation

    The polynomial substrate: container as carrier, cofree as behaviour, tricategory as coherence

    What carries a rewrite rule: every polygraphic generator is a polynomial comonoid, by a proved equivalence.

    the carrier · May 2026 · 19 pages · PDF ↗

  5. Confluence Survives the Substrate

    Byte-equal interaction-net reduction on CPU, CUDA and GB10

    Four implementations, byte-identical; the router chooses hardware by measurement, never by hope.

    silicon · May 2026 · 18 pages · PDF ↗

  6. When a Market Solves Itself

    The homology of free computation in exchange economies

    One number, the market graph’s count of independent loops, decides when an equilibrium computes itself.

    markets · June 2026 · 16 pages · PDF ↗

  7. Both Halves of the Boundary

    The reverse, the derivative and the clock a reduction calculus already contains

    Normalizing erases; its unused second negation splits every state into a reversible core and its boundary ∂a = a ∧ ∼a, which is at once a reverse, a derivative and a clock.

    time · July 2026 · 11 pages · PDF ↗

  8. Interaction Nets That Carry Their Own Coherence

    n-cell confluence over cubical type theory and the Boundary polygraph

    Each critical pair becomes a square that only a legal join can fill: coherence with its own receipt.

    coherence · 2026 · living document · 9 pages · PDF ↗

  9. Where the Parts Make a Whole

    A certified instrument for collective sense-making

    The Gluing Engine: any system as rules, four certified questions, and the one way a whole can fail.

    systems · November 2026 · 21 pages · PDF ↗

  10. What Meaning Can Copy

    Machine-checked copy laws, braiding limits and exact acceptance for compositional quantum models

    Exactly what copying permits, from a pronoun to a tied weight to a qubit, and what braiding adds.

    meaning · November 2026 · 41 pages · PDF ↗