A Lean bug in String.Pos.Raw.extract causes native code to disagree with the logical kernel, allowing proofs of false statements like Fermat's Last Theorem. The vulnerability stems from a divergence between Lean's kernel evaluator and compiled native code when handling astronomically large string positions. By exploiting this mismatch via the native_decide tactic, a user can derive a logical contradiction, proving arbitrary theorems. The issue affects Lean versions up to 4.33.1 and was patched in v4.34.0-rc1.
Lean
1 post
A “proof” of Fermat’s Last Theorem that fits the margin