How To Write Proofs
How To Write Proofs
How To Write Proofs
• An assumption or
• A conclusion, clearly following from an assumption or previously proved
result.
And that is all. Occasionally there will be the clarifying remark, but this is just for the
reader and has no logical bearing on the structure of the proof.
A well written proof will flow. That is, the reader should feel as though they are being
taken on a ride that takes them directly and inevitably to the desired conclusion
without any distractions about irrelevant details. Each step should be clear or at least
clearly justified. A good proof is easy to follow.
When you are finished with a proof, apply the above simple test to every sentence: is
it clearly (a) an assumption or (b) a justified conclusion? If the sentence fails the test,
maybe it doesn't belong in the proof.
Before we begin the proof, let's recall a few definitions. A real number is called
rational if it can be expressed as the ratio of two integers: p/q. The ancient Greeks
thought that all numbers were rational. A number that is not rational would be called
irrational. You probably believe that π is irrational. (It might surprise you that this is
not easy to prove.) When the Greeks proved that the square root of 2 is not a rational
number, the very foundations of arithmetic were called into question. This is one of
the reasons that Greek geometry subsequently flourished--all numbers could be
treated geometrically without reference to rationality.
Another fact that we will need is the Fundamental Theorem of Arithmetic. This
exciting sounding theorem is nothing more than the fact that every positive integer
has a unique representation as a product of prime numbers. The technique of proof we
will use is proof by contradiction. You do not need any specialized knowledge to
understand what this means. It is very simple. We will assume that the square root of
2 is a rational number and then arrive at a contradiction. Make sure you understand
every line of the proof.
Proof. Let's represent the square root of 2 by s. Then, by definition, s satisfies the
equation
s2 = 2.
s = p/q
where p and q are a pair of integers. In fact, by dividing out the common multiple if
necessary, we may even assume p and q have no common multiple (other than 1). If
we now substitute this into the first equation we obtain, after a little algebra, the
equation
p2 = 2 q2.
But now, by the Fundamental Theorem of Arithmetic, 2 must appear in the prime
factorization of the number p2 (since it appears in the same number 2 q2). Since 2
itself is a prime number, 2 must then appear in the prime factorization of the number
p. But then, 22 would appear in the prime factorization of p2, and hence in 2 q2. By
dividing out a 2, it then appears that 2 is in the prime factorization of q2. Like before
(with p2) we can now conclude 2 is a prime factor of q. But now we have p and q
sharing a prime factor, namely 2. This violates our assumption above (see if you can
find it) that p and q have no common multiple other than 1.
Direct Proofs
Let's start with an example.
Proof. By our assumptions, and the definition of divisibility, there are natural
numbers k1 and k2 such that
b = a k1 and c = b k2.
Consequently,
c = b k2 = a k1 k2.
If P, Then Q
Most theorems (homework or test problems) that you want to prove are either
explicitly or implicitly in the form "If P, Then Q". In the previous example, "P" was
"If a divides b and b divides c" and "Q" was "a divides c". This is the standard form of
a theorem (though it can be disguised). A direct poof should be thought of as a flow of
implications beginning with "P" and ending with "Q".
P -> ... -> Q
Most proofs are (and should be) direct proofs. Always try direct proof first, unless you
have a good reason not to.
In the theorem below, a perfect square is meant to be an integer in the form a2 where
a itself is an integer and an odd integer is any integer in the form 2a+1 where a is an
integer.
Theorem. The number 100...01 (with 3n-1 zeros where n is an integer larger then 0)
is composite.
Proof. We can rewrite our number as 100...01 = 103n + 1 where n is an integer larger
than 0. Now use the identity a3 + b3 = (a+b)(a2 - a b + b2) with a = 10n and b = 1, to
get
We will be done once we have shown that both factors (10n + 1) and (102n - 10n + 1)
are greater than 1. In the first case, this is clear since 10n > 0 when n > 0. In the
second case, 102n - 10n = 10n (10n - 1) > 0, when n > 0. This completes the proof.
Make sure you understand why it was necessary to discuss the two cases at the end.
One-to-One Functions
A function f:X->Y is called one-to-one if for any pair a, b in X such that f(a) = f(b)
then a = b. Also, if f:X->Y and g:Y->Z are two functions then the composition
gf:X->Z is the function defined by gf(a) = g(f(a)) for every a in X. Note that the
composition gf is only defined if the domain of f is contained in the range of g.
Proof. Let a and b be in X and assume gf(a) = gf(b). Thus, g(f(a)) = g(f(b)), and since
g is one-to-one we may conclude that f(a) = f(b). Finally, since f is one-to-one, a = b.
Roots of Polynomials
A number r is called a root of the polynomial p(x) if p(r) = 0.
Exercises
Prove each of the following.
1. If a divides b and a divides c then a divides b + c. (Here a, b, and c are positive
natural numbers and the definition of divisibility is given above.)
2. If a is an integer, divisible by 4, then a is the difference of two perfect squares.
3. If a and b are real numbers, then a2 + b2 >= 2 a b.
4. The sum of two rational numbers is a rational number.
5. If two onto functions can be composed then their composition is onto. (A
function f:X->Y is called onto if for every b in Y there is an element a in X
such that f(a) = b. )
6. If r1, r2, r3 are three distinct (no two the same) roots of the polynomial
p(x) = x3 + b x2 + c x+ d, then r1 r2 + r1 r3 + r2 r3 = c.
Proof by Contradiction
In a proof by contradiction we assume, along with the hypotheses, the logical
negation of the result we wish to prove, and then reach some kind of contradiction.
That is, if we want to prove "If P, Then Q", we assume P and Not Q. The
contradiction we arrive at could be some conclusion contradicting one of our
assumptions, or something obviously untrue like 1 = 0. Read the proof of the
irrationality of the square root of 2 in the introduction for an example.
Proof. Assume to the contrary that there are only finitely many prime numbers, and
all of them are listed as follows: p1, p2 ..., pn. Consider the number q = p1p2... pn + 1.
This number is not divisible by any of the listed primes since if we divided pi into q,
there would result a remainder of 1 for each i = 1, 2, ..., n. Well then, we must
conclude that q is a prime number, not among the primes listed above, contradicting
our assumption that all primes are in the list p1, p2 ..., pn.
Proof by contradiction is often used when you wish to prove the impossibility of
something. You assume it is possible, and then reach a contradiction. In the examples
below we use this idea to prove the impossibility of certain kinds of solutions to some
equations.
p3 + p q2 + q3 = 0
There are three cases to consider. (1) If p and q are both odd, then the left hand side of
the above equation is odd. But zero is not odd, which leaves us with a contradiction.
(2) If p is even and q is odd, then the left hand side is odd, again a contradiction. (3) If
p is odd and q is even, we get the same contradiction. The fourth case--p even and q
even--is not possible because we assumed that p/q is in reduced form. This completes
the proof.
Proof by Contradiction is often the most natural way to prove the converse of an
already proved theorem.
Proof. (Proof by Contradiction.) Suppose the triangle is not a right triangle. Label the
vertices A, B and C as pictured. (There are two possibilities for the measure of angle
C: less than 90 degrees (left picture) or greater than 90 degrees (right picture).)
Exercises
Use the method of Proof by Contradiction to prove each of the following.
Example: Parity
Here is a simple example that illustrates the method. The proof will use the following
definitions.
Definitions.
For the purpose of this example we will assume as proved that each integer is either
even or odd.
Theorem. If x and y are two integers for which x+y is even, then x and y have the
same parity.
Proof. The contrapositive version of this theorem is "If x and y are two integers with
opposite parity, then their sum must be odd." So we assume x and y have opposite
parity. Since one of these integers is even and the other odd, there is no loss of
generality to suppose x is even and y is odd. Thus, there are integers k and m for
which x = 2k and y = 2m+1. Now then, we compute the sum
x+y = 2k + 2m + 1 = 2(k+m) + 1,
The method of Contrapositive has the advantage that your goal is clear: Prove Not P.
In the method of Contradiction, your goal is to prove a contradiction, but it is not
always clear what the contradiction is going to be at the start.
A Test For Perfect Squares
In this example, we will need two notions. An integer n is called a perfect square if
there is another integer k such that n = k2. For example, 13689 is a perfect square
since 13689 = 1172.
The second idea is the remainder and modular arithmetic. For two integers m and n, n
mod(m) = r will be the remainder resulting when we divide m into n. This means that
there is an integer q such that n = mq + r. For example, 107 mod(29) = 11 since 29
will go into 107 4 times with a remainder of 11 (or, in other words, 107 = (4)(29) +
11). Determining whether or not a positve integer is a perfect square might be
difficult. For example, is 82,642,834,671 a perfect square? First we compute
82,642,834,671 mod(4) = 3. Then use this theorem:
Proof. We will prove the contrapositive version: "If n is a perfect square then n
mod(4) must be 0 or 1." (Do you understand why this is the contrapositive version?)
Suppose n = k2. There are four cases to consider.
Exercises
Prove each of the following by the contrapositive method.
1. If x and y are two integers whose product is even, then at least one of the two
must be even.
2. If x and y are two integers whose product is odd, then both must be odd.
3. If n is a positive integer such that n mod(3) = 2, then n is not a perfect square.
4. If a and b a real numbers such that the product a b is an irrational number, then
either a or b must be an irrational number.
Theorem. If a is an integer, then a is not evenly divisible by 3 if, and only if, a2 -1 is
evenly divisible by 3.
Proof. Since this is an "If, and Only If" theorem, we must prove two implications.
("If") We must prove "a is not evenly divisible by 3 if a2 -1 is evenly divisible by 3".
So we assume that 3 evenly divides a2 -1 = (a-1)(a+1). Since 3 is a prime number, 3
must evenly divide either a-1 or a+1. In either case, it should be apparent that 3 cannot
evenly divide a.
("Only If"). We must prove "a is not evenly divisible by 3 only if a2 -1 is evenly
divisible by 3." This means "If a is not evenly divisible by 3, then a2 -1 is evenly
divisible by 3". This is where we use the division algorithm stated above. We can
write a = 3q + r, where r = 0, 1 or 2. Our assumption that a is not divisible by 3
implies r cannot be 0. If r =1, then a-1 = 3q and so 3 evenly divides a2 -1 = (a-1)(a+1).
A similar argument works if r = 2.
Sometimes you can prove an "If, and Only If" assertion without explicitly dividing the
proof into two parts. The next example illustrates how this might be done.
Theorem. A positive integer n is evenly divisible by 3 if, and only if, the sum of the
digits of n is divisible by 3.
Exercises
Prove each of the following.
1. If a is an integer, then a is not evenly divisible by 5 if, and only if, a4 -1 is
evenly divisible by 5.
2. For two integers a and b, a+b is odd if, and only if, exactly one of the integers,
a or b, is odd.
3. For two integers a and b, the product ab is even if and only if at least one of
the integers, a or b, is even.
4. A positive integer n is evenly divisible by 9 if, and only if, the sum of the
digits of n is divisible by 9.
5. A positive integer n is evenly divisible by 11 if, and only if, the difference of
the sums of the digits in the even and odd positions in n is divisible by 11.
Mathematical Induction
Let's begin with an example.
Initial Step. We must verify that P(1) is True. P(1) asserts "1 = 1(2)/2", which is
clearly true. So we are done with the initial step.
Inductive Step. Here we must prove the following assertion: "If there is a k such that
P(k) is true, then (for this same k) P(k+1) is true." Thus, we assume there is a k such
that 1 + 2 + ... + k = k (k+1)/2. (We call this the inductive assumption.) We must
prove, for this same k, the formula 1 + 2 + ... + k + (k+1) = (k+1)(k+2)/2.
Theorem. A formula for the sequence an defined above, is an = (1 - 1/22n)/2 for all n
greater than or equal to 0.
Initial Step. When n = 0, the formula gives us (1 - 1/22n)/2 = (1 - 1/2)/2 = 1/4 = a0. So
the closed form formula gives us the correct answer when n = 0.
Inductive Step. Our inductive assumption is: Assume there is a k, greater than or
equal to zero, such that ak = (1 - 1/22k)/2. We must prove the formula is true for n =
k+1.
First we appeal to the recursive definition of ak+1 = 2 ak(1-ak). Next, we invoke the
inductive assumption, for this k, to get
Exercises
Prove each of the following by Mathematical Induction.
Theorem. The binary operation gcd is associative, that is, for any three positive
integers a, b and c,
Strategy. What do we have to prove? Two gcd's are the same. Where do we start? Let
d be one of these gcd's. Let's let d = gcd(gcd(a, b), c). What does this mean? It means
(1) d evenly divides gcd(a, b) and c and (2) if d' is any other positive integer that
evenly divides gcd(a, b) and c, then d>d'. We must prove d = gcd(a, gcd(b, c)). What
does this mean? We must prove two things: (1) d evenly divides a and gcd(b, c) and
(2) if d' is some other positive integer that evenly divides a and gcd(b, c), then d>d'.
(1) Since d divides gcd(a, b), d must divide and b. We know d divides c, so d must
divide gcd(b, c). So the first part is easy.
(2) Now we suppose d' divides a and gcd(b, c). Then, d' divides b and c, so d' must
divide gcd(a, b) too. But then by our assumption, d>d'. And this is all we needed to
prove.
Proof. Let d = gcd(gcd(a, b), c). Then d divides a, b and c, and hence divides a and
gcd(b, c). If d' divides a and gcd(b, c), then d' must divide gcd(a, b) and c, and hence
d>d'. Thus d = gcd(a, gcd(b, c)).
Proof. Let q(x) be the nonzero polynomial with rational coefficients for which
q(a) = 0. Then p(x) = q(x-r) is also a polynomial with rational coefficients (since r is a
rational number) and p(a+r) = 0. Hence a + r is an algebraic number.
Exercises
Prove each of the following.
1. The least common multiple of two positive integers a and b, lcm(a, b), is the
positive integer m that satisfies the two conditions: (1) a and b evenly divide m
and (2) if m' is another positive integer for which a and b divide m', then m <
m'. The least common multiple is associative, i.e. for any three positive
integers, lcm(lcm(a, b), c) = lcm(a, lcm(b, c)).
2. If a is an algebraic number and r is a rational number, then the product ra is an
algebraic number.
Proof. (We construct the solution.) Let a = u2 - v2 and b = 2 u v where u and v are
positive integers with u > v. Then a2 + b2 = (u2-v2)2 + (2uv)2 = u4 - 2 u2v2 + v4 + 4 u2v2
= u4 + 2u2v2 + v4 = (u2 + v2)2. Thus, (u2 - v2, 2 u v, u2 + v2), for u > v, is two
parameter family of Pythagorean triples.
Proof. The square root of 10 100 is 10 50. After a little bit of trial and error, we let x =
10 50 + 10 -51, which is clearly a rational number bigger than the square root of 10 100.
To prove that x is less than the square root of 10100+1, we compute
Existential Proofs
Sometimes it is possible to prove the existence of something mathematical without
actually constructing it. Why would you want to do this? Well, it could be that you
just cannot think of a constructive proof, or that a constructive proof is very long and
tedious. In any case, existential proofs are another valuable technique in proofs. Let's
look at a familiar example from the calculus.
Mean Value Theorem. If a real valued function f is continuous on the closed interval
[a, b] and f is differentiable on the open interval (a, b) then there is a number c in (a,
b) such that f'(c) = (f(b) - f(a))/(b-a). We can use the Mean Value Theorem to prove
that certain polynomials do not have more than one real root. (A root of a polynomial
p(x) is a number c such that p(c) = 0.)
Part 1. (Direct Existential Proof.) First we will prove p(x) has one real root. We
appeal to the Intermediate Value Theorem with a = 0 and b = 1: p(0) = - 1 < 0 and
p(1) = 1 > 0. Since 0 (N = 0) is between -1 (=p(0)) and 1 (=p(1)), we may conclude
that there is a real number c, between 0 and 1, for which p(c) = 0.
Part 2. (Proof by Contradiction.) Now we will prove that p(x) has only one root.
Assume to the contrary that p(x) has more than one root. Let's suppose two distinct
roots c1 and c2, so p(c1) = p(c2) = 0. Then by appealing to the Mean Value Theorem,
there must be a number c between c1 and c2 for which p'(c) = (p(c2) - p(c1))/(c2 - c1) =
0. But a direct calculation shows that p'(x) = 3x2 + 1, which can never be zero since x2
>= 0 for all real numbers x. The contradiction completes the proof.
Proof. The velocity function is the derivative of the position function v(t) = s'(t).
According to the Mean Value Theorem, there is a value t = t0 between a and b where
v(t0) = s'(t0) = (s(b) - s(a))/(b-a) = average velocity over the path.
Exercises
Prove each of the following.
Counter Examples
Counter examples play an important role in mathematics. Whereas a complicated
proof may be the only way to demonstrate the validity of a particular theorem, a
single counter example is all that is need to refute the validity of a proposed theorem.
For example, numbers in the form 22n + 1, where n is a positive integer, were once
thought to be prime. These numbers are prime for n = 1, 2, 3 and 4. But when n = 5,
we get
225 + 1 = 4294967297 = (641)(6700417)
a composite number. Conclusion: When faced with a number in the form 22n + 1, we
are not allowed to assume it is either prime or composite, unless we know for sure for
some other reason.
A natural place for counter examples to occur is when the converse of a known
theorem comes into question. The converse of an assertion in the form "If P, Then Q"
is the assertion "If Q, Then P".
Exercises
1. State the converse of "If a and b are even integers then a+b is an even integer".
Show that the converse is not true by producing a counter example.
2. State the converse of "If a, b and c are real numbers such that a + b = c, then
(a+b)2 = c2". Show that the converse is not true by producing a counter
example.
3. State the converse of "If a, b and c are integers such that a divides b, then a
divides the product bc." Show that the converse is not true by producing a
counter example.
4. State the converse of "If a and b are rational numbers, then so is the product
ab". Show that the converse is not true by producing a counter example.
Exercises
Prove each of the following using a case by case analysis.
1. The "Triangle Inequality" for real numbers, |a + b| is less than or equal to |a| +
|b|. (The cases correspond to the signs (plus or minus) of a and b.)
Strategy. What do we have to prove? (a+c) = (b+d) mod(m). What does this mean? It
means we must show there is an integer k such that a+c = (b+d) + k m. What are we
assuming? a = b mod(m) and c = d mod(m). This means there are integers k1 and k2
such that a = b + k1 m and c = d + k2m. What do we do? We can add these last two
equations together to get: (a+c) = (b+d) + (k1+k2)m. So if we were to let k = k1 + k2,
we would have what we want. Now we se what to do. So we write the proof.
Proof. By our assumption, there are integers k1 and k2 such that a = b + k1 m and c =
d + k2m. Adding these two equations together gives us (a+c) = (b+d) + (k1+k2)m,
which, by definition, means (a+c) = (b+d) mod(m).
So "well defined" means that the definition being made has no internal inconsistencies
and is free of contradictions. To better understand this idea, let's look at an example
where a definition turns out not to be well defined.
Example:Functions Modulo m
In the previous two examples, we looked at the "numbers" modulo m. In this system
there are only m "numbers", represented by 0, 1, ..., m-1. It is traditional to call this
set Zm. For example, Z4 has 4 elements, represented by 0, 1, 2, 3. Remember, all other
integers are just other names for these 4. For example, 13 = 1 mod(4) and - 13 = 3
mod(4).
Theorem. The function f:Z4 -> Z4, given by f(x) = 2x+1 is well defined.
Strategy. It is easy to see that f(0) = 1, f(1) = 3, f(2) = 5 = 1 mod(4) and f(3) = 7 = 3
mod(4). What do we need to prove? We need to prove that f(a) = f(b) mod (4). That
is, f(a) - f(b) is evenly divisible by 4, that is, (2a+1) - (2b+1) = 2(a - b) is evenly
divisible by 4. What is our assumption? We are assuming a = b mod(4). What does
this mean? It means that a - b is evenly divisible by 4. We can see immediately that
our assumption implies 2(a - b) is divisible by 4, which is what we wanted.
Proof. If a = b mod(m), then (a - b) is divisble by 4. Hence so is (2a + 1) - (2b + 1),
that is f(a) = f(b) mod (m).
Exercises
Prove each of the following.
Example
Theorem. Among any N positive integers, there exist 2 whose difference is divisible
by N-1.
Proof. Let a1, a2, ..., aN be the numbers. For each ai, let ri be the remainder that results
from dividing ai by N - 1. (So ri = ai mod(N-1) and ri can take on only the values 0, 1,
..., N-2.) There are N-1 possible values for each ri, but there are N ri's. Thus, by the
pigeon hole principle, there must be two of the ri's that are the same, rj = rk for some
pair j and k But then, the corresponding ai's have the same remainder when divided by
N-1, and so their difference aj - ak is evenly divisible by N-1.
Example
Theorem. For any N positive integers, the sum of some of these integers (perhaps one
of the numbers itself) is divisible by N.
Exercises
Prove each of the following using the pigeon hole principle.
1. If a city has 10,000 different telephone lines numbered by 4-digit numbers and
more than half of the telephone lines are in the downtown, then there are two
telephone numbers in the downtown whose sum is again the number of a
downtown telephone line.
2. If there are 6 people at a party, then either 3 of them knew each other before
the party or 3 of them were complete strangers before the party.