Lean's Creator on the Future of AI and Formal Verification
Lean's Creator on the Future of AI and…
Lean creator de Moura believes AI and formal verification are complementary, with Lean serving as a trusted referee for AI reasoning.
Based on Lean theorem prover creator Leo de Moura's sharing on Hacker News, the article explores the relationship between AI and formal verification. Lean is becoming a bridge between AI and rigorous logical reasoning. de Moura notes that AI can lower the barrier to formal proofs while Lean provides mechanical verification for AI output, making the "generation + verification" paradigm a path to trustworthy AI in high-stakes domains. The article also stresses that scaling formal verification remains difficult, and AI can accelerate some steps but its boundaries require a pragmatic view.
When AI Meets Mathematical Proof: Insights from Leo de Moura
In a discussion that sparked conversation on Hacker News, Leo de Moura, creator of the Lean theorem prover, shared his views on the future of AI, Lean, and formal verification. As an open-source interactive theorem prover, Lean has gained increasing attention in the mathematics and computer science communities in recent years—it is not only an important tool for formalized mathematics, but is also becoming a bridge connecting artificial intelligence with rigorous logical reasoning.
The core value of formal verification lies in using mathematical methods to prove the correctness of a system or theorem, rather than relying on testing or experience. de Moura's sharing comes at a time when AI reasoning capabilities are rapidly evolving, prompting people to reconsider: when large language models are increasingly good at writing code and solving math problems, what role will formal verification play?
Why Lean Became the Intersection of AI and Mathematics
Lean was originally designed to let mathematicians express proofs in code and let machines check every step of the logic. Compared with traditional computer-assisted proof tools, Lean emphasizes interactivity and extensibility, forming an active community ecosystem. Large collaborative projects advancing formalized mathematics with Lean have already emerged in the mathematics community, which means Lean is no longer just a niche tool but is gradually becoming part of the infrastructure of mathematical knowledge.
In the conversation, de Moura discussed that if AI systems are to be trusted in high-stakes domains such as mathematics and software verification, they need a reliable "referee" to check their output. Lean can play exactly this role: AI generates candidate proofs or code, and Lean mechanically verifies their correctness. This "generation + verification" paradigm is considered an important path toward making AI usable in critical tasks.
Interactive Theorem Prover (ITP) is a class of software systems that allow humans and machines to collaboratively construct formal proofs. Users enter proof steps, and the system checks in real time whether each step conforms to logical rules, while maintaining a "proof state" that displays the goals to be proved and the available hypotheses. Unlike automated theorem provers that pursue "one-click results," ITPs emphasize human-machine collaboration and are suited to complex theorems that require deep mathematical insight. Lean, Coq, and Isabelle/HOL are the current mainstream representatives of ITPs, among which Lean has caught up and surpassed others thanks to its modern programming language design and active community.
Formalized mathematics refers to writing mathematical definitions, theorems, and proofs completely in a rigorous logical language and having a computer verify their correctness line by line. It differs from traditional "pen-and-paper proofs," which rely on peer review but cannot mechanically check every reasoning step. A typical representative of formalized mathematics is Lean's mathlib library, which already contains more than a million lines of formalized code covering a wide range of areas from basic algebra to cutting-edge research. Although this process is time-consuming, it can eliminate hidden assumptions and logical gaps, providing the highest level of credibility for mathematical knowledge.
The Dual Impact of AI on Formal Verification
From de Moura's perspective, AI's impact on formal verification is bidirectional. On the one hand, AI can lower the barrier to formal verification—in the past, writing formal proofs required extremely high professional training, whereas AI-assisted tools can help users complete tedious proof steps, search for lemmas, and even automatically fill proof gaps. On the other hand, formal verification provides an anchor of credibility for AI, allowing AI output to be rigorously checked.
This complementary relationship was also echoed in the Hacker News discussion. One question that commenters generally focused on was: if an AI-generated proof cannot pass Lean verification, does that mean AI still has a fundamental shortcoming in mathematical reasoning? de Moura's view tends to treat Lean as a "touchstone" for AI capabilities—through formal verification, it is possible to more clearly define which reasoning steps AI is reliable on and which steps still require human intervention.
As a detail, formal verification itself also faces scaling challenges. Even with AI assistance, fully formalizing large-scale mathematical theories or industrial-grade software systems still requires enormous engineering investment. de Moura's sharing reveals a pragmatic attitude: AI is not a master key, but it can significantly accelerate certain parts of the formalization process.
The "generation + verification" paradigm of large language models in formal proofs refers to an LLM generating a proof script acceptable to Lean based on a theorem described in natural language or on existing proof fragments, with Lean's kernel then mechanically checking its correctness. The key to this paradigm is that the LLM's generative capability may make mistakes, but Lean's verification is deterministic—a proof that passes verification is mathematically confirmed. This differs from an LLM directly outputting a natural-language proof, which cannot be automatically checked and is prone to plausible-sounding but actually incorrect reasoning. This paradigm is also seen as a practice of "AI alignment" in mathematics: using a trusted verifier to constrain an untrusted generator.
The Lean kernel is the minimal trusted core in the Lean system responsible for the final check of proof correctness. It is independent of peripheral components such as the elaborator and tactic system, and accepts only a small set of logical rules, ensuring that even if upper-layer AI tools produce erroneous or malicious code, the kernel cannot be deceived. This "small kernel" design is the cornerstone of the credibility of formal verification, and it also explains why Lean can serve as the "referee" for AI output: the verification result does not depend on whether the AI that generated the proof is reliable.
Implications for Developers and Researchers
For developers interested in AI programming and formal methods, this conversation sends several signals. The Lean ecosystem is expanding, and mastering Lean skills may become a scarce capability connecting mathematics, AI, and software verification in the future. The emergence of AI-assisted proof tools means that the entry barrier to formal verification is expected to be lowered, but the core requirement of logical rigor will not change.
From an industry perspective, the value of formal verification in safety-critical systems (such as compilers, cryptographic protocols, and aerospace software) has been repeatedly demonstrated. The involvement of AI may gradually move these technologies from high-cost specialized domains toward broader engineering practice. As the creator of Lean, de Moura's judgment provides an authoritative footnote to this trend.
For readers who want to follow this direction, they can start with open-source projects in the Lean community and collaborative formalized mathematics projects, and observe how AI tools combine with proof assistants. Although this discussion on Hacker News did not have many comments, the questions it points to are profound enough: the combination of AI and formal verification may be redefining the boundaries of "trusted computing."
One-line Summary
Lean creator de Moura believes AI and formal verification are complementary, and Lean can serve as a trusted referee for checking AI reasoning.
Paragraph Summary
Based on a sharing by Lean theorem prover creator Leo de Moura on Hacker News, the article explores the relationship between AI and formal verification. As an interactive theorem prover, Lean is becoming a bridge connecting AI with rigorous logical reasoning. de Moura points out that AI and formal verification are mutually complementary in both directions: AI can lower the barrier to formal proofs and assist with tedious steps, while Lean provides a mechanically verifying "referee" for AI output, making the "generation + verification" paradigm a path toward trustworthy AI in high-stakes domains. The article also emphasizes that scaling formal verification remains a challenge, and AI can accelerate some parts but its boundaries must be viewed pragmatically. For developers, mastering Lean skills may become a scarce capability, formal verification has significant value in safety-critical systems, and AI involvement is expected to drive it toward broader engineering practice.
Related articles

Anthropic IPO Explained: Fuel for the AI Boom or the Spark for a Bubble?
Anthropic files for an IPO under ticker ANT. Breaking down the prospectus: 80% of revenue from usage-based pricing, $72B of an $80.7B net loss being non-cash charges, 900% net revenue retention, and how past IPOs like SpaceX performed on day one and over three years — answering the AI bubble question.

Will AI Kill the Research Paper? Mathematicians Offer a New Answer
Mathematicians on the Lex Fridman podcast discuss whether AI will kill research papers—from journal review pressure to Lean formal verification, GitHub open source fatigue to Mathlib's crowdsourcing model, exploring the evolution of academic contributions and the future of mathematical knowledge verification.

Enterprise LLM Development: From RAG to Multi-Agent in Practice
A course breakdown of enterprise LLM application development: from prompt engineering and RAG to multi-agent engineering practice and FDE project delivery, helping developers understand why Agent technology is a key focus for enterprise deployment and learn systematically to avoid detours.