Proofs (Computer Science Notes)
Proving a Universal Statement
Now, let’s consider how to prove a claim like for every rational number q, 2q is rational.
First, we need to define what we mean by “rational”. A real number r is rational if there
are integers m and n, n (does not equal) 0, such that r = m/n.
In this definition, notice that the fraction m/n does not need to satisfy conditions like
being proper or in lowest terms
However, it’s critical that the two numbers in the fraction be integers, since even
irrational numbers can be written as fractions with non-integers on the top and/or bottom
The simplest technique for proving a claim of the form
A, P(x) is to pick some
representative value for x.
Proof: Let q be any rational number. From the definition of “rational,” we know that q =
m/n where m and n are integers and n is not zero. So 2q = 2m/n = 2m/n. Since m is an
integer, so is 2m. So 2q is also the ratio of two integers and, therefore, 2q is rational.
At the start of the proof, notice that we expanded the word “rational” into what its
definition said. At the end of the proof, we went the other way: noticed that something
had the form required by the definition and then asserted that it must be a rational.
Another Example of Direct Proof Involving Odd and Even
Claim 1: For any integer k, if k is odd then k^2 is odd. This has a slightly different form
from the previous claim:
Z, if P(x) then Q(x) before doing the actual proof, we first
need to be precise about what we mean by “odd”. And, while we are on the topic, what
we mean by “even.”
Definition 1 An integer n is even if there is an integer m such that n = 2m.
Definition 2 An integer n is odd if there is an integer m such that n = 2m + 1.
Using these definitions, we can prove our claim as follows: Proof of Claim 1: Let k be
any integer and suppose that k is odd. We need to show that k^2 is odd. Since k is odd,
there is an integer j such that k = 2j + 1. Then we have k^2 = (2j + 1)2 = 4j2 + 4j + 1 =
2(2j2 + 2j) + 1 since j is an integer, 2j2 + 2j is also an integer. Let’s call it p. Then k2 = 2p
+ 1. So, by the definition of odd, k^2 is odd.
As in the previous proof, we used our key definition twice in the proof: once at the start
to expand a technical term (“odd”) into its meaning, then again at the end to summarize
our findings into the appropriate technical terms.
Introducing the variable p isn’t really necessary with a claim this simple. However, using
new variables to create an exact match to a definition may help you keep yourself
Direct Proof Outline
In both of these proofs, we started from the known information (anything in the variable
declarations and the hypothesis of the if/then statement) and moved gradually towards the
information that needed to be proved (the conclusion of the if/then statement).
Proving Existential Statements