Lean
Open-source functional programming language and interactive theorem prover for formal mathematics and verification.
Recommended as a proof assistant for formalizing mathematics123 and as a deterministic checker that pairs well with AI-generated proofs and code.456 Commenters caution that AI-written Lean can be sloppy or light on actual theorems78, and that a proof is only as trustworthy as Lean's own kernel, which has had a soundness bug.910
Why people recommend it
AI pairing · 3
Commenters say AI makes writing Lean easy while Lean supplies the precision AI lacks.
“Lean plus AI is a winning combo”
“I only really got serious about `lean4` like six to eight months ago”
Show 1 more
“it is effectively coupled with lean to automate theorem proving and discovery”
Trusted checking · 3
A deterministic proof checker means you trust Lean's core rather than an error-prone LLM.
“that proof is checked automatically by a deterministic system, the lean checker, which we can trust, in constrast to error prone LLMs”
“You don't even need to worry about hallucinations, you merely need to trust Lean core.”
Show 1 more
“the Lean prover did identify some incorrect steps”
Math formalization · 3
Commenters use it to formalize mathematics, and they see the field settling around Lean and Mathlib.
“I use lean a lot, reasonably effectively”
“Lean definitely has a lot going for it”
Show 1 more
“I guess this means the whole space is settling around lean?”
Language design · 3
Some call it a better programming language than any they have used, and a modern alternative to Haskell.
“Lean wins for me without considering or using dependent types (for now).”
I vibe code extremely extensively with Lean 4, enough to run out 2 claude code $200 accounts api limits every day for a week. I added LSP support for images to get better feedback loops and opus was able to debug https://github.com/alok/LeanPlot. The entire library was vibe coded by older ai. It also wrote https://github.com/alok/hexluthor (a hex color syntax highlighting extension that uses lean’s metaprogramming an
Show 1 more
“Lean4 might be a good language to check out”
Learning games · 2
The Natural Number Game and other Lean games are recommended as a way to start.
“I'd recommend to check out the lean games[1].”
“with later picking up Lean by doing Natural Number Game.”
Tooling · 2
Verso gives typechecked literate docs, and lake build gives AI agents a feedback loop.
“It is integrated with Lean and gets proper typechecking etc which I find helpful.”
“I have a single instruction file telling the AI to always run "lake build ./lean-file.lean" to get feedback.”
Caveats and dissent
Kernel trust · 2
Correctness depends on Lean itself, and a kernel soundness bug has been found.
“lean saying a proof is correct is "if lean is correct then the proof is correct".”
“We want Lean4 (or any other deduction system that we use, for that matter) to be correct”
AI output quality · 2
AI-generated Lean can be sloppy, and AI-produced formalizations can be light on theorems.
I vibe code extremely extensively with Lean 4, enough to run out 2 claude code $200 accounts api limits every day for a week. I added LSP support for images to get better feedback loops and opus was able to debug https://github.com/alok/LeanPlot. The entire library was vibe coded by older ai. It also wrote https://github.com/alok/hexluthor (a hex color syntax highlighting extension that uses lean’s metaprogramming an
“Nor did the project make use of Batteries or Mathlib which are arguably the one of the strongest motivation for me personally to use Lean4.”
Agent over-proving · 1
Putting Lean in agent specs can push coding agents to try to prove everything.
“I am using lean as part of the prd.md description handed to a coding agent.”
Learning curve · 2
Deep use benefits from a background in dependent type theory, and some workflows like Rust verification feel hard to approach.
“I use lean a lot, reasonably effectively”
“I suppose Rust with Lean involves Aeneas, but this is over my head.”
Hard domains · 1
Formalizing some areas, such as probability theory, can be subtle and difficult.
“I'd recommend to check out the lean games[1].”
Often compared with
Who recommends it in their own words
Threads where it came up
- The recently proposed o(n log n) integer multiplication algorithm [pdf] 3 mentions
- We have proof automation now 2 mentions
- Lean 4: How the theorem prover works and why it's the new competitive edge in AI 2 mentions
- AI, Lean, and the Future of Formal Verification, with Lean Creator Leo de Moura 1 mention
- We should be more ambitious with the software we build 1 mention
- Κ = 0.003 for integer multiplication crossed 1 mention
Also written as Lean 4, Lean4. Data: lean.json. Quotes are verbatim; the verdict and theme labels are written by a model from these comments, and every clause links to its sources.
All comments 33
“the Lean prover did identify some incorrect steps”
“I suppose Rust with Lean involves Aeneas, but this is over my head.”
“I don't see a problem with contributing to Lean verifications”
“The result is fully formalized in Lean by @platypii and myself”
“@platypii and I obtained a Lean proof of the same improvement”
@platypii and I have been pursuing Lean verification of improvements to kappa here: https://github.com/platypii/integer-mult-bounds-lean Current status of the campaign: kappa >= 2^-14.38 proved unconditionally on Mathlib's TM2 machine. Contributions welcome!
“Lean plus AI is a winning combo”
“proving that the ownership rules are sound with Lean”
“lean saying a proof is correct is "if lean is correct then the proof is correct".”
“I use lean a lot, reasonably effectively”
“with later picking up Lean by doing Natural Number Game.”
“Lean is another one I have been playing with for some of the more overall logic proof of the system we are building.”
“using Lean to formally verify automated optimization modeling outputs”
“it is effectively coupled with lean to automate theorem proving and discovery”
“Here are a couple of quotes from one of the Lean papers”
“An attempt at formalizing in Lean Mochizuki's ITU”
“We want Lean4 (or any other deduction system that we use, for that matter) to be correct”
“Lean wins for me without considering or using dependent types (for now).”
“You don't even need to worry about hallucinations, you merely need to trust Lean core.”
“Nor did the project make use of Batteries or Mathlib which are arguably the one of the strongest motivation for me personally to use Lean4.”
“Lean4 might be a good language to check out”
“do you see Z3 as a better fit than lean?”
“I guess this means the whole space is settling around lean?”
“I only really got serious about `lean4` like six to eight months ago”
“that proof is checked automatically by a deterministic system, the lean checker, which we can trust, in constrast to error prone LLMs”
“I love being able to put my brain cells at lean, coq, haskell.”
“Lean definitely has a lot going for it”
“It is integrated with Lean and gets proper typechecking etc which I find helpful.”
“I have a single instruction file telling the AI to always run "lake build ./lean-file.lean" to get feedback.”
“I am using lean as part of the prd.md description handed to a coding agent.”
“I'd recommend to check out the lean games[1].”
“I have been following recent progress in the formalization of mathematical proofs in Lean”
I vibe code extremely extensively with Lean 4, enough to run out 2 claude code $200 accounts api limits every day for a week. I added LSP support for images to get better feedback loops and opus was able to debug https://github.com/alok/LeanPlot. The entire library was vibe coded by older ai. It also wrote https://github.com/alok/hexluthor (a hex color syntax highlighting extension that uses lean’s metaprogramming an