Section 5.2 Proofs with cases
Recall Lemma 4.2.8.
This tells us how to structure a proof when the hypothesis is a disjunction. That is, when the hypothesis can be broken into two (or more) cases.
Take another look at Example 5.0.2. At first glance, the hypothesis is just a single statement “ is an integer”, and it is not immediately obvious that it can be broken into separate cases. However there is a clue in the conclusion, “ is odd”; it tells us to think about parity. Any integer is either even or it is odd, so we can break the hypothesis into two cases
is even, or is odd.
Because of this, the original statement can be massaged into the form of Lemma 4.2.8.
Lemma 4.2.8 then tells us that this is logically equivalent to
To show that this conjunction is true, we just need to show that both parts are true. That is, our proof will split into two cases.
- Prove that
- Prove that
This is an example of proof by cases.
Of course, we don’t just leap into things and write “Proof 1” and “Proof 2”; we need to explain to the reader what is happening. We need to explain that the hypothesis breaks into separate cases, and then we should make it clear where each case starts and where it ends. And, it won’t hurt to summarise at the end of the proof that since we have proved all the cases, the result is true. Be nice to your reader — an extra sentence or two can make their life much easier.
Let Since can be either even or odd, we consider both cases separately.
- Case 1: Assume
is even. Then for some and Since is an integer, is odd. - Case 2: Now assume
is odd, then for some and Since is an integer, is odd.
Since both cases are true, the result follows.
The above shows the very standard structure of proof by cases or proof by case analysis. Of course, not all such proofs consist of just two cases. More generally the structure will be as follows.
Proof.
- The hypothesis breaks into
cases. - Here is my proof of case 1.
- Here is my proof of case 2.
- Here is my proof of case
- Since I’ve proved all
cases the proof is done.
One of the hardest parts of case-analysis is to be sure that you have found all the cases. And since each case is really its own proof, it is possible that a single case breaks into several sub-cases, each of which requires its own proof. Case analysis is also sometimes called Proof by exhaustion! As an extreme example, the original proof of “The four colour theorem” by Appel & Haken in 1976 required the checking of about 1900 different cases. Thankfully that was done by a computer; though that was very controversial at the time.
Remark 5.2.1. Keep cases just in case “without loss of generality” causes mistakes.
You will have noticed that the two cases in the proof above are very similar. This is not unusual. It is very often the case that the cases in proof by cases are very similar to each other 38 . Many writers will omit one or more of these similar cases and instead write “The proof of the second case is similar to the proof of the first, so we omit it”. You might also see “Without loss of generality (we will only do the first case)”, which busy hard-working mathematicians will contract to “WLOG”.
“WLOG” is a notoriously dangerous mathematical phrase 39 in mathematics. It sits with phrases such as
- Clearly
- Obviously
- It is easy to show that
- A quick calculation shows
Every mathematician has been caught out by one of these. What we thought would be an easy turned out to be much harder due to that little detail we didn’t consider.
Premature optimisation is the root of all evil
One should be very careful using WLOG (and its siblings). We should be very sure that the cases really are very similar. Indeed, it is much safer (as a general rule for the inexperienced prover) to actually do all those cases in your scratch work. Then determine whether or not they really are similar enough that skipping them is not going to cause any problems. And on then skip them when writting up the proof.
Here are another couple of results to play with
Lemma 5.2.2.
Proof.
Let and be integers and assume they have opposite parities. Now either is even or odd; we prove each case in turn.
- Assume
is even. Since and have opposite parities, we know that is odd. Hence we can write for some This means that Since we know that is odd. - Now assume
is odd. Since and have opposite parities, we know that is even. Hence we can write for some This means that and since we know that is odd.
In both cases, is odd as required.
and
Lemma 5.2.3.
Proof.
Let be integers. We prove each implication in turn.
- To prove the forward implication we prove the contrapositive. Hence assume that both
are odd. So we can write and where Now Since we know that is odd as required. - The reverse implication breaks into two cases.
- Assume
is even. Then we can write where So Since it follows that is even. - Now assume that
is even. Then we can write where So Since it follows that is even.
In either case is even as required.
Remark 5.2.4. Symmetry and WLOG.
These last two results display a great deal of symmetry. That is, one can swap and without changing the result. That symmetry indicates that it may be possible to shorten the proof, by appealing to that symmetry to justify why a case can be skipped. However, correctly identifying such symmetries and their consequences takes practice. Consequently we still recommend that you avoid WLOG-ing when working through this book, and only WLOG once you have spent many more hours proving things.
Result 5.2.5.
In order to prove this we’ll make use of Euclidean division. We stated this at the beginning of Chapter 3 as Fact 3.0.3. Please revise it before continuing.
for some integer That is, every integer is either even or odd. The same result tells that every integer can (by dividing by three) be written uniquely as
for some integer It is this consequence of Euclidean division that will help us prove our result. Time for some scratch work.
It is a biconditional statement so we need to prove both the forward implication and the reverse implication.
-
If we try assuming that we aren’t going to get very far, so instead we look at the contrapositive.Here is where we can use Euclidean division.
Proof of Result 5.2.5.
We prove each implication in turn.
- We start with the forward implication. Assume that
so where Hence and since we know that - To prove the reverse implication we prove the contrapositive. Assume that
is an integer, and that Hence (by Euclidean division), we know that either or where is some integer.- Assume that
then and so is not divisible by 3. - Similarly, if we assume that
then and so is not divisible by 3.
In either case we conclude that as required.
Remark 5.2.6. The importance of uniqueness.
Notice that in the above scratch work and proof we have used the uniqueness of Euclidean divison to show that is not divisible by 3. Once we have shown (in a case) that for some integer Fact 3.0.3 tells us that there is no other way to write with Similarly, in the case where we show that the uniqueness of Euclidean division means that there is no way for us to write as 3 times an integer.
We have now had some practice with direct and contrapositive proofs, as well as proof by cases. It will soon be time to go back and do some more logic; we really need to look at quantifiers. But before that, we should do one two more examples of proof by cases — congruence modulo and the triangle inequality.
Enough cases for a luggage related pun if only we could pack one in here. Sorry.
We keep a list. Well — we should keep a list.