[KongchangAI]
· 2 min read· 1,363 words

Can Computer-Verified Proofs Be Wrong? A Deep Dive into the Trust Boundaries of Formal Verification

Can Computer-Verified Proofs Be Wrong? A Deep Dive into the Trust Boundaries of Formal Verification

Computer-verified proofs can still fail due to statement errors, kernel flaws, and axiom problems.

Based on a lively Hacker News discussion about "False computer-checked proofs," this article analyzes the most fragile links in the formal verification chain. The core point is that machines only check whether formalized code derives the stated proposition from axioms, while theorem statements are written by humans; if they are wrong (missing premises, misused quantifiers), the machine still reports success. Proof assistant kernel flaws, untrusted plugins, and logical inconsistency from additional axioms can also let erroneous proofs be legitimately accepted. This risk extends from pure mathematics to AI-assisted programming: the specification-implementation gap means "verified code" may also deviate from real needs. The conclusion: formal verification's value is forcing assumptions to be explicit, not serving as an inspection-free certificate; manual review of theorem statements and cross-validation of axiom dependencies remain irreplaceable.

Computer-assisted proofs are often regarded as the ultimate guarantee of mathematical rigor, but an article titled "False computer-checked proofs" sparked a discussion on Hacker News with 217 points and 83 comments, reminding us that computer-verified proofs can also be wrong.

Based on the core viewpoints of that discussion thread, this article outlines the most fragile links in the formal verification chain and what they mean for AI-assisted programming and mathematical research.

rss source: False computer-checked proofs

1. What Does "Verified" Actually Verify

The premise of computer-checking a proof is translating the mathematical argument into a logical language that a proof assistant (such as Coq, Lean, or Isabelle) can understand. This translation step is performed entirely by humans, and the machine is only responsible for checking whether the final formalized code derives the theorem from the axioms.

The problem is: the machine's correctness only covers the proposition it was asked to check. If the theorem statement is written incorrectly during formalization—for example, a premise is omitted, or "there exists" is written as "for all"—the machine will still happily report "verification passed." Multiple commenters in the discussion pointed out that such errors are not uncommon in real projects and are often harder to detect than errors in handwritten proofs, because the halo of "machine-verified" dispels the doubts of reviewers and readers.

In other words, formal verification guarantees that "the code is consistent with the proposition," not that "the proposition is consistent with the mathematical fact you intended to express."

How proof assistants and formal verification basically work

A proof assistant is a class of interactive software in which users write definitions, theorem statements, and proof scripts in a formal language (such as Coq's Gallina or Lean's dependently typed language), and the software checks line by line whether each step of reasoning is valid. At its core is a very small, carefully reviewed kernel, which is only responsible for judging, according to the rules of type theory, whether a given proof term has the claimed proposition type. This "small kernel + large periphery" architecture is the classic LCF-style design: all complex automation tactics must ultimately produce proof terms acceptable to the kernel, thereby concentrating trust in as little code as possible.

It should be emphasized that the "verification" of formal verification is relative: it verifies that "given these axioms and definitions, the theorem holds," not that "the theorem holds in reality or in intuitive mathematics." Axioms, definitions, and theorem statements are all written by humans, and the machine does not question their reasonableness. This is precisely the technical root of the article's claim that "the machine only checks what you ask it to check."

2. Implementation Flaws in Proof Assistants and Axiomatic Assumptions

Even if the formal statement is correct, there is another layer of risk in the verification chain: the proof assistant itself is implemented in complex software, and its kernel is responsible for the final type checking. If the kernel has bugs, or if users generate proof terms through unreliable plugins or external tools, errors may be "legitimately" accepted.

The discussion also raised issues at the axiom level. Proof assistants allow the introduction of additional axioms, and certain axioms (such as variants of the classical axiom of choice beyond the law of excluded middle) may lead to inconsistency under specific logical frameworks; once the logical system is inconsistent, any proposition can be proved. Such risks are usually strictly controlled in formal projects, but in the rapidly developing scenario of AI-assisted proving, the boundaries are becoming blurred.

Why logical inconsistency is catastrophic

In classical logic, there is an inference rule called the "principle of explosion" (Latin: ex falso quodlibet): from a contradiction, any proposition can be derived. Therefore, if a logical system is proved inconsistent—that is, it can derive both P and not-P—then any theorem in it can be "proved," and the entire verification system collapses.

This is precisely why additional axioms need strict control. Take Coq as an example: its underlying logic is constructive and by default does not include the law of excluded middle or the axiom of choice; users can introduce them as needed, but they must be clear about the compatibility of the introduced axioms with the existing logic. Historically, Russell's paradox destroyed naive set theory, and the Type:Type axiom in Martin-Löf's early type theory was also proved by Girard to lead to inconsistency. These cases show that errors at the axiom level are not local like ordinary code bugs; they globally contaminate all downstream results. When the article mentions that boundaries are blurring in AI-assisted scenarios, it refers to the possibility that automated tools may inadvertently introduce or depend on unreviewed axioms and plugins.

3. From Mathematics to Code: Generalization Risks of Formal Verification

The practical significance of this topic is not limited to pure mathematics. With the rise of AI programming tools, more and more systems claim to be able to "generate verified code." But the gap between the specification and the implementation always exists: if the specification is wrong, no matter how perfectly the code is verified, it will not help.

The consensus in the Hacker News comment section is that the value of formal methods lies in forcing people to make assumptions explicit, not in replacing human judgment. Treating it as an inspection-free certificate is precisely the most dangerous use.

Specification and implementation: the "what is verified" problem in formal methods

In software formal verification, a specification is a precise description of the properties a program should satisfy, and an implementation is the actual code that satisfies that specification. Formal verification tools (such as Frama-C, Dafny, and Isabelle/HOL used by seL4) can prove that an implementation conforms to a specification, but they cannot prove that the specification itself captures the user's true intent.

This is isomorphic to the theorem-statement problem in mathematics: if the specification omits a precondition, or if a security property is stated too weakly, verification will "succeed" yet be meaningless. The industry saying "garbage in, garbage out" is especially sharp here—the formal shell of verification may instead increase false confidence. Therefore, formal verification projects usually require independent manual specification review, cross-validation with testing, and explicit argumentation of specification coverage. The article emphasizes that the value of formal methods lies in forcing assumptions to be explicit, precisely because it turns "what exactly do we require" from tacit consensus into reviewable text.

4. Implications for AI-Assisted Proving and Development

Current large models perform impressively in generating formal proof scripts, but the very process by which model outputs must be checked by a proof assistant exposes all the weaknesses mentioned above: the model may generate theorems that appear to pass but whose statements are actually wrong; it may also exploit certain permissive features of proof assistants to bypass genuine argumentation.

A reasonable approach is to treat machine verification as one layer in a multi-layer review, not as the endpoint. Manual review of theorem statements, cross-validation of axiom dependencies, and restriction of untrusted plugins—these "human" steps remain irreplaceable.

This discussion offers no silver bullet, but it accurately delineates the trust boundary of formal verification: what the machine can check is always only what you ask it to check.

One-line Summary

Computer-verified proofs can still fail due to statement errors, kernel flaws, and axiom problems.

Paragraph Summary

Based on a lively Hacker News discussion about "False computer-checked proofs," this article analyzes the most fragile links in the formal verification chain. The core argument is that the machine only checks whether formalized code derives the stated proposition from the axioms, while theorem statements are written by humans; once they are wrong (missing premises, misused quantifiers), the machine will still report verification success. In addition, proof assistant kernel flaws, untrusted plugins, and the risk of logical inconsistency caused by additional axioms can all allow erroneous proofs to be legitimately accepted. This risk extends from pure mathematics to AI-assisted programming: the gap between specification and implementation means that "verified code" can likewise deviate from real requirements. The article concludes that the value of formal verification lies in forcing assumptions to be explicit, not in serving as an inspection-free certificate; manual review of theorem statements and cross-validation of axiom dependencies remain irreplaceable.

#formal verification#proof assistant#computer-checked proofs#AI-assisted proving#trust boundary#axiom consistency
Share:

Related articles