Formal Verification Pros and Cons: What It Means When AI Generates 13 Million Lines of Proof

    This article examines what a recent AI-generated formalization of a famous mathematical theorem actually delivers, and where its limits lie. It explains why formalization produces a new form of trustworthy asset rather than new mathematical knowledge, breaks down the real cost structure behind roughly 13.4 million lines of proof code, and highlights the core controversy: a proof that passes the kernel but cannot enter the human mathematical community. It also clarifies what formal verification guarantees and what it does not, then maps the methodology onto enterprise engineering practices such as machine-checkable invariants, layered dependency governance, and observability for specification blind spots. The key takeaway: trustworthiness and evolvability must be designed together.

    When AI Writes 13 Million Lines of Proof: The Pros and Cons of Formal Verification

    First, Align the Concepts: This Is “Formalized,” Not “Proven”

    A recent milestone in which an AI coding tool from a cloud vendor completed a machine-verifiable formalization of a famous mathematical theorem triggered a wave of discussion. Before weighing its value, however, the most common misreading needs correcting: the tool did not “prove” the theorem.

    The theorem was fully proved by human mathematicians thirty years ago, and the academic community has never raised substantive doubts about its correctness since. What actually happened is this: the original argument (more precisely, the version later organized and completed by subsequent scholars) was translated into an interactive theorem-proving language, so that a computer kernel could verify every inference step line by line from the lowest-level axioms, confirming that the entire chain holds together with no gaps.

    A software engineering analogy makes this clearer:

    • A human paper is like a high-quality design document: it describes the architecture and key algorithms but omits many implementation details that “every expert already understands.”
    • A formal proof is like source code that a compiler can check line by line: every implicit assumption, every “obviously follows,” must be expanded into minimal, individually verifiable steps.

    So in terms of mathematical knowledge, this work adds almost nothing. The mathematician leading the human-side formalization project has publicly said he was already 99.9% confident in the conclusion, and many in the number theory community were 100% confident. The result simply retraces the early literature: there is no difference in correctness, only in form.

    This point is critical: the output of formalization is not a “new true proposition” but a “new form of trustworthy asset.” Treating it as a knowledge breakthrough overestimates it; treating it as pure code porting underestimates it.

    What 13 Million Lines Actually Mean: The Real Cost Structure of Formalization

    The headline quantitative figures for this formalization are roughly:

    • About 13.4 million lines of proof code in total, or about 10.5 million after removing auto-generated boilerplate;
    • About 29,511 existing theorems ultimately depended upon;
    • About 533,000 local supporting lemmas;
    • 60,474 files involved;
    • Roughly five times the size of a general-purpose math library;
    • On a 96-core machine, compilation takes nearly twenty times as long as compiling that entire math library.

    Against an original paper of just 129 pages, the inflation factor is staggering. The reason is not mysterious; it follows from the rigid constraints of formal systems:

    1. No implicit knowledge allowed. A single sentence in human writing such as “this follows obviously from Lemma 3” must be expanded by the machine into dozens or even hundreds of intermediate lemmas.
    2. No type ambiguity allowed. Every object must be attached to an explicit type and structure; concepts such as sets, maps, topology, and modular forms must all have counterparts found or rebuilt in the library.
    3. No dangling references allowed. Every theorem used must actually exist in the dependency graph, which produces the transitive closure of nearly 30,000 theorems and more than 500,000 lemmas.
    4. Repeatable compilation is mandatory. Any change can trigger large-scale recomputation, making build time an engineering bottleneck rather than an academic concern.

    This explains an often-overlooked fact: the cost of formalization lies mainly not in “thinking it through” but in “spelling it out until the machine understands.” The former is intellectually intensive; the latter is engineering-intensive, and often higher by one or two orders of magnitude.

    The Biggest Controversy: It Passes the Kernel but Cannot Enter the Human Community

    The central controversy can be captured in a repeatedly quoted line: correctness is not the difference; form is the difference.

    What the AI delivered is a completed proof, almost entirely machine-generated. What the human community is building is an unfinished but human-readable public library that can be reused and maintained. The two have different objective functions:

    • The machine-generated route targets “closure”: land the entire dependency chain of the target proposition and get the kernel to nod.
    • The public-library route targets “growth”: every lemma is properly named, fully documented, and has a stable interface, so the next person can build on top of it.

    Under the mechanical acceptance rules of mainstream math libraries — file length limits, line length, docstring coverage, naming conventions, tolerance for duplicated code — this 13-million-line result would be almost entirely rejected. It is a proof that can pass the proof kernel but cannot get through the door of the human mathematical community.

    This judgment abstracts into a general engineering principle:

    Whether a deliverable is acceptable depends on who the “acceptance authority” is. Machine acceptance looks at verifiability; human acceptance looks at understandability, maintainability, and reusability. Satisfying only the former turns an asset quickly into an unmaintainable black box.

    The difference can be expressed with illustrative pseudocode:

    1. # Human-maintainable style: clear names, single responsibility, documented contract
    2. lemma ramification_bound_of_inertia (h : InertiaGroup p L) :
    3. v_p (discriminant L) ≤ f * e := by
    4. -- Reuse existing structures; steps are readable
    5. exact tower_discriminant_estimate h
    6. # Machine-closure style: expanded to pass checks, semantics flattened
    7. theorem T_88213 (x : Finset Nat) (h₁ : x ⊆ s) :
    8. card x ≤ card s := by
    9. simp_all [Finset.card_le_of_subset]
    10. exact Nat.le_of_eq (by norm_num)
    11. ...

    Both pass the checks, but only the first can be safely modified by another person three years later.

    The Capability Boundary of Formal Verification: What It Guarantees and What It Does Not

    The guarantees formalization provides and its boundaries must be strictly separated, or a new form of blind faith will emerge.

    What it guarantees:

    • Given a fixed axiom system and a correct library implementation, every inference step from hypothesis to conclusion is valid;
    • The classic risk of “a hole caused by the author skipping steps” does not exist;
    • The proof object can be independently replayed and verified by a third party, lowering the trust cost from “trust the author” to “trust the kernel and the library.”

    What it does not guarantee:

    • Whether the axioms and library definitions faithfully correspond to the original mathematical intent (formal correctness is not modeling correctness);
    • Whether the kernel implementation, compiler, or hardware contains defects;
    • Whether the proposition statement itself was transcribed with the wrong variables, quantifiers, or premises;
    • Whether the result is maintainable, reusable, and understandable to humans.

    The correspondence to enterprise software engineering is clear: passing unit tests does not mean the requirements were understood correctly, and passing type checks does not mean the business rules are right. Verification can only eliminate “implementation inconsistent with specification”; it cannot eliminate “the specification itself is wrong.”

    Lessons for Enterprise R&D: How to Borrow the Formalization Mindset

    Most teams do not need to formalize a mathematical theorem, but the methodology transfers directly to building high-assurance systems.

    1. Express critical invariants as machine-checkable assertions. In core paths (billing, inventory, permissions, state machines), express business invariants as preconditions, postconditions, and invariants, and include them in continuous integration.
    1. # Illustration: pre/post contract for a core state transition
    2. requires: amount > 0 and account.state == ACTIVE
    3. ensures: account.balance_after == account.balance_before - amount
    4. invariant: account.balance_after >= 0
    1. Establish layered dependency governance. The biggest pain point in formalization projects is dependency-closure explosion; software systems face the same issue. Define clear boundaries and versioning policies for the shared-capability layer to avoid the build disaster of “change one place, recompute everything.” Container platforms, image registries, and distributed build caches can significantly compress feedback cycles.

    2. Separate “verifiable” and “maintainable” assets, with distinct acceptance criteria for each. Machine-generated code suits one-off verification scenarios; long-lived modules must adhere to readability, documentation, and naming standards, or technical debt will compound.

    3. Turn verification results into public assets. The real long-term value of formalization lies in the library being reused. The corresponding practice for R&D is to bring contracts, assertions, and fault-injection cases into unified artifact management and log auditing, so verification conclusions are traceable.

    4. Cover formalization blind spots with monitoring and alerting. Since specification errors cannot be automatically ruled out, runtime observability must validate real behavior, forming a two-layer defense of “statically verifiable plus dynamically observable.”

    5. View AI coding tools rationally. They excel at expanding the implicit steps that “experts take for granted” into checkable details, which maps precisely to the high-cost scenarios of adding tests, documentation, and contracts to legacy systems. But they cannot replace architectural judgment or requirements clarification.

    Conclusion: The Dispute Over Form Is Fundamentally a Dispute Over Assets

    Back to the original question: how should we view this formalization?

    • It is not a mathematical breakthrough but an extreme demonstration of trustworthiness engineering;
    • It shows that the current toolchain can fully flatten a human argument from thirty years ago down to the axiom level, at a scale of 13 million lines and 60,000 files;
    • It also exposes the weakness of a purely “machine-closure” route: unreadable, unmaintainable, and unable to enter the human collaboration network;
    • Its real lesson is that trustworthiness and growth must be designed together. A deliverable that only aims to pass acceptance is a liability; a deliverable that the next person can safely modify is an asset.

    For enterprises, the most valuable takeaway is not the theorem but this set of criteria: for any automatically generated artifact, ask first — does it pass the kernel, or does it pass a human?