Trellis

Trellis is an autoformalization system that leverages LLM agents in a deterministically constrained workflow to enforce incremental progress on formalization through iterative refinement of natural language proofs. Our approach is motivated by the common mathematician's notion of what it means to have a rigorous proof in the first place: namely, that it would be routine to elaborate any part of the proof in further detail. The result is a system which aims to achieve reliable autoformalization on a modest budget and with generalist agents, with specialization to autoformalization coming not from any task-specific agent training but instead from a meaning-of-rigor inspired workflow enforced by process semantics overseen by a deterministic supervisor.

Formalized papers

How it works

Here is a high-level tour of how Trellis turns a paper into a machine-checked Lean formalization. The guiding idea, above, is that a proof is rigorous exactly when it would be routine to spell out any step in as much detail as one likes. Trellis operationalizes this: it forces a structured proof to be elaborated, step by step, until each remaining piece is easy to formalize — all under a deterministic supervisor that permits only genuine progress.

The proof tablet

Trellis works on a proof tablet: a directed acyclic graph of nodes wired together by Lean's import structure. Each node is either a definition or a theorem-like statement (a lemma, corollary, or helper) and carries two paired sides — a natural-language statement and proof in LaTeX, and a matching Lean statement and proof. The natural language is load-bearing: it is where the argument is decomposed and justified, before and as it is turned into Lean.

The whole system rests on keeping every node honest. Independent agents — each separate from the worker that wrote the node — judge it against three gates:

A Trellis node has a natural-language side and a Lean side, linked by correspondence, and must pass three gates judged by independent agents: substantiveness, correspondence, and soundness.

A fourth check, paper-faithfulness, applies to the few nodes meant to cover the paper's headline theorems. A run has two phases. In theorem-stating, Trellis drafts and refines the statements until every node passes its gates; a human then ratifies the Lean shapes of just the nodes those target theorems depend on (their semantic closure). Only then does proof formalization begin, where the goal is to close every Lean proof.

Enforcing progress

The hard part of autoformalization is not any single proof — it is guaranteeing steady progress across a run far longer than any agent's context window, without the agent quietly faking it. Trellis's answer is a rule with no escape hatch. Facing an open proof obligation, the worker may do only one of two things:

Facing an open proof obligation, the worker must either formalize it by writing a Lean proof the kernel verifies in an isolated build, or refine it into substantive sub-step nodes that each clear all three gates; a vacuous refinement fails substantiveness and is rejected.

Because a too-hard step can only be broken into genuinely smaller sub-steps — never repackaged or deferred — the proof cannot stall or pretend to be finished. This is the “rigor as latent formality” idea made mechanical: keep spelling things out, and every step eventually becomes easy.

The supervisor cycle

All of this is driven not by a rotating sequence of prompts but by a deterministic kernel (written in Rust, with a TLA+ specification) that owns every decision and all protocol state — Lean build status, gate verdicts, and what each agent is permitted to touch. The agents around it — a worker, the verifier lanes, and a single reviewer that routes the worker — are ordinary general-purpose LLMs with no task-specific training. The kernel issues exactly one agent call at a time, only the worker can write to the tablet, and the authoritative Lean build runs in an isolated checker no agent can reach. The diagram traces one such cycle:

One supervisor cycle as a swimlane diagram: the kernel starts a cycle and hands the worker one action; it validates the edit with a shape check, isolated Lean build, and axiom check; the per-node verifier lanes certify changes; the kernel reconciles blockers; and the reviewer routes the next worker before a checkpoint is committed.
A simplified view of one cycle. Time runs left to right, and each lane is the actor the kernel consults. The worker takes a single action; the kernel validates it (shape check, isolated Lean build, axiom check), the per-node verifier lanes certify any change in meaning, and the kernel reconciles the global blocker set before the reviewer routes the next step. Solid arrows are the normal flow; a dashed arrow carries a no-op edit, a Stuck, or a NeedsRestructure straight to the reviewer (an invalid edit is instead retried); and green double lines mark a consultation of the isolated checker.

What Trellis trusts

This division of labor is what makes a finished formalization trustworthy even though the agents are not. Exactly three things are trusted, and nothing else:

Correctness

The supervisor's isolated Lean build and axiom check certify that every node's Lean proof really supports its Lean statement. Machine-checked; rests on no agent.

Faithfulness

A human ratifies the Lean shapes of the nodes the paper's target theorems depend on — their semantic closure. That, and nothing about the agents, ties the result to the paper.

Progress

The agents — worker, verifier lanes, reviewer — are trusted only to push the run forward. They decide whether Trellis finishes, never whether the result is sound.

That is the core. The paper gives more detail on the design — fingerprints and automatic re-verification, authorized deviations from the paper, and scope and “coarse focus” — and the source repository has the full TLA+ specification and implementation for anyone who wants to see the complete spec or implementation detail.