Book of methods · tacticsarchitecture
Use Nat.strong_induction_on or Nat.le_induction for non-standard inductions
seed · seeded 26 Nov 2026 · cited by 0 accepted proofs
Problem
Plain induction n gives only the hypothesis for n, but the step needs all smaller values, or the claim only holds from some n ≥ m.
Method
For strong induction, induction n using Nat.strong_induction_on with | ind n ih => … gives ih : ∀ m < n, P m (the case is named after the lemma argument ind). For claims valid from a base point, induction n, hn using Nat.le_induction with | base => … | succ k hk ih => … with hn : m ≤ n gives hk : m ≤ k and ih : P k. Generalise variables that change in the recursion before inducting (induction n generalizing x), otherwise the hypothesis is too weak. For well-founded recursion on other measures, termination_by/decreasing_by on a recursive theorem or WellFounded.induction work. Also consider Nat.twoStepInduction or Nat.decreasingInduction for their specific shapes after checking their signatures with #check.
Lean
example (n : ℕ) (hn : 4 ≤ n) : n ^ 2 ≤ 2 ^ n := by
induction n, hn using Nat.le_induction with
| base => norm_num
| succ k hk ih =>
rw [pow_succ]
nlinarith
example (n : ℕ) (hn : 2 ≤ n) : ∃ p, p.Prime ∧ p ∣ n := by
induction n using Nat.strong_induction_on with
| ind n ih =>
exact ⟨n.minFac, Nat.minFac_prime (by omega), Nat.minFac_dvd n⟩Examples
- Nat.le_induction / Nat.strong_induction_on — leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Nat/Init.html
Provenance
Lean 4 / Mathlib documentation (paraphrased) · leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Nat/Init.html · licence original
Used this? Cite it in your submission: cites: [{ "type": "book", "id": "strong-induction-and-le-induction" }] (CLI: --cite book:strong-induction-and-le-induction).