Proof Engineering: Generation, Independent Review, and Formalization
Asking an LLM to write a proof and then check itself in the same conversation yields polite approval, not real review. Mathematical proofs suffer most from this: a single hidden assumption can be wrong while everything downstream still reads smoothly. This article explains why generation and verification must be separated into different contexts and models, and lays out a practical pipeline: one human owner defines scope and signs off, a single editor agent maintains the draft, at least two heterogeneous reviewer agents hunt for defects, and a formalization agent translates approved arguments into machine-checkable proof scripts. It covers how to run the gated workflow, manage prompts and materials in layers, treat formalization as more than typesetting, preserve human judgment at the key decision points, and recognize the risks and limits of the whole approach.
Asking a model to write a proof and then, in the same conversation, “check if there are any problems” usually produces a polite pass, not an independent review. Mathematical proofs suffer more than business code from this failure mode: if one hidden assumption is wrong, everything after it can still read perfectly. Binding generation and review to the same context and the same model is effectively letting the drafter serve as its own final reviewer. A more robust approach is to treat the proof as a gated engineering artifact: one party produces it, another hunts for errors, a human defines scope and signs off, and the result is finally sealed with a formal language that a machine can check line by line.
Why the Model That Wrote the Proof Cannot Review It
During long reasoning, a model develops path dependency. Once it commits to an estimate, an inductive hypothesis, or a decomposition, subsequent passages keep manufacturing justifications for that path. If you then ask it to self-check in the same session, the model tends to retrieve its own recent sentences rather than re-derive from the definitions. Four failure patterns are common:
- Scope drift. The task only asked to prove Proposition A, but the output casually “proves” stronger statements B and C, using estimates that have not been established.
- Hidden assumptions. Continuity, bounded moments, or interchangeable limit operations are written into the narrative without a supporting lemma.
- Circular reasoning. Later text cites an “obviously” from earlier text, which itself depends on later conclusions.
- Compilation-style coherence. Symbols, numbering, and page counts look complete, but the direction of a key inequality is flipped. Page count and elapsed time are not evidence of correctness.
Therefore review must happen in a different context—ideally with models from different families or different reasoning configurations—and must be explicitly forbidden from using conclusions from the draft as premises. A human still needs to read every finalized passage, but that time should go into proposition boundaries and key estimates, not into reading pleasantries between models.
Roles: One Human Decides, One Editor Writes
The minimum viable team has only four roles. You do not need a swarm of agents.
Project owner (human). This person writes down the target proposition, the known results that may be used, the conjectures that must not be crossed, and what “done” means. Every important lemma requires the owner’s sign-off before entering the main draft. The owner does not polish prose, but must be able to restate the proof’s main line to a colleague.
Editor (exactly one). Fix this as a single session or single agent. All additions and deletions to the draft go through it alone, preventing version forks when multiple models edit the same file. The editor revises based on review feedback but may not unilaterally expand the theorem’s scope.
Reviewers (at least two, from different model lineages than the editor). They read only the proposition, the definitions, and the current draft, and output a defect list: missing assumptions, attempted counterexamples, inequality directions, limit orders, edge cases. Review comments are work tickets, not new proof text.
Formalizer. Translates arguments that have passed human sign-off into proof-assistant-checkable scripts. It does not invent mathematics; it only converts natural-language arguments into steps that the machine rejects or accepts. A translation failure usually means the draft still has a gap—escalate back to the editor rather than quietly adding assumptions on the formalization side.
How the Pipeline Runs
Follow the gates in order. Do not run “write, formalize, and revise conjectures” in parallel.
Freeze the problem specification. Write a short document covering background, existing lemmas, blockers, and success criteria. Another model can draft the prompt, but the owner must revise it until they can stand behind it. Archive failed attempts separately, summarizing only “routes already ruled out”—do not stuff entire failed drafts into a new session, or the model will repeat old mistakes.
Assign exactly one target. If the group has conjectures A, B, and C, the first round may only prove A. If the model volunteers B and C, treat it as a scope violation: it does not enter review unless the owner expands the scope in writing.
Generate the long proof. Giving more time does not raise correctness. After generation, run a structural check first: are definitions used before they are stated, is the lemma dependency graph acyclic, and is every estimate annotated with its applicability conditions?
Heterogeneous review. At least two rounds of independent reading. Each round receives only the proposition and the draft—no leading prompts like “please confirm this is correct.” Require outputs to include: reproducible counterexample attempts, the three weakest steps, and which lemma is still missing if the proof were formalized. When the two rounds conflict, the owner adjudicates; the editor does not vote.
Formalization gate. Translate the sections that passed review into proof-assistant scripts. If the machine does not accept it, the proof is not done—no matter how complete the natural language reads. Formalization may be submitted lemma by lemma, but the main theorem’s dependencies must be closed.
Bidirectional consistency between the human-readable paper and the machine script. Whenever the natural language changes, update the formalization, and vice versa. Never change only one side.
The gates can be expressed as a checklist rather than a fancy platform:
Proposition A: status = under reviewAllowed premises: Definitions 1-4, Lemma L1 (formalized)Forbidden: using Conjecture B, exchanging limits without a lemmaEditor: only agent E may modify main.md / main.proofReviewers: agents R1, R2, independent, may not edit the draftAcceptance: formalization check passes and owner signs off
Managing Prompts and Materials
An effective prompt is a set of constraints, not eloquence. It should include at least: what the objects are, which quantities live on which measure or probability space, the precise statement to prove, known results that may be cited, and propositions explicitly out of scope for this round. Writing “we failed several previous rounds” as emotion helps nothing; writing “route X lacks tightness at this particular estimate” helps a lot.
Materials live in three layers. Layer one is the frozen problem specification, read-only during generation. Layer two is the main draft, writable only by the editor. Layer three is review comments and the failure archive, append-only. This prevents reviewer models from writing old mistakes back into the main draft as facts.
Review prompts should demand adversarial thinking: first try to construct a counterexample that breaks the conclusion, then read the proof. If no counterexample can be built within an hour, the reviewer must still identify the step that leans hardest on “obviously.” Never frame the review task as “please confirm this is correct.”
Formalization Is Not Typesetting
The value of a proof assistant or similar checkable language is that a single unsupported premise blocks acceptance. It checks logical dependency, not mathematical taste or the elegance of a physical interpretation. So before formalizing, align the definitions: does the same word always denote the same type throughout the draft, does the quantifier order match the proposition, and is it stated which parameters each constant depends on?
Translate in small steps. Each lemma becomes its own block; the main theorem is pure assembly. When hitting a “standard result,” either cite an already-librarized lemma or supply the proof—natural-language “well known” is not acceptable. When the formalizer discovers a gap, it opens a defect ticket back to the editor, and the owner decides whether to add a lemma or weaken the theorem. A weakened statement must be written back into the problem specification, so you never claim externally that the original conjecture has been solved.
What Humans Still Do
The machine pipeline does not eliminate mathematical judgment. The owner must decide: whether this estimate is permitted by the available tools, whether this counterexample actually falls within the proposition’s assumptions, and whether what passed formalization is the original proposition rather than a weaker substitute. The editor model can tidy prose, but it cannot announce “the conjecture is solved” on a human’s behalf.
When reading the draft, prioritize three places: where assumptions enter, at which step the inequality tightens, and whether limits are exchanged with expectations or integrals. These are where long proofs fail silently most often. The remaining algebraic expansions can be left more to the formalization check.
Even if all reviewer agents pass, that only means “no counterexample found under their reading of the current draft.” Externally, distinguish three states: draft complete, heterogeneous review found no blocking issues, formalization check passed. Do not collapse them into a single “proven.”
Risks and Boundaries
This process does not guarantee that an original conjecture is solvable, nor does it replace peer review. Models may share similar training blind spots—heterogeneous lineages are not independent oracles. Formalization scripts can themselves encode wrong definitions, thereby “proving” a different sentence. The mitigation is for the owner to run a definition diff against the original proposition and keep a side-by-side mapping between the natural language and the formalization.
Do not report elapsed time, page count, or the number of passing agents as performance metrics. They describe process, not mathematical strength. And do not let the generation model summarize “review has passed” in the same session—that rebinds the gate to self-evaluation.
For engineering teams, the same method applies to complex invariants, protocol correctness arguments, and written proofs of critical algorithms: separate generation from review, freeze the scope, require machine-checkable acceptance before merging, and have humans sign off only on propositions and key steps. Once a proof is treated like building a team, speed comes from clear responsibilities—not from switching to yet another model that writes longer prose.
