Post

Formalizing CPython

A project reports using coding agents to translate parts of CPython into Lean, test the translations against Python, and prove properties of them. The author says 4,071 functions have passed a separate agent’s review, and reports 418 bugs; those figures are project claims, not independently verified here.

An important caveat: a checked proof establishes its stated property about the formal model, not automatically that the C implementation matches it. The project uses differential tests and review to check that correspondence. Its early review also found many proofs were technically valid but too weak to catch broken behavior.