AI-Assisted Formal Proof: Trust Boundaries, Verification Chains, and Governance
AI coding tools are changing large-scale formal proof from a machine-checkability problem into a governance problem: can the verification chain be trusted, can evidence be reproduced, and can humans still understand the critical paths? Drawing on a reported large-scale certification effort, this article explains a five-layer verification model and discusses human comprehension, tiered supply-chain review, and a reproducible engineering pipeline for AI-assisted formal proofs.
Introduction: When AI Enters the “Last Mile” of Formal Proof
Formal proof has long been regarded as one of the most trusted verification methods in mathematics and software engineering: propositions are written as strict definitions, proofs are broken into declarations that a kernel can check one by one, and type-soundness holes or axiom misuse can be discovered by machine. But when proofs reach the scale of tens of millions of lines, modules reach the scale of hundreds of thousands, and AI coding tools participate in a large amount of technical derivation, the problem expands from “can the proof be machine-checked?” to “is the verification process trustworthy, is the evidence chain complete, and can humans still understand the critical path?”
One widely discussed case, reported as involving roughly 17 million lines of formal proof code, illustrates the challenge. The project released the formal proof code in multiple parts. A joint certification statement from the relevant prover foundation and the formal-mathematics-library community then reported that the proposition statement and the proof were correct. The certification process, as described, included several gates: it relied on standard theorem definitions verified by the community over time; several dozen external researchers independently compiled all 175,187 modules locally and reproduced consistent export files; independent comparison tools confirmed that the final proof established the original statement rather than a weakened version; and after executable scripts were stripped from the static export, the proof was fully reviewed by the official kernel, multiple independent kernels, and a checker with a mathematical meta-proof, confirming that more than 1.48 million declarations depended only on the proof assistant’s three standard axioms. The value of this process is not that a model claimed to have proved a theorem. It is that trust was broken down into reproducible, cross-verifiable, auditable engineering evidence.
1. Five-Layer Certification: From a Correct Statement to a Verifiable Proof
Trusted certification for large-scale formal proofs cannot rely on a single conclusion. It should form a layered chain of evidence.
1.1 Statement-Definition Standardization
Whether a proof is valid first depends on whether the proposition being proved is the intended one. Formal definitions need repeated verification by domain experts and must be locked in terms of version, dependencies, and semantic mapping. Otherwise, a seemingly complete proof may establish only a weakened version or an equivalent variant. Engineering teams should preserve a mapping document covering the natural-language statement, formal definition, version hash, and semantic notes to avoid substituting one proposition for another.
1.2 Independent Reproducible Compilation
A trusted proof should not pass only in the author’s environment. Multiple external researchers can use a locked toolchain, fixed dependency hashes, and a reproducible build environment to compile all modules independently and compare whether the exported files match. This helps exclude environment differences, hidden dependencies, and side effects from build scripts. For ten-million-line projects, reproduction is expensive, but it is a key step from an author’s claim to community evidence.
1.3 Semantic-Equivalence Comparison
A successful machine check does not automatically mean that the target proposition was proved. An independent comparison path can confirm semantic consistency from the exported proof, declaration dependencies, and proposition signatures, reducing the risk that “a similar but weaker proposition was proved.” The comparison tool itself should be independently implemented as far as possible, avoiding shared assumptions with the main proof chain.
1.4 Multi-Kernel Cross-Checking
Static export files should be stripped of executable scripts and retain only declarations and proof terms that a kernel can check. The official kernel and multiple independent kernels should then cross-check them. Some independent checkers even include a set-theoretic mathematical meta-proof to ensure that they do not accept false proofs. Multiple kernels cannot eliminate every risk, but they can significantly reduce systematic misjudgment caused by a defect in a single implementation.
1.5 Axiom-Dependency Audit
A proof can be fully “legal” yet depend on additional axioms or type-soundness holes. Scanning all declarations for axiom dependencies, confirming that only permitted standard axioms are used, and checking for type-soundness holes, backdoor declarations, and untrusted extensions are necessary steps for raising “formal correctness” to “trusted correctness.”
2. The Tension Between Machine Certification and Human Understanding
The process above reveals a tension more clearly than ever: being certain that a theorem is correct is not the same as humans truly understanding why it is correct. Machine certification of 17 million lines of code can provide a high degree of certainty, but line-by-line human review is no longer realistic. In the reported case, the project initiator acknowledged that he grasped the core analogies and overall direction, but during the final sprint, AI coding tools contributed many technical derivations beyond what humans could write by hand—for example, constructing lifting chains of a specified length—and completed the proof of the generalized Riemann Hypothesis in a short period. As he put it, “near the finish line, the tool had left me far behind.”
This does not deny the human role. It shows that the division of cognitive labor is changing: humans handle problem selection, core analogies, proof strategy, and key judgments, while machines handle high-frequency technical derivation and formal expansion. But if the dependency graph of critical derivations becomes too large, humans cannot explain why it holds, and long-term maintenance, teaching, dissemination, and error localization all become harder. A trusted verification pipeline should therefore include “explainable formalization” capabilities: modular proof sketches, explanations of key lemmas, dependency-graph visualization, automated explanation reports, and sampled human review. Trust is not the same as maintainability, and machine-checkability is not the same as human comprehensibility.
3. Risk Analogy: Generalization of Supply-Chain Review
The original observation compared this issue with the generalization of supply-chain review, and formal-proof governance follows a similar logic. Security review is necessary, but if the review scope is too broad, the rules are opaque, and false positives cannot be appealed, the result can be collateral damage, higher costs, and suppressed innovation. The proof supply chain also requires tiered governance: high-intensity review for core proposition definitions, kernels, axiom sets, and comparison tools; automated scanning and sampled human review for ordinary modules; traceable re-review and appeal mechanisms for false positives; and clear allowlists for approved toolchains, dependencies, and axioms. The goal of governance is not a “zero-risk” slogan, but measurable risk, traceable evidence, and assignable responsibility.
4. Engineering Practice: A Reproducible Verification Pipeline
Teams can turn the certification process into a pipeline, as in the following example:
def verify_pipeline(proof_artifact):assert check_definition(proof_artifact.theorem, standard_def)build = reproducible_build(proof_artifact.source, toolchain_lock)assert build.successassert semantic_compare(build.export, proof_artifact.export)for kernel in independent_kernels:assert kernel.check(build.export)assert audit_axioms(build.export) <= allowed_axiomsassert no_executable_scripts(build.export)return "verified"
Supporting practices include: locking toolchains and dependency hashes; generating a proof bill of materials; signing exported artifacts; retaining build logs and audit logs; cross-validating with multiple engines; versioning the axiom list; sampling key lemmas for human review; and connecting verification results to logging services and monitoring/alerting. At the infrastructure layer, general-purpose container platforms, object storage, logging services, and monitoring/alerting can support the pipeline. The central requirement remains process design and evidence-chain completeness.
Conclusion
AI-assisted formal proof pushes “machine-checkable” to a new scale, while also bringing “human understanding” and “governance auditability” to the foreground. A trustworthy system should satisfy three conditions at the same time: the proof can be reproduced and verified by multiple kernels, the critical path can be explained and maintained by humans, and the review process can be tiered, traced, and appealed. Only then can formal proof evolve from a one-off certification event into a sustainable engineering capability.
