When Proofs Meet Agents: How a "Generate–Review–Formalize" Pipeline Tackles Hard Math Problems
A real mathematical research case shows why separating proof generation, independent agent review, and formal verification produces far more reliable results than asking a model to check its own work. This article breaks down the underlying principles—separation of duties, context isolation, and redundant cross-checking—and shows how developers can apply the same generate–review–verify pipeline to everyday AI workflows.
When Proofs Meet Agents: How a “Generate–Review–Formalize” Pipeline Tackles Hard Math Problems
1. A Counterintuitive Scenario
In everyday development, we’re used to this kind of interaction: you ask a model to write a piece of code, then in the same conversation ask it to “check for bugs.” The model replies “no problems found,” and the code gets merged into the main branch.
The flaw in this path is that the generator and the reviewer are the same model, sharing the same context. A model tends to endorse what it just produced, and the confident tone already present in the conversation reinforces that tendency. This isn’t a capability problem—it’s an incentive-structure problem. An author reviewing their own manuscript has a naturally low error-detection rate.
A recent mathematical research case points in the opposite direction. The researcher was facing a long-unresolved problem in probability theory and statistical physics; earlier attempts had all failed, and the accumulated failure records filled an entire folder. This time, he handed the task to a new reasoning model, which ran for over a hundred minutes and returned a complete proof covering three conjectures—more than forty pages after compilation. What’s truly worth learning is not “the model won,” but the half-sentence about process that he added afterward: after the proof came out, he had two independent agents review and confirm it, and he is now using a formal verification language to check every reasoning step one by one.
Doing mathematics is starting to look like assembling a team: one party produces the proof, another reviews it, and humans only set the problems and make the final call.
2. Why “Asking Separately” Beats “Asking Follow-ups”
From an engineering perspective, three transferable principles lie behind this approach.
1. Separation of duties. The model generating the proof is only responsible for construction; the reviewing model is only responsible for falsification. The reviewer’s sole task is to find flaws—logical leaps, uncited lemmas, missing boundary conditions. When the reviewer doesn’t know the generator’s reasoning process, it must re-derive everything from the axioms, which is itself an independent recomputation.
2. Context isolation. Give the reviewer a fresh session with a clean context, so that the tone, assertions, and intermediate conclusions from the generation phase don’t pollute its judgment. This is equivalent to black-box testing in unit tests: it only looks at inputs (the proposition) and outputs (the proof), not internal implementation details.
3. Redundancy and majority voting. Cross-checking with two models of different architectures or training lineages significantly reduces the chance that a single model’s systematic blind spots go unnoticed. A common combination in practice is one general-purpose model at a high reasoning tier plus one domain-specialized model. If both agree, confidence rises sharply; if they diverge, the divergence itself is the most valuable review lead.
3. Prompts Aren’t Written Off the Top of Your Head: Let the Model Draft the “Task Brief”
An easily overlooked detail in this case: the researcher didn’t write the攻关 prompt himself. He first had a general-purpose large model draft a task specification based on the background material, covering:
- The background and existing results in the research field;
- Where previous attempts got stuck and the specific shape of the failures;
- The specific proposition to be proved and the expected output format;
- The scope of tools and references allowed.
This “model drafts the prompt, human reviews it” approach essentially turns requirements clarification into a pipeline stage too. Developers can readily reuse this in daily work, for example:
# RoleYou are a mathematical referee. Your task is to rigorously review the proofbelow. Only look for errors—you are not responsible for improving it.# Proposition[The proposition under review]# Proof[The full proof]# Review Requirements1. Check whether every reasoning step is justified; flag any logical leaps;2. Check whether all lemmas are correctly cited and actually hold;3. Check whether edge cases and degenerate cases are covered;4. Output: PASS / UNCERTAIN (list locations and reasons) / FAIL(provide a counterexample or the flaw).
The key to this prompt is making clear that “the reviewer only falsifies.” If you ask it to “improve the proof while you’re at it,” the boundary of responsibility blurs again.
4. Take Review Results to Formal Verification: Machine-Level Line-by-Line Checks
Verbal review can still go wrong. What truly reassures the mathematics community is translating the proof into a formal verification language—one that lets a computer check the proof’s logic line by line. If a single step is wrong, the compiler refuses to pass it.
This “generate → review → formalize” three-stage structure maps well onto three lines of defense in software engineering:
| Stage | Analogy | Purpose |
|---|---|---|
| Generate the proof | Coding/implementation | Quickly produce candidate solutions |
| Independent agent review | Code review | Catch logical flaws from an independent perspective |
| Formal verification | Compiler / static analysis / type systems | Mechanically guarantee every step is verifiable |
The takeaway for developers: any AI output that merely “looks right” should have a path leading to a machine-verifiable form. Code has compilers, type systems, and tests; configurations have schema validation; reasoning and mathematical arguments correspond to formal proof tools. Anything that cannot enter a verification pipeline should be labeled an “unverified assumption” rather than assumed correct.
A simplified pipeline orchestration might look like this:
# Pseudocode: generate–review–formalize pipelineproof = generator.solve(problem_statement, context_files)reviews = [reviewer_1.check(problem_statement, proof), # independent contextreviewer_2.check(problem_statement, proof), # high reasoning tier]if all(r.status == "PASS" for r in reviews):formalization = formalizer.translate(proof)result = lean_checker.build(formalization) # formal verificationif result.ok:publish(proof, reviews, formalization)else:route_back(result.errors)else:route_back(conflicts(reviews)) # send divergences back for rework
5. The Human–Machine Division of Labor: The Researcher’s Real Contribution
Based on public descriptions, the researcher documented the entire workflow in a process document centered on a four-role division of labor (generalized here):
- Problem setter / final approver (human): defines the problem, judges the value of results, makes the final call;
- Proof generator: constructs a complete proof under the given background;
- Independent reviewers (×2): use different models to review the proof’s correctness;
- Formal verifier: translates the proof step by step into machine-checkable form and maintains its passing status.
Notably, the human doesn’t disappear from this workflow—the human moves up from “executor” to “process designer and final arbiter.” This suggests that in the agent era, an individual’s leverage comes from three things: the judgment to ask good questions, the engineering ability to design reliable processes, and the final discernment to evaluate the output.
6. Three Practices You Can Transfer to Everyday Engineering
- Always conduct review in a clean context. Asking “any problems?” within the same conversation counts as only a rough check. Effective review requires a new conversation with only the necessary materials provided, and a review prompt that explicitly says “find errors only.”
- Design machine-verifiable forms for critical outputs. Mathematics relies on formal proof, code on tests and types, data pipelines on assertions and validation. If an AI output cannot enter any verification pipeline, downgrade its trust level and add human review.
- Drive iteration with divergence, not consensus. When two reviewers disagree, don’t simply adopt the majority view. Distill the points of disagreement into the input for a new generation round—this often gets you closest to the real flaw.
7. Conclusion
In this case, a model running for over a hundred minutes to deliver a forty-plus-page proof is certainly impressive. But what truly defines “reliability” is the subsequent cross-review by two independent agents and the formal verification now underway. A generative model’s output is only a candidate answer—independent review and machine verifiability are the threshold that makes an answer worthy of the word “theorem.” For developers, embedding this discipline into your own AI workflow—separating generation, review, and verification into three stages, with humans retaining problem-setting and final approval—delivers far more long-term value than chasing any single model’s one-off dazzling performance.
