Formal Verification at Scale: How AI-Generated, Machine-Checkable Proofs Are Reshaping Trust in Mathematics
This article examines what the wave of AI-assisted formal proofs means for developers, using a reported case of a roughly 17-million-line formal proof as the starting point. It explains why formal proofs must be machine-checkable, how a small trusted kernel verifies them, and why scaling from thousands to millions of lines turns the problem into large-scale software engineering. It then outlines a reproducible verification pipeline with content-hash caching, separate resource pools, axiom audits, and archived reports, and closes with practical guidance on dividing work between humans and automated reasoning tools, plus governance practices for high-visibility results.
1. Background: Why One Proof Sparked an Intense Debate
A mathematics researcher in his thirties, working with intelligent coding and automated reasoning tools, produced roughly 17 million lines of formal proof code and claimed to have solved one of the best-known open problems in mathematics. Once the proof was public, the discussion filled quickly with polarized reactions. One side called it a milestone for computational mathematics and formal methods. The other argued that the real intellectual contribution came from the model, and that the person who ran it was only “the one who pulled the trigger.” More seriously, the researcher said publicly that he had received threatening messages.
Setting the emotional debate aside, the parts that are genuinely useful to developers come down to three technical questions: how very large machine-checkable proofs are generated, how they are verified, and how they are hosted and reproduced as an engineering artifact. This article starts from those three questions.
2. The Technical Foundation: Why Formal Proofs Must Be Machine-Checkable
Traditional mathematical proofs rely on peer review: reviewers read natural-language reasoning and judge whether it is rigorous. That approach starts to strain at a few thousand lines and effectively breaks down at the scale of millions of lines. The formal methods answer is to push the proof down into a tiny, minimal, widely audited logical kernel that checks each inference rule one step at a time.
The core structure can be abstracted into three layers:
- Logical kernel: implements a foundational type theory or higher-order logic, usually only a few thousand lines of code, and is the root of trust for the whole system.
- Proof assistant layer: provides tactics, type class inference, rewriting, and automated search, and is responsible for “writing proofs on the human’s behalf.”
- Proof library layer: a long-accumulated collection of theorems and lemmas from the community; new proofs typically reuse a large amount of existing results.
The basic verification flow can be summarized in pseudocode:
Input: statement, proof script1. Parse the script into a term the kernel recognizes2. Have the kernel check whether the type of the term is the statement3. If the types match -> the proof holds (trustworthy relative to the kernel and the axiom assumptions)4. Otherwise -> return the error location and the unclosed goals
One point here is often misread and needs emphasis: machine checking only guarantees that every inference step from the axioms to the conclusion is legal. It does not guarantee that the axioms themselves match reality, nor that the formalized statement is semantically identical to the original problem. The correspondence between the formalization and the statement still requires review by human experts, and that step cannot currently be automated away.
3. The Engineering Challenges of Million-Line Proofs
Scaling a proof from ten thousand lines to tens of millions changes the nature of the problem. It is no longer a mathematics problem but a typical very-large-scale software engineering problem.
- Compilation and checking time. Kernel checking proceeds step by step; overall complexity is roughly linear but with a very large constant, so checking tens of millions of lines often takes a window measured in hours or even days.
- Peak memory. Type checking and term normalization keep large numbers of intermediate objects resident at the same time, and single-machine memory quickly becomes the bottleneck.
- Incremental builds. Re-checking everything because one line changed is unacceptable, so a content-hash-based dependency graph and caching mechanism are required.
- Reproducibility. Any drift in toolchain version, standard library version, or cache state can turn “it passed yesterday” into “it fails today.”
- Storage and version management. Text volume plus build artifacts easily reaches hundreds of gigabytes, which ordinary code hosting and local disks struggle to carry.
4. Designing a Reproducible Verification Pipeline
The right engineering answer is to build formal verification as a continuous integration pipeline rather than a one-off local script run.
# Example: a formal proof verification pipelinestages:- lint_formal: # statement and naming convention checks- build_deps: # build the dependency theorem library, produce a content-addressed cache- kernel_check: # core stage: the kernel checks step by stepresources: {cpu: high clock speed, mem: large memory, disk: local high throughput}cache: content_hash- axiom_audit: # audit the final set of axioms the proof depends on- report: # emit an archivable verification report
A few practices that matter:
- Use a hash of the source content as the cache key rather than a timestamp, so results are consistent across machines.
- Separate kernel checking from automated tactic search into different resource pools: the former needs clock speed and memory, the latter needs parallelism.
- Axiom auditing must be an independent gate. Many disputes are not really “the proof is wrong” but “stronger assumptions were used than expected.”
- Write all pipeline artifacts to object storage with checksums retained, send verification reports and logs to a logging service, and trigger monitoring alerts on anomalies.
On Baidu AI Cloud, this can be implemented by running parallel checking tasks on a container platform, storing source snapshots and build caches in object storage, using a message queue for task distribution and peak shaving, and tracking long-running task failures and timeouts with a logging and monitoring alerting system, forming an auditable and replayable verification chain.
5. Dividing Work Between Humans and Machines: Where Automated Reasoning Stops
Automated reasoning tools are good at local search: trying a limited set of tactic combinations on some intermediate goal and finding a path through. They are not good at global design: deciding which few dozen lemmas to split a large problem into, what auxiliary constructions to choose, and whether a given formalization path is equivalent to the original semantics.
A more sensible division of labor is therefore:
- Models and automated tactics handle “filling in” and “moving things around,” closing intermediate goals that are already well defined.
- Humans handle problem modeling, semantic alignment, axiom selection, and interpreting the conclusion.
- The system records the whole process so that every contribution can be attributed.
This also answers the central objection in the debate. Attributing the result entirely to the tool, or entirely to the person running it, both ignore the fact that attributability has to be established by engineering means such as version records, script provenance, and axiom lists, not by stating an opinion.
6. Governance and Security: The Gap the Threats Exposed
The threats against the researcher show that high-visibility results lack matching security and collaboration mechanisms. Practical measures for any team include: publishing a reproducible package and an axiom list alongside the public result, steering discussion toward technical substance; enforcing strong authentication and least privilege on collaboration accounts; routing external submissions through independent review and isolated builds so untrusted code never enters the main chain; and keeping cross-verification records from multiple parties for key conclusions.
7. Conclusion
The real lesson from a million-line formal proof is not “who solved the problem” but that mathematical verification is becoming an engineering discipline. It needs caching, dependency management, resource scheduling, auditing, and reproducibility, and overlaps heavily with the methodology of building large distributed systems. For developers, now is a good time to bring formal verification into their own development process: start with specifications and checks on critical modules, and gradually build a trustworthy, auditable, replayable quality baseline.
