Proofs — Mathematical induction (CSCI 2824, Spring 2015)

In this series of notes, we are going to

  1. Provide proofs of various propositions

  2. Ask you to fix some of our proofs.

  3. Practice proving theorems by expressing your argument in a succinct and logically consistent form.

In this page, we will discuss the principle of mathematical induction and prove properties of numbers using induction.

This lecture corresponds to section 2.3 of Ensley and Crawley's book.

Mathematical Induction: General Principle

Mathematical induction is a very common technique for proving properties of natural numbers (and other discrete structures such as sets, relations and trees that we will study very soon).

Here is a video of falling dominoes: Click here!.

Let us imagine an infinitely long sequence of tiles arranged in a straight line (close enough to each other), and let us tip domino number 1.

We wish to argue that every domino will fall. Here is how we can argue:

  • Base case: The first domino falls (we kicked it, so it falls).

  • Inductive Step: Whenever a domino numbered n falls (or all the dominos numbdered 1 to n fall), then its successor numbered n+1, also falls.

  • Therefore, we conclude that all the dominoes will fall.

The argument above is the crux of induction. To prove a property over all natural numbers k, we may argue as follows:

  • The property is true for k=0 (the first natural number).

  • If the property is true for some natural number n (or if the property is true for all natural numbers up to n), then it is true for natural number n+1.

Weak Induction Proofs

Weak induction offers a simple way for proving a property P(n) for all natural numbers n. I.e, (forall n in mathbb{N}) P(n).

Proof by weak induction proceeds in easy three steps!
  • Step 1: Check the base case. Verify that P(0) holds.

  • Step 2: Write down the Induction Hypothesis, which is in the form (forall n geq 0) mbox{IF} P(n) mbox{THEN} P(n+1). (All you need to do is to figure out what P(n) and P(n+1) are!)

  • Step 3: Prove the Induction Hypothesis (that you wrote down). This step usually makes use of the definition of the recursion and also the premise P(n).

Example 1

Induction can be really useful to guess and prove closed forms of sequences. Consider a simple one:

 a_n = a_{n-1} + (2 n -1)  mbox{for} n geq 1, mbox{with} a_0 = 0

We have a_0 = 0, a_1 =1, a_2 = a_1 + 3 = 4, a_3 = a_2 + 5 = 9, a_4 = a_3 + 7 = 16,cdots . Therefore here is our guess: a_n = n^2. How do we prove it?

Claim: a_n = n^2.

Proof by induction

Base Case: We verify that a_0 = 0 = 0^2. So this works.

Induction Hypothesis: For all n geq 0, If a_n = n^2 then a_{n+1} = (n+1)^2.

Proof of induction hypothesis:

  • Let n be any given natural number such that a_n = n^2.

  • We seek to prove that a_{n+1} = (n+1)^2. In fact,  begin{array}{rcll}  a_{n+1} &=& a_n + (2 (n+1) - 1) & [mbox{Apply the recurrence relation}] &=& a_n + 2n + 1  & [mbox{Simplification} ]  &=& n^2 + 2n + 1  & [ a_n = n^2, mbox{by induction hypothesis}] &=& (n+1)^2   end{array}

Therefore, we have proved that a_n = n^2 for all n in mathbb{N} by induction. QED.

Example 2

Theorem. The sum of first n numbers displaystylesum_{j=0}^n j = frac{n (n+1)}{2} .

Proof by induction (just like we did for the dominoes)

Base Case: We will verify the fact for n=0. Note that displaystylesum_{j=0}^0 j  = 0 = frac{0 (0+1)}{2}.

Induction Hypothesis:

 text{For all } n in mathbb{N},    text{ if }     underbrace{sum_{j=0}^n j =        frac{n (n+1)}{2}}_{mbox{Theorem holds for n}},     text{ then }     underbrace{sum_{j=0}^{n+1} j = frac{(n+1)(n+2)}{2}}_{mbox{Theorem holds for n+1}}.

Proof of Induction Hypothesis:

  • Let n be any given natural number such that sum_{j=0}^n j = frac{n (n+1)}{2} holds.

  • We wish to show that  Sigma_{j=0}^{n+1} j = frac{(n+1)(n+2)}{2}.

  • We note that  begin{array}{rcll} Sigma_{j=0}^{n+1} j &=& left( Sigma_{j=0}^n j right) + (n+1) & [mbox{Peel off last term of the summation}]  &=& frac{n(n+1)}{2} + (n+1)  & [mbox{Assume the induction hypothesis}]  &=& frac{n (n+1) + 2 (n+1)}{2}  & [mbox{Algebra}] &=& frac{ (n+2)(n+1)}{2}. end{array}

Hence, by induction we get sum_{j=0}^n=0.5n(n+1) for any integer ngeq0. QED.

Example 3

Let us try the sequence a_n = a_{n-1} + 2n,  n geq 1  mbox{with} a_0 = 0.

First, we guess what the closed form could be by writing down the first few terms:

begin{array}{rcl}  a_0 &=& 0,  a_1 &=& 2 = 1 times 2,  a_2 &=& 6 = 2 times 3, end{array} begin{array}{rcl}  a_3 &=& 12 = 3 times 4,  a_4 &=& 20 = 4 times 5,  a_5 &=& 30 = 5 times 6, ldots  end{array}.

Claim: a_n = n(n+1), forall n geq 1.

Proof by induction
  • Base Case: For n=0, we verify a_0 = 0 = 0 times 1.

  • Induction Hypothesis: For all n geq 0, if a_n = n(n+1), then a_{n+1} = (n+1)(n+2).

  • Proof of induction hypothesis:  a_{n+1} = underset{mbox{expand}}{underbrace{a_n + 2 (n+1)}} = underset{mbox{ind. hyp.}}{underbrace{n(n+1)}} + 2 (n+1) = (n+2)(n+1) .

  • Hence, by induction we have that a_n=n(n+1) for all ngeq0. QED.

Strong Induction Proof: a motivating example

In weak induction, we prove that the number n+1 satisfies P by assuming that n (its immediate predecessor) does. That may not always yield the simplest proof.

First some definitions:

Floor and Ceiling Functions

The function lfloor x rfloor is also called the floor of x. It gives the smallest integer that is less than or equal to x.

The function lceil x rceil is also called the ceil of x. It gives the smallest integer that is greater than or equal to x.

As examples, lfloor{2.9}rfloor = 2 whereas lceil{2.9}rceil = 3. For negative numbers, it is a little counter intuitive: lfloor{-3.1}rfloor = -4 whereas lceil{-3.1}rceil = -3.

Consider the recurrence a_n = a_{lfloor{frac{n}{2}} rfloor} + 1, a_0 = 0.

Here is the result of performing the recurrence on a few values of n.

 begin{array}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} hline 0 & 1 & 2 & 3 & 4 & 5 & 6& 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16  hline 0 & 1 & 2 & 2 & 3 & 3 & 3& 3 & 4 & 4 & 4  & 4  & 4  & 4 &  4 & 4 & 5 hline end{array}

Some of you may recognize the pattern (it is rather important one for CS). Here is the guess: a_n = 1+ lfloor log_2 n rfloor for n geq 1 with a_0 = 0.

We can now try proving it by induction. We will first use weak induction.

Theorem.

For all n in mathbb{N}, If n geq 1 then a_n = 1+ lfloor log_2 n rfloor.

The theorem only applies to natural numbers n geq 1. We handle this by simply allowing the base case of induction to start at n= 1.

Proof by Weak Induction (a fail…)

Base-Case For n=1, we verify that a_1 = 1 = 1+ log_2 1 .

Inductive Hypothesis: (forall n in mathbb{N}) a_n = 1+ lfloor{log_2 n}rfloor Rightarrow a_{n+1} = 1+lfloorlog_2( n+1 )rfloor.

This is not easy to prove and infact is strictly not true. This is because a_n depends on a_{frac{n}{2}} and not on a_{n-1} like our previous sequences.

Proof by Strong Induction

Strong induction is different from weak in the inductive hypothesis.

  • Weak Induction: Assume P(n) prove P(n+1).

  • Strong Induction: Assume P(k) for all k leq n and prove P(n+1).

Going back to dominoes, we assume in weak induction that the n^{th} domino falls and prove that so does the n+1^{th}. In strong induction, we assume that all dominoes numbered 1,ldots,n fall and prove that in that case the n+1^{th} also falls.

Claim: For all n in mathbb{N}, if n geq 1, then a_n = 1+lfloor log_2 nrfloor.

Proof

Proof is by strong induction over n.

Base-Case: For n=1, we verify that a_1 = 1 = 1+ log_2 1.

(Advanced note: For strong induction, the base case is really not needed but we will go through it for the sake of uniformity, anyway).

Strong Inductive Hypothesis:

For all n in mathbb{N}, if a_k = 1 + lfloorlog_2 krfloor for all k leq n, then a_{n+1} = lfloor log_2 (n+1) rfloor.

Proof of the strong induction hypothesis:

Recall the given recursion formula:  a_{n+1} = a_{leftlfloorfrac{n+1}{2}rightrfloor} + 1

We will split this into two cases based on n being odd or not.

  • Case 1: n is odd, i.e, n= 2 m +1 for some natural number m.

    • Then lfloor frac{n+1}{2} rfloor =  lfloor frac{2m+1+1}{2} rfloor = m + 1 .

    • Then we have begin{array}{rcl}  a_{n+1}  &=& a_{leftlfloorfrac{n+1}{2}rightrfloor} + 1    &=& a_{m+1} + 1   &=& underset{mbox{ind. hyp.}}{underbrace{1 + lfloorlog_2 (m+1) rfloor}} + 1   &=& lfloor log_2 (2 (m+1)) rfloor +1   &=& lfloor log_2 (n+1) rfloor  end{array}.

  • Case 2: n is even, i.e, n = 2m for some m in mathbb{N}.

    • Then lfloor frac{n+1}{2} rfloor = lfloor frac{2m +1}{2} rfloor = m .

    • We now compute a_{n+1}. In fact, begin{array}{rcl} a_{n+1} &=&a_{leftlfloorfrac{n+1}{2}rightrfloor} + 1  &=& a_m +1   &=&  underset{mbox{ind. hyp.}}{underbrace{1 + lfloorlog_2 m rfloor}} + 1   &=&  lfloor log_2 (2m) rfloor +1   &=& 1 + lfloor log_2 n rfloor   &=& 1+ lfloor log_2 (n+1) rfloor . end{array}

This proves the induction hypothesis. Almost QED… but there is now an extra proof needed on the side that argues that whenever n is even, log_2 n = log_2 (n+1).

For completeness, here is the proof of the side claim.

Side-Claim: For all natural numbers n geq 1, if n is even, then lfloor log_2 n rfloor = lfloor log_2 (n+1) rfloor.

Side Proof

This is an example of a proof by contradiction.

Let us assume otherwise. I.e., lfloor log_2 n rfloor =k and lfloor log_2 (n+1) rfloor = k+1. In other words, we have

 2^k leq n < 2^{k+1} leq n+1

Since n+1 is odd, we cannot have 2^{k+1} = n+1. Therefore,  n < 2^{k+1} < n+1. As a result, there is a natural number between n and n+1. This is a contradiction. Therefore, it has to be the case that lfloor log_2 n rfloor = lfloor log_2 (n+1) rfloor.