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 , 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.
- Suppose there are only finitely many primes. [this is a premise. Note the use of “suppose.”]
- There must be a largest prime, call it . [follows from line 1, by the definition of “finitely many.”]
- Let . [basically just notation, although this is the inspired part of the proof; looking at is the key insight.]
- is larger than . [by the definition of ]
- is not divisible by any number less than or equal to . [by definition, is divisible by each number less than or equal to , so is not.]
- The prime factorization of contains prime numbers greater than . [since is divisible by each prime number in the prime factorization of , and by line 5.]
- Therefore is not the largest prime. [by line 6, is divisible by a prime larger than .]
- This is a contradiction. [from line 2 and line 7: the largest prime is and there is a prime larger than .]
- 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 is this:
Assume . Explain, explain, …, explain. Therefore .
Often we want to prove universal statements, perhaps of the form . Again, we will want to assume is true and deduce . But what about the ? We want this to work for all . We accomplish this by fixing 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.
Example 2
Prove: For all integers , , and , if and then . (Here , read “ divides ” means that is a multiple of , i.e., that will divide into without remainder).
Even before we know what the divides symbol means, we can set up a direct proof for this statement. It will go something like this: Let , , and be arbitrary integers. Assume that and . Dot dot dot. Therefore .
How do we connect the dots? We say what our hypothesis ( and ) really means and why this gives us what the conclusion () really means. Another way to say that is to say that for some integer (that is, that is a multiple of ). What are we going for? That , for some integer (because we want to be a multiple of ). Here is the complete proof.
Proof
Let , , and be integers. Assume that and . In other words, is a multiple of and is a multiple of . So there are integers and such that and . Combining these (through substitution) we get that . But is an integer, so this says that is a multiple of . Therefore .
Proof by Contrapositive
Recall that an implication is logically equivalent to its contrapositive . 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 by contrapositive will always look roughly like this:
Assume . Explain, explain, … explain. Therefore .
As before, if there are variables and quantifiers, we set them to be arbitrary elements of our domain. Here are two examples:
Example 3
Is the statement “for all integers , if is even, then is even” true?
This is the converse of the statement we proved above using a direct proof. From trying a few examples, this statement definitely appears to be true. So let's prove it.
A direct proof of this statement would require fixing an arbitrary and assuming that is even. But it is not at all clear how this would allow us to conclude anything about . Just because does not in itself suggest how we could write as a multiple of 2.
Try something else: write the contrapositive of the statement. We get, for all integers , if is odd then is odd. This looks much more promising. Our proof will look something like this:
Let be an arbitrary integer. Suppose that is not even. This means that …. In other words …. But this is the same as saying …. Therefore is not even.
Now we fill in the details:
Proof
We will prove the contrapositive. Let be an arbitrary integer. Suppose that is not even, and thus odd. Then for some integer . Now . Since is an integer, we see that is odd and therefore not even.
Example 4
Prove: for all integers and , if is odd, then is odd or is odd.
The problem with trying a direct proof is that it will be hard to separate and from knowing something about . On the other hand, if we know something about and separately, then combining them might give us information about . The contrapositive of the statement we are trying to prove is: for all integers and , if and are even, then is even. Thus our proof will have the following format:
Let and be integers. Assume that and are both even. la la la. Therefore is even.
Here is a complete proof:
Proof
Let and be integers. Assume that and are even. Then and for some integers and . Now . Since is an integer, we see that is even, completing the proof.
Note that our assumption that and are even is really the negation of or is odd. We used De Morgan's law here.
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.
Example 5
Consider the following statement: for every prime number , either or is odd. We can rephrase this: for every prime number , if , then is odd. Now try to prove it.
Proof
Let be an arbitrary prime number. Assume is not odd. So is divisible by 2. Since is prime, it must have exactly two divisors, and it has 2 as a divisor, so must be divisible by only 1 and 2. Therefore . This completes the proof (by contrapositive).
Proof by Contradiction
There might be statements which really cannot be rephrased as implications. For example, “ 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 . What if we could prove that where was false? If this implication is true, and is false, what can we say about ? It must be false as well, which makes true!
This is why proof by contradiction works. If we can prove that leads to a contradiction, then the only conclusion is that is false, so is true. That's what we wanted to prove. In other words, if it is impossible for to be false, must be true.
Here are three examples of proofs by contradiction:
Example 6
Prove that is irrational.
Proof
Suppose not. Then is equal to a fraction . Without loss of generality, assume is in lowest terms (otherwise reduce the fraction). So,
.
Thus is even, and as such is even. So for some integer , and . We then have,
.
Thus is even, and as such is even. Since is also even, we see that is not in lowest terms, a contradiction. Thus is irrational.
Example 7
Prove: There are no integers and such that .
Proof
We proceed by contradiction. So suppose there are integers and such that . So is even. We have seen that this implies that is even. So for some integer . Then . This in turn gives . But is even, and is odd, so these cannot be equal. Thus we have a contradiction, so there must not be any integers and such that .
Example 8
The Pigeonhole Principle: If more than pigeons fly into pigeon holes, then at least one pigeon hole will contain at least two pigeons. Prove this!
Proof
Suppose, contrary to stipulation, that each of the pigeon holes contain at most one pigeon. Then at most, there will be pigeons. But we assumed that there are more than pigeons, so this is impossible. Thus there must be a pigeonhole with more than one pigeon.
While we phrased this proof as a proof by contradiction, we could have also used a proof by contrapositive since our contradiction was simply the negation of the hypothesis. Sometimes this will happen, in which case you can use either style of proof. There are examples however where the contradiction occurs “far away” from the original statement.
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 being even implies that is even, no matter what integer we pick. Showing that this works for is not even close to enough.
This cannot be stressed enough. If you are trying to prove a statement of the form , 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 such that 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 .
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
|---|---|---|---|---|---|---|---|
| 41 | 43 | 47 | 53 | 61 | 71 | 83 |
So far we have gotten only primes. You might be tempted to conjecture, “For all positive integers , the number 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 such that 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 will give which is certainly not prime. You might say that this is a counterexample to the conjecture that 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.
Example 9
Above we proved, “for all integers and , if is odd, then is odd or is odd.” Is the converse true?
The converse is the statement, “for all integers and , if is odd or is odd, then is odd.” This is false! How do we prove it is false? We need to prove the negation of the converse. Let's look at the symbols. The converse is
.
We want to prove the negation:
.
Simplify using the rules from the previous sections:
.
As the negation passed by the quantifiers, they changed from to . We then needed to take the negation of an implication, which is equivalent to asserting the if part and not the then part.
Now we know what to do. To prove that the converse is false we need to find two integers and so that is odd or is odd, but is not odd (so even). That's easy: 1 and 3. (remember, “or” means one or the other or both). Both of these are odd, but is not odd.
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 is true by proving that and for some statement . So no matter what, whether or not is true, we know that is true. In fact, we could generalize this. Suppose we want to prove . We know that at least one of the statements is true. If we can show that and and so on all the way to , then we can conclude . The key thing is that we want to be sure that one of our cases (the 's) must be true no matter what.
If that last paragraph was confusing, perhaps an example will make things better.
Example 10
Prove: For any integer , the number is even.
It is hard to know where to start this, because we don't know much of anything about . We might be able to prove that is even if we knew that was even. In fact, we could probably prove that was even if was odd. But since must either be even or odd, this will be enough. Here's the proof.
Proof
We consider two cases: if is even or if is odd.
Case 1: is even. Then for some integer . This give
, and since is an integer, this says that is even.
Case 2: is odd. Then for some integer . This gives
, and since is an integer, we see that is even again.
Since is even in both exhaustive cases, we see that is indeed always even.
Consider the statement “for all integers and , if is even, then and are even”
- Write the contrapositive of the statement.
- Write the converse of the statement.
- Write the negation of the statement.
- Is the original statement true or false? Prove your answer.
- Is the contrapositive of the original statement true or false? Prove your answer.
- Is the converse of the original statement true or false? Prove your answer.
- Is the negation of the original statement true or false? Prove your answer.
- For all integers and , if or is not even, then is not even.
- For all integers and , if and are even, then is even.
- There are numbers and such that is even but and are not both even.
- False. For example, and . , but neither nor are even.
- False, since it is equivalent to the original statement.
- True. Let and be integers. Assume both are even. Then and for some integers and . But then which is even.
- 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.
- There are no integers and such that is a prime greater than 5 and .
- For all integers , if is a multiple of 3, then can be written as the sum of consecutive integers.
- For all integers and , if is odd, then or is odd.
- Proof by contradiction. Start of proof: Assume, for the sake of contradiction, that there are integers and such that is a prime greater than 5 and . End of proof: … this is a contradiction, so there are no such integers.
- Direct proof. Start of proof: Let be an integer. Assume is a multiple of 3. End of proof: Therefore can be written as the sum of consecutive integers.
- Proof by contrapositive. Start of proof: Let and be integers. Assume that and are even. End of proof: Therefore is even.
Consider the statement: for all integers , if is even then is even.
- Prove the statement. What sort of proof are you using?
- Is the converse true? Prove or disprove.
-
Direct proof.
Proof
Let be an integer. Assume is even. Then for some integer . Thus . Therefore is even.
- The converse is false. That is, there is an integer such that is even but is odd. For example, consider . Then which is even but is odd.
The game TENZI comes with 40 six-sided dice (each numbered 1 to 6). Suppose you roll all 40 dice.
- Prove that there will be at least seven dice that land on the same number.
- 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.
-
This is an example of the pigeonhole principle.
We can prove it by contrapositive.
Proof
Suppose that each number only came up 6 or fewer times. So there are at most six 1's, six 2's, and so on. That's a total of 36 dice, so you must not have rolled all 40 dice.
-
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.
Proof
Suppose you roll 10 dice, but that there are NOT four matching rolls. This means at most, there are three of any given value. If we only had three different values, that would be only 9 dice, so there must be 4 different values, giving 4 dice that are all different.
Prove that for all integers , it is the case that is even if and only if is even. That is, prove both implications: if is even, then is even, and if is even, then is even.
One of the implications will be a direct proof, the other will be a proof by contrapositive.
Prove that is irrational.
This is really an exercise in modifying the proof that is irrational. There you proved things were even; here they will be multiples of 3.
Consider the statement: for all integers and , if is even and is a multiple of 3, then is a multiple of 6.
- Prove the statement. What sort of proof are you using?
- 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 , if is odd, then is odd. Clearly state the style of proof you are using.
Prove the statement: For all integers , , and , if , then or is even.
A proof by contradiction would be reasonable here, because then you get to assume that both and are odd. Deduce that 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 , if is prime then is solitary.
Write out the beginning and end of the argument if you were to prove the statement,
- Directly
- By contrapositive
- 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:
- Prove that if you only use an even number of both types of stamps, the amount of postage you make must be even.
- Suppose you made an even amount of postage. Prove that you used an even number of at least one of the types of stamps.
- 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: if and only if . Note, you will need to prove two “directions” here: the “if” and the “only if” part.
Prove that is irrational.
Note that if , then . Can any power of 7 be the same as a power of 10?
Prove that there are no integer solutions to the equation .
What if there were? Deduce that 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 . Here is the proof:
Proof
I claim that . Of course we can do anything to one side of an equation as long as we also do it to the other side. So subtract 2 from both sides. This gives . Now square both sides, to get . And we all agree this is true.
What is going on here? Is your friend's argument valid? Is the argument a proof of the claim ? 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.
- Three of a kind (for example, three 7's).
- A flush of five cards (for example, five hearts).
- 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 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 ? Give necessary and sufficient conditions (that is, say exactly which values of work and which do not work). Prove your answers.
What if your chessboard is missing two opposite corners? Prove that no matter what is, you will not be able to cover the remaining squares with dominoes.
- This is not to say that looking at examples is a waste of time. Doing so will often give you an idea of how to write a proof. But the examples do not belong in the proof. ↩
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.