Part 2
Part 2
5 Techniques of proof
5 Techniques of proof
4 Logic
Statements and basic logical operators
Equivalence (1)
Quantifiers
Implications
Equivalence (2)
4 Logic
Statements and basic logical operators
Equivalence (1)
Quantifiers
Implications
Equivalence (2)
Example 4.2
1 ‘1 + 1 = 2’ is a true statement.
2 ‘If x is odd then x 2 is odd’ is a true statement.
3 ‘Earth has four moons’ is a statement that is false.
4 ‘How are you?’ is not a statement.
5 ‘Close the window!’ is not a statement.
6 ‘42’ is not a statement.
7 ‘Sundays are great’ is not a statement.
8 ‘x > 2’ is a statement. However, we cannot determine the truth value
without further information.
4 Logic
Statements and basic logical operators
Equivalence (1)
Quantifiers
Implications
Equivalence (2)
Example 4.6
The statement ¬(P ∧ Q) is equivalent to the statement (¬P) ∨ (¬Q):
Example 4.7
We can use the above equivalences to show that
A ∩ (B ∪ C ) = (A ∩ B) ∪ (A ∩ C )
for arbitrary sets A, B and C :
per def.
x ∈ A ∩ (B ∪ C ) ⇐⇒ x ∈A ∧ x ∈B ∪C
per def.
⇐⇒ x ∈ A ∧ (x ∈ B ∨ x ∈ C )
distr. law
⇐⇒ (x ∈ A ∧ x ∈ B) ∨ (x ∈ A ∧ x ∈ C )
per def.
⇐⇒ x ∈A∩B ∨ x ∈A∩C
per def.
⇐⇒ x ∈ (A ∩ B) ∪ (A ∩ C )
4 Logic
Statements and basic logical operators
Equivalence (1)
Quantifiers
Implications
Equivalence (2)
Example 4.9
1 ‘x 2 ≥ 0 for all x ∈ R’ is a true statement containing the universal
quantifier. Written in symbols:
∀x ∈ R : x 2 ≥ 0.
2 The statement ‘For all x ∈ Z and for all y ∈ Z the sum x + y and the
product xy are integers.’ can be written as
∀x ∈ Z ∀y ∈ Z : (x + y ∈ Z ∧ xy ∈ Z)
or
∀x, y ∈ Z : (x + y ∈ Z ∧ xy ∈ Z).
Example 4.11
1 ‘There exists an integer x such that x 2 = 2’ is a false statement
containing the existential quantifier. Written in symbols:
∃x ∈ Z : x 2 = 2.
Warning!
The order of quantifiers is important.
Example 4.13
Compare the following two statements:
(i) ∀♂ ∃ ♀ : ♂ ♥ ♀
(ii) ∃ ♀ ∀♂ : ♂ ♥ ♀
Negation of quantifiers:
Suppose that the statement ∀x ∈ S : P(x) is true, where P(x) is a
statement involving x. The negation of this is that P(x) does not hold for
all x ∈ S. So there must exist at least one x ∈ S such that P(x) is false,
i.e. such that ¬P(x) is true. Therefore:
Similarly,
¬(∃x ∈ S : P(x)) ⇔ ∀x ∈ S : ¬P(x).
Example 4.14
The negation of the statement ‘All dogs are black’ is not ‘All dogs are not
black’ ! Rather, if the statement ‘All dogs are black’ is false, then that
means that there is at least one dog that is not black.
For the negation of statements with multiple quantifiers the following rule
applies:
Negation of quantifiers
To negate a statement of the form
Q1 x1 ∈ S1 Q2 x2 ∈ S2 . . . Qn xn ∈ Sn : P(x1 , x2 , . . . , xn ),
Example 4.15
The negation of
∃a ∈ R ∀ε > 0 ∀N ∈ N ∃n ≥ N : |an − a| < ε
is
∀a ∈ R ∃ε > 0 ∃N ∈ N ∀n ≥ N : |an − a| ≥ ε.
4 Logic
Statements and basic logical operators
Equivalence (1)
Quantifiers
Implications
Equivalence (2)
Example 4.17
Consider the implication
x > 2 ⇒ x 2 > 4.
This implication is always true, no matter what value x is.
Note: If the premise x > 2 is false, i.e. if x ≤ 2, the implication is still
true, since it does not claim anything in the case x ≤ 2. And indeed, in
this example anything can happen for x ≤ 2:
For x = 1 we have x 2 = 1, that is the conclusion x 2 > 4 is false.
But for x = −3 we have x 2 = 9, which means that in this instance
the conclusion x 2 > 4 is true.
Example 4.19
The implication ‘If I am Austrian, then I am European’ is true. The
contrapositive ‘If I am not European, then I am not Austrian’ is also true.
This is not a coincidence, as the following truth table shows:
P Q P ⇒Q ¬Q ¬P ¬Q ⇒ ¬P
1 1 1 0 0 1
1 0 0 1 0 0
0 1 1 0 1 1
0 0 1 1 1 1
Theorem 4.20
The implication ‘P ⇒ Q’ and its contrapositive ‘¬Q ⇒ ¬P’ are equivalent.
Evelina Erlacher Think Maths! 60 / 288
Logic Implications
Example 4.22
1 The implication ‘If I am Austrian, then I am European’ is true.
However, the converse ‘If I am European, then I am Austrian’ is false.
2 The implication ‘If x is positive, then −x is negative’ is true. The
converse ‘If −x is negative, then x is positive’ is also true.
Warning!
In general, the truth of ‘P ⇒ Q’ says nothing about the truth of its
converse ‘Q ⇒ P’.
Example 4.24
1 ‘If I am Austrian, then I am European’ is true. However, the inverse
‘If I am not Austrian, then I am not European’ is false.
2 ‘If x is positive, then −x is negative’ is true. The inverse ‘If x is not
positive, then −x is not negative’ is also true.
Warning!
In general, the truth of ‘P ⇒ Q’ says nothing about the truth of its
inverse ‘¬P ⇒ ¬Q’.
However, in everyday speech an implication and its inverse are often
treated as if they were equivalent.
Example 4.25
1 ‘If you don’t tidy your room, then you won’t get ice-cream’ will be
interpreted as the contract: ‘If you tidy your room, then you will get
ice-cream’, even though the original implication says nothing about
what will happen if the room is tidied.
2 Consider the statement ‘If you are a mathematician, then you are
intelligent’, and assume that it is true. This implication says nothing
about the intelligence of non-mathematicians. Yet people may get
offended as they will believe that it insults non-mathematicians: ‘Hey,
I’m a cook. Are you saying I’m stupid?’
Note: Let ‘P ⇒ Q’ be an implication. Then the converse ‘Q ⇒ P’ is
equivalent to the inverse ‘¬P ⇒ ¬Q’.
Negation of implications:
Looking at the truth table for ‘⇒’, we see that the implication ‘P ⇒ Q’ is
false only in the case where P is true and Q is false. Therefore, we create
a truth table for ‘¬(P ⇒ Q)’ and compare it with ‘P ∧ ¬Q’:
P Q P ⇒Q ¬(P ⇒ Q) ¬Q P ∧ ¬Q
1 1 1 0 0 0
1 0 0 1 1 1
0 1 1 0 0 0
0 0 1 0 1 0
Theorem 4.26
The statements ‘¬(P ⇒ Q)’ and ‘P ∧ ¬Q’ are equivalent.
Note: Since ‘¬(¬(P ⇒ Q))’ is equivalent to ‘P ⇒ Q’, also the
statements ‘P ⇒ Q’ and ‘¬(P ∧ ¬Q)’ are equivalent.
Applying implications
Let A, B, C and D be statements. Assume that the following implications
are true:
(I) B ∧ C ⇒ ¬A ∧ D (II) ¬D ⇒ ¬A ∨ C
(I) B ∧ C ⇒ ¬A ∧ D (II) ¬D ⇒ ¬A ∨ C
(c-I) A ∨ ¬D ⇒ ¬B ∨ ¬C (c-II) A ∧ ¬C ⇒ D
4 Logic
Statements and basic logical operators
Equivalence (1)
Quantifiers
Implications
Equivalence (2)
Theorem 4.27
The statements P and Q are equivalent if and only if P implies Q and
Q implies P.
The statement in logical symbols:
(P ⇔ Q) ⇔ (P ⇒ Q) ∧ (Q ⇒ P)
Proof.
P Q P ⇔Q P ⇒Q Q⇒P (P ⇒ Q) ∧ (Q ⇒ P)
1 1 1 1 1 1
1 0 0 0 1 0
0 1 0 1 0 0
0 0 1 1 1 1
Example 4.28
The statement
x2 − x − 2 = 0 ⇔ x = −1 or x = 2
is true:
Solving the equation yields the solutions −1 and 2. Hence, the ‘⇒’
direction is true.
Conversely, plugging −1 and 2 into the left hand side of the equation
gives 0. Thus, also the ‘⇐’ direction is true.
Example 4.29
The statement
x2 − x − 2 = 0 ⇔ x = −1 or x = 2 or x = 5
is not true:
The ‘⇒’ direction ‘If x solves the equation, then x is −1, 2 or 5’ is
true since all solutions of the equation are listed on the right hand
side. For the ‘⇒’ direction it does not matter that 5 is not a solution
of the equation.
The ‘⇐’ direction ‘If x equals −1, 2 or 5, then x 2 − x − 2 = 0’ is
false. To check this we plug −1, 2 and 5 into the left hand side of the
equation. For x = 5 we get 18, not 0. Therefore, the ‘⇐’ direction is
false.
Warning!
When solving equations we pass from one line to the next by showing that
the first implies the second. However, it is important to check if also the
second line implies the first!
Example 4.30
√
x −1 = x +5
2
(x − 1) = x +5
2
x − 2x + 1 = x + 5
x 2 − 3x − 4 = 0
(x − 4)(x + 1) = 0
The problem in the above example arises because squaring both sides of
an equation f (x) = g (x) and then solving it gives solutions to
−f (x) = g (x) as well.
We again look at the equation, this time also writing out all implications:
√
x −1= x +5
⇒ (x − 1)2 = x + 5
⇔ x 2 − 2x + 1 = x + 5
⇔ x 2 − 3x − 4 = 0
⇔ (x − 4)(x + 1) = 0
5 Techniques of proof
5 Techniques of proof
Direct proof
Proof by contrapositive
Proof by contradiction
Without loss of generality
Common methods for proving . . .
Counterexamples
Induction
Common mistakes
Further examples
5 Techniques of proof
Direct proof
Proof by contrapositive
Proof by contradiction
Without loss of generality
Common methods for proving . . .
Counterexamples
Induction
Common mistakes
Further examples
Theorem 5.2
Let n be an integer. If n is even, then n2 is even.
Proof (direct).
Let n be an even integer. Then n = 2k for some integer k. Hence,
n2 = (2k)2 = 4k 2 = 2(2k 2 ).
Proof.
\ c \
per def.
x∈ Ai ⇐⇒ x∈
/ Ai
rewrite
\
⇐⇒ ¬(x ∈ Ai )
per def.
⇐⇒ ¬(∀i : x ∈ Ai )
negation
⇐⇒ ∃i : x ∈
/ Ai
per def.
⇐⇒ ∃i : x ∈ Aci
per def.
[
⇐⇒ x∈ Aci
5 Techniques of proof
Direct proof
Proof by contrapositive
Proof by contradiction
Without loss of generality
Common methods for proving . . .
Counterexamples
Induction
Common mistakes
Further examples
5 Techniques of proof
Direct proof
Proof by contrapositive
Proof by contradiction
Without loss of generality
Common methods for proving . . .
Counterexamples
Induction
Common mistakes
Further examples
Another technique of proof uses the fact that a statement P is either true
or false, without a third possibility. Therefore, if we proof that ¬P is false
the statement P must be true.
Proof by contradiction
A proof by contradiction of a statement P consists of assuming that the
negation of P is true, and then using small logical steps and applying
definitions, axioms and previously established statements until a
contradiction results.
Theorem 5.5
√
The number 2 is irrational.
√
Statement: 2 is irrational.
√
Negation of statement: 2 is rational.
√ m m2
2= ⇒ 2= ⇒ 2n2 = m2 .
n n2
This implies that m2 is even, since it is the product of 2 and n2 . By
Theorem 5.4, it follows that also m is even. So, m = 2k for some integer
k. Using the equation 2n2 = m2 , we get
Theorem 5.6
Let x be a rational number. If y is an irrational number, then x + y is also
an irrational number.
Givens: x ∈ Q
Hypothesis: y ∈ R\Q
Conclusion: x + y ∈ R\Q ⇒ Negation of conclusion: x + y ∈ Q
Proof (by contradiction).
Suppose to the contrary that x ∈ Q, y ∈ R\Q and x + y ∈ Q. Then there
exist integers a, b, c and d such that
a c
x= and x +y = .
b d
It follows that c a bc − ad
y =x +y −x = − = .
d b bd
Since bc − ad ∈ Z and bd ∈ Z, this means that y ∈ Q. However, this is a
contradiction to the assumption that y is irrational. Therefore, the
theorem must be true.
Evelina Erlacher Think Maths! 87 / 288
Techniques of proof Without loss of generality
5 Techniques of proof
Direct proof
Proof by contrapositive
Proof by contradiction
Without loss of generality
Common methods for proving . . .
Counterexamples
Induction
Common mistakes
Further examples
Theorem 5.7
Let n, m ∈ Z. If nm is odd, then also n and m are odd.
5 Techniques of proof
Direct proof
Proof by contrapositive
Proof by contradiction
Without loss of generality
Common methods for proving . . .
Counterexamples
Induction
Common mistakes
Further examples
. . . that two sets are equal: If you cannot show A = B directly, prove
that A ⊆ B and B ⊆ A.
Proof.
Let x, y ∈ Q. Then, by definition, there exist a, b, c, d ∈ Z such that
x = ba and y = dc . Hence,
a c ad + bc
x +y = + = .
b d bd
Since ad + bc ∈ Z and bd ∈ Z, we conclude that x + y ∈ Q.
Note: Every statement of the form ‘∀x ∈ S : P(x)’ can be rewritten as
the implication ‘x ∈ S ⇒ P(x)’.
Evelina Erlacher Think Maths! 93 / 288
Techniques of proof Common methods for proving . . .
Theorem 5.9
∃x, y ∈ Z : 168x + 238y = 126.
Proof.
Choose x = −63 and y = 45. Then
Note: In general, such a proof does not show how the proof finder came
up with the particular value of x (and y ) at the start of the proof.
Theorem 5.10
For every odd integer a there exist integers b and c such that a = b 2 − c 2 .
Proof.
Let a be an odd integer. Then, by definition, there exists k ∈ Z such that
a = 2k + 1. Choose b = k + 1 and c = k. Then
b 2 − c 2 = (k + 1)2 − k 2 = k 2 + 2k + 1 − k 2 = 2k + 1 = a.
Proof by cases
One can sometimes prove a statement by:
1 dividing the situation into cases which exhaust all the possibilities,
and then
2 showing that the statement follows in all cases.
5 Techniques of proof
Direct proof
Proof by contrapositive
Proof by contradiction
Without loss of generality
Common methods for proving . . .
Counterexamples
Induction
Common mistakes
Further examples
Theorem 5.12
Let n and m be integers. If both n and m are even, then nm is even.
To prove this implication we have to show that the product of two
arbitrary even integers is even (this is left as an exercise). An implication
is true if and only if it is true for all instances.
We can now ask, if also the converse is true:
Incorrect Theorem
Let n and m be integers. If nm is even, then both n and m are even.
This implication is generally false. To prove that an implication is generally
false it suffices to give one example that contradicts the implication. One
and only one is needed. Such an example is called a counterexample.
Counterexample
Let n = 2 and m = 3.
Then: LHS: ‘nm = 2 · 3 = 6 is even’ is true
RHS: ‘n = 2 is even and m = 3 is even’ is false
Evelina Erlacher Think Maths! 98 / 288
Techniques of proof Counterexamples
Note: The notation P ; Q only says, that at least one example exists
such that P ⇒ Q is false, i.e. that P ∧ ¬Q is true. However, P ; Q does
not mean that P ⇒ Q is always false!
Example 5.13
Again, consider the generally false implication
Example 5.14
Are the following implications true? Prove your answer!
Note: To prove that an implication is generally false give a
counterexample.
1 x2 = y2 ⇒ x = y (x, y ∈ R)
Answer: In general, the statement is false.
Counterexample: x = 1, y = −1.
Then: LHS: 12 = (−1)2 is true
RHS: 1 = −1 is false.
2 5|(a2 − 1) ⇒ 5|(a + 1) (a ∈ Z)
Answer: In general, the statement is false.
Counterexample: a = 6.
Then: LHS: 5|(62 − 1) = 35 is true
RHS: 5|(6 + 1) = 7 is false.
Evelina Erlacher Think Maths! 100 / 288
Techniques of proof Induction
5 Techniques of proof
Direct proof
Proof by contrapositive
Proof by contradiction
Without loss of generality
Common methods for proving . . .
Counterexamples
Induction
Common mistakes
Further examples
Pn
We will prove that i=1 i = 21 n(n + 1) for all n ∈ N.
The statement
n
X 1
i = n(n + 1)
2
i=1
Initial step: We have to show that P(1) is true. For n = 1, the left-hand
side is
Xn X1
i= i =1
i=1 i=1
Inductive step: We have to prove that if the statement P(k) is true, then
P(k + 1) is true as well. Let us assume that P(k) is true for some
arbitrary k (inductive hypothesis). That is,
k
X 1
i = k(k + 1).
2
i=1
We have
k+1 k
!
X X
i = i + (k + 1)
i=1 i=1
ind. hyp. 1
= k(k + 1) + (k + 1)
2
1
= (k + 1) k +1
2
1
= (k + 1) (k + 2)
2
1
= (k + 1)((k + 1) + 1).
2
Thus, P(k + 1) is true if P(k) is true.
5 Techniques of proof
Direct proof
Proof by contrapositive
Proof by contradiction
Without loss of generality
Common methods for proving . . .
Counterexamples
Induction
Common mistakes
Further examples
Fallacious proof.
We have
Fallacious proof.
We start with a = b. Then
a = b |·b
ab = b2 | + b2
b 2 + ab = 2b 2 | − 2ab
b 2 + ab − 2ab = 2b 2 − 2ab
1(b 2 − ab) = 2(b 2 − ab) | : (b 2 − ab)
1 = 2,
5 Techniques of proof
Direct proof
Proof by contrapositive
Proof by contradiction
Without loss of generality
Common methods for proving . . .
Counterexamples
Induction
Common mistakes
Further examples
Theorem 5.18
∀a ∈ R\{1} ∃x ∈ R : ax + 1 = x.
Finding the proof: Solve the equation for x:
ax + 1 = x |−1−x
⇔ x(a − 1) = −1 | : (a − 1)
| {z }
1 6=0
⇔ x=
1−a
Hence, given some a ∈ R\{1}, we have found a solution x of the equation.
However, we still have to write up the proof in a formally correct way:
Proof (direct).
1
Let a ∈ R\{1}. Set x = 1−a , which is defined since a 6= 1. Then
1 a+1−a 1
ax + 1 = a +1= = = x.
1−a 1−a 1−a
Evelina Erlacher Think Maths! 113 / 288
Techniques of proof Further examples
Theorem 5.19
For odd integers n and m the product nm is odd.
Note: We could rewrite the Theorem as
∀n, m ∈ Zodd : nm ∈ Zodd .
or as
n, m ∈ Zodd ⇒ nm ∈ Zodd
In any case, a direct proof will always start with ‘let n, m ∈ Zodd ’ or ‘let n
and m be odd integers’.
Proof (direct).
Let n and m be odd integers. Then, by definition, n = 2k + 1 and
m = 2j + 1 for integers k and j. Hence,
Theorem 5.20
Qn Pn
Let ai > 0 for i = 1, . . . , n. Then i=1 (1 + ai ) > 1+ i=1 ai for all n ≥ 2.
Theorem 5.21
There are infinitely many prime numbers.
Theorem 5.22
Let n ∈ Z. If (n − 3)2 is not divisible by 9, then n is not divisible by 6.
Example 5.23
True or false? Prove your answer!
Note: To prove a statement starting with a chain of quantifiers is false
show that its negation is true. (In the case of a statement starting with
the universal quantifier this means one has to find a counterexample.)
1 ∀x ≥ 0 ∃y ∈ R : xy < 0
Answer: The statement is false. We prove that its negation is true.
Claim: ∃x ≥ 0 ∀y ∈ R : xy ≥ 0
Proof: Choose x = 0. Let y ∈ R. Then xy = 0 · y = 0 ≥ 0. 2
2 ∃x ∈ N ∀y ∈ Q : xy ∈ Z
Answer: The statement is false. We prove that its negation is true.
Claim: ∀x ∈ N ∃y ∈ Q : xy ∈ /Z
1
Proof: Let x ∈ N. Choose y = x+1 . Then y ∈ Q, but
x
xy = x+1 ∈ (0, 1). Hence, xy ∈
/ Z. 2
Example 5.24
True or false? Prove your answer!
1 ∀A ⊆ Z, A 6= ∅ ∃B ( Z : A ∪ B = Z
Answer: The statement is true.
Proof: Let A ⊆ Z with A 6= ∅. Choose B = Z\A. From A 6= ∅ it
follows that B ( Z. Finally, A ∪ B = A ∪ (Z\A) = Z. 2
2 A\B ⊆ C ⇒ A ⊆ C (A, B, C sets)
Answer: In general, the statement is false.
Counterexample: A = {1, 2}, B = {2}, C = {1}.
Then: LHS: A\B = {1} ⊆ C is true
RHS: A = {1, 2} ⊆ {1} = C is false.