Knowing exactly what a statement claims does not tell you how to establish it, and most statements worth proving are conditionals about every number of some kind.
The previous lesson gave the language: "for all", "there exists", and the rules for negating them. It closed on a claim it could state but not prove, that the square of every odd integer is one more than a multiple of . This lesson supplies the method, the direct proof, and proves that claim along the way. Along the way it proves the division algorithm, which settles a question the first lesson left open (every integer is even or odd, and none is both), and it covers proofs by cases, inequalities, "if and only if", existence with and without a witness, and disproof by counterexample. It assumes the definitions of parity from the first lesson: an integer is even when for some integer , and odd when for some integer .
Assume the hypothesis, reach the conclusion
A conditional is false in exactly one situation: true and false. So to prove it, there is only one situation to rule out. Assume , and derive from it, using definitions, axioms and results already proved. If happens to be false, the conditional is true anyway, which is why a proof never has to say anything about that case. This is a direct proof: it starts at the hypothesis and walks forward to the conclusion.
Most theorems are also universal. "If an integer is divisible by , it is even" means , and no list of cases can cover every . The move that does is to let be arbitrary: name an integer , assume nothing about it except the hypothesis, and reason about it. Whatever follows then follows for every integer, because nothing in the argument depended on which one was named. The proofs in the previous lesson that ended "as was arbitrary, the statement holds" used exactly this.
Why does an argument about one prove the claim for every ?
Because the argument is a template. Take any particular integer, say , and substitute it for in every line of the proof. Each line stays justified, since each justification appealed only to the hypothesis and to rules of algebra that hold for all integers. So the written proof stands for infinitely many proofs, one for each integer, and writing it once with a letter is how a finite text covers an infinite domain.
Logicians call the final step universal generalisation: from a proof of for an arbitrary , conclude . The rule carries a restriction, and every misuse of it breaks the restriction. The name must be genuinely arbitrary: nothing may be assumed about it beyond what the statement's hypothesis grants.
Here is the first way to break it. "Let be an even integer, so for some integer . Then , a multiple of . Since was arbitrary, the square of every integer is a multiple of ." The was an arbitrary even integer, not an arbitrary integer, so the conclusion is only that the square of every even integer is a multiple of , which is true. The claim about every integer is false: .
The second way is subtler. "There is a prime; call it . Then . Since was arbitrary, every integer is at least ." Here was never arbitrary. It came from an existential statement, so it names one particular object that happens to be unknown to us, and a fact about it is a fact about that one object. The wording marks the difference: "let be an integer" introduces an arbitrary object, while "there is an integer with " introduces a fixed one. In the game of the previous lesson, the sceptic chooses the arbitrary objects, and the proof must win whatever they are.
The Logic course states this rule and its restriction formally, in its lesson on proof with quantifiers, where the restriction becomes a checkable condition on where a name may appear.
Together these fix the opening and closing lines of almost every proof in this course. The first sentence names the arbitrary object and states the hypothesis: "Let be an integer divisible by ." The last sentence states the conclusion and says which definition it satisfies: "so is even." Everything in between is the work, and each line of it must be justified by what came before. In outline, a proof of reads: let be arbitrary and suppose ; then a chain of justified steps; therefore ; since was arbitrary, the statement holds for every .
Once is named, the proof may not quietly assume it is positive, or prime, or small, unless the hypothesis says so. Checking , and is not a proof about an arbitrary ; it is three examples. Nor may two objects share a letter they have not earned. If and are both even, then and for some integers and ; writing and would prove the claim only for .
Finding a proof usually runs the other way. On scrap paper, write the conclusion out by its definition, so that " is even" becomes " (some integer)", and ask what would produce that expression. Then write the argument forwards, from hypothesis to conclusion, for the reader. The scrap paper is how you found the route; the proof is the route. A later section shows what goes wrong when the scrap paper is handed in as the proof.
Divisibility
For integers and , divides , written , if there is an integer with . Equivalent phrasings are " is a divisor (or factor) of " and " is a multiple of ". So because , and because . Every integer divides , since , and divides every integer. On the other hand only when , since is always .
Two points about the notation catch almost everyone once. First, is a statement, true or false, while is a number: "" is true, and writing "" mixes a sentence with a calculation. Second, the order matters: is true and is false, because no integer gives . The definition avoids division on purpose: it uses only multiplication of integers, so it makes sense even for .
The definition has the same shape as the definitions of even and odd, a "there is an integer ", and it is used in the same two ways. To use , name the and write . To prove , produce an integer with . Parity is a special case: an integer is even exactly when .
Example. Prove that for all integers , and , if and , then .
Let , and be integers with and . By the definition of divisibility, there is an integer with , and there is an integer with . Substituting the first equation into the second gives . Since and are integers, is an integer. So is times an integer, and by the definition of divisibility, .
The two quotients get different letters, and , because nothing says they are equal. The scrap-paper route was short: the goal asked for in terms of , and the hypotheses chain to and to . This property, transitivity, lets divisibility pass along a chain: from and , without any division, .
Now you. Prove that for all integers , and , if and , then for all integers and .
Answer
Let , and be integers with and , and let and be any integers. By the definition of divisibility, there are integers and with and . Then . Since , , and are integers, is an integer, so by the definition of divisibility, . Taking gives , and taking , gives .
An expression with integer and is called an integer linear combination of and , and the Now you says that a common divisor of two numbers divides every such combination. It is the most used fact about divisibility. Here it is at work: if divides both and , then divides , so is or . Two consecutive integers share no factor greater than .
Divisibility also controls size. The next two facts are used constantly, and the second needs a small case split.
Proposition. Let and be integers.
(i) If and , then .
(ii) If and , then or .
Proof. (i) Suppose and , so for some integer . If were then would be , so , and a non-zero integer has . Therefore . (The rule is proved in the section on absolute value below.)
(ii) Suppose and . If , then tells us nothing, but says , so . If , then as well, since would force . Now (i) applies both ways: and , so , which means or .
Part (i) is the reason no integer greater than divides , a fact the next lesson leans on in Euclid's proof that the primes never run out. Part (ii) shows why the sign needs care: and , and .
Three things divisibility does not do are worth knowing before they are needed. It does not cancel freely: does not give . It does not distribute over sums in reverse: does not give . And "" is not "": and although exceeds both.
Working backwards, writing forwards
Inequalities show the gap between finding a proof and writing one most sharply. Take the claim that for all real numbers and . The natural scrap work starts from the goal: , so , so , which is true because squares are never negative. Every line is correct algebra and the claim is true. But as written, the argument runs from the claim to a known fact, so what it proves is the conditional "if , then ", which is the wrong way round.
To see that an argument of this shape proves nothing, run it on a false claim. "Claim: . Proof: squaring both sides gives , which is true." The algebra is flawless and the claim is false. The truth table of the conditional explains it: is true when is false and is true, so a false statement can imply a true one. Truth travels forwards along an implication, from hypothesis to conclusion, and never backwards. Reaching a true statement from the claim says nothing about the claim.
The repair is to run the scrap work in reverse. Let and be real numbers. The square of a real number is non-negative, so . Expanding, , and adding to both sides gives . Now each line follows from the one before, and the chain starts at a known fact. The reversal worked because every step of the scrap work could be undone; if one of them cannot, the scrap work has found no proof at all.
Example. Prove that for all non-negative real numbers and , , with equality exactly when .
The two sides are the geometric mean and the arithmetic mean of and . On scrap paper: the goal is , that is, . Since and are non-negative, , and , so the right-hand side is . That suggests where the written proof should start.
Let and be non-negative real numbers. Then and are real numbers with , and (that square roots exist is proved in the lesson on the real numbers). The square of the real number is non-negative, so
Adding to both sides and dividing by gives . Equality holds exactly when , that is, when , and since the square root of a non-negative number determines the number, that is exactly when .
The hypothesis earned its place: for the left side is and the right side is . Geometrically, a rectangle with sides and has area , and the square with the same perimeter has side , so the inequality says that the square encloses at least as much.
Now you. Prove that for every positive real number , and find when equality holds. Where does the proof use that is positive?
Answer
Scrap work: multiplying the goal by gives , which is . Written forwards:
Let be a positive real number. Then , so , and so . Dividing both sides by the positive number keeps the direction of the inequality, and gives . Equality holds exactly when , that is, when .
Positivity was used in the division. It cannot be dropped: at , . Another route is the Example with : then , and .
Is it ever safe to argue from the conclusion?
Yes, when every step is reversible and the proof says so. A chain in which is known to be true does prove , because read from right to left it is a chain of implications ending at . A proof in this style writes "", or "which holds if and only if", at each step, and the reader must check each step in both directions. That doubles the checking, which is why the forward version is usually preferred.
Some operations can always be undone. Adding the same number to both sides of an equation or inequality is reversed by subtracting it. Multiplying both sides of an equation by a non-zero number is reversed by dividing. Multiplying both sides of an inequality by a positive number is reversed the same way. Squaring is reversible for non-negative quantities: if and , then exactly when . To see this, write . If , the product has the same sign as ; if , both are and both inequalities hold.
Other operations cannot be undone. Squaring numbers whose signs are unknown loses information, as showed. Multiplying by something that might be turns any equation into . Multiplying an inequality by something that might be negative can reverse its direction.
School algebra meets the same issue under another name. Solve by squaring: , so and or . The first works, since . The second does not, since . The "extraneous root" is exactly the backward direction failing: squaring showed that every solution is among and , not that both are solutions. Whenever a step is not reversible, the argument proves only one direction, and the other must be checked separately.
Division with remainder
Dividing by gives quotient and remainder , since . School arithmetic takes for granted that such a pair always exists and that there is only one. Both halves need proof, and both are needed here: existence gives every integer a remainder, and uniqueness makes the remainder a label that can be relied on.
The existence proof rests on one property of the natural numbers, which this course takes as basic.
The well-ordering principle. Every non-empty set of natural numbers has a least element.
It is not true of every number system. The integers have no least element, and neither do the positive rationals, since half of any positive rational is a smaller one. The principle holds equally for sets of non-negative integers: add to every member of such a set, take the least element of the resulting set of natural numbers, and subtract again. The induction lesson shows that well-ordering and the principle of induction are two forms of the same fact about .
Theorem (the division algorithm). Let and be integers with . There are unique integers and with and .
The number is the quotient and the remainder on dividing by , and the remainder is written . Despite its traditional name, the result is a theorem, not a procedure, and its two parts, existence and uniqueness, get separate proofs.
Proof of existence. Let be the set of all non-negative integers of the form , where is an integer. First, is not empty. Take . Then , using for the first inequality and for the second. So by the well-ordering principle, has a least element , and since is in , for some integer . Then and .
It remains to show . Consider . It has the form , and it is smaller than because . Since is the least element of , the number is not in , and a number of the form can be missing from only by being negative. So , that is, .
Proof of uniqueness. Suppose and , where , , , are integers with and . The two representations play identical roles, so we may name them so that . Then , since and . Subtracting the two equations gives , so , and dividing by the positive number gives . The only integer in that range is , so , and then .
Why does the existence proof need the well-ordering principle?
The informal argument is: subtract from over and over (or add it, if is negative) until the result lands in the range to . It lands there because the values move in steps of exactly , the width of the target, so they cannot jump over it. The question a proof must answer is why the process stops, and "the values , , , and so on decrease, and a decreasing sequence of non-negative integers cannot go on for ever" is the well-ordering principle in other words. The formal proof goes straight to where the process ends: the least non-negative value of .
The property is special to the integers. Among the positive rationals there is no least element at all, which is why "divide by with remainder" needs the quotient to be declared an integer before it means anything. With the quotient an integer, the theorem does extend to real and , but then the existence proof needs a new ingredient, the fact that the integers are not bounded above inside , which is part of what makes the real numbers the real numbers.
The theorem is the start of number theory. Applied repeatedly, it gives Euclid's algorithm for the greatest common divisor, the subject of the Discrete Mathematics lesson on divisibility, and arithmetic that keeps only remainders is modular arithmetic. It also generalises. Polynomials with real coefficients can be divided with remainder, with degree playing the part of size: for polynomials and with not the zero polynomial, there are unique polynomials and with and either or of smaller degree than . The existence proof is this one again, taking an of least degree. Number systems with such a division are called Euclidean domains, and most of the theory of the integers carries over to them.
The condition decides what happens for negative : , so . The pair , also satisfies , but is out of range, and uniqueness says is the only remainder in range.
Uniqueness gives a test for divisibility: exactly when . If the remainder is , then . Conversely, if for some integer , then is a representation with remainder in range, so by uniqueness the remainder is .
It also pays the debt from the first lesson.
Corollary. Every integer is even or odd, and no integer is both.
Proof. Let be an integer. Dividing by gives with , so or . If then is even, and if then is odd. Now suppose and for integers and . These are two representations with remainders and , both in range, so uniqueness would make . Hence no integer is both.
The same argument with shows that every integer has exactly one of the forms , , , and in general, for , every integer has exactly one of the forms , , and so on up to . That splits the integers into classes, and a proof about all integers can take them one at a time.
Proof by cases
Sometimes no single argument covers every value, but a few arguments do, each covering part. A proof by cases splits the hypothesis into possibilities that together exhaust it, and gives a direct proof in each. Its logic is the rule for "or": if holds, and and both hold, then holds.
The commonest split is by parity, which the corollary above has now made legitimate. Take the claim that is even for every integer .
Let be an integer. If is even, then for some integer , and , which is even. If is odd, then for some integer , and , which is even. Since every integer is even or odd, is even in every case.
A result once proved becomes a tool. Here is the previous lesson's open claim. Let be an odd integer, so for some integer . Then . By the result just proved, applied to the integer , there is an integer with . So , and . For that is , and for it is . No case split was needed in this proof; the one inside the lemma did the work.
Two things make a case split sound. The cases must between them cover everything: a proof about all integers that treats and has proved nothing about . And each case must be proved using only what that case supplies, plus what was assumed for all of them. The cases may overlap harmlessly, for instance "" and "" share , but none may be missing.
Parity is division by , and the division algorithm allows division by anything. Splitting by the remainder on division by , or , or , is how most facts about squares and powers are proved.
Example. Prove that no integer of the form is a sum of two squares of integers.
The claim says a certain thing does not exist, and the previous lesson turned such a claim into a universal one: is . So the claim is that for all integers and , the sum does not leave remainder on division by , and that has a direct proof. First a lemma about single squares.
Lemma. The square of every integer has the form or for some integer . Let be an integer. If is even, , and , which has the form with . If is odd, , and , which has the form .
Now let and be integers. By the lemma, and for some integers and , where each of and is or . Then , and is , or . In every case this writes with and . By the uniqueness of the remainder, the remainder of on division by is not , so is not of the form .
So , , , , and every fourth number after them are never sums of two squares, a fact about infinitely many numbers and all pairs of integers, settled by four small cases. The converse fails: is not a sum of two squares, since none of , , , , is a square. Remainders give a necessary condition, not a sufficient one. For primes the full answer is a famous theorem: Fermat claimed in a letter to Marin Mersenne on Christmas Day 1640 that an odd prime is a sum of two squares exactly when it has the form , as , and do. The Example is the easy half; Euler proved the hard half more than a century later.
Now you. Prove that the square of every integer has the form or , and deduce that no integer of the form is a perfect square.
Answer
Let be an integer. By the division algorithm, has exactly one of the forms , , for some integer .
If , then . If , then . If , then . In each case has the form or with an integer.
So the remainder of any square on division by is or , and by uniqueness of the remainder it is never . Hence no integer of the form is a square. For instance , , , and are not squares. Notice that the third case lands on remainder only because : the remainder of the square depends only on the remainder of the number.
How many cases can a proof have?
As many as can be checked. Logic puts no limit on the number: a proof by cases, or proof by exhaustion, is valid when the cases provably cover everything and each is proved. What separates it from checking examples is that first requirement. Checking to a million covers a million cases out of infinitely many, while the four cases above cover every integer because the division algorithm says so.
In 1976 Kenneth Appel and Wolfgang Haken proved the four colour theorem, that every map drawn in the plane can be coloured with four colours so that regions sharing a border differ, by reducing it to nearly two thousand configurations and checking each by computer, over some twelve hundred hours of machine time. The proof was controversial, since no person could read all of it. In 1996 Neil Robertson, Daniel Sanders, Paul Seymour and Robin Thomas gave a cleaner proof with 633 configurations, still checked by machine, and in 2005 Georges Gonthier verified the whole argument in the Coq proof assistant, software that checks every logical step. Thomas Hales's proof of the Kepler conjecture (that no packing of equal spheres is denser than the greengrocer's stack of oranges), announced in 1998, went the same way: the referees reported being "99% certain" of the computer case analysis, and a formal verification by Hales's Flyspeck project was completed in 2014.
These are proofs by cases in exactly this lesson's sense. The computer changes who checks the cases, not what makes the argument valid, and the doubts they raised were answered by making every step checkable by a program far smaller than the proof.
Absolute value and the triangle inequality
The absolute value of a real number is itself defined by cases: if , and if . So and . Geometrically, is the distance from to on the number line, and is the distance between and . Any claim about absolute values invites a proof by cases on signs, because in each case the bars can be replaced by something plain. The basic facts come first.
Lemma. For all real numbers , and :
(i) , with only when ;
(ii) and ;
(iii) ;
(iv) if and only if .
Proof. (i) If , then , and means . If , then .
(ii) For , split on signs. If and , then , so . If and , then , so . If and , then , so ; here, when , both readings of give , so the formula is still right. The case is the same with and exchanged. Taking gives .
(iii) If , then , and . If , then , so , and .
(iv) Suppose . By (iii), and . Conversely, suppose . If , then . If , then , because .
Part (iv) says that means " lies within of ", and it is how inequalities with absolute values are unpacked in practice. The same proof with strict inequalities shows that exactly when .
Theorem (the triangle inequality). For all real numbers and , .
First proof, by cases. Let and be real numbers. There are three cases, according to their signs.
If and , then , so .
If and , then , so .
If one is non-negative and the other negative, the claim is symmetric in and , so we may suppose . Then and . Now is either or . In the first event, , since . In the second, , since .
The three cases exhaust all pairs of real numbers, and the inequality holds in each.
Checking only the first two cases would prove nothing about , , and that is where the inequality is strict: , while .
Second proof, from the lemma. Let and be real numbers. By (iii), and . Adding these inequalities gives , and by (iv), with , this says .
The second proof is shorter because the cases were paid for once, in the lemma, and then reused. That is the usual pattern: a case split belongs at the lowest level where it is needed, inside a lemma that is proved once, rather than repeated in every theorem that uses it.
The name comes from geometry. Replace by and by , and the inequality becomes
for all real , and : the distance from to is at most the distance travelled by going through . In the plane, it says that one side of a triangle is no longer than the other two together. Rearranged, it also gives a lower bound.
Corollary (the reverse triangle inequality). For all real numbers and , .
Proof. Let and be real. Since , the triangle inequality gives , so . Exchanging the roles of and gives , and by (ii), so . Together, , and by (iv) this says .
These two inequalities are the everyday tools of analysis. The lesson on limits uses the triangle inequality to prove that a sequence cannot converge to two different limits and that the limit of a sum is the sum of the limits, and the reverse form shows that if then .
Without loss of generality
The first proof of the triangle inequality treated the case and skipped the case . That was honest because the statement is symmetric in and : exchanging the two letters turns into , which says the same thing. So the written argument for , with the letters exchanged throughout, is an argument for , and writing it out again would add nothing. The phrase for this move is without loss of generality, often shortened to WLOG: "without loss of generality, ". The uniqueness half of the division algorithm used it too, when it named the two remainders so that .
The phrase is a promise that the omitted cases follow from the treated one by a symmetry, and a reader is entitled to ask which symmetry. The test is mechanical: apply the symmetry to the whole statement, hypotheses included, and check that the same statement comes back. Good writing names it: "the statement is symmetric in and , so we may assume ."
Here is what failing the test looks like. "Claim: for all real numbers and , . Proof: without loss of generality , and then ." Exchanging and turns the claim into , a different statement, so the case was lost, not saved; the claim fails at , . Hypotheses must survive the exchange too. In "let be even and odd; without loss of generality ", the exchange would make the even one, so the assumption is not free.
Used properly, the move saves a great deal. A statement symmetric in three variables allows "without loss of generality ", one ordering in place of six, and a statement unchanged when is replaced by allows "without loss of generality ". When the symmetry is not obvious, write the second case out.
If and only if
A biconditional is the conjunction of two conditionals, and , so a proof of it is two proofs. Label them, so the reader knows which is which: the forward direction () assumes and reaches , and the backward direction () assumes and reaches . The two may need quite different arguments, and either may be proved by any method, including a contrapositive, which proves in the form .
The classic mistake is to prove one direction and believe both are done, usually because the easy direction was proved and the other looked like "the same thing backwards". Take "an integer is even if and only if is even". The forward direction is one line: gives . The backward direction is the claim this lesson cannot yet prove, as its last section explains.
A convention to know: definitions are written with "if" but mean "if and only if". "An integer is even if it is twice an integer" also means that an integer that is not twice an integer is not even. Theorems do not get this licence; in a theorem, "if" means only "if".
Example. Prove that for every integer , if and only if and .
Let be an integer.
() Suppose , so for some integer . Then and , and and are integers, so and .
() Suppose and , so and for some integers and . The goal is a factor of , and appears if each expression for is multiplied by the other divisor. Since ,
and is an integer, so .
The backward direction is not a formality, and it does not hold for every pair of divisors: and , but does not divide . It worked because , an integer combination of and equal to . The same trick shows that whenever for some integers and , a number divisible by both and is divisible by . For and no such combination exists, since is always even.
Now you. Prove that for all integers and , is even if and only if and have the same parity (both even or both odd).
Answer
Let and be integers.
() Suppose is even, so for some integer , and . By the corollary to the division algorithm, is even or odd. If is even, , and is even, so both are even. If is odd, , and is odd, so both are odd. Either way and have the same parity.
() If both are even, and , so . If both are odd, and , so . Either way is even.
Each direction was a proof by cases, split on different things: the forward direction on the parity of , the backward direction on which kind of "same parity" was assumed.
Longer lists of equivalent statements are proved in a cycle. To show that , and are all equivalent, it is enough to prove , and : three proofs instead of six, since any one of the statements leads round the cycle to each of the others. Textbooks announce this as "the following are equivalent", and the order of the cycle is chosen to make each step easy.
Proving that something exists
A claim is proved most plainly by producing an and checking . Such a proof is constructive. When the claim is , the may depend on , so the proof must give a recipe that turns each into a suitable .
Take the claim that for every natural number there are consecutive natural numbers, none of them prime. Let be a natural number and write , the product . Consider the numbers . Each has the form with . Then , since is one of the factors of , and , so because a common divisor divides a sum. As , the number has a divisor other than and itself, so it is not prime.
For the recipe gives and the run to . It is far from the first such run, which is to . A constructive proof must produce a witness, not the best one. The result also says something that sounds like the opposite of the next lesson's theorem that the primes never run out: there are gaps between consecutive primes as long as you like.
Many theorems claim more than existence: there is exactly one such object. That is two claims, and each needs its own proof. Existence is proved as above. Uniqueness is a universal claim, "any two objects with the property are equal", and is proved by letting two such objects be arbitrary and showing they coincide, as the division algorithm did with and . Showing that one candidate works and that no other one comes to mind proves existence only.
Some existence proofs never say which object works. Here is the classic, which assumes that is irrational (the next lesson proves it).
Example. Prove that there are irrational numbers and with rational.
Consider the real number . It is either rational or irrational. If it is rational, take : both are irrational and is rational. If it is irrational, take and , both irrational, and then , which is rational. In either case a suitable pair exists.
This is a proof by cases in which the cases are never resolved. It establishes that one of two pairs works without saying which, so it is non-constructive. The argument was published by Dov Jarden in 1953. The answer is known from outside the proof: a theorem proved independently by Aleksandr Gelfond and Theodor Schneider in 1934 implies that is irrational (indeed not the root of any polynomial with integer coefficients), so the second pair is the one.
Now you. Given that and are irrational, give a constructive proof of the same claim.
Answer
Take and , both irrational. Since , we get , using . So is rational, and this time the pair is named. (That is irrational follows from the irrationality of , which the next lesson proves.)
Some mathematicians, the constructivists, reject non-constructive proofs, because they rest on the claim that every statement is true or false even when nobody can say which.
Is a proof that names no witness really a proof?
In the mathematics taught in this course, yes. The Example uses one principle beyond the definitions, the law of excluded middle: for every statement , either or . Applied to " is rational", it licenses the case split, and each case is then proved. Accept the law, and the proof is complete.
Not everyone accepts it. Early in the twentieth century the Dutch mathematician L. E. J. Brouwer argued that, for statements about infinite collections, asserting " or not " claims knowledge nobody has, and that to prove something exists is to show how to find it. His intuitionism, and the constructive mathematics that grew from it, rejects the law of excluded middle, and with it the Example. David Hilbert answered in 1927 that taking the law of excluded middle from the mathematician would be like denying the telescope to the astronomer or the use of his fists to the boxer. Mainstream mathematics sided with Hilbert, but the constructive view never went away, and it returned with computers: in constructive logic, a proof of contains a program computing from , and some proof assistants are built on this idea.
Non-constructive proofs can say surprising things. Chomp, a game popularised by David Gale in 1974, is played on a rectangular bar of chocolate whose bottom-left square is poisoned; players alternately choose a square and eat it together with every square above and to the right of it, and whoever must eat the poisoned square loses. The game always ends and cannot be drawn, and in such a game one of the two players has a winning strategy. On any rectangle larger than one square it is the first player. For suppose the second player could always win, and let the first player open by eating only the top-right square. The second player has a winning reply to that. But every move eats the top-right square along with the rest, so the first player could have made that same reply as the opening move, reaching the same position, and then won by following the second player's strategy. So the second player cannot always win. The argument proves a winning first move exists without naming it, and for most rectangles nobody knows what it is.
Examples, counterexamples and finite checks
A universal claim over an infinite domain is proved only by an argument about an arbitrary element, and no number of examples will do. It is disproved by a single counterexample: one value that satisfies the hypothesis and fails the conclusion. A disproof should state the counterexample and verify it, since a value that fails the hypothesis refutes nothing.
Many exercises, and most real questions, say "prove or disprove", and the first job is to decide which. Try examples first, and choose them to be awkward: , and , negative numbers, equal values, the smallest case the hypothesis allows. If a counterexample appears, the question is settled. If none does, attempt a proof and watch where it strains: a step that fails usually points to the values where the claim fails.
Example. Prove or disprove each claim. (a) The sum of any three consecutive integers is divisible by . (b) The sum of any four consecutive integers is divisible by .
(a) Examples: , , , all divisible by . So attempt a proof. Let be an integer; the three consecutive integers starting at are , and , and their sum is . Since is an integer, divides the sum. The claim is true.
(b) The first example, , already fails: , so does not divide it. The claim is false, and this one counterexample disproves it. The attempted proof shows more. The sum always leaves remainder , so the sum of four consecutive integers is never divisible by . A counterexample settles the question; the algebra explains it.
Now you. Prove or disprove each claim, for all integers , and . (a) If and , then . (b) If and , then .
Answer
(a) True. Let , and be integers with and . A common divisor of two integers divides their sum, and , so .
(b) False. Take and . Then and , both divisible by , but does not divide .
Part (a) suggests the repair. The claim in (b) becomes true when is odd: writing , we have , and divides both and , hence divides . This is the combination trick from the section on "if and only if", with .
Checking examples is a proof in one situation: when the domain is finite, and every element is checked. The division algorithm can make an infinite domain finite. Take the claim that the last digit of every perfect square is , , , , or . Let be an integer, and divide by : with . Then
so and leave the same remainder on division by (write with and apply uniqueness), and the remainder of a non-negative integer on division by is its last digit. So the last digit of is the last digit of one of , which is one of . That is ten checks, and they settle every integer, because the division algorithm proves that the ten remainders are all there are. So is not a square, and no search was needed to see it.
Where the direct route stalls
Every proof above ran forwards: unpack the hypothesis by its definition, then rearrange, split into cases or construct, until the conclusion's definition appears. Try the same on "for every integer , if is even then is even". Let be an integer with even, so for some integer . The goal is (an integer), and all the hypothesis offers is , which is not visibly twice anything.
The hypothesis is about and the conclusion is about , and information does not flow backwards through squaring. Cases on the parity of only help by ruling the odd case out, which is a different method in disguise. The statement is true, and the next lesson proves it by turning the conditional round, the same move that proves irrational.
Problems
Work each problem on paper before opening anything; for Core and Challenge problems, try the hint before the solution.
Warm-up
1. Using only the definition of divisibility, decide which of these are true: , , , , .
Solution
is true, since and is an integer.
is false: by part (i) of the proposition on divisibility and size, it would give .
is true, since . The statement is true even though is undefined, which is one more reason to keep "" (a statement) apart from "" (a number).
is false, since for every integer .
is true, since .
2. For each pair, find the integers and given by the division algorithm, so that and : (a) , ; (b) , ; (c) , ; (d) , .
Solution
(a) , so and .
(b) , since . So and . The tempting answer gives , with remainder , which is out of range.
(c) , so and . When , the quotient is and the remainder is itself.
(d) , so and .
In each case holds, so by uniqueness these are the only answers.
3. Prove that for all integers , and : (a) if then ; (b) if then ; (c) if then and .
Solution
Let , and be integers with , so for some integer .
(a) Then , and is an integer, so .
(b) Then , and is an integer, so .
(c) Then and , and is an integer, so and .
4. Prove that for all real numbers and , if and only if . Use this to find all real with .
Solution
Let and be real numbers. By the strict form of part (iv) of the lemma on absolute value, applied to the number , we have if and only if . Adding to each part is reversible (subtract to undo it), so this holds if and only if .
For the second part, by part (ii) of the lemma. So if and only if , which by the first part holds if and only if . These are exactly the real numbers within of .
Core
5. Prove that for every odd integer , the number is divisible by . Show by an example that cannot be replaced by .
Hint
Factor as a difference of two squares, and use the fact proved in the lesson that the square of an odd integer has the form .
Solution
Let be an odd integer. By the result proved in the section on proof by cases, for some integer . Then
and is an integer, so .
For , , and does not divide , since has remainder . So the claim with in place of is false, and is a counterexample.
6. Prove or disprove each claim, for all integers , and . (a) If then . (b) If and then . (c) If then . (d) If then .
Hint
Two are true and have one-line proofs. For the other two, try small values, including in (b) and a perfect square for in (d).
Solution
(a) True. Let , , be integers with , so for some integer . Then , and is an integer, so .
(b) False. Take . Then and , but does not divide (by part (i) of the proposition, a divisor of has size at most ). The claim does hold when and have an integer combination equal to , by the argument in the section on "if and only if", and and do not.
(c) True. Let , be integers with , so for some integer . Then , and is an integer, so .
(d) False. Take and . Then and , but does not divide , since a divisor of has size at most .
7. Find the flaw in this proof, show that the claim is false, and state and prove a correct claim about the sum of an even and an odd integer.
Claim. The sum of an even integer and an odd integer is one more than a multiple of .
Proof. Let be even and odd. Then and for some integer . So , which is one more than a multiple of .
Hint
Ask what the proof has assumed about how and are related.
Solution
The definitions give for some integer and for some integer , and nothing says . By using one letter for both, the proof assumed , so it proved the claim only for an even integer and the odd integer immediately after it. For those it is correct: .
The claim itself is false. Take and : then , which by uniqueness of the remainder is not of the form .
A correct claim is that the sum of an even integer and an odd integer is odd. Let be even and odd, so and for some integers and . Then , and is an integer, so is odd.
8. Find the flaw in this argument.
Let and be real numbers with and . Multiplying both sides by gives . Subtracting gives . Factorising, . Dividing by gives . Since , this says , and dividing by gives .
Hint
Each step but one is valid algebra. Which operation is only allowed under a condition, and does the condition hold here?
Solution
The flaw is the division by . Since , the number is , and division by is not defined. The rule being used is cancellation: if and , then . Without the condition the rule is false, since while .
Every line up to and including is true: with both sides are . The line does not follow from it, and it is false, because gives . The final division by is legitimate, because the hypothesis says .
9. For real numbers and , let be if and otherwise, and let be if and otherwise. Prove that for all real and ,
Hint
Check that both sides of each equation are unchanged when and are exchanged. Then one case is enough.
Solution
First, the statement is symmetric in and . Exchanging them leaves and unchanged: if both are defined by which of the two is larger, and if every expression involved equals . It also leaves the right-hand sides unchanged, since and by part (ii) of the lemma on absolute value. So the pair of equations for is the same pair as for , and without loss of generality .
Let . Then , so , and by definition and . Now
which are and , as required. The case follows by exchanging the letters.
10. Prove that for every real number , and that equality holds if and only if .
Hint
The signs of and change at and , which suggests three cases. For the inequality alone, there is also a one-line proof by the triangle inequality.
Solution
Let be a real number, and write . The three cases below cover every real number.
If , then and , so . Since , , so .
If , then and , so and (when both readings give ). So .
If , then and , so . Since , , so .
In every case . For the equality: if then by the middle case; conversely, if , then is not in the first or third case, where , so .
The inequality alone also follows from the triangle inequality: . Geometrically, the sum of the distances from to and to is at least the distance between and .
11. Let and be integers with . Prove that there are unique integers and with and . Find and for , and for , .
Hint
For existence, start from the division algorithm and move the remainder down by when it is too big. For uniqueness, follow the uniqueness proof in the lesson: the two remainders now lie in a range of width that includes one end and not the other.
Solution
Existence. By the division algorithm, for integers and with . If , take and ; then . If , take and . Then . Also , because , and , because . So in both cases the pair has the required properties.
Uniqueness. Suppose with , , , integers and both and in the range . The two representations play identical roles, so without loss of generality . Then , and , because and . Subtracting the equations gives , so , and dividing by gives . Hence , so and .
For , : the division algorithm gives , and , so and , that is, . For : , and , so and .
12. Prove that an integer can be written as for some integers and if and only if does not have the form for any integer .
Hint
For the backward direction, compute and . For the forward direction, use the lemma that every square has the form or .
Solution
Let be an integer.
() Suppose is not of the form . By the division algorithm, has one of the forms , , for some integer . If or , then is odd, say for an integer , and . If , then
In every case is a difference of two squares of integers.
() Suppose for integers and . By the lemma in the section on proof by cases, and for some integers and , with each of and equal to or . Then , and is , or . If is or , then leaves remainder or on division by . If , then leaves remainder . In no case is the remainder , so by uniqueness of the remainder, is not of the form .
For example, and , while , and are not differences of two squares.
Challenge
13. Prove that is the only natural number for which is prime.
Hint
Add and subtract : then is a difference of two squares.
Solution
Let be a natural number. Then
For , , which is prime.
Now let . The second factor is , since . The first factor is , which exceeds the second, so it is greater than as well. So is the product of two integers each greater than , which by definition makes it composite, and hence not prime. For instance , and the factors are and .
So is prime for and for no other natural number. The factorisation is a case of an identity named after Sophie Germain: . Finding it is the whole difficulty.
14. Prove that is divisible by for every integer .
Hint
Factor completely over the integers. Show separately that , and divide it, using cases on remainders, and then combine the three facts with the trick from the Example in the section on "if and only if".
Solution
Let be an integer and write . Factoring,
Throughout, if an integer divides one factor of a product, it divides the product (Problem 3(a)).
Divisibility by . The product is even, as proved in the lesson, and it is a factor of , so .
Divisibility by . By the division algorithm, , or for some integer . In the first case ; in the second ; in the third . In each case divides a factor of , so .
Divisibility by . Write with . If , . If , . If , . If , then . If , then . In each case divides a factor of , so .
Combining. Since and , the Example in the section on "if and only if" gives . Now and , say and for integers and . Since ,
and is an integer, so .
As a check, gives and gives . Each of the three facts is a case of Fermat's little theorem, that for every prime , which needs new ideas to prove for all primes at once.
15. Prove that for all real numbers and ,
Hint
First prove that whenever . Then apply it with and , split the resulting fraction in two, and compare each half with the right-hand side.
Solution
All the denominators are at least , so every fraction is defined.
Step 1. Let and be real numbers with . Then
because and the denominator is positive. So .
Step 2. Let and be real numbers. By the triangle inequality, , so Step 1 with and gives
Step 3. Since , we have , and a non-negative numerator over a larger positive denominator gives a smaller or equal fraction, so . In the same way . Adding these to the inequality of Step 2 proves the claim.
Applied to and , the result says that , a measure of distance that never exceeds , still satisfies the triangle inequality.