Postmortem for Kernel Soundness Bug #14576
Posted by juhopitk 1 day ago
Comments
Comment by gr_norm 1 day ago
Things like this aren't too surprising, given that even much simpler type checkers like Rust's have soundness issues occasionally. I think it's very important to view verified results not as an absolute and unbreakable guarantee, just an extraordinarily strong one where (1) the surface area for soundness issues has been painstakingly minimized and (2) any realized soundness issues are taken very seriously and fixed in short order.
Comment by rzmmm 1 day ago
Comment by Cantinflas 1 day ago
Comment by UqWBcuFx6NV4r 1 day ago
Comment by sieabahlpark 1 day ago
Comment by stevefan1999 1 day ago
Linear/Affine types aren't easy, although deep down it is about enforcing XOR.
Comment by why_only_15 1 day ago
Comment by esterna 1 day ago
Comment by twotwotwo 1 day ago
https://leanprover.zulipchat.com/#narrow/channel/270676-lean...
A mathematically-inclined reviewer (or an LLM) can quickly identify that it's an exploit. (Two exploits; it's crafted to hit a bug in another proof checker, too.)
The post gestures at this, but a natural follow-up, beyond fixing specific bugs around this exploit, would be to task some security-oriented models with proving False in Lean, or with reviewing the code for potentially unsound steps, missing checks, or even useful 'hardening'. That's happening and bugfixes are landing as a result.
Comment by twotwotwo 1 day ago
Proofs aren't generally machine-read-only. An exploit of a proof system kernel doesn't necessarily look like normal proof code. Exploits can be fragile: 'safe' tweaks break them. If an exploit used maliciously is found, the person sneaking it through wouldn't exactly be thanked for it. And the window for exploits overall seems to be shrinking: Lean/nanoda are easier to secure than, say, Chrome.
If someone wanted to deliberately sow confusion (my career advice is not to do that!) they would probably have better luck with a subtly wrong formalization or an informal proof. If they have prover kernel bugs, they should report them and get free T-shirts.
Still, it's cool to see how they're hardening Lean.
Comment by dafelst 1 day ago
> Beware of bugs in the above code; I have only proved it correct, not tried it.
-Knuth, 1977
Comment by michaelfm1211 1 day ago
I know this is an implementation bug not a meta-theory bug, but I'd almost consider the fact soundness bugs are possible as a bug in the ideology, or at least a severe drawback. Stuff like this just wouldn't happen in Metamath. In a future where AI is autogenerating formalizations, why not have the AI use a harder but airtight system like Metamath?
Comment by derdi 1 day ago
Comment by xelxebar 1 day ago
Metamath isn't a silver bullet in the design space of formal proof tools, but I personally think it just about nails the metatheory we want. Maybe some explicit facility around definitions would be desireable.
Comment by LegionMammal978 1 day ago
That is to say, the Swiss-cheese approach definitely lends authority, but individual implementations are unfortunately not as foolproof as they're made out to be.
[0] https://github.com/david-a-wheeler/mmverify.py/issues/30
[1] https://github.com/LegionMammal978/mm-verifier-tests/blob/ma...
Comment by i2talics 1 day ago
Comment by poizan42 1 day ago
Comment by xelxebar 1 day ago
Comment by alethic 1 day ago
The mathematics community's motivation for formalizing problems like Maryna Viazovska's sphere packing results in Lean weren't because the results were in doubt -- she won a Fields Medal for it, it's an extremely examined proof -- but because formalizing those results would lead to a lot of interesting and useful mathematical objects needing to be formalized as a prerequisite, which could then be merged into Lean's Mathlib and become useful for anyone working with Lean, particularly students. Having a library of idiomatic proofs available in a formal system capable of checking your work is Really Cool! Working in a proof assistant is a great way to develop mathematical maturity, especially for people who might not have an undergraduate education available to them.
(Unfortunately in the sphere packing case, the research group working on it made the mistake of trusting one of the various "AI for Math" slop companies, who promptly rugpulled them: https://arxiv.org/html/2603.03684v3)
So the short answer is "it depends on what you want". Lean is an eminently usable system for humans and LLMs alike; Metamath is uh. Not. But yes, Metamath seems to have a more trustable kernel wrt. the independent verifiers, so if that's all you're after it would be a better pick. But... there's only so many bugs Lean's kernel can have. At some point, they'll all be found.
Comment by senderista 1 day ago
https://mathoverflow.net/questions/35468/widely-accepted-mat...
Comment by jojomodding 1 day ago
Comment by alethic 23 hours ago
Comment by vatsachak 1 day ago
If AI is water, Lean is the pipe and collatz is a clog on one end, then surely we'll find the cracks.
Comment by Gehinnn 1 day ago
If every bug-exploiting proof would make it easy to prove false, putting a bounty on proving false could increase trust in the validity of verified but obscure Lean proofs.
Comment by estherney 1 day ago
"every statement that can be derived also holds" is the difficult part to show, and something we refer to as soundness. For some fancy logics, it's not even possible to show, hence the discovered Kernel Soundness Bug in Lean!
"every statement that holds can also be derived", a notion known as completeness, is often a trivial property; in practice, we use refutation completeness instead, i.e. "every statement that doesn't hold can derive false". A bug that would allow a user to prove/derive a previously unproven statement would fall under this category of "completeness bug".
However, such completeness bugs immediately show up in testing. Generally, deduction systems have two kinds of rules: a handful of rules that are enough to establish (refutation) completeness, and then a few extra rules to optimize inference. Because so few rules are needed for completeness, lots of test cases will break if one of the rules break.
--
I'm not actually sure how the completeness situation looks like for proper provers like Lean. It's my graduate student's hubris to assume completeness remains easy to show for more advanced systems than the Superposition calculus ;)
Comment by cyphar 1 day ago
Comment by logicallee 1 day ago
you mention completeness in the rest of your comment, so I'm not sure how you aren't aware of this, but the famous incompleteness theorem says that for a consistent set of axioms there will always be true statements you can't prove.[1]
[1] https://en.wikipedia.org/wiki/Gödel%27s_incompleteness_theor...
Comment by chowells 1 day ago
Truth is some sort of value judgment that is outside the scope of formal systems. And looking at how bizarre Gödel statements are, it's unclear if there's any particular justification for declaring them to be true or false.
Comment by nextaccountic 1 day ago
Comment by j16sdiz 1 day ago
Comment by cyphar 1 day ago
In fact there is a simple way to do it -- add contradictory axioms and then you can use the principle of explosion to prove any statement as true. Is such a system inconsistent and thus useless? Yes, but it is complete.
Comment by logicallee 1 day ago
>The first incompleteness theorem states that no consistent system of axioms whose theorems can be listed by an effective procedure (i.e. an algorithm) is capable of proving all truths about the arithmetic of natural numbers. For any such consistent formal system, there will always be statements about natural numbers that are true, but that are unprovable within the system.
Comment by markasoftware 1 day ago
Comment by Smaug123 1 day ago
(For that matter, another correctness bug is "the checker rejects all proofs". You can't prove false if you can't prove anything.)
Comment by markasoftware 1 day ago
Comment by Gehinnn 1 day ago
For example, the bug could allow proving a=b if the hashes of the terms equal. And the only (hypothetically) known hash collision that could be used to exploit this might not lead to an obvious contradiction.
Comment by markasoftware 1 day ago
for real problems with my statement, see your sibling comment.
Comment by tibbar 1 day ago
Comment by remywang 1 day ago
Comment by cperciva 1 day ago
Comment by IsTom 1 day ago
Comment by AnimalMuppet 1 day ago
Comment by jonathrg 1 day ago
Comment by jojomodding 1 day ago
Comment by derdi 1 day ago
Comment by paulddraper 1 day ago
The proof was not actually a proof at all, because it was unsound (despite Lean admitting the proof).
Comment by juhopitk 1 day ago
Comment by de_aztec 1 day ago
Comment by layer8 1 day ago
(In practice, there’s also the possible error that the proved formal statement means something different than what you thought it meant.)
Comment by fancy_pantser 1 day ago
Comment by xelxebar 1 day ago
That said, I'm sure there's also room for underhanded Lean programming as well, which would be even more interesting.
Comment by AnimalMuppet 1 day ago
Comment by jkwang 1 day ago
Comment by Sui_Kate 1 day ago
Comment by as1297 1 day ago
Comment by aseipp 1 day ago
Beyond that it looks like a pretty simple oversight. Coq and Isabelle have also had 'prove False' bugs, it isn't the end of the world. Stuff like this happens.
Comment by Jweb_Guru 1 day ago
Comment by adw 1 day ago
Comment by Zsfe510asG 1 day ago
- Probably too close to corporations.
- Does not care about slop.
We have seen many projects that adopted AI under corporate pressure circle the drain. Often the corporations themselves backpedaled after some months.
Comment by muglug 1 day ago
Which?
> Often the corporations themselves backpedaled after some months.
Which
Comment by daishi55 1 day ago
Mmm there are humans who think they make very few mistakes. Ones who actually make few mistakes, not sure about that one. Could be a mistake that they catch themselves very quickly, but I just don’t think humans are very good at generating 100% reliable output on the first try anywhere close to most of the time.
Comment by msdz 1 day ago
Comment by josh-wrale 1 day ago
Comment by Ar-Curunir 1 day ago