Proof Hike · Module 5 · Lean 4.36.0
Numbers & induction.
One small step. A proof for every number.
The five steps
- Example 21: Numbers from zero and steps
- Example 22: Your first induction
- Example 23: Addition in either order
- Example 24: Add a whole staircase
- Example 25: Let omega handle the arithmetic
New words
- Natural number
- Zero or a positive whole number. Lean’s Nat type does not contain negative integers or fractions.
- Constructor
- A specified way to build a value of an inductive type. Nat has zero and successor constructors.
- Inductive type
- A type specified by constructors that build its values, sometimes from smaller values of the same type.
- Induction
- A proof method following the constructors of an inductive type, with hypotheses for recursive constructor arguments.
- Base case
- The starting case of an induction or recursive definition, such as zero or an empty list.
A checked example
#check Nat.zero
#check Nat.succ
#eval Nat.succ (Nat.succ Nat.zero)
example (n : Nat) : Nat.succ n = n + 1 := by
rfl
Before you move on
- Explain the claim in everyday words.
- Identify what Lean expects at each step.
- Complete the warm-up exercises.
- Read an error and explain its fix.
The full lesson includes the captured Lean output, hints, stretch tasks, and checked solutions.
Use your browser’s Print command. This course stores progress only in the learner’s browser.