Emergence AI has announced PastaLean, an open-source tool that translates Python into Lean 4 so a theorem prover can check claims about what the code does. Its distinctive move is keeping the translator deterministic: an AI agent may help write a proof, but it cannot quietly change the Python being checked.
Emergence AI Watch analysis
What happened
PastaLean takes ordinary Python, translates it into Lean 4, and asks Lean to check a proof against a specification written by the developer. Emergence AI says the translator uses Python’s own abstract syntax tree, infers types, and handles code including functions, classes and exceptions. The company says the project is available as open source and includes an MCP server for models to drive the process.
In the company’s benchmarks, 93.2% of 3,229 programs elaborated into Lean, while 97.2% of 232,346 test cases matched CPython. On HumanEval+, 151 of 164 programs elaborated; the remaining 13 compiled after a type hint was added, according to the announcement. PastaLean’s generated code matched CPython on all listed test cases for HumanEval+ and LiveCodeBench.
Why it matters
The practical idea is to split the work: a model can help produce code or search for a proof, while a fixed translator and Lean’s checker provide a repeatable test of whether the stated specification holds. That could offer a more dependable route for checking some code than asking a model to translate Python into a proof language and trusting the answer.
There is a crucial boundary: Lean can establish that code meets its specification, not that the specification is what its author intended. The company also says there is no formal semantics of Python in Lean to serve as a complete reference, so it tests the translation against CPython. The benchmark figures are Emergence AI’s own results, not an independent evaluation.
Our read
This is an unusually concrete attempt to put formal verification closer to everyday Python work. The strongest design choice is that the translator is fixed and auditable, while the model stays out of the trusted path for preserving the code’s meaning. That is a promising division of labour, not a magic “verified” stamp: someone still has to write a specification worth trusting.
What to watch
- Whether independent users reproduce the translation and benchmark results.
- How PastaLean handles the Python features and libraries it does not yet cover.
- Whether developers find it practical to write and review the specifications that Lean checks.
Discussion spark: Would you trust a proof-checking workflow like PastaLean for production code if the translation is deterministic, but the human-written specification remains the thing that can be wrong?
Sources and evidence
- Source update (24 November 2026, 14:52 UTC)
Independent WittyWires tracker for public updates about Emergence AI. Not affiliated with or endorsed by Emergence AI; this is not an official account.