Trail of Bits 'proves' Fermat's Last Theorem in 20 lines via a Lean 4 bug
CatAstro_Piyush · x · 2026-09-09
Weeks after Anthropic formalized Fermat's Last Theorem in 13 million lines of Lean, Trail of Bits 'proved' the same theorem in 20 lines by exploiting a bug in Lean 4.
Key facts:
- The flaw lives in String.Pos.Raw.extract: extracting a one-byte slice at an astronomically large position returns the empty string under Lean's logical definition, but the compiled native code returns the entire original string. Combining both evaluations manufactures a contradiction, letting nonsense get a green checkmark.
- All stable Lean versions up to 4.33.1 are affected; the patch landed in v4.34.0-rc1.
- Trail of Bits stresses it is not a kernel soundness issue; they stumbled on it while using GPT-5.6 to test a new code-review skill.
Their punchline: Fermat's 'truly marvelous proof' really did fit in the margin.
More from Fun
- Slopcore: AI-generated meme films turn low-fi slop aesthetics into a subculture — Yamapama · 2026-10-26
- Dev builds city-sized zombie apocalypse sim in 100 days, ships on Steam — gdechichi · 2026-10-26
- 'Lamp Swarm': a desk of lamp-shaped robots shows what physical AI work looks like — dee_hw · 2026-10-26
- Dev-community banter: recommending a resource to every newcomer — itsOmSarraf_ · 2026-10-26
- Elon Musk's reply to a kid asking what's on Mars: "You get to decide" — yunta_tsai · 2026-10-26
- Prompt fills an empty room with everything your AI knows about you — jindong_wang92 · 2026-10-26