Proofs
Exercise 7.1. You’re about to leave on holiday, but you forgot to pack socks! You’ve ran back to your room, but the light’s burnt out, so you can’t see the colours of your socks.
You know that in your sock drawer that there are ten pairs of green socks, ten pairs of black socks, and eleven pairs of blue socks (all mixed up.)
How many of your socks do you need to take before you can be sure you’ve grabbed at least one matching pair?
Exercise 7.2. You’re a mad scientist! You’ve conducted an experiment on yourself to get superpowers. It worked, but to keep the powers you need to take two different tablets each day; if you forget one, or take more than one of either type, you’ll, um, explode.
Unfortunately, they look completely identical, and you’ve just dropped your last two days of supply (four tablets) on the floor.
What can you do?
Proofs: Motivation and Fundamentals
Throughout this coursebook, we’ve stressed the importance of clear, logical explanations for why things are true. In our previous chapters, we motivated the need for these arguments in a number of ways:
-
In our answer to Exercise 1.1, we said that making a good, logical argument is often a useful skill in the workplace! In real life, you will often have to work for people who aren’t particularly “tech-y” and will expect you to be able to do literally impossible tasks. Being able to give a clear and patient explanation for why something can never happen is a good skill to have!
-
In our argument for Claim 1.1, we explained why an argument that just checks a few hundred or even a few thousand cases is often not enough in mathematics and computer science. As we saw then, there are tons of examples of claims that are true for all of the small values you’d like to check, but that suddenly become completely false when you get to large values (i.e. the ones that you could encounter when running code!)
-
Finally, in chapter 4 we studied algorithms, step-by-step processes that we could easily turn into computer programs. When doing so, we often added in discussions about why these algorithms were “guaranteed” to work or why these algorithms would never “crash;” these arguments made it so that we could trust these processes to always work.
This is something that you do in real life as a computer scientist all the time! Good code involves carefully thinking about all of the possible inputs you could be given, and for each case ensuring that your code is well-behaved. Writing such code and documenting it in a way that others can understand is a key part of being a professional programmer!
These motivations aren’t just hypotheticals! Here’s a pair of stories that illustrate why knowing how to make logical arguments is a useful skill:
Story 7.1. Janelle Shane is a researcher in optics who works with neural networks and machine learning. Roughly speaking, the way that a neural network works is the following:
- Take a bunch of examples of the thing you want the neural network to recognize, as well as a bunch of nonexamples.
- “Show” the neural network these examples and nonexamples.
- The neural network will then come up with a set of rules that it believes describes what it means for.
“Show” is hard to define in words, but there are some great YouTube videos: see SethBling’s Mar I/O videos for a fun and accessible introduction!
People are often tempted to just use the results of a neural network directly, without checking whether its discovered rules make sense. Doing so, as Janelle notes, leads to some fascinatingly weird behaviour:
- “There was an algorithm that was supposed to sort a list of numbers. Instead, it learned to delete the list, so that it was no longer technically unsorted.”
- ” In 1997, some programmers built algorithms that could play tic-tac-toe remotely against each other on an infinitely large board. One programmer, rather than designing their algorithm’s strategy, let it evolve its own approach. Surprisingly, the algorithm suddenly began winning all its games. It turned out that the algorithm’s strategy was to place its move very, very far away, so that when its opponent’s computer tried to simulate the new greatly-expanded board, the huge gameboard would cause it to run out of memory and crash, forfeiting the game.”
- “An algorithm that was supposed to figure out how to apply a minimum force to a plane landing on an aircraft carrier. Instead, it discovered that if it applied a huge force, it would overflow the program’s memory and would register instead as a very small force. The pilot would die but, hey, perfect score.”
In short: just because something works for a bunch of examples doesn’t mean it’s good!
Story 7.2. A somewhat darker story on the importance of being able to read and understand proofs comes from the NSA, and something called a Dual Elliptic Curve Deterministic Random Bit Generator. This was an algorithm, designed by the NSA (a USA security agency,) that they claimed was a cryptographically secure way to generate random numbers.
However, this algorithm was one that the NSA had built a “backdoor” into. That is, they designed the algorithm around certain secret values so that anyone with knowledge of those values (i.e. the NSA) could predict the randomly-generated numbers with a higher-than-normal degree of accuracy and thereby defeat cryptographic systems using this algorithm.
The NSA managed to get their algorithm used as a “standard” for over seven years. However, many mathematicians and computer scientists were suspicious of the NSA’s algorithm from the very start, in large part because it was not something that was proven to work! Their research led to the eventual revocation of the NSA’s algorithm as a standard.
See the New York Times for an article summarizing the scandal.
Also, check out Kleptography: Using Cryptography Against Cryptography and Cryptanalysis of the Dual Elliptic Curve Pseudorandom Generator, if you’d like to read through some research papers describing the NSA’s algorithm/its weaknesses.
So: we have some motivation for why we would want to write clear, logical arguments. The next question for us, then, is what counts as a valid argument?
Every major field of study in academia, roughly speaking, has a way of “showing” that something is true. In English, if you wanted to argue that the whale in Melville’s Moby Dick was intrinsically tied up with mortality, you would write an essay that quoted Melville’s story alongside some of of his other writings and perhaps some contemporary literature, and logically argue (using these quotations as “evidence”) that your claim holds. Similarly, if you were a physicist and you wanted to show that the speed of light is roughly meters per second, you’d set up a series of experiments, collect data, and see if it supports your claim.
In mathematics, a proof is an argument that mathematicians use to show that something is true. However, the concepts of “argument” and “truth” aren’t quite as precise as you might like; certainly, you’ve had lots of “arguments” with siblings or classmates that haven’t proven something is true!
In mathematics, the same sort of thing happens: there are many arguments that (to an outsider) look like a convincing reason for why something is true, but fail to live up to the standards of a mathematician. In Chapter 1, we already studied a pair of “failed” proofs: namely, our first attempts at proving Claim 1.1 and Exercise 1.1. We said that these arguments failed because they did not work in general: that is, they only considered a few cases, and did not consider all of the possible ways to put dominoes on a chessboard, or to pick a pair of integers.
This, however, is not the only way in which a proof might fail us! Here’s another dodgy proof:
“Bad” proof:
A defense of the “bad” proof: We’re not using examples; we’re working in general! Also, we totally showed that this claim is true: after all, we started with our claim and turned it into a true thing!
Why this proof is not acceptable in mathematics:
- We have no idea what and are! In particular, by plugging in some sample values of and , we can see that this is sometimes true and sometimes false: for we do indeed have , but for the claim is very false, as ! So, to do anything here, we first need to know what and are. That is: we need to define what set come from!
- This proof is “backwards:” that is, it starts by assuming our claim is true, and from there gets to a true statement. This is not a logically sound way to make an argument! For example, if we assume that 1=2, we can easily deduce a true statement by multiplying both sides by 0:
This doesn’t prove that 1=2, though! As we said above, proofs need to start with true things, and then through argument get to what you’re trying to show.
- Finally, this proof has no words! This flaw in some sense is why the other two flaws could exist: if you had to write out in words what and were, and how you went from one line to the next, it would probably become clear that this proof was written backwards and also that we have to be careful with what are allowed to be.
This sort of thing is often easy to fix, though! If your proof is “backwards,” simply try starting from the end and reasoning your way backwards to the start. If your logic was flawed, somewhere along the way you’ll encounter a nonreversible step.
For example, if we tried to reverse our proof that , we could go from to , but would see that we can’t “divide by 0” to get to the desired conclusion (and thus that this doesn’t work.)
With this in mind, let’s try a “fixed” version of this proof:
Theorem 7.1. (The arithmetic mean-geometric mean inequality.) For any two nonnegative real numbers , we have that the geometric mean of and is less than or equal to the arithmetic mean of and : in other words, we have that
Proof. Take any pair of nonnegative real numbers . We know that any squared real number is nonnegative: so, in specific, we have that the square of , is nonnegative. If we take the equation and perform some algebraic manipulations, we can deduce that
Because and are both nonnegative, we can take square roots of both sides to get
Again, because both and are nonnegative, we can also remove the absolute-value signs on the sum , which gives us
which is what we wanted to prove.
Much better! This proof doesn’t have logical flaws, it’s easier to read, and we’ve justified all of our steps so that even a skeptical reader would believe us.
Direct Proofs
In our past chapters, we’ve seen a number of useful techniques for writing such arguments while studying new mathematical concepts. In this chapter, we’re reversing this structure a bit: instead of focusing on new mathematics, we’re going to focus our sections on new argument techniques. By doing this, we’re hoping that the arguments you’ve been reading in the past few chapters will become ones that you’re comfortable with writing and reading on your own!
The proof we just wrote serves as a nice example of the first proof technique we’ll study in this class: the idea of a direct proof. To prove that a given claim is true, the most straightforward path we’ve used in this class has been the following:
- Write down things that you know are true that relate to your claim. This typically includes the definitions of any terms referred to in the definition, any results from class or the tutorials/assignments that look related, and maybe some fundamental facts you know entering this class about numbers.
- Combine those things by using logic or algebra to create more things you know are true.
- Keep doing this until you get to the claim!
A particularly common form of direct proof comes up when people want to prove a statement of the form “if A holds, then B must follow” for two propositions A and B (or equivalently, “A implies B,” which we write in symbols as .)
To write a direct proof of such a statement, we proceed as before, but also throw in the assumption that A holds! That is, to prove “A implies B,” we assume thaat A is true, and try to combine this assumption with other known true things to deduce that B is true. (Logically speaking, this is because holds as long as we’re never in the situation where is true and is false. Therefore, if we can show that being true forces to also be true, then we know that our claim must hold!)
We illustrate this with a pair of examples here:
Proof. We start by “assuming” the part by the “if:” that is, we assume that is an odd integer. By definition, this means that we can write for some other integer .
We seek to study . By our observation above, this is just . This is a multiple of 4 plus 1, as claimed! Therefore we have completed our proof.
Proof. We start this proof by thinking about all of the facts that we know about graphs and degrees. There’s one result that should immediately jump to mind, namely the degree-sum formula: for any graph ,
= |
Let’s use this result! Specifically: in this problem, we’re studying vertices with odd degree. How can we turn this result into something that talks about odd-degree vertices? Well: from our work in our first chapter, we know that every integer is either even or odd. If we apply this idea to our degree-sum formula, we get the following:
+ | = |
We wanted to study the odd-degree vertices, so let’s get them isolated on one side of our equation:
= | - |
On the right-hand side, notice that we have an even number (twice the number of edges) minus a bunch of even numbers (the degrees of all even-degree vertices in ); therefore, the right-hand-side is even!
As a result, the left-hand-side is also even. But this means that the sum of all odd-degree vertices is an even number.
We know that summing an odd number of odd numbers is always odd, and that summing an even number of odd numbers is always even. Because the left-hand side is even, we know we must be in the second case; that is, that we have an even number of vertices of odd degree, as claimed!
Proof by Cases
Our second proof technique is best illustrated by an example:
Theorem 7.2. For every natural number , if is a square number, then .
An integer is said to be a square number if we can write for some other integer . For example, are all square numbers!
Proof. As always, we start by expanding our definitions. If is a square number, then by definition we know that for some integer .
From here, we use the particularly clever trick that this section is devoted to: we consider cases. That is: we want to look at what is congruent to modulo 3.
We don’t have any information about what or theirselves are modulo 3, so it would seem hard to introduce this information into our proof! However, by the definition of the modulus operator , we know that every number is congruent to one of 0, 1 or 2 modulo 3. By definition, then, this means that we most always be in one of the following three cases: , or .
In each of these cases, we can now expand our definitions and use our knowledge of modular arithmetic to proceed further:
- Assume that we’re in the case. In this situation, we have that for some , which means that is also a multiple of 3. Thus, .
- Now, assume instead that we’re in the case. In this situation, we have that for some , which means that . Thus, .
- Finally, consider the last remaining case, where . In this situation, we have that for some , which means that . Thus, .
In all three of these cases, we’ve seen that is not congruent to 2 modulo 3. These cases cover all of the possibilities! Therefore, we know that is simply never congruent to 2 modulo 3 in any situation, and have therefore proven our claim.
The trick to the proof above was that we were able to introduce additional information about (namely, its remainder on division by 3) by simply considering all possible remainders as separate cases! This technique, called proof by cases, is a powerful technique in several situations:
- Whenever you’re dealing with integers and answering a question about whether some expression is even or odd, try considering the two cases ” is even” and ” is odd.”
- If you’re dealing with a claim about modular arithmetic, or with claims like “is a multiple of”, considering the different possible remainders that a number could have (i.e. the three cases where or we considered above) is often a great approach.
- If you’re dealing with claims about rational and irrational numbers, separating the cases ” is rational” and ” is irrational” can be handy.
We practice this in the examples below:
Proof by cases is an excellent technique whenever you see an absolute value, as it lets you get rid of the absolute value in each case.
Proof. We proceed by considering cases:
-
We first consider the case where . In this case, , and so is just . In this case, our inequality holds!
-
Now, we consider the case where . In this case, , and so we have (as the negative of a negative is a positive!)
Therefore, we have . If < then , and so . Therefore our claim holds in this case as well!
Because every number is either greater than or equal to 7 or less than 7, we’ve considered all possible cases. As our claim was true in each possible case, this completes our proof!
_Proof._We consider two possible cases:
- . In this case, we have and ; therefore, as claimed.
- . In this case, we have and ; therefore, , also as claimed.
This covers all possible cases, as for any two numbers either or ! Therefore, we’ve proven our claim.
In the next example, we return to the tricks we used to calculate the last digit of a number in Claim 1.10:
Proof by cases is also usually a good idea if you see the modulus operator!
Proof. We saw before in our chapter on integers that if is the last digit of an integer , then is equal to for any positive integer power .
Therefore, in our claim, we don’t have to actually consider every possible integer ; we can just consider the ten different possible last digits could have, and calculate the cubes of each of those! We do so here:
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
In all ten cases, our remainders are always 0, 1, 5, or 6, as claimed! Therefore, we’ve proven our claim.
Finally, we can use a proof by cases to prove one of our exercises:
Answer to Exercise 7.1. Even though there are lots of socks in the drawer, there are only 3 colours. Therefore, we can just take 4 socks to make sure that at least 2 of them are the same colour. To understand why, let’s look at the colours of three first socks.
There are two possible cases here:
- If we were lucky enough to pick two matched socks from those first three, then we’ve succeeded!
- However, in the worst-case scenario the first three socks we took were all different colours, and we do not yet have a pair. In this situation, we have one sock of each colour.
In this case, however, our fourth sock is guaranteed to match at one of our three previously chosen socks!
In any case, we’ve grabbed a pair of socks, as desired.
Proof by Contradiction
Contradiction - i.e. the “if we’re stuck on a problem, suppose we’re wrong and see what happens” proof technique --- is a method we’ve already used to considerable success throughout this coursebook! In this section, we study several more examples of proof by contradiction, and talk a bit about the trickier aspects of this proof method.
To start, let’s examine one of the most famous proofs by contradiction! In this proof, we’re going to really pick apart the structure of a proof by contradiction, so that we can see why this method works:
Proof. As always, let’s start by unpacking our definitions:
- is the unique positive real number such that when we square it, we get 2.
- A number is rational if we can write , where and are integers and is nonzero.
With this done, our claim can be unpacked to the following:
“For a real number , if , then there are no values of with such that .”
So: how do we do this? Because the problem wants us to show that we cannot write for any integers with , we can’t just check a few examples: we’d have to look at all of them, and this could be quite difficult! We’d have to find some useful property that makes all examples of this form fail, and this could be quite hard to find.
Instead, consider the following way to “side-step” these difficulties. Instead of looking at all pairs and trying to show that each one fails, let’s assume that we have one such pair such that !
With this assumption in hand, let’s now show that this assumption “breaks mathematics” in some way: that starting from this assumption, we can get to something we know is impossible, like . If we can do this, then we know that our original assumption that there was such a fraction must have been nonsense (i.e. false), and therefore that our claim that no such fraction exists is true!
We do this here. Suppose that we can find two integers with such that . If and have common factors, divide through by those factors to write in its simplest possible form: that is, don’t write something like or , write
Then if we square both sides, we get . Multiplying both sides by gives us , which means that is even (because it is a multiple of 2)!
This means that is even (see the tutorials from earlier in this course!), and therefore that we can write for some integer . If we plug this into our equation , we get , and by dividing by we have .
This means that is even, and therefore that is even as well (same logic as before.)
But this means that both and are multiples of 2; that is, that they have a common factor! We said earlier that we’d divided through by any common factors to get rid of them, so this is a contradiction: from our initial assumption we got to something that is both true and false. As a result, our original assumption (that we could write ) must be false; that is, we have shown that for any integers with , as desired. Yay!
We can generalize the form of the argument we just made above as follows:
- We have a claim we’re trying to prove; let’s denote it , for shorthand.
- Instead of proving is true directly, we want to prove that “not ” is impossible.
- To do this, we can simply do the following:
-
Assume, for the moment, that “not- ” is actually true!
-
Working from this assumption, find a pair of contradictory statements that are implied by “not .” That is, find a pair of statements and “not- ” such that if was false, both and “not- ” would both hold. Common examples are “1=1” and “1=0”, or ” is even” and ” is false”, or ” is positive” and ” is negative”: stuff like that.
-
This proof demonstrates that “not- ” must be impossible, because it implies two contradictory things (like the two simultaneous claims ” is even”and ” is odd.“) Mathematics is free from false statements and contradictions; therefore, we know that this must be impossible. In other words, “not- ” must be false and must be true!
-
This is how a proof by contradiction works. You take your claim , assume it’s false, and use “not ” to deduce contradictory statements, which you know mathematics cannot contain.
A beautiful quote about proofs by contradiction, by the mathematician G. H. Hardy: “Proof by contradiction”, which Euclid loved so much, is one of a mathematician’s finest weapons. It is a far finer gambit than any chess gambit: a chess player may offer the sacrifice of a pawn or even a piece, but a mathematician offers the game.
We consider another example here:
Proof. In the example we’re studying here, we want to show that it’s impossible for to be irrational for every pair of irrational numbers . To do this via a proof by contradiction, we do the following: first, assume that is irrational for every pair of irrational numbers ! If we apply this knowledge to one of the few numbers ( ) we know is irrational, our assumption tells us that in specific
is irrational.
What do we do from here? Well: pretty much the only thing we have is our assumption, our knowledge that is irrational, and our new belief that is also irrational. The only thing really left to do, then, is to let , , and apply our hypothesis again. But this is excellent! On one hand, our we have that is irrational by our hypothesis. On the other hand, we have that is
which is clearly rational. This is a contradiction! Therefore, we know that our hypothesis must be false: there must be a pair of irrational numbers such that is rational.
An interesting quirk of the above proof is that it didn’t actually give us a pair of irrational numbers such that is rational! It simply told us that either
- is rational, in which case is an example, or
- irrational, in which case is an example,
but it never actually tells us which pair satisfies our claim! This is a weird property of proofs by contradiction: they are often nonconstructive proofs, in that they will tell you that a statement is true or false without necessarily giving you an example that demonstrates the truth of that statement.
To stick with the classical route, let’s study another one of the first proofs by induction, that we considered all the way back in our first chapter:
Proof. As we did with our argument that no number can be both even and odd at the same time, let’s approach this with a bit of a thought experiment: what would happen if there were not infinitely many prime numbers?
Well: if this were to happen, then there would be some fixed number of primes in existence. Let’s give that number a name, and say that there were primes in existence. Then, if we had a piece of paper with lines on it, we could in theory write down all of the prime numbers that existed!
If we labeled those lines , we could then refer to those prime numbers by their labels: that is, we could refer to our prime numbers by calling them . (Giving things names: a very useful technique!)
In this world where we have all of these prime numbers, what can we do with them? Well: as we saw before, a particularly useful property about prime numbers is that they form the building blocks out of which we can make all integers. Therefore, we’re motivated to take our primes and stick them together, and see what happens!
After a lot of effort, you might eventually hit on the clever combination of our prime numbers that Euclid discovered: think about what happens if we multiply all of our prime numbers together, and then add 1 to that entire sum. That is: look at the number
On one hand: take any of the prime numbers on our list. To indicate that we’re taking a general prime number from our list, let’s refer to that prime number as , where could be any index. Look at . By definition, this is equal to
In particular, notice that this is not an integer! is some fraction strictly between 0 and 1, because is a prime and therefore at least 2, while the right-hand-bit is a product of integers and therefore is an integer itself.
Therefore, we’ve shown that if we multiply by a number to get , that number cannot be an integer; in other words, we have shown that is not a factor of . This holds for any of our primes, because was an arbitrary prime; therefore is not a multiple of any of our prime numbers!
On the other hand, though, we know that is an integer. Therefore, we know that we can factor into prime numbers! Do so, and write as a product of prime numbers.
Our argument above tells us that that none of those prime numbers can be from our list . But this list was supposed to contain all of the prime numbers! Therefore, we know that our original assumption that we could write down all of the prime numbers must have been false: that is, there must have been infinitely many prime numbers.
Common Contradiction Mistakes: Not Understanding Negation
In a proof by contradiction, we’re trying to prove that a claim is true by showing that “not- ” cannot be false. Perhaps surprisingly, the most common mistake people make when using a proof by contradiction is in their very first step: specifically, in writing just what “not- ” is for a given claim!
For example, consider the following claim:
Here are a number of incorrect ways that people will try to negate this claim:
-
“For every pair of integers such that are both even, we have that is also even.”
The first mistake made here is in the first two words, where we wrote “for every!” That is: Claim 7.10 is a claim about all pairs of integers. As such, if someone were to say that was false, they’d just have to have one counterexample to prove us wrong!
That is: if someone made a claim that every UoA student was enrolled in Compsci 120, you wouldn’t prove them wrong by trying to show that every UoA student is not enrolled in Compsci 120; you’d just have to find at least one student not in Compsci 120.
This tells us the first part of how we should write the negation of this claim: it should go “There is a pair of integers …”
-
This, however, is not enough! That is: “There is a pair of integers such that are both even and is also even” is also not the negation of our claim.
To see why this fails, note that Claim 7.10 is a claim about all pairs of odd integers. As such, if we’re trying to say that this claim fails, we still need to work in the same universe as our normal claim, and we need to find a counterexample that consists of a pair of odd integers.
That is: if someone told you “every Compsci 120 student who’s never been to Antartica currently has an A,” you don’t disprove them by trying to find a student who’s been to Antarctica! Their claim was about people who haven’t been to Antarctica; to disprove it, you need to work within the same bounds!
As such, the correct negation of Claim 7.10, is the following:
“There is a pair of integers such that both are odd, and yet is even.”
Much more reasonable!
Using similar logic, the clam
should negate to the following:
“Every prime number is odd.”
This is because the opposite of a claim about something existing is that there are no counterexamples (i.e. a claim about everything). As well, the universe of numbers we’re studying (primes) should remain the same, leaving only the conclusion (even) to flip to “odd.”
Let’s consider another claim:
There are many tempting and incorrect ways to negate this claim:
-
If is a claim containing vertices, then does not contain 2 vertices whose degrees are different.” This is the same “negating the universe” error from before!
That is: our claim is about graphs on 2 or more vertices. Its negation should still talk about graphs on 2 or more vertices! As well, our claim was about vertices whose degrees agreed. Its negation should still talk about vertices with equal degree!
-
This suggests the following as a fix: “If is a graph containing vertices, then does not contains two vertices whose degrees are equal.”
This has the right universe, but it fails for a second, more subtle reason: the opposite of “if then ” is not “if then not- .”
That is: suppose that someone claimed to you “if you attend tutorials in Compsci 120, you’ll pass the class.” The above strategy would say that you could disprove their claim by saying “if you attend tutorials in Compsci 120, then you won’t pass the class.”
This doesn’t really make sense, though! Their claim here is a really strong guarantee: it says that everyone who attends tutorials in Compsci 120 will pass. To disprove this, you don’t need to show that everyone who attends tutorials won’t pass; that’s way too hard! Instead, you’d just need to find at least one person who (1) attended all of the tutorials but (2) didn’t pass the class.
That is: the opposite of “if then ” is “there is a situation where holds and fails.”
By using this, the correct negation of Claim 7.12,. is the following:
“There is a graph on vertices, such that does not contain two vertices with the same degree.”
We can summarise the observations we made above as follows:
To finish this section and put this to use, let’s prove Claim 7.12!
Proof of Claim 7.12,. As noted above, the contradictive assumption here would be that is a graph on vertices in which all of the vertices have different degrees.
We know that the maximum degree of any vertex in is , because any vertex is at most adjacent to every other vertex. As well, the minimum degree of any vertex is trivially 0. Therefore, there are in theory different possible degrees for the vertices in , namely the values .
If no degrees are repeated in , then (because there are vertices and different possible degrees) there is exactly one vertex with degree , for every . If , note that in particular , and so the degree-0 and degree- vertices are different.
Now, notice that if there is a vertex with degree , it is connected to every other vertex in our graph. In particular it must be connected to the vertex that has degree 0, which contradicts the property that this vertex is supposed to have degree 0.
Therefore we have a contradiction, and can conclude that our original claim must hold.
Proof by Construction
In many of the proofs above, we’ve been focused on proving claims about “all” numbers , or “all” odd integers , or other sorts of “universal” claims about things. When we’re proving claims of these forms, we need to use techniques and arguments like the ones above where we work in general / don’t get to use examples to prove our claim!
Sometimes, however, we’ll find ourselves with claims of the form “There exists a number such that…” or “There is a value with the property…” In this sort of situation, we’re not being asked to show that something is true for all values: instead, we’re just asked to find a single example!
In situations like this, a common technique is proof by construction, where we simply create an object with the desired properties. We illustrate this with an example:
Proof. Notice that . Therefore, is a power of 2. 1 is also odd, as we can write it in the form for some integer (specifically, .) Therefore we’ve constructed the claimed integer, as desired.
Notice the following two aspects of this proof:
- We didn’t have to work with a general integer ; instead, we got to give a specific example! This is because our claim was of the form “There is …”, which means that we’re just asked for a single example. If our proof had started “For all …”, this would be different, and this proof would be invalid (just like how examples weren’t enough for a proof in our earlier “the sum of any two odd numbers is even” claim.)
- Also notice that we didn’t just say “1 is the answer” and ended our proof; we actually took the time to explain why 1 has the desired properties. You should expect to always do this!
We give a second example, to illustrate how these sorts of things come up in combinatorics and/or “puzzle” mathematics:
Proof. Behold!
In this proof, we don’t have much to really explain: the solution presented self-evidently has the desired property (just check every row and column.) If it was unclear, though, we’d have to have some explanation along with our answer!
We close by giving a pair of slightly trickier examples for how construction can work, by using processes and algorithms:
Proof. Consider the following algorithm to paint any connected graph ’s vertices with the colors red and blue:
Algorithm 7.13. Init: Choose any vertex in , and paint it red.
- Take all currently uncolored vertices that are connected to any red vertices by an edge, and color them blue.
- Take all currently uncolored vertices that are connected to any blue vertices by an edge, and color them red.
- If there are any uncolored vertices left, go back to (i) and repeat.
We claim that this algorithm will always succeed at coming up with a valid vertex coloring of any tree ; indeed, more generally, we claim that this algorithm will always succeed at making a valid 2-coloring of any graph that doesn’t contain an odd-length circuit as a subgraph! Because any tree does not have an odd-length circuit as a subgraph (indeed, it doesn’t contain a cycle subgraph of any length), this would prove our claim.
To see why, we use a second proof technique: contradiction! Think about what would happen if this algorithm would fail, given a connected graph with no odd-length circuit subgraphs.
Because is connected, the above process will eventually color every vertex of ; we first color , then its neighbors, then its neighbor’s neighbors, and so on/so forth, coloring every vertex within a walk of edges by the -th pass. So if the algorithm fails, it does so because in its coloring there must be an edge in which both get the same color.
Notice that if a vertex is colored blue, it is because we can walk to to from our starting in either one step, or three steps, or five steps … or in general an odd number of steps. This is because we alternated between red and blue in our algorithm. Similarly, if a vertex is colored red, it is because we can walk to in either 0 or 2 or 4 or 6 or … or an even number of edges.
Take any walk from to , and any other walk from to . We have proven that either both have an even number of edges, or that they both have an odd number of edges. Therefore, the circuit formed by starting at , walking along to , using the edge to go to , and then reversing to return to has either or length. Both of the quantities, in particular, are odd! This contradicts our assumption that had no odd-length circuits.
As a result, our original claim (that is bipartite) must be true!
Proof. Consider the following constructive process for generating such a circuit:
- Label the vertices in the grid graph with coordinates , where vertex is the vertex in the bottom-left-hand corner and is the vertex in the upper-right-hand corner.
- Start at ,
- From this vertex, walk to the right until you’re at the bottom-right corner .
- Go up one step to , and then walk back to the left until you’re at .
- Go up one step to , then walk back to the right until you’re at .
- Go up one step to , and then walk back to the left until you’re at .
- Go up one step to , then walk back to the right until you’re at .
- … Keep doing this! Eventually, you will find yourself at , having walked on all of the vertices whose second coordinates are not equal to 1, and not having visited any vertices whose second coordinate is 1 other than (1,1). (This is where the ” ” part comes in: because we go right on odd rows and left on even rows, if our grid has even height then we’ll be going left on our top row and thus wind up at as claimed.)
- Walk from to , and then go down to .
By construction we have visited all vertices in our graph exactly once, and thus created a Hamiltonian circuit, as desired.
Finally, we can answer one our earlier exercises by using construction:
Answer to Exercise 7.2. This has a nice constructive answer: take half of each of the four tablets today, and the other half tomorrow.
Because this is constructive, we don’t have to explain how we came up with this clever idea: we can just present it as an answer! (Though if you did something clever to come up with an idea, it is good to mention how you did this.) We just have to explain why this works, which is pretty simple: half of each tablet gives us half of the tablets of each type, and thus exactly one dose for each kind.
Proof by Induction: First Examples
Sometimes, in mathematics, we will want to study a statement that depends on some variable . For example:
- “The sum of the first natural numbers is .”
- “If , we have .
- “Every polynomial of degree has at most roots.”
- Take a grid of unit squares, and remove one square from the top-right-hand corner of your grid. The resulting shape can be tiled by - shapes.
For any fixed , we can usually use our earlier proof methods to prove that the claim holds! For instance, let be the fourth example above, and consider , which is the claim that if we take a grid of squares and delete the top-right-hand corner square, we can tile the rest of the shape with tiles. We can prove this by construction by just giving an explicit way to do it: see the drawing below!
However, sometimes we will want to prove that one of these statements holds for every value . How can we do this?
The answer here is mathematical induction! Mathematical induction is just a formal way of writing up our “building-block plus preserved property” process, in a way that will hopefully let us avoid everyone having the same shoe size. We describe it here:
-
To start, take a claim that we want to prove holds for every .
-
The first step in an inductive proof is the base step: in this step, we explicitly prove that the statement holds for a few small cases using normal proof methods (typically construction or just calculation.)
Usually you just prove that your claim holds when , but sometimes you start with if your claim is one where 0 is a “dumb” case, or prove a handful of cases like to get the hang of things before moving on. You can think of this as the “building block” step from before!
-
With this done, we move to the induction step! Here, we prove the following statement:
If our claim is true for all values up to some , \then it will continue to be true at the next value . |
Because this is an implication, i.e. an if-then proof, we usually prove it directly by assuming that our claim holds for all values up to some , and then use this assumption to prove that our claim holds when we have in our claim.
Just doing these two steps shows that your claim is true for every natural number ! To see why, just examine what these two steps tell you:
- By our “base case” reasoning, we know that our claim is true at n=0.
- By our “inductive step” reasoning, we know that if our claim is true at 0, it is true at the “next” value .
- By our “inductive step” reasoning, we know that if our claim is true up to 1, it is true at the “next” value .
- By our “inductive step” reasoning, we know that if our claim is true up to 2, it is true at the “next” value .
- …
- By continuing this process, we eventually get to any ! Therefore our claim is true for every , as desired.
The way we usually think of inductive proofs is to think of topping dominoes. Specifically, think of each of your propositions as individual dominoes - one labeled , one labeled , one labeled , and so on/so forth. With our inductive step, we are insuring that all of our dominoes are lined up - in other words, that if we’ve knocked over some of them, the “next one” will also be knocked over. Then, we can think of the base step as “knocking over” the first domino. Once we do that, the inductive step makes it so that all of the later dominoes also have to fall, and therefore that our proposition must be true for all (because all the dominoes fell!)
To illustrate how these kinds of proofs go, let’s go back to our tiling problem, and prove that we can tile this grids for every ! (As an added bonus, let’s prove it for grids where we remove one square from anywhere, not just the top-right-hand corner!)
Proof. As suggested by the section title, we proceed by induction, where our proposition is “we can tile a grid of squares with one square deleted by using - shapes.”
Base case: we want to prove . So: what is ?
Well: for , we have a grid, which we’ve removed a square from. In other words, we have nothing. If you want, you can think of “nothing” as being something we can trivially cover by placing no three-square shapes!
Alternately, you can decide that 0 is a stupid case and look at instead. For , we simply have a grid with one square punched out. As this is one of our three-square shapes, we are done here; just place a tile on top of our grid!
Either starting place is fine. In general, we recommend doing as many base cases as you need to do in order to feel comfortable with the pattern and believe that you’ve done something concrete! Most of the time, though, the base case will feel kinda silly; don’t worry about this! The inductive step will do all of the heavy lifting for us.
Inductive step: We want to prove that if we know that our claim holds up to , then it holds for as well; formally, this means that we want to show that if and and … and all hold, then must follow.
In this problem in particular, this means that we’re assuming that we can tile a -grid with a square deleted for any , and want to use this assumption to tile a grid with a square deleted.
To do this, take any grid with a square deleted. Divide it into four squares by cutting it in half horizontally and vertically. Finally, by rotating our grid if needed, make it so that the one missing square is in the upper-right hand corner.
Take this grid, and carefully cut out one three-square shape in the center as drawn below.
Now, look at each of the four squares in this picture. They all are missing exactly one square: the upper-right hand one because of our original setup, and the other three because of our placed three-square-shape.
By our inductive hypothesis we know that all of these smaller squares can be tiled! Doing so then gives us a tiling of the whole shape; in other words, we’ve shown how to use our results to get a tiling of the grid.
As this completes our inductive step, we are thus done with our proof by induction.
The claim we proved above - one where we were some sense “growing” or “extending” a result on small values of to get to larger values of - is precisely the kind of question that induction is set up to solve! The Fibonacci numbers, which we introduce in the next question, is another object where this sort of “extension” approach is useful to consider.
To illustrate how it works, let’s use it to calculate the first few values of the Fibonacci sequence! We know that by definition.
To find , we can use the fact that for any , to calculate that.
We can calculate further values of similarly:
When doing this, you’ll likely notice a number of interesting properties about the Fibonacci sequence: see for a ton of weird/beautiful properties these numbers have! We prove one of these properties here:
Proof. Let denote the claim “(the -th Fibonacci number is even) ( is a multiple of 3).” We want to prove that holds for all , and proceed to prove this claim by induction.
Our base cases are pretty easy to check! We calculated the Fibonacci numbers from to above, and we can see that the only ones that are even are and ; so we know that and all hold.
We now move to the inductive step: here, we want to prove and and and … and , when all combined together, imply . We start with what we’re assuming, namely that all of are all true: that is, we’re assuming that the -th Fibonacci number is even if and only if it is a multiple of 3, for every .
We want to prove , i.e. that the -th Fibonacci number is even if and only if it is a multiple of 3.
So: let’s consider cases! There are two possible cases for the value : either it is a multiple of 3, or it’s not.
- If is a multiple of 3, we can write for some . Notice that this means that and , and in particular that both of the values are not multiples of 3! As a result, our inductive assumption tells us that are both not even, because they’re not multiples of 3! But being not-even just means that these numbers are both odd. As a result, because odd+ odd= even, we have shown that is even in this case.
- If is not a multiple of 3, then either has remainder 1 or 2 when we divide it by 3; this is because any number has remainder 0, 1 or 2 when divided by 3. This means we can write or , for some . As a result, we can see that of the two numbers , exactly one of them is a multiple of 3; if then , and if then . As a result, our inductive hypothesis tells us that exactly one of are odd, and the other is even. Therefore, because (one odd number plus one even number)= odd, we have shown that is odd in this case.
So, by using strong induction, we have proven that is even if and only if it is a multiple of 3!
Induction: Two Recurrence Relations
As we just saw in the section above, induction is a useful tool to study recurrence relations! In this section, we continue with this theme, and use induction to prove Claim 4.2 and Claim 4.6 from our algorithms chapter.
Proof. We proceed by induction. First, we can notice that the table of values we calculated earlier validates our claim for the first few values of :
This gives us our base case.
For the inductive step, we proceed as always: we assume that our claim holds up to some value , and seek to prove it for .
In particular, if our claim holds up to some value , we have
As well, by Claim 4.1, we know that
By combining these together, we get
But we know that
In other words, we’ve shown that our claim holds at , and have thus proven our claim by induction!
We can study in the same way:
Proof. We again proceed by induction. Again, as before, our previously-calculated table of values suffices for a base case:
With this established, we turn to the inductive step. Here, we again assume that our claim holds up to some value , and seek to prove it for .
In particular, if our claim holds up to some value , we have
As well, by Claim 4.5, we know that
Again, by combining these together, we get
But we know that
In other words, we’ve shown that our claim holds at , and have thus proven our claim by induction!
Induction, Graphs, and Trees
Induction is a particularly useful technique to use when studying graphs and trees! We prove three claims here, two of which you may recall from our section on trees:
Proof. We proceed by induction on . For , this claim is trivially true, as we always have that is a nonnegative number.
This establishes our base cases, so we now turn to the inductive step: here, we assume that our claim holds for all connected graphs on at most vertices, and seek to use that assumption to prove that our claim holds for connected graphs on vertices.
To do this, consider the following operation, called edge contraction. We define this as follows: take any graph and any edge in with two distinct endpoints. We define , the graph that this edge, as follows: take , delete , and then combine ’s two endpoints together into a single vertex, preserving all of the other edges that the graph has along the way.
We draw examples of this process below: here, we have started with a graph on six vertices, and then contracted one by one the edges highlighted in red at each step.
Notice that contracting an edge decreases the number of vertices by 1 at each step, as it “squishes together” two adjacent vertices into one vertex. It also decreases the number of edges by 1 at each step, as we are contracting an edge to a point!
Finally, notice that contracting an edge preserves the property that our graph is connected. To see why, take any walk
in our graph. Notice that if we contracted an edge in this walk, this would collapse the vertices into some new vertex and preserve all of the edges other than . As a result, our walk would just become
and thus still connects the vertices . Therefore, edge contraction cannot “break” any pre-existing walks, and so preserves the property that our graph is connected.
We can use this process to prove our claim via induction:
- Take any connected multigraph graph on vertices.
- Take any edge in with two distinct endpoints (such an edge exists, because contains at least two different vertices and is connected) and contract that edge. This gives us a new graph , which is connected and contains vertices.
- Therefore, by induction, we know that in , the number of edges is at least .
- We also know that has exactly one more edge than .
- Therefore, in , we know that we have at least edges. In other words, we’ve proven that our claim holds for graphs on vertices, as desired!
Notice that this result applies to simple graphs as well, as any simple graph is certainly a multigraph!
We can also use induction to prove Theorem 6.2! We split this result into two parts, as it’s a longish equivalence proof:
Theorem 7.3(Half of Theorem 6.2) If is a tree on vertices, then contains exactly edges.
Proof. We proceed by induction. Our base case is straightforward: any tree on 1 vertex clearly has no edges (as it’s a simple graph.) If you want, you can also consider 2-vertex graphs as well; the only connected two-vertex graph is , which has one edge as desired.
For the inductive step, let’s assume that our property holds for all trees on up to vertices. Let be any tree on vertices; we want to use our assumption to prove that contains exactly edges.
To do this, let be a leaf vertex in (we know that exists by our earlier theorem.) Delete and the edge connecting to the rest of from ; call the resulting graph .
contains vertices, because we started with vertices and deleted one vertex. It is also still connected (because was degree 1, the only walk that would need to use the edge to is a walk going directly to , and we deleted .) Finally contains no cycle subgraphs, because contained no cycle subgraphs and deleting things from cannot have somehow caused a cycle to exist.
Therefore is a tree! By induction, contains edges.
Therefore itself contains edges, because is just plus the vertex and the single edge connecting to the rest of . In other words, we’ve proven our inductive claim!
Theorem 7.4(The other half of Theorem 6.2).If is a connected graph on vertices containing exactly edges, then is a tree.
Proof. We proceed by contradiction; suppose that is a connected graph on vertices containing edges that is somehow not a tree.
Because is connected, the only way that can fail to be a tree is if it contains a cycle subgraph. Let be such a cycle subgraph.
Take and delete the edge from . We claim that is still connected.
To see why, take any walk in that uses the edge , and replace each use of with the sequence of edges . In other words, every time you’d go directly from to along that edge, instead use the cycle to go the “other” way around!
As a result, if two vertices used to be connected by a walk in , they are still connected after deleting ; in other words, is still connected.
But is a graph on vertices containing edges, as we had edges and deleted one. But in Claim 7.20, we proved that a connected graph on vertices must contain at least edges! In other words, we have a contradiction, and so our claim that was a tree must have been correct.
Proof Methods: How to Choose
With all of these proof methods at our fingertips, a natural question is this: how do you choose a method? One answer is the following:
Just try methods one-by-one until something works! |
Paper is cheap, and it’s usually just a lot faster to try stuff and see which things break than to predict ahead of time which method is “best.” Also, most problems in maths can be solved by a number of different methods: there’s rarely a single “correct” approach to a problem! Instead, many problems can be solved with many different techniques, and each different proof can help illustrate a new way of thinking about the task at hand.
With that said, though, there are clues or signs in a problem statement that can indicate that certain techniques might be useful. There are no hard-and-fast rules here, but the following observations often come in handy:
-
Are you proving a claim of the form “if (some claim is true), then (some other claim is true)?” If so, a direct proof is maybe a good idea! Write down what it would mean for to be true, and try to use that assumption to prove that is also true.
-
Are you dealing with modular arithmetic, even versus odd numbers, claims about “is a multiple of,” or absolute values? Cases are often useful here. (More generally: if you have any problem where the inputs or outputs can be split into cases, do so! Proofs by cases often combine with other proof methods.)
-
Are you being asked a claim of the form “Show that exists?” Construction’s a good way to go here! (This is opposed to claims of the form “Show that every has property ,” which you usually do not do by construction, as it’s hard to construct every !)
-
Are you proving a claim where it seems like your previous results stick together to give you a later result? (Tiling problems that involve a general integer , anything defined recursively like the Fibonacci sequence, processes that have recursion in them, …) When you’re writing your proof, do you find yourself wanting to use ”…” to show how a pattern you’ve found continues? Then this is probably a good candidate for induction!
Induction is often especially useful for studying the runtime of an algorithm, or for proving that a given algorithm is “guaranteed” to give a specific output.
-
Are you totally stuck? Try contradiction! Contradiction often gives you something to start from: i.e. it turns claims like “show that every object has property ” into “what would happen if an object failed to have property ?” This is often an easier place to start from! It can be a lot easier to think about how to “break” things and find contradictions of any kind, than to try to proceed directly and argue why some very specific property must hold.
Contradiction is a particularly nice technique if you’re trying to show that some task is impossible: the opening line of “suppose that this is possible” often makes proofs a lot easier to start.
-
Are you still totally stuck? Maybe it’s false: try a disproof! Best-case scenario: you disprove it and can move on. Worst-case scenario: even if you fail at disproving it, if you think about why you weren’t able to disprove your claim, you might be able to turn that back into a good proof.
To get some practice with this, we solve a few problems below, and in each proof explain why we picked the methods that we did!
Proof. Let’s think about which of our proof methods we want to try:
-
Direct proof: we could try this. This would involve expanding out what it means to be a multiple of 15, and trying to use logic/known results to get to the conclusion.
-
Cases: even though cases is often a good technique when working with mods / multiple problems, this is likely not a great idea here. This is because there isn’t really a clear set of cases you’d want to divide into: even versus odd doesn’t seem relevant, and considering all fifteen possible remainders of seems painful enough to not do unless absolutely necessary.
-
Contradiction: could do, if we’re stuck!
-
Construction: not relevant. We’re proving something for every integer, not building examples for some values.
-
Induction: This doesn’t obviously look like induction, in that it’s not clear how you’d relate to the “next” value .
With some algebraic trickery, though, this is possible! Notice that , and thus that we’ve related one step to the next (in a way that involves a 15, which seems promising.) So if you saw this trick, then this is promising!
-
Disproof: If you were suspicious of this claim, you could start by calculating a handful of values of , and see if any failed to be a multiple of 15.
No obvious counterexamples immediately showed up in our table below, so let’s not try to disprove this just yet.
So, amongst our proof methods, a direct proof and induction look promising. Let’s try induction first!
Base case: we saw in our table in the margins that our case holds for and . So we’ve established our claim for a number of base cases.
Inductive step: For the inductive step, we assume that we’ve proven our claim for : i.e. that is a multiple of 15. We seek to use this claim to prove that our claim holds for the “next” value : i.e. that is also a multiple of 15.
This is not too hard to do! Notice that as we observed above,
If is a multiple of 15, then by definition we can write for some integer . Doing so tells us that the right-hand-side is
Therefore, is also a multiple of 15! As a result, we’ve proven our claim by induction: we showed that it holds for the first few values of , and then showed that it will stay true, as if it is true for some value of it must stay true for the “next” value .
This is not the only way you could prove this result! We could also use a direct proof:
Proof. We want to show that is always a multiple of 15, for any positive integer .
By definition, this holds true if and only if .
So: we know that , because is itself a multiple of 15. We also know from Claim that for any positive integers that if , then as well.
Combining these facts tells us that for any positive integer , we have . Because for all , this gives us . By definition, this means that for every positive integer we’ve shown that is a multiple of 15, as desired!
|
Prove that for every nonnegative odd number , if stops, it outputs 1.
Proof. We consider proof methods:
- Direct proof: we could try this, in that really any proof can be written in a direct method. (In this sense, “direct” often just means “not worrying about a specific technique.“)
- Cases: This seems promising! Our program does different things based on different inputs. As such, cases is a natural technique to use!
- Contradiction: could do, if we’re stuck!
- Construction: not relevant. We’re proving something for every integer, not building examples for some values.
- Induction: Not a great technique here. It doesn’t look like knowing what our program does on input would tell us much about what it does on input .
- Disproof: this seems true (run the program on a bunch of odd values if you’re skeptical!), so disproving it doesn’t seem like a good idea.
Cases looked like the strongest approach: so let’s try that!
Take any nonnegative odd number . Because is a nonnegative integer, this means that or is a two-digit number (whose last digit is 1,3,5,7 or 9.)
After one iteration of our program, if was a two-digit number it will be replaced with one of 1,3,5,7,9; so it suffices to just understand those five cases:
- If , then the program immediately stops and outputs 1, as desired.
- If , then on our first iteration we square to get 9; on our second iteration we square again to get 81; on our third iteration we replace this two-digit number with 1; and on our fourth iteration we stop and output 1.
- If , we saw earlier that this case enters an infinite loop.
- If , then on our first iteration we square and get 49; on our second iteration we replace this two-digit number with 9; on our third iteration we square to get 81; on our fourth iteration we replace this two-digit number with 1, which we then output and halt on our fifth iteration.
- If , we go to 81 and then 1 and then halt (as described above.)
In all of these cases, we either run forever or output 1, as claimed!
Again, we can use a more direct approach if we see it:
Proof. Take any nonnegative odd number . Notice that if is odd, then no matter what our program does will stay odd! This is because the square of an odd number is odd, and the last digit of an odd number is odd.
Therefore, will never be reduced to either of 0 or 6. As a result, the only possibilities that remain are “the program halts when ” or “the program runs forever,” as there are no other conditions that cause our program to halt.
We close this section with a third problem about graphs:
Proof. While we could go through all of the proof methods again, we’ll shortcut the process and explain why we know this is a constructive proof: it’s asking us to show that there is a graph with some property! This isn’t a “show all graphs have property problem or a “take any graph , show that it cannot be ” task: this is just asking us to find some single graph with a given property.
So, uh: behold the graph below!
This is the Petersen graph , a particularly useful counterexample to many claims in graph theory. We claim that is a graph that needs four colors to properly color its edges; i.e. you cannot edge-color with three colors. Note that to complete our proof, we need to explain why using just 3 colors to edge-color this grap is impossible: that is, it’s not enough to just give our object, we also need to show that it has the desired property!
To do this, we now need a new proof technique. We claim that if you went through your list of proof techniques, none would stand out and you’d get stuck for a while. In this situation, contradiction is what we’d go to!
Here, a proof by contradiction would start as follows: suppose that we could use only three colors to color the edges of . Call them red, green and blue.
Make the following observations:
-
Notice that because every vertex of is degree 3, every vertex of has one red, one green, and one blue edge leaving it.
-
Notice that on the outer pentagon of , we need to use all three colors: if we tried to use just two colors to edge-color the pentagon, then we would have two edges with the same color touching each other.
-
Take a red edge on the outer pentagon of . Call its two endpoints , and let the inner vertices adjacent to be called .
Because is red, the edge is not red. Therefore, the red edge that (1) told us must be connected to is on this inner star.
Similarly, because is red, is not red. Therefore, the red edge that (1) told us must be connected to is also on this inner star.
Finally, because and are not adjacent, these red edges are different: that is, there are two red edges in this inner star.
-
Take a blue edge on the outer pentagon of . The same logic as in (3) guarantees two blue edges in the inner star.
-
Take a green edge on the outer pentagon of . The same logic as in (3) guarantees two green edges in the inner star.
-
Conclusion: the inner start has two blue edges, two red edges, and two green edges.
… but it only has five edges! Therefore this is impossible; i.e. we’ve reached a contradiction, and our original claim (that at least four colors are required) has been proven.
Practice Problems
-
You’re a programmer! You’ve found yourself dealing with a program that has no comments in its code, and you want to know what it does. After some experimentation, you’ve found that takes in as input a natural number , and does the following:
- If is either 0, 1, 2, or 3, output and stop. Otherwise, go to (ii).
- If is even, replace with and go back to (i). Otherwise, go to (iii).
- Replace with and go to (i).
Come up with the following proofs about :
(a) Use contradiction to prove the claim “if this program outputs 3 on input , then is not a power of 2.”
(b) Disprove the claim “Given any natural number as input, this program will eventually stop” by finding a counterexample.
(c) Prove by construction the claim “There is some input to this program that causes it to output 0.”
(d) Write a direct proof that if “the output of this program is 1” then “the input to this program was 1.”
-
(-) Let be three integers, such that divides and divides . Write a direct proof that also divides .
-
(-) Write a proof by cases that for any integer , the number is even.
-
(-) Prove by contradiction that the number is irrational.
-
Suppose that , are a pair of real numbers with the following property: if is any number greater than , then must also be greater than . Prove by contradiction that .
-
(+) The game of generalized -tic-tac-toe is played as follows: on a grid, two players and take turns placing their respective symbols into cells of the grid. No cell can be repeated. The game ends whenever any player gets consecutive copies of their symbol on the same row /column / diagonal, or when the grid is completely filled in without any player having any such consecutive symbols. (Normal tic-tac-toe is where .)
Prove that there is no strategy in generalized tic-tac-toe where the second player to move is guaranteed to win.
-
A queen in the game of chess is a piece, shaped like . In the game of chess, when moved, a queen (when placed in a given cell in a chessboard) can go to any cell within the same row, any cell within the same column, or any cell along the two diagonals through the cell that it starts from. We illustrate this below.
The -queens problem is the following task: Take a chessboard. Can you place distinct queens on this chessboard, so that no queen can capture any other (i.e.\ so that there is no way to move any one queen into a cell currently occupied by another queen?): (a) Prove by cases that there are no solutions to the -queens problem. (b) Prove by construction that there is a solution to the -queens problem. (c) Prove by construction that there is a solution to the -queens problem.
-
Prove or disprove the following claim: if is a graph in which the degree of every vertex is 3, then cannot be bipartite.
-
Prove or disprove the following claim: if is a graph in which the degree of every vertex is at least 2, then is connected.
-
Consider the following two-player game: starting with the single number 123, two players alternately subtract numbers from the set from this value. The player who first gets this sum to 0 wins.
If you want to win this game, should you go first or second? Prove that your chosen player has a winning strategy. (Hint: try induction!)
- Take an equilateral triangle with side length . Divide it up into side-length 1 equilateral triangles, and delete the top triangle. Call this shape :
Take three side-length 1 equilateral triangles. Join them together to form the following tile: Prove that you can tile with tiles, for every .
- Consider the following inductive “proof:”
Claim: If is a graph containing at least 3 vertices, and every vertex in has degree at least 2, then contains a subgraph Proof. We proceed by induction on the number of vertices in . To start: we assume that our claim holds for all graphs on up to vertices, and seek to prove that it holds for all graphs on vertices as well. To do this: for any , take any graph on vertices in which every vertex has degree at least 2. Add a new vertex to this graph, and connect to at least two other vertices in ; this gives us a new graph on vertices. We know by our inductive assumption that itself contains a subgraph. Therefore this new graph on vertices also contains a subgraph! This is what we wanted to prove, and thus finishes our inductive proof. |
Find every logical flaw in this proof. Explain why the flaws you have found are indeed mistakes. (Hint: there are at least two flaws here!)
- Consider the following solitaire game:
The picture above contains three circles drawn in the plane. In each of the bounded regions formed by the intersections of these circles, we’ve placed a coin, which is white on one side and black on the other. All of the coins start with their black side up.
The moves you’re allowed to perform in this game are the following:
- You can at any time flip all of the coins within any circle.
- Alternately, you can at any time take any circle and flip all of its white coins over to black. Can you ever reach the following configuration? Prove your claim.