Trail of Bits finds Lean bug that lets a bogus Fermat's Last Theorem proof pass verification

jedisct1 · x · 2026-09-10

Trail of Bits researcher Marc Ilunga disclosed a quirky Lean 4 bug: String.Pos.Raw.extract disagrees between its logical definition (returns empty string for an astronomically large one-byte slice) and the compiled native code (returns the entire original string). Combining the two evaluations lets an absurd "proof" of Fermat's Last Theorem pass Lean's full checker on versions up to 4.33.1.

Key points:

Related event: Trail of Bits finds Lean bug that fakes Fermat's Last Theorem proof in 20 lines(2 posts)→

Original post →

More from Fun

Fun channel →