Formal Verification at Scale: Engineering Lessons from an AI-Assisted Mathematical Proof
This article examines the engineering lessons behind a recent AI-assisted formal proof effort that generated a massive machine-checkable codebase in a matter of weeks. It explains why formal proofs behave like software projects, how to make large proof repositories reproducible, how to manage context and state in long-running human-AI collaboration, and where to draw the line between model-generated and human-reviewed work. Developers will find a practical checklist for one-command verification, layered caching, audit trails, and risk controls.
1. The Event: A Stress Test for Human-AI Collaboration
A young mathematics researcher recently said publicly that he had received threatening messages. The attention came from the fact that, with the help of intelligent coding and reasoning tools, he had completed an extremely large formal proof codebase in a few weeks, advancing a conjecture first proposed in the nineteenth century and long regarded as a “north star” in number theory.
The debate around the event falls into three camps. The first sees it as a landmark moment for cross-disciplinary collaboration. The second questions attribution, arguing that “the person who pulled the trigger” should not be conflated with “the person who wrote all the reasoning.” The third focuses on the emotional tone, holding that academic evaluation should not end in personal attacks.
For developers, the useful move is not to pick a side but to treat this as a stress-test sample: when model output reaches the scale of tens of millions of lines, the task cycle is measured in weeks, and the result must be reviewed line by line by peers, what engineering capabilities are needed to keep the work reliable.
2. First, the Concept: Why Formal Proofs Are an Engineering Problem
A formal proof uses a machine-checkable language to write every reasoning step as a term that a kernel can verify. The key difference from everyday business code is this: business code can cover most risks with tests, while a proof’s “correctness” is determined by the checker. Once a proof passes, logical holes are essentially reduced to the level of the kernel and axioms.
This leads to three engineering characteristics:
- Compilation is acceptance. A proof has no intermediate state; failing the checker means it does not pass, similar to a pipeline that is either fully green or fully red.
- Dependencies are extremely sensitive. A change to a low-level lemma can trigger large-scale recompilation upstream.
- The asset is text; the cost is compute. Repository size, cache hit rate, and incremental build strategy directly determine iteration speed.
A schematic way to organize the work (showing a generic structure, not a specific tool interface):
repo/axioms/ # base axioms and type definitionslemmas/ # reusable lemmas, layered by topictargets/ # target theoremsci/check.sh # full verification entry pointcache/ # build cache directory
# Full verification (schematic)./ci/check.sh --all# Verify only affected modules (schematic)./ci/check.sh --changed lemmas/analytic
3. Reproducibility: Turning “He Proved It” into “Anyone Can Verify It”
The most failure-prone part of this kind of work is not inspiration but reproduction. At minimum, lock down four things:
- Version pinning: fix the language version, dependency versions, and cache keys; no floating versions.
- One-command verification: any reviewer runs the full check with a single command and gets a machine-readable report.
- Layered caching: build incrementally by module hash to avoid recomputing everything each time.
- Environment isolation: build a uniform image on a container platform so local and pipeline behavior match.
Once reproducibility is solid, attribution debates cool down naturally: who submitted what, which step came from a human idea, and which step was filled in by the model can all be reconstructed from commit history and verification logs.
4. Long-Horizon Tasks: Context and State Management Are the Real Challenge
A six-week human-AI collaboration is essentially an ultra-long context task. A model’s context window is limited, while proof state keeps accumulating. A workable approach is to “externalize state”:
- Maintain a machine-readable goal list where each entry includes the goal, current blocker, and dependent lemmas.
- Feed in only the slice strongly related to the current goal each round, not the entire repository.
- Store failed attempts to form a negative-example set and avoid repeating the same mistakes.
- Use a message queue or task table for asynchronous scheduling, decoupling “exploration” from “verification.”
{"goal": "target/analytic/main","status": "blocked","blockers": ["lemma/zero_free_region"],"deps": ["lemmas/contour", "lemmas/density"],"attempts": 17}
The same approach applies to ordinary development: large refactors, cross-service migrations, and long-tail defect convergence can all borrow the pattern of “externalized state + small slices + accumulated negative examples.”
5. Division of Labor: Write Boundaries into the Process, Not Rely on Intuition
From the public description, humans handle problem decomposition, path selection, and final judgment, while the model handles high-intensity candidate generation and detail completion. For team processes, define three boundaries clearly:
- Model may write: templated code, repetitive lemmas, first drafts of tests and documentation.
- Human must review: core assumptions, boundary conditions, safety-related logic.
- Mandatory traceability: record the reason for every accept/reject decision to form an auditable chain.
Also build awareness of a “hallucination budget”: the model may generate intermediate conclusions that look plausible but do not hold, so they must be intercepted by both the checker and review, rather than using generation speed as a performance metric.
6. Result Auditing and Risk Control
Large-scale automated output must come with auditing. A minimal usable checklist includes: archiving full verification reports, dual review of critical paths, dependency-change impact analysis, wiring anomaly alerts into a monitoring and alerting system, and consolidating logs through a unified logging service. Object storage is used to keep build artifacts and reports, and a container platform ensures environment consistency; these are generic capability categories, not proprietary terms from any vendor.
As for the “threatening remarks” in the controversy, the technical community’s role is simple: pull evaluation back to verifiable facts and replace emotional output with reproducible engineering evidence.
7. An Action Checklist for Developers
- This week, add a one-command full verification entry point to your team’s core repository.
- Create a goal-list file and move long-task state out of the chat window and into the repository.
- Design layered caching and incremental builds, and quantify changes in iteration time.
- Define human-AI boundaries and write them into review rules.
- Use generic cloud capabilities to build a reproducible build and audit chain.
When intelligent tools begin to participate in tasks at the level of basic science, the real dividing line is not “who adopted them first” but “who turned verification, reproducibility, and auditing into infrastructure.”
