Lean 4: Proofs a Computer Can Check
Write Lean 4 code and proofs that a computer checks, starting from zero.
- 5 modules
- 16 lessons
- About 64 min of reading
- Beginner
- A coding problem in every lesson
- Quizzes, final exam and certificate

What you will be able to do
Write small Lean 4 programs, prove statements about numbers and lists step by step while watching the goal view, find lemmas in Mathlib, and read a real theorem statement well enough to check it against a paper. Here is the kind of proof you will write by lesson 10, with the goal Lean shows after each step:
theorem and_swap_tac (p q : Prop) : p ∧ q → q ∧ p := by
intro h -- h : p ∧ q ⊢ q ∧ p
constructor -- two goals: ⊢ q and ⊢ p
· exact h.2 -- first goal closed
· exact h.1 -- No goalsEvery code block in the course was compiled with Lean 4, and the examples that show an error were checked to fail with that error. You can follow along in the online playground without installing anything.
What you will learn
- What a proof assistant is, how to install Lean, and how types work.
- Write functions, define your own types, and use recursion that Lean accepts.
- See how a proof is just a value, and prove and, or, for all and exists statements.
- Prove things step by step with tactics, rewriting and induction.
- Find lemmas in Mathlib, read real theorem statements, and check one against a paper.
Curriculum
5 modules, 16 lessons. Each lesson is a short article, a hands-on problem you solve in the browser, and a 3-question quiz. See the day-by-day study plan.
1Why Lean3 lessons · 10 min
What a proof assistant is, how to install Lean, and how types work.
- 1Why Mathematicians Let a Computer Check Their Proofs: Meet Lean
- 2Set Up Lean 4 and Talk to It With #eval and #check
- 3Every Lean Expression Has a Type, and Type Errors Are Your Friend
2Programming in Lean3 lessons · 10 min
Write functions, define your own types, and use recursion that Lean accepts.
- 4Writing Functions in Lean: def, fun, Curly Braces and match
- 5Build Your Own Nat: How Inductive Types Define Data in Lean
- 6Why Lean Refuses a Function That Might Never Stop
3Propositions as Types3 lessons · 12 min
See how a proof is just a value, and prove and, or, for all and exists statements.
- 7A Proof Is Just a Value: Propositions as Types in Lean
- 8And, Or, Implies: Building Proofs Like Data in Lean
- 9For All, There Exists, and Equals: Lean's Three Workhorse Statements
4Tactic Proofs4 lessons · 16 min
Prove things step by step with tactics, rewriting and induction.
- 10Tactic Mode in Lean 4: Proving Step by Step With the Goal View
- 11rw vs simp in Lean 4: Rewriting Goals Without Losing Track
- 12Why Lean Accepts n + 0 = n but Not 0 + n = n: Induction on Nat
- 13Proving Facts About Lists in Lean 4: Append, Length and Reverse Twice
5Reading Real Lean3 lessons · 16 min
Find lemmas in Mathlib, read real theorem statements, and check one against a paper.
- 14Finding the Lemma You Need in Mathlib: Names, exact? and Loogle
- 15Lean Accepted It. Is It True? How to Read a Theorem Statement
- 16Lean Proved It. Did It Prove What the Paper Says?
Finish the course
Pass the lesson quizzes, then take the final exam and submit the capstone project. Your Certificate of Completion is issued once you pass both.
The Certificate of Completion is issued by BlogLLM. It is not an accredited qualification and it is not affiliated with any university or vendor.