Discrete Math and Proof
Proof by induction and recursion
Proving a statement for every natural number
Line up a million dominoes. You can't push each one - but you don't have to. Knock the first, and guarantee that every domino topples its neighbour, and all million fall from those two facts alone. That is mathematical induction: a finite argument that certifies infinitely many cases at once.
Two facts, infinitely many cases
Topple the dominoes, prove the sum
We'll prove the classic identity . Step 1: knock the base case. Step 2: drag the three algebra pieces into the order that turns into - until you do, no domino past the first is allowed to fall. Step 3: scrub and watch the chain cascade, with the running sum matching the formula at every stop.
No dominoes down yet - knock the base case to begin.
Start by knocking the first domino - the base case P(1).
Drag the three pieces left-to-right so each equals the one before it, ending at :
What the two gates are really teaching
The three moving parts, named
- Base case - prove (or whatever the smallest is) directly. Without it, nothing starts; a rule with no first domino topples nothing.
- Inductive hypothesis - the assumption that holds for some arbitrary . You are not assuming the conclusion; you are assuming one case to build the next.
- Inductive step - prove the implication . This is the domino-knocks-its-neighbour guarantee, and it must hold for every .
The template, formally
The principle of mathematical induction is the single rule of inference:
Every induction proof is that shape filled in. In our demo the step is the algebra you dragged: , which is exactly 's right-hand side.
Weak, strong, and the ground it stands on
What we just used is weak (ordinary) induction: the step may assume only . Sometimes one predecessor isn't enough - proving something about needs several smaller cases (think dividing a problem in half). Then you use strong induction, whose step may assume the whole run of earlier cases at once:
They are equally powerful - anything one proves, the other can too - but strong induction is often more convenient. Both rest on the well-ordering principle: every non-empty set of positive integers has a smallest element. If some statement had a counterexample, there would be a least counterexample - but the base case rules out the very bottom and the step manufactures it from a smaller case, so no least counterexample can exist. That contradiction is why the dominoes can't secretly leave one standing.
Recursion is induction you can run
# sum_to(n) = 1 + 2 + ... + n
def sum_to(n):
if n == 1: # BASE CASE -> P(1): stops the recursion
return 1
return sum_to(n - 1) + n # INDUCTIVE STEP -> assume P(n-1), build P(n)
# Correct because: base sum_to(1) == 1 OK
# step if sum_to(n-1) == (n-1)*n/2, then
# sum_to(n) == (n-1)*n/2 + n == n(n+1)/2 OKThe recursion / induction mirror
Check yourself
Assuming P(k) as the hypothesis, the inductive step must prove that:
Knocking the first domino by hand corresponds, in a proof, to the:
Recall: what two things must every induction proof establish, and what does each guarantee?
Try to state it, then check.
Lock it in
- Induction certifies for every from just two facts: the base case , and the inductive step .
- The base case gives you a place to stand; the inductive step is a reusable machine that turns any true case into the next one.
- The inductive hypothesis is the assumption that holds - you are borrowing one case to build the next, not assuming the conclusion.
- Strong induction lets the step assume the whole run ; it is equally powerful, and both rest on the well-ordering principle.
- Recursion is induction you can run: the code's base case is the proof's base case, and the recursive call on a smaller input is the inductive hypothesis.
Primary source
Ask your teacher