Verifying an AI-Assisted Mathematical Proof: How Millions of Lines of Code Can Be Trusted
Large-scale formal proofs, such as a hypothetical AI-assisted proof of the Riemann Hypothesis delivered as roughly 17 million lines of code, raise a fundamental question: how can humans confirm that the machine verified the right statement in a trustworthy way? This article discusses why formal proofs grow so large, distinguishes between the legality of machine-checked derivations and the correctness of the formalized statement, and outlines a multi-layer verification framework covering statement audit, trusted kernel inspection, independent reproduction, proof-object consistency checks, and community review. It also offers practical engineering recommendations for building and auditing large-scale formal proof projects.
一、The Core Problem: When Mathematical Proofs Become Engineering Artifacts
In the history of mathematics, proofs of major conjectures typically appear as papers: definitions, lemmas, theorems, and corollaries form a logical chain that peers can read and review. If a claim states that mathematicians and an AI system have collaborated to prove the Riemann Hypothesis—open for over a century—and have submitted about 17 million lines of code, the real question is not whether the code is “too much.” The question is whether the submission constitutes a formal proof that is checkable, reproducible, and auditable.
The Riemann Hypothesis states that the real part of every non-trivial zero of the Riemann zeta function is always 1/2. The formal statement may look short, but it relies on substantial background mathematics: complex numbers, analytic continuation, definition of the zeta function, classification of zeros, contour integrals, estimate inequalities, and more. If the proof depends on computational certificates or heavily automated lemmas, the expansion of code volume is not surprising. The issue is that the larger the scale, the harder it is for humans to read line by line. Machine checking, however, can cover every step of the derivation. The core tension therefore becomes: the machine can finish the checking, but how can humans confirm that the machine checked “the correct proposition,” and that the checking process itself is trustworthy?
二、What a Formal Proof Is Actually Proving
A formal proof is not the translation of a natural-language paper into code. It is the encoding of mathematical statements and inference rules into a trusted logical framework. A simplified pseudocode sketch would look like this:
theorem RH_statement :forall s : Complex,zeta(s) = 0 and not is_trivial_zero(s)-> real(s) = 1/2
This pseudocode only expresses: “If s is a non-trivial zero, then its real part is 1/2.” A truly checkable proof requires a step-by-step derivation from axioms and previously defined lemmas to this proposition. When the checker accepts the proof, it means: under the given logical system, axiom set, and definitions, a legitimate derivation chain reaches the conclusion.
Therefore, “successful proof” involves at least two layers:
- Validity of the derivation: the checker confirms line by line that each step follows the rules;
- Correctness of the statement: the proposition being proved is indeed the Riemann Hypothesis, not a weakened version, a misaligned definition, or a proposition with hidden extra assumptions.
The second layer is often more dangerous than the first. Seventeen million lines of code can guarantee that the derivation process is covered by machine checking, but it cannot automatically guarantee that “the conjecture in the headline” and “the proposition in the code” are exactly the same.
三、Why 17 Million Lines of Code
Large-scale formal proofs typically consist of several components:
- Foundation libraries: basic definitions and lemmas for complex analysis, real analysis, topology, analytic number theory, and more;
- Problem formalization: precise encoding of concepts such as the zeta function, non-trivial zeros, and the critical line;
- Main proof chain: key lemmas and derivation steps;
- Computational certificates: machine-checkable records of finite computations, interval verification, and numerical estimates;
- Automatically generated content: intermediate proof terms produced by tactics or search procedures;
- Glue code: interfaces, type conversions, module composition, and compatibility layers.
Automatically generated content and foundation libraries often make up the majority of the line count. A large number of lines does not directly mean the mathematical ideas are complex, nor does it mean the core proof is unreadable. Just as in large software systems, the business-critical logic may occupy only a small number of modules while dependency libraries and generated code are enormous. When evaluating such proofs, one should distinguish between “core logic” and “engineering support.”
四、Can Humans Still Understand It
Humans do not necessarily have to read all the code line by line. A more realistic approach is layered understanding:
- Read the proof outline: start with the high-level theorem dependency graph to see how the main proof is decomposed into key lemmas;
- Review the key lemmas: focus on the most central and least intuitive mathematical steps;
- Check interface contracts: confirm the preconditions, postconditions, and invariants of each module;
- Inspect the formal statements: compare the mathematical definitions word by word to rule out concept substitution;
- Audit the trust base: examine axioms, external assumptions, unchecked computations, and runtime dependencies;
- Reproduce the build: rebuild the proof objects from source in an independent environment and re-run the checking.
Readability is not about requiring everyone to read 17 million lines. It is about ensuring the proof has an “auditable structure”: core propositions can be located, key dependencies can be traced, trust boundaries can be clarified, and reproduction steps can be executed. If the submission is only a massive pile of code without a formal statement description, dependency graph, and audit report, then the cost of human understanding will be extremely high, and verification will degenerate into blind trust in a small number of checkers.
五、How to Confirm a Proof Has Succeeded: A Multi-Layer Verification Framework
Confirming such a proof cannot rely on “the last line passed” alone. The following framework is recommended:
1. Specification Statement Audit
Number theorists and formalization experts should jointly review: whether the definition of the zeta function is equivalent to the standard definition; whether non-trivial zeros exclude trivial zeros; whether the critical line condition is accurate; and whether any extra assumptions are hidden in types or contexts. The natural-language proposition and the formal proposition should be mapped item by item.
2. Trusted Kernel Inspection
The credibility of a formal proof depends on the checking kernel. In the ideal case, the kernel should be small, its rules clear, and it should have undergone long-term independent auditing. What needs to be confirmed: whether the number of axioms is minimal; whether any unproven extra axioms were introduced; whether external solvers or numerical libraries are treated as “trusted black boxes”; and whether the checker version and build artifacts are reproducible.
3. Independent Reproduction
Different teams should rebuild and re-check the proof from the original materials in isolated environments. The reproduction should record dependency versions, compilation parameters, random seeds, and resource consumption. If the proof depends on large-scale computational certificates, independent teams should also recompute sampled intervals or the entire certificates.
4. Consistency Between Proof Object and Code
Verify the final theorem name, type signatures, and exported interfaces to confirm that the checked object is indeed the target proposition. Large projects are prone to “proving a similar-looking proposition.” This must be double-checked by both machine-readable statement fingerprints and manual comparison.
5. Community Review and Peer Scrutiny
Machine checking cannot replace the mathematical community’s review of meaning, novelty, and correctness of the statement. The proof outline, key lemma explanations, trust-base inventory, and reproduction reports should be made public for long-term scrutiny. Only after independent audit and sustained community questioning can the claim be widely accepted.
六、Practical Engineering Recommendations
For teams that want to build or audit large-scale formal proofs, the following practices are recommended:
- Separate the core proof from generated code so that the core modules remain readable;
- Write natural-language explanations and dependency information for each key lemma;
- Use a minimal trust base, explicitly listing axioms and external assumptions;
- Provide independently verifiable formats and sampling-and-recomputation schemes for computational certificates;
- Establish a continuous-integration-style checking pipeline so that every modification is reproducible;
- Publish an audit checklist: statement mapping, dependency graph, trust base, reproduction steps, and known risks.
七、Conclusion
A mathematical proof of 17 million lines is not in itself frightening. What is frightening is mistaking “machine acceptance” for “confirmation by the mathematical community.” Truly reliable verification should simultaneously cover derivation validity, statement correctness, trust-base transparency, and social review. AI systems can significantly accelerate formalization and proof search, but the final credibility still comes from auditable structure, independent reproduction, and human review of the core propositions. For major claims like the Riemann Hypothesis, the right attitude is neither to reject them because of their scale, nor to blindly accept them because a checker passed. It is to use an engineering-grade verification framework to turn “machine-checkable” into “human-confirmable.”
