CSC 333, Summer 2012
Lecture Notes: Proof Techniques
c
Matt
Stallmann & Suzanne Balik, 2004, all rights reserved.
1
page 1 of 4
Prove p → q : Assume p is true, prove q is true.
Prove that if a right triangle with sides of length x and y and hypotenuse of length z has an area of
z 2 /4, the triangle is isosceles.1
From the hypothesis and the formula for the area of a right triangle, z 2 /4 = 1/2xy. By the
Pythagorean theorem, x2 + y 2 = z 2 . Substituting x2 + y 2 for z 2 , we obtain x2 − 2xy + y 2 = 0 or
(x − y)2 = 0. Hence, x = y, and the triangle is isosceles.
2
Prove ¬q → ¬p : Assume q is not true, prove p is not true.
Prove that if n is an integer and n2 is even, then n is even
Assume n is odd, then n = 2k + 1 for some integer k. Therefore n2 = (2k + 1)2 = 4k 2 + 4k + 1 =
2(2k 2 + 2k) + 1, so since 2k 2 + 2k is an integer, n2 is odd. Thus, if n2 is even, n is even.
3
Proof by Contradiction: Assume p is true and q is not true and obtain
a contradiction.
√
Prove that 2 is irrational.
√
√
Assume 2 is rational. Then 2 = m/n where m and n are both integers which are not divisible by
the same number (If they are, divide by that number and use the new values of m and n). Therefore
m and n are not both even numbers.
√
Multiplying both sides of the equation by n we obtain n 2 = m and squaring both sides we obtain
2n2 = m2 Therefore m2 is even and since the square of an odd number is always odd, m is even and
can be written m = 2k.
Substituting 2k for m, we obtain 2n2 = (2k)2 = 4k 2 and n2 = 2k 2 so n2 and n are even.
We have shown that both√m and n are even which contradicts our earlier statment that m and n
are not both even. Thus 2 is irrational.
4
Prove p ↔ q : Prove p → q and prove q → p.
Prove A ∩ (B − C) = (A ∩ B) − C, which is equivalent to
∀x∀A∀B∀C x ∈ A ∩ (B − C) ↔ x ∈ (A ∩ B) − C
Prove p → q :
If x ∈ A ∩ (B − C), x ∈ A ∧ (x ∈ B ∧ x ∈
/ C).
By the associative law, (x ∈ A ∧ x ∈ B) ∧ (x ∈
/ C).
Hence, x ∈ (A ∩ B) − C.
Prove q → p :
If x ∈ (A ∩ B) − C, (x ∈ A ∧ x ∈ B) ∧ x ∈
/ C.
By the associative law, x ∈ A ∧ (x ∈ B ∧ x ∈
/ C),
so x ∈ A ∩ (B − C).
1 This
example is from How to Read and Do Proofs by Daniel Solow
CSC 333, Summer 2012
5
Lecture Notes: Proof Techniques
page 2
Prove ¬(p → q) : Find a counter example
Prove A ∩ (B ∪ C) = (A ∩ B) ∪ C:
This statement is not true, because if A ={1, 2}, B ={2, 3}, and C ={4},
then A ∩ (B ∪ C) = {2} 6= {2, 4} = (A ∩ B) ∪ C.
How proofs that fail are useful
Sometimes proof techniques are useful for helping us figure out whether a statement is true or under
what circumstances it’s true. Consider the previous statement and and suppose we found several
examples of sets A, B, and C for which A ∩ (B ∪ C) = (A ∩ B) ∪ C and were wondering if this might
be true for all choices of A, B, and C. One good way to learn more is to follow the proof recipe for
proving ∀A∀B∀C . (A ∩ (B ∪ C) = (A ∩ B) ∪ C).
First apply the recipe for set equality to get ∀A∀B∀C∀a . (a ∈ A ∩ (B ∪ C) ↔ a ∈ (A ∩ B) ∪ C).
Then fix A, B, C, and a as arbitrary and break the proof down into two directions.
→: Assume a ∈ A ∩ (B ∪ C). This means (converting to Boolean logic) that either a ∈ A ∧ a ∈ B
or a ∈ A ∧ a ∈ C. The remainder of this part of the proof breaks down into two distinct cases; for
each case we must prove (a ∈ A ∧ a ∈ B) ∨ a ∈ C.
Case 1. a ∈ A ∧ a ∈ B. Using the recipe for p ∨ q, choose p = (a ∈ A ∧ a ∈ B), which follows directly
from the assumption.
Case 2. a ∈ A ∧ a ∈ C. Choose a ∈ C, which, again, follows directly.
←: Assume a ∈ (A ∩ B) ∪ C, which means either a ∈ A ∧ a ∈ B or a ∈ C. Again, there are two
cases; in each case we need to prove a ∈ A ∧ (a ∈ B ∨ a ∈ C).
Case 1. a ∈ A ∧ a ∈ B. The first operand of ∧, a ∈ A, follows directly. In the second, choose a ∈ B,
which also follows directly.
Case 2. a ∈ C. We need to prove a ∈ A, which is not true unless C ⊆ A. The seond part,
(a ∈ B ∨ a ∈ C), is true if we choose a ∈ C.
Thus the proof succeeds exactly when C ⊆ A.
6
Proof by cases
Prove that an undirected graph with at least two vertices must have at least two vertices with the
same degree.2
Suppose a graph G has n vertices. The lowest possible degree is 0 and the highest possible degree
is n − 1. Let k be the number of vertices of degree 0.
Case 1 : If k = 0, then there are only n − 1 different degrees and by the pigeonhole principle, two
of the n vertices must have the same degree.
Case 2 : If k = 1, then there are n − 1 vertices with degree ≥ 1 and the highest possible degree is
n − 2, so again by the pigeonhole principle, at least two vertices must have the same degree.
Case 3 : If k ≥ 2, then at least two vertices have the same degree.
2 This
proof is from Dr. Carla Savage’s Graph Theory notes
CSC 333, Summer 2012
7
Lecture Notes: Proof Techniques
page 3
Proof by induction: Prove P (c) is true; assume P (n) is true for n > c;
prove P (n + 1).
n2
i=1 i ≥ 2
P1
Base case: i=1 i = 1 ≥ 21
Pn
2
Assume that i=1 i ≥ n2 .
Prove that
Pn
n+1
X
i =
i=1
=
12
2
Then
n
X
i + (n + 1)
i=1
2
≥
=
>
=
n
+ (n + 1)
2
n2 + 2n + 2
2
n2 + 2n + 1
2
(n + 1)2
2
using the (inductive) assumption
because (n + 1)2 = n2 + 2n + 1
By induction, therefore, the inequality is true for all n ≥ 1. 2
8
Proof by strong induction: Prove P (c) is true; assume P (k) is true for
all k if c ≤ k ≤ n; prove P (n + 1).
Prove that an undirected graph with no cycles and at least one edge has at least 2 nodes of degree
1.
Base Case: A graph with 2 nodes and one edge has 2 nodes of degree 1.
Assume that any undirected graph with n or fewer nodes, where n ≥ 2, no cycles, and at least one
edge has at least 2 nodes of degree 1.
Consider any undirected graph, G, with no cycles, n + 1 nodes, and at least one edge.
Remove an edge, xy, from G. Because G has no cycles there are no other paths connecting x and
y so removing xy creates two disjoint subgraphs, Gx and Gy , containing x and y respectively with
≤ n nodes each. Without loss of generality, assign any nodes of degree 0 in G other than x and y to
either Gx or Gy .
Case 1: Both Gx and Gy contain an edge. By the induction hypothesis, each contains at least two
nodes of degree 1. Adding an edge between x and y creates a graph with at least two nodes of degree
1. Note that even if x and/or y are nodes of degree 1 in Gx and/or Gy , each subgraph has at least
one other node of degree 1.
Case 2: Gx has an edge and Gy does not. By the induction hypothesis, Gx contains at least two
nodes of degree 1. Node y has degree 0 in Gy . Adding an edge from x to y, creates a graph with at
least two nodes of degree 1: y and some node other than x that has degree 1 in Gx .
Case 3: Gy has an edge and Gx does not. Symmetric to case 2.
9
Proof of Language Equivalence: Prove w ∈ L1 ↔ w ∈ L2 .
Prove that the following two descriptions describe the same language:
L1
= {ai bj | i, j ≥ 0}
L2
= {w over {a, b} | ba is not a substring of w}
CSC 333, Summer 2012
Lecture Notes: Proof Techniques
page 4
Suppose w ∈ L1 . Any substring of w must either consist completely of a’s or b’s, or all a’s precede
all b’s, or it is ε.The substring ba does not fit any of these descriptions, so we conclude that w ∈ L2 .
Suppose w ∈ L2 . We can show that w must be in L1 by induction on the length of w. For the basis,
if |w| = 0, then w = ε, which is in L1 if we choose i = j = 0.
Assume that all w ∈ L2 having length n are in L1 and consider a w ∈ L2 with |w| = n + 1. Write
w as xs where |x| = n and s ∈ {a, b}. Clearly x cannot have ba as a substring since w does not, so
we know x ∈ L2 . By our (inductive) assumption x ∈ L1 .
Case 1. s = a. Since ba is not a substring of w, we know x does not end with b. Being in L1 it must
be of the form ai for some i ≥ 0. This implies w = ai+1 which is also in L1 .
Case 2. s = b. In this case x can be anything in L1 , so let’s suppose it’s ai bj . then w = ai bj+1
which is also in L1 .
The two cases cover all possible endings for w. Hence we have shown that any string w ∈ L2 of
length n + 1 is also in L1 . By induction, any string w ∈ L2 of any length ≥ 0 is in L1 .
We can now conclude that L1 = L2 . 2
10
Proofs By Construction: Show how to construct an object.
Prove that for each even number n greater than 2, there exists a 3-regular graph with n nodes.3
Proof: Let n be an even number greater than 2. Construct a graph G = (V, E) with n nodes as
follows. The set of nodes of G is V = {0, 1, ..., n − 1}, and the set of edges of G is the set
E
= {{i, i + 1}| for 0 ≤ i ≤ n − 2} ∪ {{n − 1, 0}}
∪ {{i, i + n/2}| for 0 ≤ i ≤ n/2 − 1}
Picture the nodes of this graph written consecutively around the circumference of a circle. In that
case the edges described in the top line of E go between adjacent pairs around the circle. The edges
described in the bottom line of E go between nodes on opposite sides of the circle. This mental
picture clearly shows that every node in G has degree 3. 2
3 This
example is from the textbook
© Copyright 2026 Paperzz