Lessons from Human-AI Collaboration on a Mathematical Proof: A Four-Stage Engineering Framework
When a mathematician released 17 million lines of formal verification code and faced both praise and threats, the debate over whether AI or the human deserved credit obscured the real engineering question. This article breaks down why long-chain reasoning tasks like the Riemann Hypothesis are the hardest tier for LLM assistance, and presents a reusable four-stage framework: task decomposition into a dependency DAG, retrieval augmentation to handle context limits, sandbox verification of untrusted output, and reproducible experiments. It also covers verification and governance practices, showing that correctness at scale depends on executable, reproducible, and rollback-capable pipelines rather than human readability.
1. The Event: A Misread “AI Proof”
A 34-year-old mathematician published 17 million lines of code used for formal verification and received both acclaim and death threats. Public opinion split immediately: one camp saw a paradigm shift in mathematical research, while the other accused him of “merely pulling the trigger,” arguing that the intelligent coding tool did the real work.
From an engineering perspective, this debate conflates two separate things: the origin of the idea behind a conjecture and the verifiability of its proof. In modern mathematics, a result is accepted by the community only if it can be checked step by step. When a proof chain grows beyond what any human can read end to end, code and formal verifiers become the only available “compiler.” So the part of this event that actually matters to developers is not “who won,” but: when output exceeds human reading capacity, what engineering practices guarantee correctness?
2. Why These Tasks Are the Hardest Tier for AI Assistance
Progress on the Riemann Hypothesis has been slow since it was proposed in 1859. The core reason is not a shortage of brilliant minds but a lack of a clear attack path. The hypothesis asserts that a seemingly random phenomenon—the distribution of primes—follows a definite pattern, and it is entangled with an entire toolkit: non-vanishing regions, analytic continuation, functional equations. It is also one of the seven million-dollar prize problems frequently cited.
For large-model assistance systems, this class of task has three extreme characteristics:
- Very long dependency chains: the correctness of each later step depends entirely on earlier lemmas, and a single symbolic error propagates forward.
- Context explosion: the relevant definitions, lemmas, and notation conventions far exceed a single context window.
- Sparse feedback: no compiler immediately tells you “this is wrong,” and verification is extremely costly.
These map directly to three engineering necessities: retrieval, decomposition, and verification.
3. A Reusable Four-Stage Engineering Framework
3.1 Task Decomposition: Turn a “Proof” into a Directed Acyclic Graph
Do not ask the model to “prove it directly.” First break the goal into lemma nodes and record dependencies explicitly:
nodes:- id: L1claim: "An identity for a certain determinant at inert primes"depends_on: []status: verified- id: L2claim: "Divisibility of the invariant derivative operator on CM curves"depends_on: [L1]status: verifying- id: L3claim: "Period integrals under automorphic lifting and a six-fold cover"depends_on: [L2]status: pending
The payoff: a failure can be rolled back locally instead of invalidating all prior work, and the structure naturally forms a distributable task queue.
3.2 Retrieval Augmentation: Solving Context Explosion
Chunk existing literature, notation tables, and verified lemmas into a store, use hybrid retrieval combining vector and keyword search, and require the model to cite source IDs in its prompts. Three engineering cautions apply: chunk along semantic boundaries like “definition / lemma / proof” rather than fixed lengths; maintain a single authoritative version of the notation table separately; and attach version numbers to all retrieved results so that outdated literature cannot contaminate the reasoning.
3.3 Sandbox Verification: Caging Untrusted Output
This is the foundation of the whole framework. All model output must run in an isolated environment with restricted network, file system, and compute quotas, allowed to access only the designated formal verifier and local dependencies. Execution results flow back as structured logs, and failure messages are automatically trimmed into the minimal reproduction snippet the model can digest.
[verify] node=L2 attempt=7[verify] error: unsolved goal at line 4182[verify] context: 3 lemmas, 1 definition[verify] action: rollback to L2-a, request narrower claim
3.4 Reproducible Experiments: Making Results Independent of Human Memory
Fix random seeds, lock dependency versions, log every prompt and retrieval hit, and write intermediate artifacts to object storage with retained checksums. Any third party should receive not “trust me” but a pipeline that can be re-run with one command.
4. Verification and Governance: Costs You Cannot Skip
- Layered review: the formal verifier handles syntax and logic; humans handle “did we prove what we intended to prove.” Neither can replace the other.
- Minimal checkable units: split the 17 million lines into modules that can be independently reviewed, aggregating trust layer by layer.
- Observable compute and cost: use monitoring, alerting, and logging services to track task queuing, failure rates, and resource consumption, preventing long-running tasks from failing silently.
- Permissions and isolation: authorize code, data, and model calls in separate domains so one mistaken operation cannot affect all intermediate results.
Deploying this in the cloud typically requires only combinations of general-purpose capabilities: a container platform to host sandboxes, object storage for intermediate artifacts, a message queue for task distribution, and logging and monitoring for observability. In research-assistance scenarios like this, Baidu AI Cloud likewise provides these general capability categories rather than some irreplaceable proprietary interface.
5. Conclusion
Whether “AI is the real prover” is not an important question from an engineering standpoint. What matters is: when humans cannot read the output end to end, correctness must be guaranteed by a process that is executable, reproducible, and rollback-capable. Decomposition, retrieval, sandboxing, and traceability—these four hold equally for any domain requiring long-chain reasoning: formal verification, large-scale refactoring, complex data analysis. The truly scarce capability is not making the model produce more content, but building a system where errors surface as early as possible.
