How to Verify AI-Generated Mathematical Proofs at Scale
As AI tools take on increasingly large-scale mathematical reasoning, AI-assisted formal proofs have reached a scale no human can feasibly review line by line. This article explains how formal proof systems, trusted kernels, and independent cross-verification shift trust from the proof's author to reproducible, machine-checkable evidence. It also covers the engineering challenges of verifying massive proofs, the boundaries of what formal verification can and cannot establish, and the infrastructure needed to make AI-assisted research trustworthy.
1. When Review Can No Longer Keep Up With Generation
AI’s capabilities in mathematical reasoning have advanced rapidly in recent years. It can now help with proof work that was once considered the domain of top mathematicians working over long periods.
One striking trend is the sheer size of AI-assisted formal proofs. Some public formalization projects contain hundreds of thousands of modules and roughly 17 million lines of code, with the exported raw proof data reaching tens of gigabytes.
At this scale, the traditional approach to mathematical review—experts reading line by line and manually checking each step—effectively breaks down. No one can read through tens of millions of lines of code in a reasonable amount of time.
But there is a crucial turning point: a machine can check. What once depended on human effort to verify each derivation becomes a task a computer can execute and repeat reliably.
This raises a central question: if verification is handed back to machines, why should we trust the result? To answer it, we first need to understand what a formal proof system is.
2. Formal Proof Systems: Making Proofs Machine-Checkable
A formal proof system—often called a proof assistant or theorem prover—is a specialized piece of software. It uses a strict formal language to describe mathematical objects and rules of inference, turning a “proof” into a sequence of symbolic operations that can be mechanically checked step by step.
Unlike everyday mathematical writing, which relies heavily on shorthand such as “clearly follows” or “similarly, we have,” formal proofs require every step to be stated explicitly with its justification. No hidden leaps are allowed.
At their core, these systems are typically built on rigorous logical foundations such as dependent type theory. Drawing on the “propositions as types, proofs as programs” idea (the Curry–Howard correspondence), proving a proposition becomes equivalent to constructing a program term that satisfies the corresponding type.
The structure of a formal proof can usually be abstracted into three parts (the following is language-agnostic pseudocode and does not represent the syntax of any specific tool):
# 1. Setup: define objects and declare axioms and known premisesdefine nontrivial_zeros := { s | ζ(s) = 0 and 0 < Re(s) < 1 }axiom functional_equation : ζ(s) and ζ(1-s) satisfy a symmetry relation# 2. Statement to be proved: express the "Riemann Hypothesis" as a formal propositiontheorem riemann_hypothesis : ∀ s ∈ nontrivial_zeros, Re(s) = 1/2# 3. Proof body: a series of derivation steps, each checkable individuallyproof:apply functional_equationapply symmetrization_lemma...qed
The key is the third part. As long as each apply corresponds to a valid rule of inference, the machine can determine whether the entire proof chain holds. The Riemann Hypothesis, for example, claims that all non-trivial zeros of the Riemann zeta function lie on the critical line where the real part equals 1/2. A finite number of zeros satisfying this pattern is not enough to prove that all zeros do—which is exactly why a rigorous proof is required.
3. Why Machine Verification Is More Reliable Than Manual Review
The heart of the matter is the fundamental asymmetry between generation and verification. This asymmetry is also the cornerstone of the entire trust model.
Generating a correct proof is hard and requires creativity. Checking whether a given proof is correct is often much easier. Formal proof systems exploit this by adopting a “small, trusted kernel” architecture: the surrounding system may contain vast amounts of code, complex automation tactics, and enormous mathematical libraries, but what ultimately decides whether a proof is accepted is a small, repeatedly auditable core checking program.
This yields a powerful property: whether a proof is written by a mathematician by hand or generated by AI in a matter of minutes, once it passes the same trusted kernel check and is accepted, its trustworthiness is identical. The kernel does not care where a proof came from—only whether each step of reasoning is valid. In other words, the trustworthiness of an AI-generated proof does not depend on whether the AI itself is “trustworthy,” but on the independently audited verification kernel.
4. Independent Verification: Cross-Confirmation With Multiple Checkers
Even if the kernel is trusted, people still worry: could the kernel itself be flawed? Could a particular implementation contain a bug?
The engineering answer to this is independent cross-verification. The idea comes from an important principle: a system should export proofs into a tool-independent core format (called the “exported proof term”) so that any third-party checker can read and independently verify the same result.
A rigorous large-scale verification typically follows a pipeline like this:
# Verification pipeline (illustrative)1. Generation: produce proof scripts2. Kernel check: verify every inference rule step by step, rejecting any illegal step3. Export: export the proof into a tool-independent core proof term (which can reach tens of GB)4. Cross-verification: use multiple independently implemented checkers to verify the same exported result5. Verdict: accept the proof as logically valid only when all checkers accept it
If multiple independently implemented checkers, developed by different teams, all reach the same conclusion, the risk that a bug in a single implementation causes a false result is greatly reduced. In logic, whether a proof can be verified by independent checkers is precisely the key criterion for judging whether a formal system is trustworthy.
5. Engineering Challenges of Verification at Scale
At the tens-of-millions-of-lines level, verification is itself a serious engineering undertaking. A formalization project of the scale described earlier can involve tens of gigabytes of raw data, with many modules that must be compiled one by one. A single high-performance checker often requires dozens of threads running in parallel and tens of minutes to complete the verification.
This kind of workload places clear demands on infrastructure:
- Elastic parallel computing: proof modules are mutually independent, naturally suited to large-scale parallel compilation and verification, requiring ample CPU cores and memory;
- High-throughput storage: tens of gigabytes of proof artifacts must flow efficiently between the generation, export, and checking stages;
- Batch processing and task orchestration: splitting, scheduling, and aggregating the compile/check tasks for massive numbers of modules;
- Monitoring and reproducibility: recording the resource usage, versions, and results of each verification run so that others can reproduce them.
In this scenario, the general-purpose capabilities of public cloud are a natural fit: elastic compute instances provide parallel processing power, object storage handles large-scale proof data, batch processing services handle task orchestration, and monitoring and alerting keep the process observable. For example, Baidu AI Cloud’s combination of “elastic compute + large-scale storage + batch scheduling” can provide scalable infrastructure support for large formal verification projects, making the verification process both feasible to run and reproducible and auditable.
6. What Machines Can and Cannot Verify
It is important to be clear-eyed about the boundaries. Formal verification addresses logical validity, but there are several things it cannot do:
- Whether the proposition is “truly” the intended proposition. The kernel only guarantees that a proof is consistent with the formal proposition in front of it; it cannot judge whether that formal proposition faithfully captures the problem the researcher actually wants to solve. If the problem is modeled incorrectly at the outset, then even a rigorous proof is only proving the wrong thing.
- Whether the definitions and premises are reasonable. Whether the choice of axioms and definitions is correct and appropriately characterizes the object of study still depends on human mathematical judgment.
- Mathematical meaning and insight. A machine knows that “the proof holds,” but does not understand “why it holds.” The truly valuable ideas behind a proof, and its connections to other theories, still require humans to understand and articulate.
Therefore, even if an AI-generated proof passes all independent verification, it must still return to the human scientific community’s process: academic publication, peer review, and long-term scrutiny, ultimately forming consensus. For major conjectures, the international mathematics community usually has even stricter recognition procedures—results are formally adopted only after being published in qualifying venues, undergoing a sufficiently long period of scrutiny, and gaining broad acceptance. Machine verification makes the most tedious and error-prone step—whether the reasoning is correct—reliable and reproducible, but whether a result is significant and accepted by the academic community is still a question for humans to answer.
7. Implications for Trust in AI-Assisted Research
What this episode truly reveals is not a particular tool or piece of code, but an emerging paradigm for trustworthy AI-assisted research: letting AI take on large-scale, creative generation work, and letting formal systems handle strict, reproducible verification—two roles working in tandem.
This approach can be extended to more areas of AI-assisted research. When the scale of AI’s output exceeds humans’ ability to review it line by line, trust should not rest on “trusting the model,” but on “executable verification”: converting conclusions into a form that can be independently, automatically, and reproducibly checked, then cross-confirming them with multiple independent implementations. For developers and enterprises, this means that building trustworthy AI systems requires focusing not only on model capabilities, but also on the accompanying verification kernels, independent checkers, and the infrastructure that supports large-scale verification.
Generation can be handed to AI, but trust must be built on evidence that can be repeatedly verified by machines and is independent of the generator. That is the key step toward trustworthy AI-assisted research.
