Login
📚 Discrete Mathematics
Chapters ▾
⇩ Download ▾

4.2 Proofs

Anyone who doesn't believe there is creativity in mathematics clearly has not tried to write proofs. Finding a way to convince the world that a particular statement is necessarily true is a mighty undertaking and can often be quite challenging. There is not a guaranteed path to success in the search for proofs. For example, in the summer of 1742, a German mathematician by the name of Christian Goldbach wondered whether every even integer greater than 2 could be written as the sum of two primes. Centuries later, we still don't have a proof of this apparent fact (computers have checked that “Goldbach's Conjecture” holds for all numbers less than 4 × 10 18 , which leaves only infinitely many more numbers to check).

Writing proofs is a bit of an art. Like any art, to be truly great at it, you need some sort of inspiration, as well as some foundational technique. Just as musicians can learn proper fingering, and painters can learn the proper way to hold a brush, we can look at the proper way to construct arguments. A good place to start might be to study a classic.

This proof is an example of a proof by contradiction, one of the standard styles of mathematical proof. First and foremost, the proof is an argument. It contains sequence of statements, the last being the conclusion which follows from the previous statements. The argument is valid so the conclusion must be true if the premises are true. Let's go through the proof line by line.

  1. Suppose there are only finitely many primes. [this is a premise. Note the use of “suppose.”]
  2. There must be a largest prime, call it p . [follows from line 1, by the definition of “finitely many.”]
  3. Let N = p ! + 1 . [basically just notation, although this is the inspired part of the proof; looking at p ! + 1 is the key insight.]
  4. N is larger than p . [by the definition of p ! ]
  5. N is not divisible by any number less than or equal to p . [by definition, p ! is divisible by each number less than or equal to p , so p ! + 1 is not.]
  6. The prime factorization of N contains prime numbers greater than p . [since N is divisible by each prime number in the prime factorization of N , and by line 5.]
  7. Therefore p is not the largest prime. [by line 6, N is divisible by a prime larger than p .]
  8. This is a contradiction. [from line 2 and line 7: the largest prime is p and there is a prime larger than p .]
  9. Therefore there are infinitely many primes. [from line 1 and line 8: our only premise lead to a contradiction, so the premise is false.]

We should say a bit more about the last line. Up through line 8, we have a valid argument with the premise “there are only finitely many primes” and the conclusion “there is a prime larger than the largest prime.” This is a valid argument as each line follows from previous lines. So if the premises are true, then the conclusion must be true. However, the conclusion is NOT true. The only way out: the premise must be false.

The sort of line-by-line analysis we did above is a great way to really understand what is going on. Whenever you come across a proof in a textbook, you really should make sure you understand what each line is saying and why it is true. Additionally, it is equally important to understand the overall structure of the proof. This is where using tools from logic is helpful. Luckily there are a relatively small number of standard proof styles that keep showing up again and again. Being familiar with these can help understand proof, as well as give ideas of how to write your own.

Direct Proof

The simplest (from a logic perspective) style of proof is a direct proof. Often all that is required to prove something is a systematic explanation of what everything means. Direct proofs are especially useful when proving implications. The general format to prove P Q is this:

Assume P . Explain, explain, …, explain. Therefore Q .

Often we want to prove universal statements, perhaps of the form x ( P ( x ) Q ( x ) ) . Again, we will want to assume P ( x ) is true and deduce Q ( x ) . But what about the x ? We want this to work for all x . We accomplish this by fixing x to be an arbitrary element (of the sort we are interested in).

Here are a few examples. First, we will set up the proof structure for a direct proof, then fill in the details.

Proof by Contrapositive

Recall that an implication P Q is logically equivalent to its contrapositive ¬ Q ¬ P . There are plenty of examples of statements which are hard to prove directly, but whose contrapositive can easily be proved directly. This is all that proof by contrapositive does. It gives a direct proof of the contrapositive of the implication. This is enough because the contrapositive is logically equivalent to the original implication.

The skeleton of the proof of P Q by contrapositive will always look roughly like this:

Assume ¬ Q . Explain, explain, … explain. Therefore ¬ P .

As before, if there are variables and quantifiers, we set them to be arbitrary elements of our domain. Here are two examples:

We have seen how to prove some statements in the form of implications: either directly or by contrapositive. Some statements are not written as implications to begin with.

Proof by Contradiction

There might be statements which really cannot be rephrased as implications. For example, “ 2 is irrational.” In this case, it is hard to know where to start. What can we assume? Well, say we want to prove the statement P . What if we could prove that ¬ P Q where Q was false? If this implication is true, and Q is false, what can we say about ¬ P ? It must be false as well, which makes P true!

This is why proof by contradiction works. If we can prove that ¬ P leads to a contradiction, then the only conclusion is that ¬ P is false, so P is true. That's what we wanted to prove. In other words, if it is impossible for P to be false, P must be true.

Here are three examples of proofs by contradiction:

Proof by (counter) Example

It is almost NEVER okay to prove a statement with just an example. Certainly none of the statements proved above can be proved through an example. This is because in each of those cases we are trying to prove that something holds of all integers. We claim that n 2 being even implies that n is even, no matter what integer n we pick. Showing that this works for n = 4 is not even close to enough.

This cannot be stressed enough. If you are trying to prove a statement of the form x P ( x ) , you absolutely CANNOT prove this with an example.1

However, existential statements can be proven this way. If we want to prove that there is an integer n such that n 2 n + 41 is not prime, all we need to do is find one. This might seem like a silly thing to want to prove until you try a few values for n .

n 1234567
n 2 n + 41 41434753617183

So far we have gotten only primes. You might be tempted to conjecture, “For all positive integers n , the number n 2 n + 41 is prime.” If you wanted to prove this, you would need to use a direct proof, a proof by contrapositive, or another style of proof, but certainly it is not enough to give even 7 examples. In fact, we can prove this conjecture is false by proving its negation: “There is a positive integer n such that n 2 n + 41 is not prime.” Since this is an existential statement, it suffices to show that there does indeed exist such a number.

In fact, we can quickly see that n = 41 will give 41 2 which is certainly not prime. You might say that this is a counterexample to the conjecture that n 2 n + 41 is always prime. Since so many statements in mathematics are universal, making their negations existential, we can often prove that a statement is false (if it is) by providing a counterexample.

Proof by Cases

We could go on and on and on about different proof styles (we haven't even mentioned induction or combinatorial proofs here), but instead we will end with one final useful technique: proof by cases. The idea is to prove that P is true by proving that Q P and ¬ Q P for some statement Q . So no matter what, whether or not Q is true, we know that P is true. In fact, we could generalize this. Suppose we want to prove P . We know that at least one of the statements Q 1 , Q 2 , , Q n is true. If we can show that Q 1 P and Q 2 P and so on all the way to Q n P , then we can conclude P . The key thing is that we want to be sure that one of our cases (the Q i 's) must be true no matter what.

If that last paragraph was confusing, perhaps an example will make things better.

Consider the statement “for all integers a and b , if a + b is even, then a and b are even”

  1. Write the contrapositive of the statement.
  2. Write the converse of the statement.
  3. Write the negation of the statement.
  4. Is the original statement true or false? Prove your answer.
  5. Is the contrapositive of the original statement true or false? Prove your answer.
  6. Is the converse of the original statement true or false? Prove your answer.
  7. Is the negation of the original statement true or false? Prove your answer.
  1. For all integers a and b , if a or b is not even, then a + b is not even.
  2. For all integers a and b , if a and b are even, then a + b is even.
  3. There are numbers a and b such that a + b is even but a and b are not both even.
  4. False. For example, a = 3 and b = 5 . a + b = 8 , but neither a nor b are even.
  5. False, since it is equivalent to the original statement.
  6. True. Let a and b be integers. Assume both are even. Then a = 2 k and b = 2 j for some integers k and j . But then a + b = 2 k + 2 j = 2 ( k + j ) which is even.
  7. True, since the statement is false.

For each of the statements below, say what method of proof you should use to prove them. Then say how the proof starts and how it ends. Bonus points for filling in the middle.

  1. There are no integers x and y such that x is a prime greater than 5 and x = 6 y + 3 .
  2. For all integers n , if n is a multiple of 3, then n can be written as the sum of consecutive integers.
  3. For all integers a and b , if a 2 + b 2 is odd, then a or b is odd.
  1. Proof by contradiction. Start of proof: Assume, for the sake of contradiction, that there are integers x and y such that x is a prime greater than 5 and x = 6 y + 3 . End of proof: … this is a contradiction, so there are no such integers.
  2. Direct proof. Start of proof: Let n be an integer. Assume n is a multiple of 3. End of proof: Therefore n can be written as the sum of consecutive integers.
  3. Proof by contrapositive. Start of proof: Let a and b be integers. Assume that a and b are even. End of proof: Therefore a 2 + b 2 is even.

Consider the statement: for all integers n , if n is even then 8 n is even.

  1. Prove the statement. What sort of proof are you using?
  2. Is the converse true? Prove or disprove.
  1. Direct proof.
  2. The converse is false. That is, there is an integer n such that 8 n is even but n is odd. For example, consider n = 3 . Then 8 n = 24 which is even but n = 3 is odd.

The game TENZI comes with 40 six-sided dice (each numbered 1 to 6). Suppose you roll all 40 dice.

  1. Prove that there will be at least seven dice that land on the same number.
  2. How many dice would you have to roll before you were guaranteed that some four of them would all match or all be different? Prove your answer.
  1. This is an example of the pigeonhole principle. We can prove it by contrapositive.
  2. We can have 9 dice without any four matching or any four being all different: three 1's, three 2's, three 3's. We will prove that whenever you roll 10 dice, you will always get four matching or all being different.

Prove that for all integers n , it is the case that n is even if and only if 3 n is even. That is, prove both implications: if n is even, then 3 n is even, and if 3 n is even, then n is even.

One of the implications will be a direct proof, the other will be a proof by contrapositive.

Prove that 3 is irrational.

This is really an exercise in modifying the proof that 2 is irrational. There you proved things were even; here they will be multiples of 3.

Consider the statement: for all integers a and b , if a is even and b is a multiple of 3, then a b is a multiple of 6.

  1. Prove the statement. What sort of proof are you using?
  2. State the converse. Is it true? Prove or disprove.

Part (a) should be a relatively easy direct proof. Look for a counterexample for part (b).

Prove the statement: For all integers n , if 5 n is odd, then n is odd. Clearly state the style of proof you are using.

Prove the statement: For all integers a , b , and c , if a 2 + b 2 = c 2 , then a or b is even.

A proof by contradiction would be reasonable here, because then you get to assume that both a and b are odd. Deduce that c 2 is even, and therefore a multiple of 4 (why? and why is that a contradiction?).

Suppose that you would like to prove the following implication:

For all numbers n , if n is prime then n is solitary.

Write out the beginning and end of the argument if you were to prove the statement,

  1. Directly
  2. By contrapositive
  3. By contradiction

You do not need to provide details for the proofs (since you do not know what solitary means). However, make sure that you provide the first few and last few lines of the proofs so that we can see that logical structure you would follow.

Suppose you have a collection of 5-cent stamps and 8-cent stamps. We saw earlier that it is possible to make any amount of postage greater than 27 cents using combinations of both these types of stamps. But, let's ask some other questions:

  1. Prove that if you only use an even number of both types of stamps, the amount of postage you make must be even.
  2. Suppose you made an even amount of postage. Prove that you used an even number of at least one of the types of stamps.
  3. Suppose you made exactly 72 cents of postage. Prove that you used at least 6 of one type of stamp.

Use a different style of proof for each part. The last part should remind you of the pigeonhole principle, so mimicking that proof might be helpful.

Prove: x = y if and only if x y = ( x + y ) 2 4 . Note, you will need to prove two “directions” here: the “if” and the “only if” part.

Prove that log ( 7 ) is irrational.

Note that if log ( 7 ) = a b , then 7 = 10 a b . Can any power of 7 be the same as a power of 10?

Prove that there are no integer solutions to the equation x 2 = 4 y + 3 .

What if there were? Deduce that x must be odd, and continue towards a contradiction.

Prove that every prime number greater than 3 is either one more or one less than a multiple of 6.

Prove the contrapositive by cases. There will be 4 cases to consider.

Your “friend” has shown you a “proof” he wrote to show that 1 = 3 . Here is the proof:

What is going on here? Is your friend's argument valid? Is the argument a proof of the claim 1 = 3 ? Carefully explain using what we know about logic.

Your friend's proof a proof, but of what? What implication follows from the given proof? Is that helpful?

A standard deck of 52 cards consists of 4 suites (hearts, diamonds, spades and clubs) each containing 13 different values (Ace, 2, 3, …, 10, J, Q, K). If you draw some number of cards at random you might or might not have a pair (two cards with the same value) or three cards all of the same suit. However, if you draw enough cards, you will be guaranteed to have these. For each of the following, find the smallest number of cards you would need to draw to be guaranteed having the specified cards. Prove your answers.

  1. Three of a kind (for example, three 7's).
  2. A flush of five cards (for example, five hearts).
  3. Three cards that are either all the same suit or all different suits.

Suppose you are at a party with 19 of your closest friends (so including you, there are 20 people there). Explain why there must be least two people at the party who are friends with the same number of people at the party. Assume friendship is always reciprocated.

Consider the set of numbers of friends that everyone has. If everyone had a different number of friends, this set must contain 20 elements. Is that possible? Why not?

Your friend has given you his list of 115 best Doctor Who episodes (in order of greatness). It turns out that you have seen 60 of them. Prove that there are at least two episodes you have seen that are exactly four episodes apart on your friend's list.

This feels like the pigeonhole principle, although a bit more complicated. At least, you could try to replicate the style of proof used by the pigeonhole principle. How would the episodes need to be spaced out so that no two of your sixty were exactly 4 apart?

Suppose you have an n × n chessboard but your dog has eaten one of the corner squares. Can you still cover the remaining squares with dominoes? What needs to be true about n ? Give necessary and sufficient conditions (that is, say exactly which values of n work and which do not work). Prove your answers.

An 8 by 8 chessboard with the top-right corner square removed. Every other square is shaded darker (checkerboard pattern).

What if your n × n chessboard is missing two opposite corners? Prove that no matter what n is, you will not be able to cover the remaining squares with dominoes.

An 8 by 8 chessboard with the top-right and bottom-left corner squares removed. Every other square is shaded darker (checkerboard pattern).

Discrete Mathematics: An Open Introduction, 3rd edition, by Oscar Levin (discrete.openmathbooks.org), licensed under CC BY-SA 4.0; this adaptation is distributed under the same license. License: CC-BY-SA-4.0.