Multi-Agent Collaboration for Complex Proofs: A Three-Stage Pipeline

    This article explains why single agents often fail on complex mathematical proofs, formal reasoning, and long-chain code refactoring, and how a three-stage multi-agent pipeline separates proof construction, review, and formalization into distinct roles. You will learn how to structure each role, run independent cross-reviews to locate the first broken step, use formal verification as the final arbiter, and orchestrate the workflow with structured state, context management, and cost controls. The article also covers common pitfalls such as treating multiple instances as majority voting, skipping definitional formalization, and judging quality by page count.

    1. Background: Why Single Agents Get Stuck

    On tasks such as complex mathematical proofs, formal reasoning, and long-chain code refactoring, the most common failure mode of a single agent is not “it cannot do it at all,” but drifting further in the wrong direction. The typical pattern looks like this: the first few reasoning steps hold up, an unproven intermediate claim is introduced in the middle, later steps build on that claim, and the final output is a derivation that looks complete but contains a break.

    These tasks share three characteristics:

    1. Extremely large state space: candidate lemmas, transformation directions, and construction methods grow combinatorially.
    2. Intermediate claims are hard to self-check: a step may look locally reasonable but fail globally.
    3. “Correct” and “looks correct” are hard to tell apart: textual fluency does not correlate with logical rigor.

    So the more effective engineering approach is not to keep raising the “thinking level” of a single inference call. Instead, split the task into three stages—construct, review, formalize—assign them to different roles, and build a pipeline with mutual checks and balances.

    2. Core Method: A Three-Stage Multi-Agent Pipeline

    2.1 Proof Constructor: Explore and Produce Candidate Proofs

    The constructor role aims for one thing first: “get a path that can actually go through.” Three engineering points matter:

    • Define the context boundary clearly: state the known premises, the allowed lemma set, and the forbidden circular arguments.
    • Require explicit labeling of uncertain steps: write “I assume this step holds” on the page instead of hiding it in the prose.
    • Allow failure and keep drafts: failed attempts become negative samples for downstream roles, so the same pit is not hit twice.

    A structured prompt for the role constraints can look like this:

    1. Role: Proof Constructor
    2. Input: proposition P, set of known premises A, set of citable lemmas L
    3. Constraints:
    4. 1) Only use conclusions from A ∪ L; do not introduce unproven propositions;
    5. 2) Label every step as [Proven] / [To Prove] / [Assumed];
    6. 3) If stuck, output a minimal description of the current blocker instead of expanding further.
    7. Output: proof draft + list of items to prove

    2.2 Reviewer: Falsify, Do Not Agree

    The review stage is the easiest to get wrong, because models naturally tend to “go along with” the text. The effective fix is to change the review objective from “judge whether it is right” to “find the first step that does not hold“:

    • Require numbered, line-by-line checking, and output “break location + counterexample or missing justification”;
    • Use independent multi-instance review (for example, two instances that cannot see each other), then compare whether the conclusions agree;
    • When conclusions disagree, do not settle it by voting; hand the point of disagreement to a third role for adjudication.

    Pseudo-code for review scheduling:

    1. def cross_review(proof, premise_set, lemma_set, n=2):
    2. results = []
    3. for _ in range(n):
    4. results.append(reviewer(proof, premise_set, lemma_set, goal="locate the first break"))
    5. if consistent(results):
    6. return results[0]
    7. return adjudicator(proof, disagreement(results))

    2.3 Formalizer: Turn Natural-Language Proofs into Machine-Checkable Objects

    This is the critical closure of the whole chain. The reliability ceiling of a natural-language proof is bounded by its reader, whereas a formal proof is checked clause by clause by a kernel—there is no room for “looks right.” The usual practical path is:

    • First formalize the proposition and definitions, and confirm the problem has not been quietly weakened;
    • Then fill in the intermediate lemmas and pass them one by one;
    • Finally assemble the main proof and handle details such as types, quantifiers, and boundary cases.

    It is worth stressing that the problems surfaced in the formalization stage are often not “the idea is wrong,” but trivial cases omitted from the original proof and implicit applicability conditions. That is exactly where this stage delivers the most value.

    3. What the Original Case Shows: 103 Minutes and 43 Pages

    The original material describes this situation: a highly difficult problem was not solved after several strong agents tried continuously; after switching to an agent on a different path, a single prompt produced forty-odd pages of derivation in about 103 minutes. Multiple agent instances then cross-reviewed and confirmed it, and the work entered the formalization stage. When a researcher asked whether it was done by “using A to construct and B to check,” the answer was yes—and checking can also be done with a higher reasoning level or another instance, which is usually sufficient.

    Once the specific product references are removed, the reusable information in this case is four points:

    1. Failure experience is a transferable asset: a problem others got stuck on often just needs a different search starting point.
    2. Division of labor beats raising the reasoning level: having different roles construct and check is more reliable than one role confirming itself.
    3. Cross-review requires independence: multiple instances must not see each other, otherwise they will make the same mistake together.
    4. Formalization is the final judge: page count and fluency are not evidence; machine checking is.

    As for “103 minutes and 43 pages,” treat them as one observation on a specific task, not a general metric you can promise. Tasks differ enormously in proposition complexity, richness of available lemmas, and maturity of the formalization ecosystem, so both time and length will vary significantly.

    4. Engineering Implementation: Orchestration, Context, and Cost Control

    4.1 Orchestration Layer

    Describe state transitions with a directed flow, and make the “list of items to prove” an explicit state:

    1. draft → cross-review → (break found) → back to constructor (with break info)
    2. └→ (no break) → formalization → (failure) → add lemmas → formalization

    The key point is that rollback carries structured diagnostic information, not a plain retry. A retry adds no new information and just spins in place.

    4.2 Context Management

    Long proofs easily exceed the context window. Options include:

    • Layered summarization: compress each completed lemma into “conclusion + dependencies + applicability conditions”;
    • Conclusion-library retrieval: inject only the relevant lemmas into the current context;
    • Externalized drafts: put the full derivation in object storage and keep only indexes and summaries in the context.

    4.3 Cost and Stability

    • Use a higher reasoning level for construction, a medium level plus multiple instances for review, and a stable low level for formalization;
    • Log the full chain and intermediate artifacts to support retrospectives and regression;
    • Build a collection of failure samples as the basis for iterating on prompt templates and strategies.

    5. Common Pitfalls

    • Treating “multiple instances” as “multiple votes”: non-independent repeated sampling only amplifies the same bias.
    • Skipping definitional formalization: a quietly weakened proposition is the most common cause of rework in the formalization stage.
    • Insisting on one-shot success: designing the flow to be rollback-capable and locally redoable is more realistic than chasing a single-attempt success rate.
    • Judging quality by length: page count only reflects how much was expanded and is not evidence of correctness.

    6. Conclusion

    Reliability on complex proof tasks comes from structure, not brute force: the constructor explores, the reviewer falsifies, and the formalizer finalizes, coupled through structured state and independent cross-checks. Turn this chain into an engineering flow that is orchestrable, observable, and rollback-capable, and run it on the cloud with general-purpose capabilities—such as object storage for drafts, a message queue to decouple stages, a container platform to host execution, and logging plus monitoring and alerting to track the full chain—so that an occasional success becomes a repeatable delivery capability.