Learn Lean by writing code and proofs.
Start with a calculation you can prove. Work up to logic, induction and verified programs through 135 short lessons. Write your own Lean code, check it, and learn from the result.
- 43 lessons free
- 135 exercises
- Lean 4.30 compiler
- Browser based no setup
Try it here. A test can reverse a few lists twice and compare. Lean can show it holds for every list, including ones nobody has written yet. Type simp in the editor and press Check.
The goal: for any list of numbers xs, reversing it twice gives xs back.
The course, in order
14 courses in 5 stages. Each one builds on the one before it. The first 4 are free; if you already know the early material, start wherever you need. See every lesson on one page →
- 1
Start here
Lean as a language, the first proof steps, proofs about your own programs, and propositional logic.
- Lean foundationsNew lessonsValues, types, functions and your own data, checked by Lean from the first minute.FreeStart
- Your first Lean proofsRead a goal, take a proof step, and let Lean check your reasoning.FreeStart
- Proofs about your programsNew courseProve what your functions do for every input, one tool at a time.FreeStart
- Propositional logicAnd, or, not and if-and-only-if, then excluded middle and proof by contradiction.FreeStart
- 2
Proof techniques
Quantifiers, rewriting, simp, omega and calc, and proofs written as terms.
- QuantifiersStatements about every number and about some number.PassView
- Rewriting and automationrw, simp, decide, omega and calc.PassView
- Proof terms and Curry–HowardProofs are programs. Write them directly as terms.PassView
- 3
Programs and induction
Recursive programs, induction on numbers, lists and trees, and specifications you prove.
- Functional programmingFunctions as values, structured data, recursion, termination, and type classes.PassView
- Induction on numbers and listsProve facts about every natural number and every list.PassView
- Programs with proofsWrite a specification, then prove the program meets it.PassView
- Inductive types and case analysisModel your own data, then reason about every shape it can take.PassView
- 4
Natural Number Lab
Arithmetic built from zero and successor, through order and divisibility.
- The Natural Number LabAddition, multiplication, powers, order and divisibility, proved from zero and successor.PassView
- 5
Advanced proofs and effects
Proof-carrying data, length-indexed vectors, monads and their laws.
- Advanced functional proofsLaws for map, filter and fold, evidence carried in data, and lengths checked by the type.PassView
- Monads and effectsOption, Except, state and IO, the Monad class, and proofs of the monad laws.PassView
Questions
Do I need to install Lean?
No. The course editor runs in the browser and sends checks to Lean 4.30. You can install Lean locally later without changing the language or tactics you learned here.
Is this Mathlib?
The exercises use Lean’s core library so that they run fast and teach the language itself. Every tactic covered (rw, simp, omega, induction, obtain, calc …) is the same one you will use with Mathlib.
When is an exercise complete?
The proof must compile without errors or sorry. Completion is then saved to your account.
Some lessons moved. Is my progress still there?
Yes. In November 2026 the proof lessons of Lean foundations moved to the new course Proofs about your programs, and every lesson you completed still counts under its new address. Old links lead to the new pages.
What happened to the previous Lean 4 course?
Its material now belongs to the Academy sequence. Lean foundations contains the free introduction; Functional programming contains the later programming, recursion and type-class lessons.