Reading 4: Proofs
Reading 4: Proofs
Reading 4: Proofs
Reading 4 : Proofs
Author: Dieter van Melkebeek (updates by Beck Hasti and Gautam Prakriya)
Up until now, we have been introducing mathematical notation to capture concepts such as
propositions, implications, predicates, and sets. We need this machinery in order to be able to
argue properties of discrete structures in a rigorous manner. As we were introducing new concepts,
we stated various facts and gave proofs of some of them, but we were not explicit about what a
correct proof should look like. In this reading we start discussing what constitutes a valid proof of
a proposition and give some guidelines for writing proofs.
4.1 Proofs
We briefly mentioned what proofs were in the second reading. Let’s repeat some of this discussion,
and make our definition of a proof more precise.
Definition 4.1. A proof of a proposition P is a chain of logical deductions ending in P and starting
from some set of axioms.
Our definition of a proof mentions axioms and logical deductions, both of which require further
consideration. Let’s discuss them one by one.
4.1.1 Axioms
Axioms are statements we take for granted and do not prove. The set of axioms we use depends
on the area we work in. For geometry, we would use Euclid’s five axioms of geometry. Another set
of axioms are the ZFC axioms (the abbreviation stands for Zermelo, Fraenkel, and the axiom of
Choice) which form the basis of all set theory. However, both of these sets of axioms are small and
proving any substantial result starting just from those axioms requires a significant amount of work.
Thus, such sets of axioms are more suitable for a course on logic than a course on discrete structures.
In this course, we use a much larger set of axioms because our focus is on proof techniques and
their applications to discrete structures. Thus, we will consider any familiar fact from math at the
level of high school as an axiom. If you are unsure whether you can take something for granted on
an assignment, just ask.
1
4.2 Proof Techniques
To describe inference rules in a more compact way, we draw a horizontal line, place all an-
tecedents above the horizontal line (either on the same line or on multiple lines), and write the
conclusion below the horizontal line. In Figure 4.1a we show the notation for a general inference
rule with antecedents P1 , P2 , . . . , Pk and conclusion Q, and we give two ways of writing modus
ponens in Figures 4.1b and 4.1c.
P
P1 P2 . . . Pk P P ⇒Q P ⇒Q
Q Q Q
(a) General case (b) Modus ponens using (c) Modus ponens using
one line two lines
c
a
Proposition 4.2 (Pythagorean Theorem). In a right triangle where the hypotenuse has length c
and the other two sides have lengths a and b, we have a2 + b2 = c2 .
Proof. Consider a right triangle like the one in Figure 4.2. We take four copies of the triangle and
arrange them in two different ways.
First, form a square with the hypotenuse as the side. Its area is c2 . We show this arrangement
in Figure 4.3a. The four copies of the right triangle are shaded in dark gray. The space shaded
light gray inside the square in Figure 4.3a is a square of side length b − a.
Now rearrange the five pieces differently, as shown in Figure 4.3b. The thick blue lines indicate
that we can view this arrangement as two squares of sides a and b placed next to each other. The
square on the right has length is b, so the area of that square is b2 . The square on the left has side
length a, so its area is a2 , and the total area is, therefore, a2 + b2 .
2
4.2 Proof Techniques 4.2.2 Proving Implications
b a
c
a
b b−a
b b−a
a
a b−a a
b
(a) An arrangement of four copies (b) A rearrangement of Figure 4.3a.
of the right triangle from Figure
4.2. There is a square in the mid-
dle.
Since we obtained the second picture from the first one by rearranging, they have the same
area, which completes the proof that a2 + b2 = c2 .
The use of Venn diagrams to prove properties of sets is another example of a proof “by picture”.
While such proofs are often very appealing, they don’t constitute a valid proof in mathematics.
Pictures are typically used only to aid our intuition.
Step 1: Assume that P holds. We usually write this as the first sentence in the proof.
Step 3: Say that Q holds. This is usually the last sentence in the proof.
As an example, we prove the statement that if an integer is odd, then so is its square. We state
it as Theorem 4.3.
The statements P and Q for the implication in Theorem 4.3 are P : “x is odd” and “Q: x2 is
odd”.
Note that the implication is universally quantified. Whenever we prove a universally quantified
statement, we have to prove it for every x in the domain. In our case, we have to prove the
implication P ⇒ Q for every integer x. It does not suffice to prove, say, that if 3 is odd, then 9 is
odd. We cannot make any assumption about x besides the fact that it’s odd.
For the purposes of presentation, we label where the three steps outlined earlier in the margin.
3
4.2 Proof Techniques 4.2.2 Proving Implications
We usually highlight the end of the proof in some way. In the proof above, we used a square
in the lower right corner at the end of the last paragraph. Another common way to end a proof is
to write Q.E.D. This comes from Latin “quod erat demonstrandum”, which means “which is what
had to be shown”.
Proof.
√
Step 1 We prove the contrapositive of our statement, that is, we show that if x is rational, then so
is x.
Step 2 We use a direct proof to prove the contrapositive.
√
Let x be a positive real number, and assume that x ∈ Q. Then
√ a
x= for some a ∈ Z, b ∈ N, b ̸= 0. (4.1)
b
√
Taking the square of both sides of (4.1) yields x = (a/b)2 . Now ( x)2 = x and (a/b)2 = a2 /b2 , so
x = a2 /b2 . Since a is an integer, so is a2 , and since b is a positive integer, so is b2 , which means
that x is a rational number.
√
Step 3 It follows that if x ∈
/ Q, then x ∈ / Q.
4
4.2 Proof Techniques 4.2.3 Proving Equivalences
Step 2: Prove the implication P ⇒ Q using a proof technique of your choice. Make sure you state
your choice of proof technique.
Proof.
Step 1 Let x ∈ Z. We prove the equivalence “x is even ⇐⇒ x2 is even” by proving the implications
“x is even ⇒ x2 is even” and “x2 is even ⇒ x is even”.
Step 2 We first prove that if x is even, then so is x2 . We do so by a direct proof.
If x is even, we can write x = 2y for some y ∈ Z. By squaring both sides, we get x2 = (2y)2 =
4y = 2(2y 2 ). Now 2y 2 is an integer, which means that x2 is even.
2
Step 3 Next, we prove that if x2 is even, then so is x. We prove this using an indirect proof.
Observe that the statement “if x2 is even, then so is x” is the contrapositive of Theorem 4.3.
Recall that Theorem 4.3 says that if x is odd, then so is x2 . Its contrapositive says that if x2 is
not odd, then x is not odd. But this is equivalent to saying that if x2 is even, then so is x, which
is what we wanted to show.
Step 4 It follows that x is even if and only if x2 is even.
The proof of Theorem 4.5 uses a theorem we proved earlier. Using theorems to prove other
theorems is common practice. The programming analog of this is calling a function instead of
writing all the code for that function again from scratch. It makes no sense to reprove a fact that
has already been proved, just like it makes no sense to rewrite a function that is provided to us.
Of course, there are exceptions to this rule, such as if we want to prove a slightly different fact or if
we want to override some function in a subclass, but in general, we should attempt to use existing
work before we “reinvent the wheel”.
5
4.2 Proof Techniques 4.2.4 Proof by Contradiction
Proof. Pick x ∈ Z. We prove the equivalence “x2 is even ⇐⇒ (x + 1)2 is odd” by constructing a
chain of equivalences.
We know by Theorem 4.5 than x2 is even if and only if x is even. The latter is true if and only
if x + 1 is odd. Note that Theorem 4.5 also tells us that x2 is odd if and only if x is odd. Therefore,
using x + 1 instead of x in our alternative formulation of Theorem 4.5, we see that x + 1 is odd if
and only if (x + 1)2 is odd.
Thus, we have shown that x2 is even if and only if (x + 1)2 is odd.
6
4.2 Proof Techniques 4.2.5 Proof by Cases
Note that a/b = a′ /b′ because dividing the numerator and the denominator of a fraction by the
same number doesn’t change the value of the fraction. We now have
√ a′
2= ′ where gcd(a′ , b′ ) = 1. (4.2)
b
By squaring (4.2), we get 2 = (a′ /b′ )2 = (a′ )2 /(b′ )2 , so
Therefore, (a′ )2 is even, which implies that a′ is even by Theorem 4.5. Hence, we can write
a′ = 2c, c ∈ Z. (4.4)
Substituting (4.4) into (4.3) tells us that 2(b′ )2 = (2c)2 = 4c2 , so (b′ )2 = 2c2 . It follows that (b′ )2
is even. By Theorem 4.5, this means that b′ is even.
We have shown that a′ and b′ are both even, which means that 2 is a common divisor of a′ and
b . This is a contradiction with the fact that gcd(a′ , b′ ) = 1, so the statement that 2 is√a common
′
divisor of a′ and b′ is false. What led to this contradiction was the assumption that 2 √ ∈ Q, so
this assumption is false. Therefore, the opposite of our assumption is true, and we have 2 ∈ / Q,
which is what we wanted to show.
(C1 ∨ C2 ∨ · · · ∨ Ck ) C1 ⇒ P C2 ⇒ P · · · Ck ⇒ P
.
P
We give an example of this proof technique by proving an elementary fact about graphs.
Theorem 4.8. Every group of 6 people contains a subgroup of 3 people who are mutual acquain-
tances or a subgroup of 3 people who are mutual strangers.
7
4.2 Proof Techniques 4.2.5 Proof by Cases
Case 2. Now suppose that Alice knows at most two people from the group. We have two cases
in this situation.
Case 2.1. Suppose that among people Alice doesn’t know, there are at least two people who
don’t know each other. Then Alice and those two people are all mutual strangers.
Case 2.2. Now suppose that all people not known by Alice know each other. In that case, any
group of 3 such people is a group of mutual acquaintances.
Since either there is a pair of people not known by Alice who also don’t know each other (case
2.1), or all people not known by Alice know each other (case 2.2), we have shown that if Alice has
at most two acquaintances, then the group contains a subgroup of three mutual acquaintances or
a subgroup of three mutual strangers. This completes the proof for case 2.
Finally, since Alice either has at least three (Case 1) or at most two (Case 2) acquaintances,
we have shown that the group contains a subgroup of three mutual acquaintances or a subgroup of
three mutual strangers.
Observe that the proof for Case 2 is the same as the proof for Case 1, except the roles of the
words “acquaintance” and “stranger” are switched.
We mentioned that Theorem 4.8 was a statement about graphs, yet we did not use any graph
terminology in the theorem or its proof. Here is the connection. Represent the six people as vertices
in a graph. There is an edge connecting two vertices if the people those vertices correspond to know
each other. Now Alice is one vertex in the graph, and is connected to some number of vertices by
edges. In Case 1, there area at least 3 edges connecting Alice to other vertices. Furthermore, in
Case 1.1, there is at least one edge between vertices representing people who know Alice, and in
Case 1.2 there are no such edges. We show these two cases in Figures 4.4a and 4.4b.
Bob Bob
Tom Tom
(a) Case 1.1: Some pair of Alice’s ac- (b) Case 1.2: No pair of Alice’s ac-
quaintances know each other. The three quaintances know each other. There
thick lines show that Alice, Bob and are no edges between the vertices
Paul are mutual acquaintances. labeled Eve, Bob and Tom, which
means that those three people are
mutual strangers.