Skip to content
LeanLearn
Level 2~40 minLean 4

Mathematical induction: proving infinitely many cases

Lesson 2 showed that testing cannot prove a claim about every number. Induction can. Learn the base case and the step, and prove claims about all numbers and all lists in Lean.

You will be able to
  • State the principle of induction: base case and inductive step.
  • Explain why both parts are needed, using counterexamples.
  • Write induction proofs in Lean, reading the zero and succ goals.
  • Use structural induction on lists.

Recommended first: Recursion: functions that use themselves, Your first proof: P → Q → P, Examples are not proofs. You can start anyway. Nothing is locked.

EncounterActivity 1 of 11

Encounter

Imagine an endless row of dominoes, numbered 0, 1, 2, 3, … You want to be sure every domino falls. You cannot watch them all. But two facts are enough:

  1. Base case: domino 0 falls.
  2. Inductive step: whenever a domino kk falls, it knocks over domino k+1k + 1.

Then 0 falls, so 1 falls, so 2 falls, … and no domino can stay standing.

In symbols, to prove ∀n,  P(n)\forall n,\; P(n) it is enough to prove P(0)and∀k,  P(k)→P(k+1).P(0) \quad\text{and}\quad \forall k,\; P(k) \to P(k+1). The assumption P(k)P(k) inside the step is called the induction hypothesis.