GitHub Repos advanced 3 min read Jul 27, 2026
Public Preview Sign in free for the full digest →

Lean 4: the theorem prover behind DeepMind's AlphaProof

“Google DeepMind's AlphaProof and a $1.45 billion startup both write their proofs in a language with 8,578 GitHub stars.”

Lean 4: the theorem prover behind DeepMind's AlphaProof
Source · github.com

“"dependent types and total functions do not scale. Maintenance is terrible." — el_pollo_diablo, Hacker News, 2026-07-27 (https://news.ycombinator.com/item?id=49066421)”

You know that feeling when the test suite is green, review passed, and you still cannot say the function is right — you can only say nobody found the input that breaks it. Tests sample; they never cover the case you did not think of. That gap got sharper the moment LLMs started producing code faster than you can read it, because now you are reviewing plausible-looking output in volume with no mechanical way to separate correct from convincing. Lean 4's answer is to make correctness something the machine decides rather than something you argue about in a pull request.

formal-verificationtheorem-proverdependent-typesfunctional-programmingcompilersai-for-mathopen-source

Think of a spell-checker that refuses to save the file until every sentence is grammatical — except the rule here is logical rather than grammatical, and there is no 'ignore' button. You write your program and, alongside it, a statement of what it must always do; Lean's kernel, a small checker everything funnels through, either accepts the argument or rejects it. What separates Lean 4 from older provers is that the elaborator, tactic framework and macro system are themselves Lean programs, so an automation tactic you write is a compiled Lean program rather than a plugin in a second language like Rocq's OCaml or Isabelle's ML. The price is bootstrapping: the compiler cannot be built without a compiler, so pre-generated C sits in `stage0/` inside git, stage1 rebuilds the runtime and standard library with it, and stage2 rebuilds stage1's output using stage1 itself. Stage3 exists only as a sanity check and is expected to come out identical to stage2.

01
Kernel-checked correctness — every proof funnels through one small checker, so you get a mechanical yes/no instead of a reviewer's opinion about whether the edge case is handled.
02
Tactics are Lean programs, not plugins — you extend the prover in the language you already write proofs in, instead of dropping into OCaml (Rocq) or ML (Isabelle) to add automation.
03
Mathlib as shared ground — 280,000+ formalized theorems and 750+ contributors per Leo de Moura's FLoC 2026 talk page, so you are not re-proving basic algebra before reaching your own problem.
04
One-line toolchain install — `curl https://elan.lean-lang.org/elan-init.sh -sSf | sh` gets you elan and lake on Linux, macOS or Windows with no account, no paid service and no GPU.
05
Predictable release cadence — v4.31.0 (2026-06-15), v4.32.0 (2026-07-13) and v4.32.1 (2026-07-22) shipped with release candidates about four weeks ahead, so you can schedule upgrades instead of guessing.
06
Apache-2.0 with an institutional backer — Lean FRO is a non-profit formed July 2023 under Convergent Research, with named funders including a $10MM Alex Gerko commitment in July 2025.
07
Machine-gradeable AI output — a Lean proof either type-checks or does not, which gives model output a pass/fail gate that reading prose cannot.
Who it’s for

If you write cryptography, compilers, authorization logic, or anything where a rare wrong edge case becomes a security incident, Lean 4 gives you a check that testing structurally cannot. It also fits if you are building AI systems and want a mechanical judge for model output rather than a human reviewer reading everything. It is not for you if you need a general-purpose application language today — one practitioner's Lean Zstandard decoder ran 10× slower than command-line zstd — or if your team cannot absorb a language where the type system is the hardest part of the job.

Worth exploring

Worth real time if correctness is your product: the repo committed on 2026-07-27, ships stable releases monthly, and Google DeepMind, Harmonic, the Cedar policy specification and ArkLib all build on it. Read the marketing carefully, though — lean-lang.org says the kernel 'guarantees absolute correctness,' while issue #8982, an unsoundness in `unif_hint`, has been open and triaged P-low since 2025-06-24. Budget for a long ramp: the highest-reaction open RFCs describe the `have` tactic as 'an enormous footgun for new users' and have sat unresolved for more than two years.

Developer playbook
Tech stack, code snippet, sentiment, alternatives.
PM playbook
Adoption angles, user fit, positioning.
CEO playbook
Traction signals, ROI, build vs buy.
Deep-dive insight
Full long-form analysis, no fluff.
Easy mode
Core idea, fast — when you need the gist.
Pro mode
Technical nuance, edge cases, tradeoffs.
Read the full digest
Go beyond the preview

Deep-dive insight, Easy and Pro modes, plus action playbooks — the full breakdown is one tap away.

Underrated tools. Unfiltered takes.

Read the full digest in the Snaplyze app for deep-dive insight, Easy and Pro modes, and the playbooks you can actually use.

Install Snaplyze →