Opus formalizes CPython in 613K lines of Lean — and finds real Python bugs

pbaylies · x · 2026-11-10

Developer @broyojo42 used Claude Opus 5.5 to fully formalize CPython in the Lean theorem prover, producing 613,318 lines of Lean that mirror Python's internals line by line, tested against the real interpreter and machine-checked by Lean.

Along the way it surfaced real bugs in Python, including crashes triggerable from plain Python code. It's a landmark case of LLMs tackling industrial-scale formal verification — work that would normally take expert teams months.

A quoted reply jokingly suggests redoing it in the Bend language, tagging Bend's creator Victor Taelin.

Original post →

More from Models

Models channel →