Survey of Mathematics

0.1 How to read a theorem

Every theorem is built from a few logical pieces (and, or, not, if-then, for every, there exists). Read them exactly, negate them correctly, and half of every proof is already done.

Beyond the courseCS 240 (propositional and predicate logic)Velleman, How to Prove It, ch. 1 and 2Hammack, Book of Proof, ch. 2

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.

Before you start

Nothing beyond school algebra. If you took CS 240, much of this will be familiar; the quick checks tell you where to slow down.

Quick checkWhat is the negation of 'If nn is odd, then n2n^2 is odd'?
Quick check'Every student has a phone' and 'There is a phone that every student has'. Do they say the same thing?

The picture

Think of a theorem as a contract. “If nn is even, then n2n^2 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.

Where this came from· Why mathematicians started writing logic down

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

Definition B

Statement

A statement (or proposition) is a sentence that is either true or false. ”77 is prime” is a statement (true). "2+2=52 + 2 = 5" is a statement (false). "x>3x > 3" is not a statement until you say what xx 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.

Quick checkWhich of these is a statement in the sense just defined?

Statements combine with three connectives. We write PP and QQ for statements.

SymbolReadTrue exactly when
P∧QP \land QP and Qboth are true
P∨QP \lor QP or Qat least one is true (maths “or” includes “both”)
¬P\neg Pnot PPP is false

If-then

Definition B

Implication

The implication P⇒QP \Rightarrow Q, read “if PP then QQ” or ”PP implies QQ”, is false when PP is true and QQ is false, and true in every other case. PP is the hypothesis and QQ the conclusion.

In one line'If P then Q' (P⇒QP \Rightarrow 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.

PPQQP⇒QP \Rightarrow QThe promise “if P then Q”
TTTkept
TFFbroken
FTTnot tested
FFTnot tested
Your answerTake three statements P,Q,RP, Q, R. Their truth table has 8 rows. In how many rows is (P∨Q)⇒R(P \lor Q) \Rightarrow R false?
Why· Why 'false implies anything' counts as true

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 nn is even then n2n^2 is even” should be a true theorem about all integers. When n=3n = 3, the hypothesis is false. If we called that case false, the theorem would be false because of n=3n = 3, which it never talked about.

Worked example
Decide whether each statement is true: (a) 'If 1=21 = 2 then 5=75 = 7.' (b) 'If 2+2=42 + 2 = 4 then 5=75 = 7.' (c) 'If xx is a prime and xx is even, then x=2x = 2', for the particular number x=9x = 9.

Solution.

  1. Find the hypothesis and the conclusion of (a). Hypothesis: 1=21 = 2. Conclusion: 5=75 = 7. An implication is judged by the pair (hypothesis, conclusion), so name both first.
  2. Decide the truth value of each part. 1=21 = 2 is false, and 5=75 = 7 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.
  3. 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).
  4. Do (b). 2+2=42 + 2 = 4 is true and 5=75 = 7 is false: the row T, F. This is the only row that gives false.
  5. Do (c). For x=9x = 9 the hypothesis “9 is prime and even” is false (9 is not prime). The conclusion "9=29 = 2" 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.

Why· Why $P \Rightarrow Q$ means the same as 'not P, or Q'

From the table, P⇒QP \Rightarrow Q is false only in the row ”PP true, QQ false”. So it is true exactly when that row does not happen: when PP is false, or QQ is true. That is ¬P∨Q\neg P \lor Q. 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 P⇒QP \Rightarrow Q in several ways. All of these mean exactly the same statement.

WordingExample with PP = ”nn is divisible by 4”, QQ = ”nn is even”
if PP, then QQif nn is divisible by 4, then nn is even
PP implies QQnn divisible by 4 implies nn even
QQ whenever PPnn is even whenever it is divisible by 4
PP only if QQnn is divisible by 4 only if nn is even
PP is sufficient for QQbeing divisible by 4 is enough to be even
QQ is necessary for PPbeing 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 PP and QQ. The thing after “only if” is the conclusion, and in ”QQ is necessary for PP” the conclusion is the thing that is necessary, QQ.

Quick check'You pass the course only if you score at least 40.' Which statement does this say?

Three relatives of P⇒QP \Rightarrow Q appear constantly.

Definition B

Converse

The converse of P⇒QP \Rightarrow Q is Q⇒PQ \Rightarrow P.

In one lineThe converse of P⇒QP \Rightarrow Q is Q⇒PQ \Rightarrow P; 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 nn is divisible by 4, then nn is even” is true. Its converse, “if nn is even, then nn is divisible by 4”, is false, because n=6n = 6 is even and not divisible by 4.

Your answerAmong the integers 1,2,…,201, 2, \dots, 20, for how many nn does the converse of 'if nn is divisible by 4 then nn is even' fail? (It fails at nn when nn is even but not divisible by 4.)
Definition B

Contrapositive

The contrapositive of P⇒QP \Rightarrow Q is ¬Q⇒¬P\neg Q \Rightarrow \neg P: swap the two sides and negate both.

In one lineThe contrapositive of P⇒QP \Rightarrow Q is ¬Q⇒¬P\neg Q \Rightarrow \neg P; 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, ¬P⇒¬Q\neg P \Rightarrow \neg Q: 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.

Worked example
Write the converse, the contrapositive and the inverse of 'If a number is divisible by 6, then it is divisible by 3.' Decide which are true.

Solution.

  1. Name the two parts. PP: “the number is divisible by 6”. QQ: “the number is divisible by 3”. All four statements are built from the same PP and QQ.
  2. Converse (Q⇒PQ \Rightarrow P). “If a number is divisible by 3, then it is divisible by 6.” Swap the sides.
  3. Contrapositive (¬Q⇒¬P\neg Q \Rightarrow \neg P). “If a number is not divisible by 3, then it is not divisible by 6.” Swap the sides and negate both.
  4. Inverse (¬P⇒¬Q\neg P \Rightarrow \neg Q). “If a number is not divisible by 6, then it is not divisible by 3.” Negate both and keep the order.
  5. Decide the original. True: n=6k=3(2k)n = 6k = 3(2k). Unfold divisibility and exhibit the multiple.
  6. Decide the other three with one example each. The contrapositive is true, because it is equivalent to the original. The converse is false: n=9n = 9 is divisible by 3 and not by 6. The inverse is false for the same reason, because it is equivalent to the converse (again n=9n = 9: 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.

Theorem B

An implication equals its contrapositive

For any statements PP and QQ, P⇒QP \Rightarrow Q and ¬Q⇒¬P\neg Q \Rightarrow \neg P have the same truth value.

In one lineP⇒QP \Rightarrow Q and ¬Q⇒¬P\neg Q \Rightarrow \neg P are true in exactly the same situations.

Why it is trueBoth are false in exactly one case: P true and Q false.

Proofstandard
The idea: An implication is false in exactly one case. Find that case for each statement and see that it is the same case.
P⇒QP \Rightarrow Q is false exactly when PP is true and QQ is false.
By the definition of implication: false only when the hypothesis holds and the conclusion fails.
¬Q⇒¬P\neg Q \Rightarrow \neg P is false exactly when QQ is false and PP is true.
Here the hypothesis is ¬Q\neg Q and the conclusion is ¬P\neg P. It is false only when ¬Q\neg Q is true and ¬P\neg P is false.
So the two statements always have the same truth value.
The two descriptions are the same situation, so the statements are false together and true together.
Proof workshopRebuild the proof that an implication equals its contrapositive

Tap the lines in the order a proof would write them. Each line can only use what is already above it.

    Watch out· Proving the contrapositive IS proving the theorem

    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 "¬Q⇒¬P\neg Q \Rightarrow \neg P" proves "P⇒QP \Rightarrow Q". You do not prove the original separately. You choose whichever of the two is easier to start from.

    Definition B

    If and only if

    P⇔QP \Leftrightarrow Q, read ”PP if and only if QQ” (written iff), means P⇒QP \Rightarrow Q and Q⇒PQ \Rightarrow P. It is true when PP and QQ have the same truth value. To prove it, you prove both directions, often labelled (⇒\Rightarrow) and (⇐\Leftarrow), as in the subspace test of 2.1.

    In one line'P if and only if Q' (P⇔QP \Leftrightarrow Q) means both P⇒QP \Rightarrow Q and Q⇒PQ \Rightarrow P.

    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.

    Worked example
    Prove: an integer nn is odd if and only if n+1n + 1 is even.

    Solution. An integer is even if it equals 2k2k for some integer kk, and odd if it equals 2k+12k + 1 for some integer kk. We prove the two directions separately.

    1. Direction (⇒\Rightarrow): assume nn is odd. Then n=2k+1n = 2k + 1 for some integer kk. This direction is “odd implies n+1n + 1 even”, so the hypothesis is “odd” and we unfold it.
    2. Reach the conclusion. n+1=2k+2=2(k+1)n + 1 = 2k + 2 = 2(k + 1), and k+1k + 1 is an integer, so n+1n + 1 is even. The conclusion “even” needs the form 2(integer)2(\text{integer}).
    3. Direction (⇐\Leftarrow): assume n+1n + 1 is even. Then n+1=2mn + 1 = 2m for some integer mm. This is the converse direction. It is a different statement, so it needs its own proof.
    4. Reach the conclusion. n=2m−1=2(m−1)+1n = 2m - 1 = 2(m - 1) + 1, and m−1m - 1 is an integer, so nn is odd. The conclusion “odd” needs the form 2(integer)+12(\text{integer}) + 1.

    Answer. Both P⇒QP \Rightarrow Q and Q⇒PQ \Rightarrow P hold, so nn is odd if and only if n+1n + 1 is even. ■\blacksquare

    Quick checkA theorem says 'If AA is invertible, then det⁡A≠0\det A \ne 0.' Which statement is guaranteed to be true as well?

    Quantifiers

    Definition B

    Quantifier

    The universal quantifier ∀x\forall x reads “for every xx”. The existential quantifier ∃x\exists x reads “there exists (at least one) xx”. Putting a quantifier in front of a predicate turns it into a statement. "∀x∈R, x2≥0\forall x \in \mathbb R,\ x^2 \ge 0" is true. "∃x∈R, x2=−1\exists x \in \mathbb R,\ x^2 = -1" is false.

    In one line'For every' (∀\forall) and 'there exists' (∃\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.

    Watch out· Hidden quantifiers

    Theorems often hide their “for every”. “If nn is even then n2n^2 is even” means “for every integer nn: if nn is even, then n2n^2 is even”. A proof must work for an arbitrary nn, not for n=4n = 4. Before proving anything, rewrite the statement with every quantifier visible.

    Quick checkDoes '∀x∈R, x2>0\forall x \in \mathbb R,\ x^2 > 0' hold?

    The order of quantifiers matters. The cleanest example uses xx and yy ranging over the real numbers.

    Worked example
    Compare ∀x ∃y: y>x\forall x\ \exists y:\ y > x with ∃y ∀x: y>x\exists y\ \forall x:\ y > x.

    Solution.

    1. Read the first one as a game. “For every xx, there is a yy with y>xy > x.” You name any xx; I then get to choose yy, knowing your xx. The variable that comes later may depend on the ones before it.
    2. Decide it. Whatever xx you name, I answer y=x+1y = x + 1. So it is true. My yy is allowed to depend on your xx.
    3. Read the second one. “There is a yy such that for every xx, y>xy > x.” Now I must commit to one yy first, and then it has to beat every xx you could name. Here yy comes first, so it cannot depend on xx.
    4. Decide it. Whatever yy I pick, you name x=y+1x = y + 1, and y>xy > x 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 ∀\forall and ∃\exists changed which player moves first, and so changed the meaning.

    Your answerLet xx and yy range over {1,2,3,4,5,6}\{1, 2, 3, 4, 5, 6\}. For how many values of xx is the statement '∀y: xy≤12\forall y:\ xy \le 12' true?
    Worked example
    Does '∃x: (x is even and x is odd)\exists x:\ (x \text{ is even and } x \text{ is odd})' say the same as '(∃x: x is even)∧(∃x: x is odd)(\exists x:\ x \text{ is even}) \land (\exists x:\ x \text{ is odd})'? Let xx range over the integers.

    Solution.

    1. Read the first sentence. It asks for ONE integer that is both even and odd. One quantifier covers the whole bracket, so a single xx must satisfy both parts.
    2. 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.
    3. Read the second sentence. It has two separate quantifiers. The first xx is even and the second may be a different integer that is odd. Each ∃\exists introduces its own xx, and the two do not have to agree.
    4. Decide it. x=2x = 2 is even and x=3x = 3 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 ∃\exists cannot be split across an “and” when the same xx must serve both parts. (The mirror case, with ∀\forall and “or”, is one of the problems below.)

    A preview· Preview: the limit definition is this game

    "an→La_n \to L" means: ∀ε>0 ∃N ∀n>N: ∣an−L∣<ε\forall \varepsilon > 0\ \exists N\ \forall n > N:\ |a_n - L| < \varepsilon. You (the sceptic) pick ε\varepsilon; the prover answers with NN, which may depend on ε\varepsilon. 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.

    Definition B

    Negation

    The negation ¬S\neg S of a statement SS is true exactly when SS 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.

    Fact B

    Rules for negating

    1. ¬(P∧Q)\neg(P \land Q) is ¬P∨¬Q\neg P \lor \neg Q. (De Morgan)
    2. ¬(P∨Q)\neg(P \lor Q) is ¬P∧¬Q\neg P \land \neg Q. (De Morgan)
    3. ¬(P⇒Q)\neg(P \Rightarrow Q) is P∧¬QP \land \neg Q.
    4. ¬(∀x P(x))\neg(\forall x\ P(x)) is ∃x ¬P(x)\exists x\ \neg P(x).
    5. ¬(∃x P(x))\neg(\exists x\ P(x)) is ∀x ¬P(x)\forall x\ \neg P(x).

    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.

    Proofstandard
    The idea: For each rule, describe exactly when the original statement is false; that description is the rule's right side.
    Rule 1: P∧QP \land Q is false exactly when PP is false or QQ is false.
    'P and Q' needs both. It fails as soon as one of them fails.
    Rule 2: P∨QP \lor Q is false exactly when PP is false and QQ is false.
    'P or Q' needs at least one. It fails only when both fail.
    Rule 3: P⇒QP \Rightarrow Q is false exactly when PP is true and QQ is false.
    From the truth table of implication: the only false row is P true, Q false.This is the rule missed on CS 240 Exam 1. The negation of an if-then is an AND, never another if-then.
    Rule 4: ∀x P(x)\forall x\ P(x) is false exactly when some xx has P(x)P(x) false.
    'Every x works' fails as soon as one x does not work.
    Rule 5: ∃x P(x)\exists x\ P(x) is false exactly when every xx has P(x)P(x) false.
    'Some x works' fails only when no x works, that is, every x fails.

    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.

    Worked example
    Use a truth table to show ¬(P∧Q)\neg(P \land Q) and ¬P∨¬Q\neg P \lor \neg Q always agree (De Morgan, rule 1).

    Solution.

    1. List the rows. Two letters give 2×2=42 \times 2 = 4 rows: (P,Q)(P, Q) = TT, TF, FT, FF. Every combination must appear once, or the check could miss a case.
    2. Fill the left side ¬(P∧Q)\neg(P \land Q). First P∧QP \land Q is T, F, F, F. Negating gives F, T, T, T. P∧QP \land Q is true only in row TT, and the ‘not’ flips each entry.
    3. Fill the right side ¬P∨¬Q\neg P \lor \neg Q. ¬P\neg P is F, F, T, T and ¬Q\neg Q 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).
    4. 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 ¬(P∧Q)\neg(P \land Q) and ¬P∨¬Q\neg P \lor \neg Q 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 ∀\forall to ∃\exists and each ∃\exists to ∀\forall, and using rule 3 when you reach an if-then.

    Worked example CS 240 Exam 1
    Negate: 'If 3n+43n + 4 is odd, then n−3n - 3 is even' (for every integer nn).

    Solution.

    1. Make the hidden quantifier visible. The statement is ∀n∈Z: (3n+4 odd)⇒(n−3 even)\forall n \in \mathbb Z:\ (3n + 4 \text{ odd}) \Rightarrow (n - 3 \text{ even}). Theorems about integers speak about every integer unless they say otherwise.
    2. Negate the quantifier. ∃n∈Z: ¬((3n+4 odd)⇒(n−3 even))\exists n \in \mathbb Z:\ \neg\big((3n + 4 \text{ odd}) \Rightarrow (n - 3 \text{ even})\big). Rule 4.
    3. Negate the implication. ∃n∈Z: (3n+4 odd)∧(n−3 odd)\exists n \in \mathbb Z:\ (3n + 4 \text{ odd}) \land (n - 3 \text{ odd}). Rule 3: the negation of if-then is AND. Note ‘not even’ is ‘odd’ for integers.

    Answer. “There is an integer nn with 3n+43n + 4 odd and n−3n - 3 odd.” A proof by contradiction assumes exactly this and derives something impossible. The wrong version, “if 3n+43n + 4 is odd then n−3n - 3 is odd”, is another if-then statement, and assuming it leads nowhere.

    Worked example
    Disprove: 'For every real xx, if x2>4x^2 > 4 then x>2x > 2.'

    Solution.

    1. Write the negation. ∃x∈R: x2>4∧x≤2\exists x \in \mathbb R:\ x^2 > 4 \land x \le 2. Rules 4 and 3. To disprove a ‘for every’, exhibit one xx for which the negation holds.
    2. Find a witness. x=−3x = -3: x2=9>4x^2 = 9 > 4 and −3≤2-3 \le 2. Negative numbers have large squares but are small.

    Answer. The statement is false, and x=−3x = -3 is a counterexample: an object that makes the negation true.

    Your answerFor how many integers nn from 11 to 1010 is the statement 'if nn is prime, then nn is odd' false?
    Worked example
    A function ff is increasing if ∀x ∀y: x<y⇒f(x)<f(y)\forall x\ \forall y:\ x < y \Rightarrow f(x) < f(y). Write what 'not increasing' means, and show f(x)=x2f(x) = x^2 on R\mathbb R is not increasing.

    Solution.

    1. Write the definition with every quantifier visible. ∀x ∀y: (x<y)⇒(f(x)<f(y))\forall x\ \forall y:\ (x < y) \Rightarrow (f(x) < f(y)). Start from the full sentence so that nothing is hidden.
    2. Negate the two ∀\forall‘s. ∃x ∃y: ¬((x<y)⇒(f(x)<f(y)))\exists x\ \exists y:\ \neg\big((x < y) \Rightarrow (f(x) < f(y))\big). Rule 4, applied twice. Each ∀\forall becomes ∃\exists and the ‘not’ moves right.
    3. Negate the implication. ∃x ∃y: x<y∧f(x)≥f(y)\exists x\ \exists y:\ x < y \land f(x) \ge f(y). Rule 3: the negation of if-then is AND. Also, ‘not less than’ is ‘greater than or equal’.
    4. 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.
    5. Find a witness for f(x)=x2f(x) = x^2. Take x=−2x = -2 and y=−1y = -1. Then x<yx < y, and f(x)=4≥1=f(y)f(x) = 4 \ge 1 = f(y). The square of a negative number gets bigger as the number moves away from 0.

    Answer. ‘Not increasing’ means: there are x<yx < y with f(x)≥f(y)f(x) \ge f(y). The pair (−2,−1)(-2, -1) shows x2x^2 is not increasing on R\mathbb R.

    Quick checkWhich is the negation of 'Every vector space has a basis with 3 elements'?
    Quick checkWhich is the negation of 'Some student passed every exam'?
    Proof workshopGive the reason for each step of this negation

    Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.

    1. ¬(∀x ∃y: x+y=0)\neg\big(\forall x\ \exists y:\ x + y = 0\big)
    2. ∃x ¬(∃y: x+y=0)\exists x\ \neg\big(\exists y:\ x + y = 0\big)
    3. ∃x ∀y: ¬(x+y=0)\exists x\ \forall y:\ \neg(x + y = 0)
    4. ∃x ∀y: x+y≠0\exists x\ \forall y:\ x + y \ne 0

    Reading a theorem, step by step

    Before proving any theorem, do these four things. They take a minute and prevent most wrong proofs.

    1. Name the objects and their types: integers, real numbers, vectors, functions.
    2. Write every quantifier, including hidden ones, in order.
    3. Split hypothesis from conclusion. What may you assume? What must you show?
    4. Write the negation of the conclusion (for contradiction) and of the whole statement (to look for counterexamples).
    Worked example Apostol Thm 1.5; 2.2
    Read the statement behind Apostol's Theorem 1.5: 'If kk vectors span a space, then any k+1k + 1 vectors in that space are linearly dependent.'

    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 OO.

    1. Name the objects. A vector space VV; vectors x1,…,xkx_1, \dots, x_k in VV that span VV; vectors y1,…,yk+1y_1, \dots, y_{k+1} in VV. Know what each letter is before reading further.
    2. Write the quantifiers. For every VV, every k≥1k \ge 1, every x1,…,xkx_1, \dots, x_k that span VV, and every list y1,…,yk+1y_1, \dots, y_{k+1} in VV: the yy‘s are dependent. ‘Any k+1k + 1 vectors’ is a hidden ‘for every’.
    3. Split hypothesis from conclusion. Hypothesis: the xx‘s span VV (so each yiy_i is a combination of the xx‘s). Conclusion: there exist c1,…,ck+1c_1, \dots, c_{k+1}, not all zero, with ∑ciyi=O\sum c_i y_i = O. Unfolding ‘dependent’ gives a conclusion containing an ‘exists’.
    4. Say what a proof must do. Take arbitrary xx‘s and yy‘s satisfying the hypothesis and construct the cic_i. An ‘exists’ in the conclusion means the proof must produce something. The proof cannot just argue that none is impossible.
    5. Write the negation, to know what a counterexample would be. kk vectors that span VV and k+1k + 1 vectors in VV 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 cic_i. The proof in 2.2 builds them by induction.

    Where it is used

    Used inside maths· Inside maths: every definition is a quantified sentence

    A function ff is continuous at aa if ∀ε>0 ∃δ>0 ∀x: ∣x−a∣<δ⇒∣f(x)−f(a)∣<ε\forall \varepsilon > 0\ \exists \delta > 0\ \forall x:\ |x - a| < \delta \Rightarrow |f(x) - f(a)| < \varepsilon. 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.

    Used in the real world· Computer science: specifications and databases

    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 ii, output[i]≤[i] \le output[i+1][i+1]”. 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 ∀\forall 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: ∀\forall is the same as “not exists not”.

    Traps

    Watch out· The negation of if-then is AND

    ¬(P⇒Q)\neg(P \Rightarrow Q) is P∧¬QP \land \neg Q. It is never "P⇒¬QP \Rightarrow \neg Q". Proof by contradiction of “if P then Q” assumes P and not-Q together.

    Watch out· A converse is a different theorem

    Proving Q⇒PQ \Rightarrow P does not prove P⇒QP \Rightarrow Q. When a proof seems to work too easily, check that you did not prove the converse.

    Watch out· 'Or' includes both

    In mathematics ”PP or QQ” is true when both hold. ”nn is even or nn is divisible by 3” is true for n=6n = 6.

    Watch out· An example is not a proof of 'for every'

    Checking n=1,2,3n = 1, 2, 3 proves nothing about all nn. But one counterexample DOES disprove a ‘for every’, and one example DOES prove a ‘there exists’.

    Problems

    check

    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 det⁡A=0\det A = 0, then AA has two equal rows (false: [1224]\begin{bmatrix}1&2\\2&4\end{bmatrix}). Contrapositive: if det⁡A≠0\det A \ne 0, then AA has no two equal rows (true, since it is equivalent to the original, which is true).

    check

    Is “If 1=21 = 2, 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.

    check

    Negate: “There is an integer nn such that n2=2n^2 = 2.”

    Solution

    “For every integer nn, n2≠2n^2 \ne 2.” (Rule 5.) This negation is the true one.

    use

    Negate, and decide which version is true: “For every real x>0x > 0 there is a real y>0y > 0 with y<xy < x.”

    Solution

    Negation: there is a real x>0x > 0 such that for every real y>0y > 0, y≥xy \ge x. The original is true: given x>0x > 0, take y=x/2y = x/2. So the negation is false.

    use

    Write the definition “the vectors x1,…,xkx_1, \dots, x_k are linearly independent” with explicit quantifiers, then negate it. What familiar definition do you get?

    Solution

    Independent: for all scalars c1,…,ckc_1, \dots, c_k, if ∑cixi=O\sum c_i x_i = O then every ci=0c_i = 0. Negation: there exist c1,…,ckc_1, \dots, c_k with ∑cixi=O\sum c_i x_i = O and not every ci=0c_i = 0 (rules 4 and 3). That is exactly the definition of linearly dependent in 2.2.

    use

    ff is called bounded if ∃M ∀x: ∣f(x)∣≤M\exists M\ \forall x:\ |f(x)| \le M. Write what ”ff is not bounded” means, and show f(x)=xf(x) = x on R\mathbb R is not bounded.

    Solution

    Not bounded: ∀M ∃x: ∣f(x)∣>M\forall M\ \exists x:\ |f(x)| > M. For f(x)=xf(x) = x: given any MM, take x=∣M∣+1x = |M| + 1; then ∣f(x)∣=∣M∣+1>M|f(x)| = |M| + 1 > M.

    prove

    Prove with a truth table, then explain in words, that P⇒QP \Rightarrow Q and ¬P∨Q\neg P \lor Q are equivalent.

    Solution

    Rows (P, Q): (T,T): both true. (T,F): P⇒QP \Rightarrow Q false; ¬P∨Q\neg P \lor Q = 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

    Prove that P⇔QP \Leftrightarrow Q is equivalent to (P⇒Q)∧(¬P⇒¬Q)(P \Rightarrow Q) \land (\neg P \Rightarrow \neg Q). Why does this give a second way to prove an “if and only if”?

    Solution

    ¬P⇒¬Q\neg P \Rightarrow \neg Q is the contrapositive of Q⇒PQ \Rightarrow P, so it has the same truth value. Hence the right side has the same truth value as (P⇒Q)∧(Q⇒P)(P \Rightarrow Q) \land (Q \Rightarrow P), which is the definition of P⇔QP \Leftrightarrow Q. So to prove an iff you may prove “P implies Q” and “not P implies not Q”.

    prove

    Explain why "∀x (P(x)∧Q(x))\forall x\ (P(x) \land Q(x))" is equivalent to "(∀x P(x))∧(∀x Q(x))(\forall x\ P(x)) \land (\forall x\ Q(x))", but "∀x (P(x)∨Q(x))\forall x\ (P(x) \lor Q(x))" is NOT equivalent to "(∀x P(x))∨(∀x Q(x))(\forall x\ P(x)) \lor (\forall x\ Q(x))". Give a counterexample for the second.

    Solution

    First: both sides say every xx satisfies both properties. Second: take xx ranging over integers, P(x)P(x) = ”xx is even”, Q(x)Q(x) = ”xx 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.

    stretch

    ff is uniformly continuous if ∀ε>0 ∃δ>0 ∀x ∀y: ∣x−y∣<δ⇒∣f(x)−f(y)∣<ε\forall \varepsilon > 0\ \exists \delta > 0\ \forall x\ \forall y:\ |x - y| < \delta \Rightarrow |f(x) - f(y)| < \varepsilon. Compare with continuity at every point: ∀a ∀ε>0 ∃δ>0 ∀x: ∣x−a∣<δ⇒∣f(x)−f(a)∣<ε\forall a\ \forall \varepsilon > 0\ \exists \delta > 0\ \forall x:\ |x - a| < \delta \Rightarrow |f(x) - f(a)| < \varepsilon. Which quantifiers moved, and what does that change? Write the negation of uniform continuity.

    Solution

    In continuity the point aa comes before δ\delta, so δ\delta may depend on aa. In uniform continuity δ\delta comes before xx and yy, so one δ\delta must work everywhere at once. Negation: ∃ε>0 ∀δ>0 ∃x,y: ∣x−y∣<δ∧∣f(x)−f(y)∣≥ε\exists \varepsilon > 0\ \forall \delta > 0\ \exists x, y:\ |x - y| < \delta \land |f(x) - f(y)| \ge \varepsilon. (Chapter 1.3 shows f(x)=x2f(x) = x^2 on R\mathbb R is continuous but not uniformly continuous.)

    Summary

    • A theorem is a sentence; read it exactly before proving it.
    • P⇒QP \Rightarrow Q is false only when PP is true and QQ is false. It means the same as ¬P∨Q\neg P \lor Q and as its contrapositive ¬Q⇒¬P\neg Q \Rightarrow \neg P; it does NOT mean the same as its converse Q⇒PQ \Rightarrow P.
    • 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.

    Watch and read

    The same ideas explained by someone else. Use these when an explanation here does not land.

    Where this sits

    Comes from
    Nothing earlier in this volume
    Leads to
    2.1 Vector spaces and subspaces
    Same idea elsewhere
    CS 240: This is CS 240's logic, reread for proofs. You already know truth tables; this chapter is about using them while reading and writing mathematics.
    Exam 1 (CS 240): Your one miss was negating 'if P then Q' as 'if P then not Q'. The section on negation fixes exactly this.
    MATH 521: Every definition in analysis (limit, continuity, uniform convergence) is a sentence with three alternating quantifiers. Reading them is the whole skill.