| name | proof-by-induction |
| description | Prove statements about natural numbers using mathematical induction. Triggers on "prove for all n", "prove for every integer", "show that for n ≥", statements with recursive/iterative structure |
Proof by Induction
Prove a statement P(n) holds for all natural numbers n ≥ base.
Step 1: Formalize the Statement
Example:
theorem sum_odds (n : ℕ) : (∑ k in Finset.range n, 2*k + 1) = n^2 := by
sorry
Tools to use:
lean_prover: Verify theorem statement is well-formed
Step 2: Base Case
Base case tactics to try:
simp - simplification
ring - polynomial arithmetic
decide - decidable propositions
rfl - reflexivity
Tools to use:
symbolic_compute: Verify base case numerically
lean_prover: Prove base case formally
Step 3: Inductive Step
In Lean:
induction n with k ih
-- Base case: prove P(0)
-- Inductive case: ih : P(k), goal: P(k+1)
Key tactics:
induction n with k ih - start induction
simp [ih] - use inductive hypothesis
ring - solve polynomial equations
omega - linear integer arithmetic
rw [ih] - rewrite using hypothesis
Tools to use:
lean_prover: Execute induction and prove steps
Step 4: Verify Complete Proof
Output Format
**Theorem:** [Statement in natural language]
**Proof by induction on n:**
**Base case (n = 0):**
[Explanation]
P(0) = ... = ... ✓
**Inductive step:**
Assume P(k): [hypothesis]
Prove P(k+1): [goal]
[Explanation of key insight]
P(k+1) = ...
= ... [using P(k)]
= ... ✓
**Lean proof:**
[Full Lean code with comments]
Common Patterns
| Pattern | Tactic |
|---|
| Sum formula | simp [Finset.sum_range_succ]; ring |
| Product formula | simp [Finset.prod_range_succ]; ring |
| Divisibility | use ...; ring |
| Inequality | linarith or nlinarith |