When AI Writes the Code, Who Proves It Works? artwork

When AI Writes the Code, Who Proves It Works?

The Data Exchange with Ben Lorica

October 29, 2026

Ben Lorica speaks with Leo de Moura, creator of Lean, VP and Distinguished Scientist at AWS, and Chief Architect of the Lean Focused Research Organization, about how AI is making formal verification more accessible and potentially transforming software engineering.

0:04

Ben Lorica

All right, so today we have a treat. We have Leo de Moura, VP and Distinguished Scientist in the Automated Reasoning Group at AWS. And more importantly, he is the creator of Lean, which can be found at leanlang.org.

Lean is both a programming language and a tier improver. And he is also the chief architect of the Lean Focused Research Organization. So with that long-winded introduction, Leo, welcome to the podcast.

0:38

Leo de Moura

Thank you, thank you. I'm very excited to be here.

0:41

Ben Lorica

All right. So I guess the over-arching thesis of this conversation is that we're in an era where generation has become easy, not necessarily cheap, as people who use thought code will attest, but easy.

0:57

Leo de Moura

But easy.

0:58

Ben Lorica

And so then one of the key challenges is verification. And so Lean is normally associated as the go-to tool. In fact, it's going to be a tool, I think, that will increasingly be in the lips of many people in AI in the next year around the topic of formal verification.

So I guess, let's start here, Leo, just the basics. For someone, for a listener who's accustomed to code reviews, QA and testing, what does formal verification add?

1:31

Leo de Moura

Yeah.

Lean is both a programming language and a proof of assistance, right? You can, at the same time, write codes but also state properties the code should have. You can state open conjectures in math, and you can provide proofs to these claims, right? But the proof is not informal. The proof is written in the Lean language, and more importantly, it's machine-checked. Lean is a big piece of code, but to trust a result, prove it with Lean, you need to trust only the kernel, right? It's where the proof is being checked. There's lots of, like any other programming language, you have all the tooling, LSP server, IntelliSense, code generators, auto-completion. All these features are available in Lean, but this is not important for the proof-checking step. And we have more than one checker.

You can, in Lean proof, you can view proof as data that can be manipulated, that can be transformed. You can export your proofs and check with different checkers. Some of these checkers are verified now.

We have two verified checkers, the third is coming soon. But this ability to be able to have machine checkable proofs, it helps to address the trust bottleneck, not just the trust bottleneck between humans, but also between humans and AI. For example, suppose that you want to synthesize a piece of code, you want to implement a piece of code that has specific properties. In the past, you would implement the software, maybe you would add some testing infrastructure to make sure these properties hold. Some property-based testing is very popular these days, and you would write the testing framework. Testing framework is very useful for finding bugs, but it's not useful for proving that there are no bugs.

3:37

Ben Lorica

You may even have a separate theme conduct the testing.

3:41

Leo de Moura

Yes.

Now, with formal verification, you can start with the properties.

You can, for example, write the properties down, ask the AI implement a piece of code that satisfies these properties, and prove to me, you're going to implement the codes and write a proof, a Lean proof, that will be machine-checked. And the AI now is fully capable of doing that. For example, a colleague and friend of mine, Kim Morrison, she did an experiment where she ported ZLIP to Lean. This is a compression library. Now she has a property, a property that says that if you compress data and you decompress, you get the data back. There is no loss. The data was not corrupted. It's an important property.

4:31

Ben Lorica

No matter the level of compression, right? Exactly.

4:34

Leo de Moura

Exactly. Great. Great. The theorem says exactly that. One of the parameters of the theorem is...

4:40

Ben Lorica

So Leo, for our listeners, she did this. She wrote this compression tool using Lean. And then Lean served as the formal verification tool.

So if I'm a developer and I do the same thing and I say, I'm going to use Lean to formally verify my software, but I'm going to write it in Rust first. So can Lean still help me?

5:07

Leo de Moura

Yes. Yes, it can. In two different ways. The first way is using IANIAS. IANIAS is a tool that allows you to verify Rust code using it.

IANIAS is used by, for example, by the Syncrypt team at Microsoft. Syncrypt is the crypto library at Microsoft. They use IANIAS plus Lean to verify the crypto library. So you can start by using IANIAS. Another possibility is to ask your AI, build a model of my codes in Lean.

Read the other 33 minutes of this episode here.

$15 gets you this episode and 99 more. Credits never expire. After checkout, one link brings you back here to read it.

Not what you expected? Full refund within 14 days.

Thousands of transcripts fetched by people building searchable podcast archives

Fetch transcripts with code

The same credits work from a script or an AI agent. The demo key returns a sample episode in full, no card needed:

request
curl -H "x-api-key: pt_demo" \
  https://spoken.md/transcripts/1000651996090

Markdown with the speakers named, for your notes, your knowledge base, or anything that makes HTTP calls.

From $0.10 per transcript. No subscription. Credits never expire. Prices exclude VAT, added at checkout for EU customers. Not what you expected? Email us within 14 days with 20 or fewer credits used and we refund the pack in full.

Using your own key:

request
curl -H "x-api-key: YOUR_KEY" \
  https://spoken.md/transcripts/1000798693325