A theorem is a sentence. Before you can prove one, you have to know exactly what it says: what you may assume, what you must show, and for which objects. Most wrong proofs are not wrong in the algebra. They prove a slightly different sentence. This chapter is about reading sentences exactly. It reuses the logic from CS 240. The goal here is to read and write mathematics, not to fill in truth tables.
Nothing beyond school algebra. If you took CS 240, much of this will be familiar; the quick checks tell you where to slow down.
The picture
Think of a theorem as a contract. “If is even, then is even” makes a promise about every number you could hand it. It does not promise anything about odd numbers. A proof is the argument that the promise is never broken. To break it, someone would need one number that is even but has an odd square. Knowing exactly what would break a promise is the key skill of this chapter. That is the negation, and it is how proofs by contradiction and counterexamples work.
For most of history, mathematicians reasoned in ordinary language. In the 1800s, analysis needed more care. Words like “approaches” and “infinitely small” were too loose to settle which statements about continuous functions and infinite sums were true. Augustin-Louis Cauchy (1821) defined limits in careful words. Karl Weierstrass and his students, around the middle of the century, turned them into the sentences with “for every” and “there exists” that you will meet as the epsilon-delta definitions of Unit 1. In the same century George Boole (1847) treated “and”, “or” and “not” as an algebra, and Gottlob Frege (1879) added quantifiers to the symbolic language. That symbolic logic is what CS 240 taught you. It exists because ordinary words were not precise enough for proofs.
Definitions and theorems
Statements and connectives
Statement
A statement (or proposition) is a sentence that is either true or false. ” is prime” is a statement (true). "" is a statement (false). "" is not a statement until you say what is: it is a predicate, a sentence with a variable, which becomes a statement once the variable is fixed or quantified (below).
In one lineA sentence that is either true or false, with no third option.
Why it existsOnly sentences with a definite truth value can be proved or disproved.
Statements combine with three connectives. We write and for statements.
| Symbol | Read | True exactly when |
|---|---|---|
| P and Q | both are true | |
| P or Q | at least one is true (maths “or” includes “both”) | |
| not P | is false |
If-then
Implication
The implication , read “if then ” or ” implies ”, is false when is true and is false, and true in every other case. is the hypothesis and the conclusion.
In one line'If P then Q' () is false in exactly one case: P true and Q false.
Why it existsIt is the shape of almost every theorem: hypotheses on the left, conclusion on the right.
| The promise “if P then Q” | |||
|---|---|---|---|
| T | T | T | kept |
| T | F | F | broken |
| F | T | T | not tested |
| F | F | T | not tested |
The last two rows bother everyone. Think of a promise: “If it rains, I will bring an umbrella.” On a day it does not rain, you cannot accuse me of breaking the promise, whatever I carry. A promise is broken only when its condition happens and the result does not. Mathematics counts a promise that was never tested as kept. This is called vacuous truth.
It is not a trick. It is what makes theorems usable. “If is even then is even” should be a true theorem about all integers. When , the hypothesis is false. If we called that case false, the theorem would be false because of , which it never talked about.
Solution.
- Find the hypothesis and the conclusion of (a). Hypothesis: . Conclusion: . An implication is judged by the pair (hypothesis, conclusion), so name both first.
- Decide the truth value of each part. is false, and is false. That is the row F, F of the table. The table needs the truth value of each part, never the meaning of the whole sentence.
- Read the table. The row F, F gives true. The hypothesis never happened, so the promise was never tested and was never broken (vacuous truth).
- Do (b). is true and is false: the row T, F. This is the only row that gives false.
- Do (c). For the hypothesis “9 is prime and even” is false (9 is not prime). The conclusion "" is also false. The row F, F gives true. Plugging in a number that fails the hypothesis cannot break the promise. Only a prime that is even and not 2 could, and there is none.
Answer. (a) true, (b) false, (c) true.
From the table, is false only in the row ” true, false”. So it is true exactly when that row does not happen: when is false, or is true. That is . In words: “if it rains I bring an umbrella” says the same as “either it does not rain, or I bring an umbrella”. Both rule out exactly one situation: rain and no umbrella.
Mathematicians say in several ways. All of these mean exactly the same statement.
| Wording | Example with = ” is divisible by 4”, = ” is even” |
|---|---|
| if , then | if is divisible by 4, then is even |
| implies | divisible by 4 implies even |
| whenever | is even whenever it is divisible by 4 |
| only if | is divisible by 4 only if is even |
| is sufficient for | being divisible by 4 is enough to be even |
| is necessary for | being even is needed in order to be divisible by 4 |
The two to watch are “only if” and “necessary”. They can sound like they reverse and . The thing after “only if” is the conclusion, and in ” is necessary for ” the conclusion is the thing that is necessary, .
Three relatives of appear constantly.
Converse
The converse of is .
In one lineThe converse of is ; it is a different statement and can be false when the original is true.
Why it existsMixing up a statement with its converse is the most common logical error in proofs.
“If is divisible by 4, then is even” is true. Its converse, “if is even, then is divisible by 4”, is false, because is even and not divisible by 4.
Contrapositive
The contrapositive of is : swap the two sides and negate both.
In one lineThe contrapositive of is ; it always has the same truth value as the original.
Why it existsSometimes 'not Q' is easier to start from than P, so proving the contrapositive is a legitimate shortcut.
The fourth relative is the inverse, : negate both sides and keep the order. It is the contrapositive of the converse, so it is equivalent to the converse and not to the original.
Solution.
- Name the two parts. : “the number is divisible by 6”. : “the number is divisible by 3”. All four statements are built from the same and .
- Converse (). “If a number is divisible by 3, then it is divisible by 6.” Swap the sides.
- Contrapositive (). “If a number is not divisible by 3, then it is not divisible by 6.” Swap the sides and negate both.
- Inverse (). “If a number is not divisible by 6, then it is not divisible by 3.” Negate both and keep the order.
- Decide the original. True: . Unfold divisibility and exhibit the multiple.
- Decide the other three with one example each. The contrapositive is true, because it is equivalent to the original. The converse is false: is divisible by 3 and not by 6. The inverse is false for the same reason, because it is equivalent to the converse (again : not divisible by 6, yet divisible by 3). A single number making the hypothesis true and the conclusion false kills an implication. The contrapositive needs no check, since it always has the truth value of the original.
Answer. Original and contrapositive are true. Converse and inverse are false.
An implication equals its contrapositive
For any statements and , and have the same truth value.
In one line and are true in exactly the same situations.
Why it is trueBoth are false in exactly one case: P true and Q false.
Tap the lines in the order a proof would write them. Each line can only use what is already above it.
A student’s common question: “if I use the contrapositive, do I still need to show the original is true?” Showing the contrapositive true is the whole proof. Because the two statements are always true together, proving "" proves "". You do not prove the original separately. You choose whichever of the two is easier to start from.
If and only if
, read ” if and only if ” (written iff), means and . It is true when and have the same truth value. To prove it, you prove both directions, often labelled () and (), as in the subspace test of 2.1.
In one line'P if and only if Q' () means both and .
Why it existsDefinitions and characterisations ('a matrix is invertible iff its determinant is non-zero') say two things are the same condition, and need proofs in both directions.
Solution. An integer is even if it equals for some integer , and odd if it equals for some integer . We prove the two directions separately.
- Direction (): assume is odd. Then for some integer . This direction is “odd implies even”, so the hypothesis is “odd” and we unfold it.
- Reach the conclusion. , and is an integer, so is even. The conclusion “even” needs the form .
- Direction (): assume is even. Then for some integer . This is the converse direction. It is a different statement, so it needs its own proof.
- Reach the conclusion. , and is an integer, so is odd. The conclusion “odd” needs the form .
Answer. Both and hold, so is odd if and only if is even.
Quantifiers
Quantifier
The universal quantifier reads “for every ”. The existential quantifier reads “there exists (at least one) ”. Putting a quantifier in front of a predicate turns it into a statement. "" is true. "" is false.
In one line'For every' () and 'there exists' (): they say how many objects a predicate is claimed for.
Why it existsEvery theorem is about a whole class of objects, and the quantifiers say which and how many.
Theorems often hide their “for every”. “If is even then is even” means “for every integer : if is even, then is even”. A proof must work for an arbitrary , not for . Before proving anything, rewrite the statement with every quantifier visible.
The order of quantifiers matters. The cleanest example uses and ranging over the real numbers.
Solution.
- Read the first one as a game. “For every , there is a with .” You name any ; I then get to choose , knowing your . The variable that comes later may depend on the ones before it.
- Decide it. Whatever you name, I answer . So it is true. My is allowed to depend on your .
- Read the second one. “There is a such that for every , .” Now I must commit to one first, and then it has to beat every you could name. Here comes first, so it cannot depend on .
- Decide it. Whatever I pick, you name , and fails. So it is false: no real number is bigger than all real numbers. One counter-move is enough to defeat an ‘exists’.
Answer. The first is true and the second is false. Swapping and changed which player moves first, and so changed the meaning.
Solution.
- Read the first sentence. It asks for ONE integer that is both even and odd. One quantifier covers the whole bracket, so a single must satisfy both parts.
- Decide it. No integer is both even and odd, so it is false. An integer leaves remainder 0 or 1 on division by 2, never both.
- Read the second sentence. It has two separate quantifiers. The first is even and the second may be a different integer that is odd. Each introduces its own , and the two do not have to agree.
- Decide it. is even and is odd, so it is true. Exhibiting examples proves an ‘exists’.
Answer. They are different: the first is false and the second is true. An cannot be split across an “and” when the same must serve both parts. (The mirror case, with and “or”, is one of the problems below.)
"" means: . You (the sceptic) pick ; the prover answers with , which may depend on . Chapter 1.2 plays this game with a visualizer. Reading quantifier order is most of what analysis asks of you.
Negation
To disprove a statement, or to set up a proof by contradiction, you need its exact negation. These rules give it mechanically.
Negation
The negation of a statement is true exactly when is false.
In one lineThe negation of a statement is the statement that is true exactly when the original is false.
Why it existsProof by contradiction starts from the negation, and a counterexample is a witness for the negation.
Rules for negating
- is . (De Morgan)
- is . (De Morgan)
- is .
- is .
- is .
In one lineNot(and) is or-of-nots; not(or) is and-of-nots; not(if P then Q) is P and not Q; not(for all) is exists-not; not(exists) is for-all-not.
Why it is trueEach rule describes exactly the situations in which the original is false.
A truth table is a second way to check any rule about connectives. It lists every possible combination of true and false for the letters and compares the two sides row by row.
Solution.
- List the rows. Two letters give rows: = TT, TF, FT, FF. Every combination must appear once, or the check could miss a case.
- Fill the left side . First is T, F, F, F. Negating gives F, T, T, T. is true only in row TT, and the ‘not’ flips each entry.
- Fill the right side . is F, F, T, T and is F, T, F, T. ‘Or’ of the two is F, T, T, T. An ‘or’ is true as soon as one side is true, and false only in the row where both are false (row TT).
- Compare the columns. F, T, T, T on both sides. Same value in every row means the two statements are equivalent.
Answer. The columns agree in all four rows, so and always have the same truth value.
To negate a long sentence, move the “not” from left to right one symbol at a time, flipping each to and each to , and using rule 3 when you reach an if-then.
Solution.
- Make the hidden quantifier visible. The statement is . Theorems about integers speak about every integer unless they say otherwise.
- Negate the quantifier. . Rule 4.
- Negate the implication. . Rule 3: the negation of if-then is AND. Note ‘not even’ is ‘odd’ for integers.
Answer. “There is an integer with odd and odd.” A proof by contradiction assumes exactly this and derives something impossible. The wrong version, “if is odd then is odd”, is another if-then statement, and assuming it leads nowhere.
Solution.
- Write the negation. . Rules 4 and 3. To disprove a ‘for every’, exhibit one for which the negation holds.
- Find a witness. : and . Negative numbers have large squares but are small.
Answer. The statement is false, and is a counterexample: an object that makes the negation true.
Solution.
- Write the definition with every quantifier visible. . Start from the full sentence so that nothing is hidden.
- Negate the two ‘s. . Rule 4, applied twice. Each becomes and the ‘not’ moves right.
- Negate the implication. . Rule 3: the negation of if-then is AND. Also, ‘not less than’ is ‘greater than or equal’.
- Read the negation in words. There are two inputs, one smaller than the other, whose outputs are in the wrong order or equal. This tells us exactly what object to hunt for.
- Find a witness for . Take and . Then , and . The square of a negative number gets bigger as the number moves away from 0.
Answer. ‘Not increasing’ means: there are with . The pair shows is not increasing on .
Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.
Reading a theorem, step by step
Before proving any theorem, do these four things. They take a minute and prevent most wrong proofs.
- Name the objects and their types: integers, real numbers, vectors, functions.
- Write every quantifier, including hidden ones, in order.
- Split hypothesis from conclusion. What may you assume? What must you show?
- Write the negation of the conclusion (for contradiction) and of the whole statement (to look for counterexamples).
Solution. Linear dependence is defined in 2.2. Here we only use its shape: a set is dependent when some combination of its vectors, with coefficients not all zero, equals the zero vector .
- Name the objects. A vector space ; vectors in that span ; vectors in . Know what each letter is before reading further.
- Write the quantifiers. For every , every , every that span , and every list in : the ‘s are dependent. ‘Any vectors’ is a hidden ‘for every’.
- Split hypothesis from conclusion. Hypothesis: the ‘s span (so each is a combination of the ‘s). Conclusion: there exist , not all zero, with . Unfolding ‘dependent’ gives a conclusion containing an ‘exists’.
- Say what a proof must do. Take arbitrary ‘s and ‘s satisfying the hypothesis and construct the . An ‘exists’ in the conclusion means the proof must produce something. The proof cannot just argue that none is impossible.
- Write the negation, to know what a counterexample would be. vectors that span and vectors in that are independent. Rule 3 for the whole statement. If the theorem is true, no such pair exists.
Answer. Unfolding the definitions shows the shape of the proof before you start: build the coefficients . The proof in 2.2 builds them by induction.
Where it is used
A function is continuous at if . Reading that line correctly (who picks first, what depends on what, what the negation says) is the whole of Unit 1, and of MATH 521.
Program specifications are quantified implications. A sorting routine’s contract is “for every input list, the output is a permutation of it and for all , output output”. Testing checks a few inputs. Proving the contract, as the proof assistant Coq and the program verifier Dafny do, covers the ‘for every’. A database query “find customers who bought every product in category X” has a over products. SQL has no ‘for all’, so it is written as “there is no product in category X that the customer did not buy”, a double ‘NOT EXISTS’. That is rules 4 and 5 read backwards: is the same as “not exists not”.
Traps
is . It is never "". Proof by contradiction of “if P then Q” assumes P and not-Q together.
Proving does not prove . When a proof seems to work too easily, check that you did not prove the converse.
In mathematics ” or ” is true when both hold. ” is even or is divisible by 3” is true for .
Checking proves nothing about all . But one counterexample DOES disprove a ‘for every’, and one example DOES prove a ‘there exists’.
Problems
Write the converse and the contrapositive of “If a matrix has two equal rows, then its determinant is 0.” Which of the three is guaranteed to be true?
Solution
Converse: if , then has two equal rows (false: ). Contrapositive: if , then has no two equal rows (true, since it is equivalent to the original, which is true).
Is “If , then the moon is made of cheese” true or false?
Solution
True. The hypothesis is false, so the implication is vacuously true: its promise is never tested.
Negate: “There is an integer such that .”
Solution
“For every integer , .” (Rule 5.) This negation is the true one.
Negate, and decide which version is true: “For every real there is a real with .”
Solution
Negation: there is a real such that for every real , . The original is true: given , take . So the negation is false.
Write the definition “the vectors are linearly independent” with explicit quantifiers, then negate it. What familiar definition do you get?
Solution
Independent: for all scalars , if then every . Negation: there exist with and not every (rules 4 and 3). That is exactly the definition of linearly dependent in 2.2.
is called bounded if . Write what ” is not bounded” means, and show on is not bounded.
Solution
Not bounded: . For : given any , take ; then .
Prove with a truth table, then explain in words, that and are equivalent.
Solution
Rows (P, Q): (T,T): both true. (T,F): false; = F or F = false. (F,T): both true. (F,F): both true. They agree in every row. In words: each is false in exactly one situation, P true and Q false.
Prove that is equivalent to . Why does this give a second way to prove an “if and only if”?
Solution
is the contrapositive of , so it has the same truth value. Hence the right side has the same truth value as , which is the definition of . So to prove an iff you may prove “P implies Q” and “not P implies not Q”.
Explain why "" is equivalent to "", but "" is NOT equivalent to "". Give a counterexample for the second.
Solution
First: both sides say every satisfies both properties. Second: take ranging over integers, = ” is even”, = ” is odd”. Every integer is even or odd, so the left side is true. But not every integer is even, and not every integer is odd, so the right side is false.
is uniformly continuous if . Compare with continuity at every point: . Which quantifiers moved, and what does that change? Write the negation of uniform continuity.
Solution
In continuity the point comes before , so may depend on . In uniform continuity comes before and , so one must work everywhere at once. Negation: . (Chapter 1.3 shows on is continuous but not uniformly continuous.)
Summary
- A theorem is a sentence; read it exactly before proving it.
- is false only when is true and is false. It means the same as and as its contrapositive ; it does NOT mean the same as its converse .
- Proving the contrapositive proves the theorem.
- Quantifier order matters: a later variable may depend on earlier ones.
- Negation rules: not-and = or-of-nots, not-or = and-of-nots, not(if P then Q) = P and not Q, not-for-every = exists-not, not-exists = for-every-not.
- Before a proof: name the objects, write every quantifier, split hypothesis from conclusion, write the negation.