Skip to content

Creator of Lean: Handwritten Math Will Change Dramatically | Leonardo de Moura

The Peterman Pod

Hosted by Ryan Peterman

1h 8m
Transcript

Original podcast

Summary

Written by a model from the transcript; not yet reviewed.

This episode features a detailed discussion with the creator of Lean, a programming language and proof assistant used for software verification and formal mathematics. The conversation explores how Lean provides machine-checkable proofs to show the absence of bugs, contrasting with traditional program testing. The guest explains how artificial intelligence is transforming formal verification by automating the tedious process of writing and maintaining complex proofs, enabling achievements like solving International Mathematical Olympiad problems and verifying C libraries. Listeners will gain insight into how formal specifications could eventually replace test suites and change how software and mathematics are developed.

  • Lean provides machine-checkable proofs that allow you to establish absolute assurance that your code or mathematical statements are correct. 0:59
  • An inefficient program can serve as a simple, naive specification that AI can then optimize and prove equivalent to the efficient version. 9:21
  • While manual proof maintenance was historically the most painful and expensive part of formal verification, artificial intelligence now eliminates that burden. 11:26
  • Lean's kernel acts as a small, trustworthy component that checks if the type of a proof matches the claimed specification. 19:18

Chapters

  1. 0:00
    Intro and Dijkstra Quote

    The host opens the episode, introduces Lean, and references Dijkstra’s quote about bug testing.

  2. 0:59
    What Is Lean?

    The guest explains Lean as both a programming language and a proof assistant, outlining its core capabilities.

  3. 1:53
    Using Lean for Software Verification

    Discussion of Lean’s two main use cases: reasoning about Lean programs and verifying programs written in other languages via shallow and deep embeddings.

  4. 3:15
    Concrete Example: C Program Proof

    A step‑by‑step illustration of proving a C buffer‑overrun property using Lean and the N‑E‑S tool.

  5. 7:51
    Lean vs. Traditional Testing

    Comparison between test suites and formal proofs, highlighting the ability of proofs to guarantee absence of bugs.

  6. 12:06
    Automation and AI in Proof Construction

    Exploration of how AI can generate Lean code, rewrite proofs, and automate verification tasks, reducing human effort.

  7. 15:36
    Lean’s Tooling and Ecosystem

    Description of Lean’s build system, IDE support, and extensibility, emphasizing the importance of the Info View and community extensions.

  8. 21:25
    Lean in the Math Community

    Overview of Lean’s impact on mathematics, including high‑profile formalizations and the role of the Lean Mathematical Library.

  9. 33:46
    Future Outlook and AI Integration

    Speculation on how AI will further reduce verification costs, expand Lean’s adoption, and shape the future of handwritten mathematics.

  10. 39:41
    Z3 SMT Solver and Lean Comparison

    Explanation of Z3’s role as a constraint solver, its differences from Lean, and how Lean complements Z3 in verification workflows.

  11. 48:35
    Challenges of Implementing Lean

    Insight into the technical hurdles of porting Lean from C++ to Lean itself, including proof maintenance and kernel design.

  12. 1:01:30
    Lean’s Vision for Formal Verification

    The host discusses Lean’s ambition to become a leading tool for software and hardware verification, highlighting AWS support and the need for funding.

Highlights

  • 0:59

    Defining Lean and Proofsinsight

    The guest defines Lean as both a programming language and a proof platform that generates machine-checkable proofs for absolute assurance.

  • 3:15

    Verifying C Array Boundsstrategy

    The guest explains how to write a mathematical statement in Lean to ensure C array accesses stay within valid bounds.

  • 6:14

    AI Verifies Compression Librarystory

    The guest shares a story where an AI successfully translated the C compression library Z Lib into Lean and proved it correctly decompresses data after one week.

  • 9:21

    Inefficient Programs as Specsstrategy

    The guest suggests writing a naive, inefficient program as a specification and asking AI to generate and prove an optimized equivalent.

  • 17:49

    Lean Implemented in Leaninsight

    The discussion covers how Lean is implemented in Lean itself, with independent kernels checking the typing of proofs.

  • 21:29

    Solving IMO Math Problemsdata

    The guest discusses how AI combined with Lean has achieved gold medals on International Mathematical Olympiad problems.

  • 24:01

    The Liquid Tensor Experimentstory

    The guest recounts how researchers formalized a complex mathematical result by Peter Scholze using Lean without fully understanding the original proof.

  • 39:21

    Z3 Versus Lean Differencesinsight

    The guest contrasts the fully automated Z3 SMT constraint solver with the interactive proof assistant Lean.

Quotes

  • “And in my understanding is that Lean and formalizing proofs can be used to show the absence of bugs.”
    Ryan Peterman · 0:43
  • “You can check your proofs and get absolute assurance they are correct.”
    Unnamed speaker · 1:13
  • “And A I synthesizing the codes and a proof that's the code that was synthesized meets your specification, right?”
    Unnamed speaker · 5:33
  • “And believe it or not, the A I, after one week, succeeded doing the whole thing.”
    Unnamed speaker · 6:45
  • “But with a proof, you're covering all possible cases.”
    Unnamed speaker · 8:09
  • “where you can prove things about your programs, right?”
    Unnamed speaker · 1:01:30
  • “not writing units tests anymore, I'm writing properties and proving them, the AI is proving most of them for me.”
    Unnamed speaker · 1:02:24
  • “the proof, this is game changer in my point of view.”
    Unnamed speaker · 1:03:03
  • “and I would tell, look, you should work on your people skills, I mean, because it helps a lot, I mean, when you have to interact with a community, with people.”
    Unnamed speaker · 1:06:47
  • WorkOS 31:02–31:33
  • Kickstarter 1:07:30–1:08:02

About this episode

Leonardo de Moura is the creator of Lean and the Z3 theorem prover. I talked with him about how Lean works and why LLMs plus Lean will fundamentally change how we write software and do math. • My ergonomic keyboard project I mentioned, you can follow along here: https://read.compose.llc/ • The Kickstarter page for it: https://www.kickstarter.com/projects/ryanlpeterman/compose-simple-ergonomics-beautifully-done Podcast links: • YouTube: https://youtu.be/KzdYKeAqWhY • Apple: https://podcasts.apple.com/us/podcast/the-peterman-pod/id1777363835 • Transcript: https://www.developing.dev/p/creator-of-lean-the-end-of-handwritten Thank you to this episode's sponsor for supporting my work: • WorkOS: makes your app Enterprise Ready with easy to use APIs to add SSO, SCIM, RBAC, and more in just a few lines of code, check them out at https://workos.com/ Timestamps: (00:00) Intro (00:28) How formal verification works (05:21) A new way of writing software (13:15) Proof assistants vs programming languages (21:06) How Lean has assisted in mathematical breakthroughs (32:03) When is it worth formalizing software (33:29) How Lean will impact handwritten math (38:55) The Z3 theorem prover project he started (45:44) The most technically challenging work of his career (51:10) Lean vs its competitors (01:00:37) The future of Lean (01:04:10) Technical book recommendations (01:06:15) Advice for his younger self (01:07:10) Outro Where to find Leonardo: • Wikipedia: https://en.wikipedia.org/wiki/Leonardo_de_Moura • Website: https://leodemoura.github.io/ • GitHub: https://github.com/leodemoura • LinkedIn: https://www.linkedin.com/in/leonardo-de-moura-26a27b5/ • X/Twitter: https://x.com/Leonard41111588 Where to find Ryan: • Newsletter: https://www.developing.dev/ • X/Twitter: https://x.com/ryanlpeterman • LinkedIn: https://www.linkedin.com/in/ryanlpeterman/ • Threads: https://www.threads.com/@ryanlpeterman • Instagram: https://www.instagram.com/ryanlpeterman • TikTok: https://www.tiktok.com/@ryanlpeterman Referenced in this episode: • Lean 4: https://github.com/leanprover/lean4 • Mathlib: Lean Mathematical Library: https://github.com/leanprover-community/mathlib4 • Lean4Lean: https://github.com/digama0/lean4lean • Liquid Tensor Experiment: https://xenaproject.wordpress.com/2020/12/05/liquid-tensor-experiment/ • Veil protocol verification language: https://veil.dev/ • Z3 theorem prover: https://github.com/Z3Prover/z3 • seL4 formally verified microkernel: https://github.com/seL4/seL4

Transcript

0:00
1:08:06

9,989 words · 2 speakers

Speaker names marked are inferred from speaking time and the show’s known hosts — they are not voice-verified.

Topics

  • Lean
  • AI
  • Z3
  • Rust
  • OpenAI
  • Lake
  • LeanVal
  • Amazon
  • Z Lib
  • DeepMind

Page updated · transcript and summary are machine-generated