SE 500: Examples of Proof by Mathematical Induction

The following are examples of proof by mathematical induction, written in the style propounded by Gries & Schneider in their book A Logical Approach to Discrete Math.

Example 1 (Exercise 12.4(b)): Prove by mathematical induction that (∀n:ℕ |: (+i | 0≤i<n : 2i+1) = n2)

Solution: Let P : (+i | 0≤i<n : 2i+1) = n2.  

Base Case: (n=0) We show that the left-hand side (LHS) of P.0 (i.e., P[n:=0]) equals the right-hand side (RHS):
   (+i | 0≤i<n : 2i+1)[n:=0]

=     < textual sub >
     
   (+i | 0≤i<0 : 2i+1)

=     < range is empty >

   (+i | false : 2i+1)

=     < Empty range (8.13); identity of + is 0 >

   0

=     < arithmetic >

   02

=     < textual sub >

   (n2)[n:=0]
Inductive Case: Let n≥0 and assume, as an induction hypothesis (IH), P.0 ∧ P.1 ∧ P.2 ∧ ... ∧ P.n. We prove P(n+1) (i.e., P[n:=n+1]) by transforming its LHS to its RHS:
   (+i | 0≤i<n : 2i+1)[n:=n+1]

=     < textual sub >

   (+i | 0≤i<n+1 : 2i+1)
     
=     < (8.23) split off term >

   (+i | 0≤i<n : 2i+1) + (2i+1)[i:=n]

=     < Assumption P.n  and  textual sub >

   n2 + 2n+1

=     < algebra >

   (n+1)2

=     < textual sub >

   (n2)[n:=n+1]

Notice that, in the induction step, P.n was the one and only conjunct of the induction hypothesis that we used. This is not unusual. Indeed, we could have stated that the induction hypothesis was, simply, P.n. When we use this weakened form of the IH, we say that the proof is by weak induction. (When two or more of the conjuncts of the IH are used, we say that strong induction was employed.)


Example 2. (Exercise 12.9): Prove by mathematical induction that (∀n:ℕ | n≥4 : n2 ≤ 2n)

Solution: Let P : n2 ≤ 2n.   We prove that P holds for all n≥4:

Base Case: (n=4) We transform the LHS of P.4 (i.e., P[n:=4]) to its RHS (where, in each step, the relationship between the one line and the next is or something stronger, such as either < or =):
   (n2)[n:=4]

=     < textual substitution >
      
   42

=     < arithmetic >
   
   16

=     < arithmetic >

   24

=     < textual substitution >

   (2n)[n:=4]
Inductive Case: Let n≥4 and assume, as an induction hypothesis (IH), P.4 ∧ P.5 ∧ ... ∧ P.n. We prove P(n+1) (i.e., P[n:=n+1]) by transforming its LHS to its RHS (where, in each step, the relationship between the one line and the next is or something stronger, such as either < or =):
   (n2)[n:=n+1]

=     < textual substitution >

   (n+1)2

=     < algebra >

   n2 + 2n + 1

≤     < Assumption P.n  and  arithmetic (namely, a≤b ⇒ (a+c ≤ b+c)) > 

   2n + 2n + 1

<     < 2n+1 < 2n for n>3 (by Exercise 12.8), and arithmetic (namely, a<b ⇒ (a+c < b+c)) > 

   2n + 2n

=     < algebra >

   2n+1

=     < textual substitution >

   (2n)[n:=n+1]


Example 3: Prove that, for all n≥2, n3 − n is divisible by 3.

Note: The mathematical notation for saying that m is divisible by k is k | m. Two relevant theorems regarding divisibility are these:

Divisibility 1: For all k≠0 and all r:   k | (k·r)

Divisibility 2: For all k≠0 and all r,m:   k|m ⟹ (k|r  ≡  (k | (m+r))

Solution: The proof is by mathematical induction on n.

Base Case: n = 2.
   (3 | n3−n)[n:=2]

=    < textual substitution >

   3 | 23−2

=    < arithmetic >

   3 | 6

=    < arithmetic >

   3 | 3·2

=    < Divisibility 1, with k,r := 3,2 >

   true
Inductive Step: Let n≥2 and assume (as an induction hypothesis) that n | n3−n.
   (3 | n3−n)[n := n+1]

=    < textual substitution >

   3 | (n+1)3−(n+1))

=    < algebra, arithmetic >

   3 | (n3 + 3n2 + 3n + 1) − (n+1)

=    < algebra, arithmetic >

   3 | (n3−n) + 3n2 + 3n

=    < IH, Divisibility 2, with k,r,m := 3, 3n2+3n, n3−n >

   3 | 3n2 + 3n

=    < algebra >

   3 | 3·(n2 + n)

=    < Divisibility 1, with k,r := 3, n2 + n >

   true


Example 4: Define f as follows:

f.0 = 1
f.1 = 2
f.n =  5×f(n−1)  −  6×f(n−2)   (for n > 1)

Prove by mathematical induction that f(n) = 2n for all n≥0.

Note: The base case may include any finite number of values; in this instance, the base case should cover n=0 and n=1.

Solution: Let P : f.n = 2n. We prove by induction that P holds for every natural number n.

Base Case: (n=0,1)

   (f.n)[n:=0]

=    < textual sub. >

   f.0

=    < defn of f >

   1

=    < arithmetic >

   20

=    < textual sub. >

   (2n)[n:=0]
   (f.n)[n:=1]   

=    < textual sub. >

   f.1

=    < defn of f >

   2

=    < arithmetic > 

   21

=    < textual sub. >

   (2n)[n:=1]

Inductive Case: Let n≥1. As an IH, assume P.0 ∧ P.1 ∧ ... ∧ P.n.

   (f.n)[n:=n+1]

=    < textual substitution >

   f(n+1)

=    < defn of f >

   5×f.n - 6×f(n-1)

=    < Assumptions P.n, P.(n-1) >

   5×2n  -  6×2n-1

=    < arithmetic/algebra >

   5×2n   -  3×2n

=    < × distributes over - >

   (5-3) × 2n

=    < arithmetic >

   2 × 2n

=    < algebra >

   2n+1

=    < textual substitution >

   (2n)[n:=n+1]


Example 5: A graph is a non-empty collection of vertices and edges, where each edge connects two vertices together. Graphs are typically rendered as a two-dimensional "picture" (e.g., on a sheet of paper or a chalkboard) in which vertices are shown as circles or boxes and edges are shown as (not necessarily straight) lines connecting two vertices.

A graph is said to be connected if, for every pair of vertices, there is a path (of edges) by which you can get from one vertex to the other.

A planar graph is one for which there exists a way to draw the graph on a plane (e.g., a sheet of paper) such that no two edges cross each other. Such a drawing is called a planar embedding.

Think of the edges in a planar embedding as fences and the vertices as fenceposts. A face in a planar embedding is a set of points (on the plane) such that one can "move" from any point to any other without having to pass through a vertex or an edge (i.e., jump over a fence).

Let v(G), f(G), and e(G) be the number of vertices, faces, and edges, respectively, in a connected planar embedding of connected graph G. Euler proved that v(G) + f(G) = e(G) + 2.

We now duplicate Euler's feat.

Solution: We prove it using induction on e(G).

Basis: e(G) = 0. The only way for G to have no edges but yet be connected is for G to consist of a single vertex, which implies that v(G) = 1 and f(G) = 1. Hence, we have

   v(G) + f(G)

=    < observations above >

   1 + 1

=    < arithmetic >

   2

=    < arithmetic >

   0 + 2

=    < assumption e(G) = 0 >

   e(G) + 2

Inductive Case: Let n≥0, and assume, as an induction hypothesis, that any planar embedding of a connected graph with n edges satisfies the equation. Let G be an arbitrary connected planar graph such that e(G) = n+1, and suppose that we have a planar embedding of G.

Case G has no cycles:
It is well known that any connected graph with no cycles is a tree. Moreover, it is well known that any tree has exactly one fewer edges than vertices and any planar embedding of a tree has one face. Hence,

   v(G) + f(G)

=     < observations above >

   e(G)+1 + 1

=     < arithmetic >

   e(G) + 2

The above is the right way to prove this case, but it fails to illustrate the concept of mathematical induction! Hence, we offer the following, inferior, proof of this case, as it illustrates what we want.

In any tree (i.e., connected graph without a cycle) having at least one edge, there is a vertex of degree 1. (The degree of a vertex is the number of other vertices to which it is connected by an edge.) To convince yourself of this, start at any vertex and follow an edge to another vertex. From there, follow a different edge. Do this repeatedly, leaving each vertex using an edge different from the one used to arrive there. Eventually, you must either arrive at a vertex for the second time or else arrive at a vertex having no "second" edge by which to leave it. The former possibility is precluded by our assumption that the graph has no cycles. The latter possibility must therefore be a certainty, and it implies that a vertex of degree 1 exists.

So let us remove from G a vertex of degree 1 and its incident edge. Call the resulting planar embedding H. Clearly, we have v(G) = v(H) + 1 and e(H) = e(G) - 1 = n + 1 - 1 = n. (Because H has n edges, the IH can be applied to it!)

By drawing some pictures, you should be able to convince yourself that f(H) = f(G). In general, the removal of an edge that does not lie on any cycle has no effect on the number of faces in a planer embedding. And any edge incident to a degree 1 vertex lies on no cycles.

We have

   v(G) + f(G)

=    < v(G) = v(H) + 1,  f(G) = f(H) >

   v(H) + 1 + f(H)

=    < applying IH to H >

   e(H) + 2 + 1

=      < e(H) = e(G) - 1, algebra >

   e(G) + 2

Case G has a cycle: Choose an edge that lies on a cycle and remove it from G. The resulting planar embedding H is connected and satisfies v(H) = v(G), e(G) = e(H) + 1, and f(G) = f(H) + 1. (Removal of an edge on a cycle causes the two faces that it separated to become one face.) We have

   v(G) + f(G)

=    < v(H) = v(G),  f(G) = f(H) + 1 >

   v(H) + f(H) + 1

=      < applying IH to H >

   e(H) + 2 + 1

=      < e(G) = e(H) + 1, algebra >

   e(G) + 2


5. A tree is a connected acyclic graph. It is well known that, for any two nodes in a tree, there is a unique path that connects them. (Note: The terms vertex and node are, more or less, synonymous. In the context of a tree, it is conventional to use the latter rather than the former.) A rooted tree is one in which a particular node is identified as the root. For each node other than the root, its parent node is the first one on the unique path from it to the root. The remaining nodes to which a node is connected by an edge are its children. A node's ancestors are itself, its parent, its grandparent, etc., etc., up to the root. A node's descendants include all those nodes of which it is an ancestor.

In a rooted tree, each node v is the root of the subtree containing all its descendants.

A full binary tree (FBT) is a binary tree in which every node is either a leaf (i.e., has no children) or has two children. In other words, every FBT has one of these two forms:
AtomicComposite
  *
      *
     / \
    /   \
   /     \
 TL       TR

An atomic FBT consists of a single leaf node, whereas a composite FBT has a root node with two children, each of which is the root of a subtree that is itself a FBT. (In the figure, TL and TR are the two subtrees just mentioned.)

For a tree T, let L(T) and I(T) be the number of leaf nodes and interior nodes (i.e., non-leaf nodes) in T.

Prove that, in any full binary tree, the number of leaves exceeds the number of interior nodes by exactly one. (That is, for every FBT T, L(T) = I(T) + 1.)

Solution: We use (strong) induction on the number of leaf nodes.

Base Case: L(T) = 1. In any tree, each node has at least one descendant (possibly itself) that is a leaf. In a FBT, each interior node has two children, each of which has (based on the previous sentence) at least one descendant that is a leaf. Hence, any FBT with an interior node has at least two leaves. It follows that T (which has only one leaf) has no interior nodes. That is, we have

   L(T)

=    < assumption >

   1

=    < arithmetic >

   0 + 1

=    < I(T) = 0 from observations above >

   I(T) + 1

Inductive Case: Let n≥1, and assume, as an IH, that every FBT having n or fewer leaves satisfies the claim.

Let T be an arbitrary FBT satisfying L(T) = n+1. Since T has at least two leaves, it must have at least one interior node. That is, T must be a composite FBT, and so it has a root node with two children that are the roots of subtrees TL and TR, each of which is a FBT.

A node is a leaf in T if and only if it is a leaf in either TL or TR. Thus, L(T) = L(TL) + L(TR).

A node is an interior node in T if and only if it is the root of T or else it is an interior node in one of TL or TR. Thus, I(T) = I(TL) + I(TR) + 1.

Notice that each of TL and TR has fewer leaf nodes than T, and so the IH can be applied to each of them!

   L(T)

=    < observation above >

   L(TL) + L(TR)

=    < IH applied to each of TL and TR >

   (I(TL) + 1) + (I(TR) + 1)

=    < algebra >

   I(TL) + I(TR) + 1 + 1

=    < observation above >
 
   I(T) + 1