Uploaded by davmed2014

Proof Writing

advertisement
WTW 114: Proof Writing
Eder Kikianty
The contents of this document are taken from the following sources.
• Howard Anton and Chris Rorres, Elementary Linear Algebra, 11th Ed., 2010.
• Rod Haggarty, Fundamentals of Mathematical Analysis, 2nd Ed., 1993.
• Kevin Houston, How to Think Like a Mathematician, 2009.
• John van den Berg, Lessons in How to Write Mathematics, University of Pretoria.
1
What is a Proof ?
A mathematical statement is a sentence which can be labelled as true (T) or false (F).
A proof is a “convincing argument” that justifies the truth of a mathematical statement.
What may be convincing to one person may not be convincing to another. In this document,
we establish clear standards on what is considered to be an acceptable proof.
If a mathematical statement is true, we say that the truth value of this statement is true.
Similarly, the truth value of a mathematical statement is false, if the statement is false.
Example 1. Here are some examples of mathematical statements.
1. There are infinitely many prime numbers.
2. The equation x2 + 1 = 0 has a real root.
3. If n is a natural number and n2 is odd, then n is odd.
Comment. Do you know the truth value of each statement in Example 1?
Statement 3 in Example 1 is an instance of three statements that are joined with connectives. Such a statement is referred to as composite statement. Connectives are words
that link, or join, simpler statements together. Some examples of connectives are “and”,
“or”, and “if ... then ...”.
Let P be the statement “n is a natural number”, Q be the statement “n2 is odd”, and R be
the statement “n is odd”, then Statement 3 in Example 1 can be rewritten as follows:
If P and Q, then R.
1
The meaning of these connectives in relation to the truth values of the statements will be
made precise shortly.
1.1
Negation
We begin with the notion of negation of a mathematical statement. Let P be a mathematical statement. The negation of P , commonly denoted by “not P ” or “¬P ” or “ ∼P ”, is
another mathematical statement which has the opposite truth value to that of P .
To be more precise, ¬P is true when P is false, and ¬P is false when P is true. We summarise
this fact neatly in a truth table for negation.
P
T
F
not P
F
T
Example 2.
1. Let P be the statement “3 is an odd number”. Then ¬P is the statement
“3 is not an odd number”. With the knowledge from school that if a natural number
is not odd then it is even, we can rewrite ¬P as “3 is an even number”.
2. Let Q be the statement “All students in WTW114 love calculus”. The simplest way
to write ¬Q is “Not all students in WTW114 love calculus”. However, this is not
mathematically useful. A more useful way of writing ¬Q is “There is a student in
WTW114 that does not love calculus”. There is, in fact, a logical step to obtain this
final form of ¬Q, but we will discuss this at a later stage, in Section 2.
1.2
Conjunction (and) and disjunction (or)
If P and Q are mathematical statements, the composite statement “P and Q”, commonly
denoted by P ∧ Q, is deemed to be true provided both P and Q are true, and false otherwise.
If P and Q are mathematical statements, the composite statement “P or Q”, commonly
denoted by P ∨ Q, is true provided at least one of P and Q is true, and false otherwise. We
summarise these facts in a truth table.
P
T
T
F
F
Q
T
F
T
F
P and Q
T
F
F
F
P or Q
T
T
T
F
Comment. In everyday conversation, “or” is usually interpreted exclusively. For instance,
when saying “you can have ice cream or chocolate”, it is understood that you cannot have
2
both; while in mathematics, “or ” is interpreted inclusively (you can have both ice cream
and chocolate!).
Further comment. There is a notion of exclusive disjunction in mathematics: P ∨ Q
(read: either P or Q) means “P or Q, but not P and Q”. To be more precise, P ∨ Q is true
only in the case when either one of P or Q is true, and the other one is false. Try to write
the truth table yourself.
1.3
Logical equivalence
Two mathematical statements are logically equivalent if they have the same logical content
(have the same truth value).
Example 3. Show that the mathematical statements R = (not (P and (not Q))) and
S =((not P ) or Q) are logically equivalent.
Solution. We use the truth tables of R and S to see whether they are logically equivalent
or not.
P
T
T
F
F
Q
T
F
T
F
not Q
F
T
F
T
P
T
T
F
F
P and (not Q) R = (not (P and (not Q)))
F
T
T
F
F
T
F
T
Q not P
T
F
F
F
T
T
F
T
S = ((not P ) or Q)
T
F
T
T
Since the last columns of the truth tables for R and S are identical, R and S have the same
truth value and therefore are logically equivalent.
1.4
Implication
Let P and Q be two mathematical statements. The statement (P ⇒ Q) is defined by the
following truth table:
P
T
T
F
F
Q
T
F
T
F
P ⇒Q
T
F
T
T
We read (P ⇒ Q) as:
3
• “P implies Q”; or
• “if P then Q”; or
• “Q if P ”, or
• “P is a sufficient condition for Q”; or
• “Q is necessary for P ”.
In this instance, the statement P is called the hypothesis or antecedent and Q is called
the conclusion or consequent.
In practice, a mathematician is interested in situations where (P ⇒ Q) is true. Most
theorems in mathematics are of this form. There are three instances for which the implication
(P ⇒ Q) is true (lines 1, 3, and 4 of the truth table for implication). This leads us to the
following observation for the truth of (P ⇒ Q).
(O1) If P is true, then Q must be true (cf. lines 1 and 2 of the truth table for implication).
(O2) If P is false, then Q may be true or false (cf. lines 3 and 4 of the truth table for
implication) and so no conclusion can be drawn in this case.
The conclusion we made in (O1) is a logical step in order to prove an implication. To prove
that (P ⇒ Q) is true, we assume that P is true, and we deduce that Q is true. We
demonstrate this in Section 4.
1.5
Negation of an implication
First we start with the following statements known as De Morgan’s laws.
• (Not (P and Q)) is logically equivalent to ((not P ) or (not Q)).
• (Not (P or Q)) is logically equivalent to ((not P ) and (not Q)).
As an exercise, prove the above statements using truth tables. We now consider the following
problem:
Show that (P ⇒ Q) is logically equivalent to ((not P ) or Q).
Solution. We compare the truth tables of both statements
P
T
T
F
F
Q
T
F
T
F
P ⇒ Q not P
T
F
F
F
T
T
T
T
((not P ) or Q)
T
F
T
T
The logical contents of (P ⇒ Q) and ((not P ) or Q) in the above truth table are the same.
Therefore (P ⇒ Q) is logically equivalent to ((not P ) or Q).
Equipped with the above logical equivalence and De Morgan’s laws, we conclude that
4
(not (P ⇒ Q)) is logically equivalent to (P and (not Q)).
Warning! The negation of an implication is NOT an implication.
Example 4. Write the negation of the statement: if x2 > 1, then x > 1.
Solution. We want to negate the implication (P ⇒ Q) where P is the statement “x2 > 1”
and Q is “x > 1”. Note that the negation of “x > 1” is “x ≤ 1”. Thus, the negation of
(P ⇒ Q) is the statement (P and (not Q)), that is, x2 > 1 and x ≤ 1.
2
Universal and existential quantifiers
Recall the statement “Let n be a natural number. Prove that if n is odd, then n2 is odd.”
Another way of writing this statement is
“For all natural number n, if n is odd then n2 is odd.”
In the original statement, we do not specify which natural number n that we are working
with, but rather, we work “abstractly” with an unspecified, or arbitrary, choice of a natural
number, which we denote by n. You will see the keyword “for all” many times in this course
(sometimes your lecturer uses this notation: ∀, to shorthand “for all”). Denoting the set of
natural numbers by N, we can now write the statement in Example 6 as follows
“∀ n ∈ N, if n is odd, then n2 is odd.”
Comment. Using the notation ∀ is not compulsory, in fact, it is common to only use it on
the board in lectures, to save time.
The keyword “for all”, or sometimes “for any”, is commonly referred to as a universal
quantifier. A quantifier specifies how many individuals satisfy the given statement. A
universal quantifier specifies that all individuals satisfy the given statement.
In contrast, an existential quantifier specifies that at least one individual satisfies the
given statement. A common keyword that is used to in a statement with an existential
quantifier is “there exists”. For example (you saw this earlier, in a slightly different form):
“There exists a student in WTW114 that does not love calculus”. Sometimes your lecturer
writes ∃ to short hand “there exists”. Another common keyword is “for some”.
Now we give a thorough explanation to rewriting the negation of the statement: “All students
in WTW114 love calculus” in a more “useful” form as in Example 2 part 2. First of all,
note that this statement contains a universal quantifier, in other words, the statement can
be written as follows:
“For all WTW114 students P , P loves calculus.”
The negation of this statement is a statement for which it is not true that all students in
WTW114 loves calculus, i.e. there is at least one student in WTW114 that does not love
calculus. Thus the negation of the given statement is
5
“There exists a WTW114 student P such that P does not love calculus.”
The negation of the statement “For all objects O, O satisfies the statement P ” is
“There exists an object O such that O does not satisfy P ” or
“There exists an object O such that O satisfies ¬P .”
The negation of the statement “There exists an object O such that O satisfies P ” is
“For all objects O, O does not satisfy P ” or
“For all objects O, O satisfies ¬P .”
2.1
Combining quantifiers
Recall the definition of a surjective function: Let f : A → B. We say that f is surjective if
for all y ∈ B, there exists x ∈ A such that f (x) = y.
We have a statement of the following form:
For all
, there exists
such that
.
Example 5. Consider the following statement: All people are married. This statement can
be written with quantifiers as follows:
For all persons P , there exists a person Q, such that P is married to Q.
Warning! Note the order of the quantifiers. If we swap the existential and universal
quantifiers in the above, i.e. the sentence becomes
There exists a person P , such that for all persons Q, P is married to Q.
The meaning has changed to the following: all people are married to P .
3
Contrapositive and converse
Exercise: Show that (P ⇒ Q) is logically equivalent to ((not Q) ⇒ (not P )).
The statement ((not Q) ⇒ (not P )) is called the contrapositive of (P ⇒ Q).
Meanwhile, the statement (Q ⇒ P ) is called the converse of (P ⇒ Q).
Warning! Do not confuse the terms contrapositive with converse!
The composite statement form ((P ⇒ Q) and (Q ⇒ P )) is abbreviated as (P ⇔ Q), and
embodies the notion that P and Q are (logically) equivalent. The statement (P ⇔ Q) is
true either when both P and Q are true; or when both P and Q are false (P and Q have
the same truth values).
6
P
T
T
F
F
Q
T
F
T
F
P ⇒Q
T
F
T
T
Q⇒P
T
T
F
T
P ⇔Q
T
F
F
T
We read (P ⇔ Q) as:
• “P (is true) if and only if Q (is true)”; or
• “P is a necessary and sufficient condition for Q”.
It is common to abbreviate “if and only if” as “iff”.
Comment. When proving a statement of the form “P if and only if Q”, you must prove two
implications: “if P then Q” and “if Q then P ” (your lecturer will often remind you to prove
both directions).
4
4.1
How to prove that ...
How to prove that P implies Q
Many theorems in mathematics take the form “if P then Q”. There are three ways to prove
the implication “if P then Q”.
Method 1: The direct method
Assume that P is true and deduce that Q is true. We demonstrate this with an example.
Example 6. Let n be a natural number. Prove that if n is odd, then n2 is odd.
Proof. We start with the given assumption that n is a natural number. We further assume
that n is odd. In other words, there exists a natural number m such that n = 2m + 1.
(Note that the case of n = 1 can be easily checked as n2 = 1 is also odd.) Therefore,
n2 = (2m + 1)2 = 4m2 + 4m + 1 = 2(2m2 + 2m) + 1. We set k := 2m2 + 2m, which is a
natural number since m is a natural number. Thus, n2 = 2k + 1, for some natural number
k, which means that n2 is odd.
Warning! Let’s read together a proof given by Naughty Newman for the same statement
in Example 6:
“Let n = 3, which is an odd number. Then n2 = 32 = 9, another odd number.”
This is not a correct proof, as Naughty Newman only considered the case for a particular odd
number (namely n = 3) and he did not cover all cases, as n can be any odd number.
Method 2: The indirect method of proof
Prove the contrapositive directly, that is, assume Q is false and deduce that P is false. We
can do this because (P ⇒ Q) is logically equivalent to ((¬Q) ⇒ (¬P )).
7
Example 7. Let n ∈ N. Prove that if n2 is odd then n is odd.
Proof. Let n ∈ N. We prove the contrapositive, namely, if n is even, then n2 is even. Assume
that n is even, and so there exists a natural number m such that n = 2m. Then
n2 = (2m)2 = 4m2 = 2(2m2 )
another even number. Therefore n2 is even, as required.
Method 3: Proof by contradiction (reductio ad absurdum)
Assume that P is true and Q is false and deduce an obviously false statement. This works
because of the following reason: the fact that (P and (not Q)) is false means that (not (P
and (not Q))) is true. Note that (not (P and (not Q))) is logically equivalent to (P ⇒ Q)
[Check!], and thus (P ⇒ Q) is true.
Example 8. Let n ∈ N. Prove that if n2 is even then n is even.
Proof. Let n ∈ N. We suppose, for the sake of contradiction, that n2 is even and n is odd.
Then, n2 + n is an odd number. But n2 + n = n(n + 1), which is a product of two consecutive
natural numbers, one of which must be even. Thus, n2 + n must be an even number. This
contradicts the previous statement that n2 + n is an odd number. Therefore, our supposition
that n2 is even and n is odd must be false. We conclude that if n2 is even, then n must be
even.
(Bonus section) Vacuous proof
In the truth table for implication (P ⇒ Q), observe that when P is false (see (O2) on page
4), Q may be true or false, in order for the implication to be true. In such a situation,
namely when the hypothesis cannot be satisfied, we call the truth of the implication to be
vacuous.
Example 9. Prove the following statement: Let S be a set of real numbers. An empty set
is a subset of S.
Solution. Before proving the statement, recall that A is a subset of B if all elements of
A are also elements of B, in other words, we want to prove the implication “if a ∈ A then
a ∈ B”. Our task is now to prove the following: Assume that S is a set of real numbers and
A = ∅, show that if a ∈ A then a ∈ S. However, the statement a ∈ A is always false, as A is
an empty set which does not contain any member. Based on the truth table for implication,
the implication (P ⇒ Q) must be true, regardless the truth value of Q. This kind of proof
is called vacuous proof. We now write the proof formally.
Proof. Let S be a set of real numbers and A = ∅. Let a ∈ A. Since A is an empty set,
the statement a ∈ A is false. Thus the implication “if a ∈ A then a ∈ S” is always true.
Consequently, A ⊆ S.
8
4.2
4.2.1
Proving statements with “or” and “and”
Proof by cases
We demonstrate with an example.
Example 10. Let x ∈ R. Prove that x ≤ |x|.
Proof. Let x ∈ R. We consider two cases.
Case 1: x ≥ 0, i.e. |x| = x. Thus, x ≤ |x| since x = |x|.
Case 2: x < 0. Since |x| ≥ 0, x < 0 ≤ |x|, by transitivity.
From both cases, we conclude that x ≤ |x|.
4.2.2
Proving statements with ‘and’
To prove P ⇒ (Q and R), we prove P ⇒ Q and P ⇒ R.
Example 11. Let x ∈ R. If x ≥ 1, show that x2 ≥ 1 and x3 ≥ 1.
Proof. Let x ∈ R and assume that x ≥ 1. Note that x ≥ 1 > 0. We multiply x ≥ 1 with
x > 0 to get x2 ≥ x and by transitivity x2 ≥ x ≥ 1. We multiply x2 ≥ 1 by x > 0 to get
x3 ≥ x, and again by transitivity x3 ≥ x ≥ 1. This completes the proof.
4.2.3
Proving statements with ‘or’
Note that
P ⇒ (Q or R)
is equivalent to
(not P ) or (Q or R),
which is equivalent to
((not P ) or Q) or R,
since the logical “or” operation is associative. The above is equivalent to
not ((not P ) or Q) ⇒ R
which is equivalent to
P and (not Q) ⇒ R.
Thus, to prove (P ⇒ (Q or R)), we prove (P and (not Q) ⇒ R).
Example 12. Let x, y ∈ R. Prove that if xy = 0, then x = 0 or y = 0.
Proof. Let x, y ∈ R. Assume xy = 0 and x 6= 0. Since x 6= 0, we divide through xy = 0 by
x and so y = 0. This completes the proof.
9
4.3
4.3.1
Proving universal and existential statements
How to prove a universal statement
To prove a universal statement, namely a statement of the form: “For all objects O, O
satisfies P ”, we start by considering an arbitrary (unspecified, abstract) object O and show
that O satisfies P . We demonstrate with an example. Denote by Z and Q the sets of integers
and rational numbers respectively. Note that the set of rational numbers can be written in
a set builder notation as follows:
Q = {x ∈ R : x = p/q for some p, q ∈ Z and q 6= 0}.
Example 13. Use the fact that N ⊆ Z to prove the following statement: For all n ∈ N,
n ∈ Q.
Proof. Let n ∈ N be arbitrary. Since N ⊆ Z, then n ∈ Z (by definition of subsets). Note
that n = n/1 and since 1 ∈ Z and 1 6= 0, we conclude that n ∈ Q.
Warning! Again, let’s read together a proof given by Naughty Newman for the same
statement in Example 13:
“Let n = 3. Note that n is a rational number because it can be written as 3/1.”
This is not a correct proof! Can you explain why?
In most cases, we are concerned in proving statements of the following form:
For all objects O, if P then Q.
Note that P and Q here are statements concerning O. Given our experiences thus far, we
now have a logical step to prove such a statement, namely, consider an arbitrary object O,
assume P is true, deduce that Q is true. We demonstrate this with an example.
Example 14. Prove that for all m, n ∈ N, if m is odd and n is even, then m + n is odd.
Proof. Let m, n be two arbitrary natural numbers. Assume that m is odd, namely there
exists p ∈ N such that m = 2p + 1, and assume that n is even, namely there exists q ∈ N
such that n = 2q. Then,
m + n = 2p + 1 + 2q = 2(p + q) + 1,
i.e. m + n is odd.
4.3.2
How to prove an existential statement
In contrast, to prove an existential statement, namely a statement of the form “There
exists an object O such that O satisfies P ”, we need to find an object O that satisfies P .
We demonstrate with an example.
10
Example 15. Let A be the set of natural numbers that are even. Show that there exists a
natural number n such that n is not a member of A.
Solution. We need to find a natural number that is not a member of A, i.e. a natural
number that is not even. We have many choices, but we only need one. Pick your favourite
one and write a formal proof. We do so here.
Proof. Choose n = 3. Note that n = 3 = 2 · 1 + 1. Since n is not divisible by 2 (3 has
remainder 1 when divided by 2), then n is not even. Therefore, n is not a member of A.
We sometimes call this a proof by example.
Warning! Do not prove a universal statement by example. For statements of the form “for
all ...”, you must indeed show that the statement is true for any arbitrary object, so do not
prove such a statement by example.
4.3.3
How to disprove a universal statement
A counterexample is an example that disprove a statement, i.e. an example which shows
that a given statement is false.
Example 16. Prove that the following statement is false: For all x ∈ R, if x2 > 1 then
x > 1.
Comment. We often use the term “disprove” to mean that one is required to prove that
the given statement is false.
Solution. Remember that a statement is false when its negation is true. Thus, to prove the
above is the same by proving that the negation of the statement “For all x ∈ R, if x2 > 1
then x > 1” is true. Therefore, we want to prove that there exists x ∈ R such that x satisfies
the negation of the implication “if x2 > 1 then x > 1”, i.e. “x2 > 1 and x ≤ 1” (see Example
4). To summarise, we are now tasked to prove the statement
There exists x ∈ R, such that x2 > 1 and x ≤ 1.
Again, based on experience, we know that we need to find a real number x which satisfies
two properties: x2 > 1 and x ≤ 1. Some experience working with real numbers may be
required here. Try to think of a number x ≤ 1 for which x2 is greater than 1. Again, there
are many examples, so choose your favourite one (that works, of course)! We will do so here.
Proof. We want to show that there exists x ∈ R, such that x2 > 1 and x ≤ 1. Choose
x = −2. Note that x2 = 4 > 1 and x = −2 ≤ 1, as required.
Comment. We sometimes call such a proof: disproof by counterexample. In other words,
we provide an example (or a counterexample, rather) which makes a (universal) statement
to be false.
Warning! Do not disprove an existential statement by a counterexample. Remember that
the negation of an existential statement is a universal statement!
11
4.3.4
How to prove statement with more than one quantifier
We now demonstrate how to prove statements of the form:
For all
, there exists
such that
.
Example 17. Show that there is no largest real number.
Solution. First, let us write the above sentence in the desired form. To say that there is
no largest real number means that for any arbitrary real number, we can find another real
number that is larger. Thus, the statement that we want to prove is
For all real number x, there exists a real number y such that x < y.
We start by assuming an arbitrary real number x. Once we do this, x is fixed. We want to
find a real number y, which depends on x, and show that our choice of y satisfies x < y.
Think of a real number that is greater than a fixed number x, and choose this as your y
(again the choice is not necessarily unique!). Now we write the formal proof.
Proof. We want to prove that for all real number x, there exists a real number y such that
x < y. Let x ∈ R. Set y = x + 1 and thus x < x + 1 = y.
4.3.5
How to prove that something does not exists
Use proof by contradiction: assume the object exists.
Example 18. Show that there are no positive integers x and y such that x2 − y 2 = 1.
Comment. Note that you are required to prove that for all positive integers x and y, x2 −y 2 =
1 does not hold. We are going to use prove by contradiction. We suppose that the negation
of “for all positive integers x and y, x2 − y 2 = 1 does not hold”, namely “there exist two
positive integers x and y such that x2 − y 2 = 1”.
Proof. We prove by contradiction. Suppose there exist two positive integers x and y such
that x2 − y 2 = 1. Thus we have (x + y)(x − y) = 1. Since both x, y are integers, then both
x + y and x − y are also integers which means that for their products to be 1, either both of
them are 1 or both of them are −1. We consider both cases separately.
Case 1: x + y = 1 and x − y = 1. Solving these equations, we get that x = 1 and y = 0,
which contradicts the fact that y is a positive integer.
Case 1: x + y = −1 and x − y = −1. Solving these equations, we get that x = −1 and
y = 0, which contradicts the fact that both x and y are positive integers.
Thus our supposition that there exist two positive integers x and y such that x2 − y 2 = 1 is
false, thus for all positive integers x and y, x2 − y 2 = 1 does not hold. In other words, there
are no two positive integers x and y such that x2 − y 2 = 1.
12
4.4
How to prove something indexed by the natural numbers
The Principle of Mathematical Induction requires that we have a sequence of statements
indexed by the natural numbers, for instance:
n
X
1
For all n ∈ N,
i = n(n + 1).
2
i=1
The Principle of Mathematical Induction works as follows: Let A(n) be an collection of
statements with n ∈ N.
(Base case) We show that A(1) is true.
(Inductive step) We assume the inductive hypothesis, namely that the statement A(k) is
true for some arbitrary k ∈ N, and we show that A(k + 1) is true.
The above shows that A(n) is true for all n ∈ N.
n
X
1
Example 19. Prove that
i = n(n + 1) for all n ∈ N.
2
i=1
Proof. Let A(n) be the statement
n
X
i=1
A(1) =
1
i = n(n + 1) where n ∈ N. Note that
2
1
X
i=1
1
i = 1 = (1)(1 + 1),
2
proving the base case. Now we prove the inductive step. We assume our inductive hypothesis
k
X
1
A(k) is true for some arbitrary k ∈ N. To be more precise, we assume that
i = k(k + 1)
2
i=1
holds for some arbitrary k ∈ N. Now we want to show that A(k + 1) is true. Note that
k+1
X
i = 1 + 2 + · · · + k + (k + 1) =
i=1
i + (k + 1),
i=1
and using the inductive hypothesis, we know that
k
X
i=1
k+1
X
k
X
k
X
1
i = k(k + 1) and so
2
1
i + (k + 1) = k(k + 1) + (k + 1)
2
i=1
i=1
1
=
k + 1 (k + 1)
2
1
1
= (k + 2) (k + 1) = (k + 1) ((k + 1) + 1),
2
2
which proves that A(k + 1) is true. Thus, by the Principle of Mathematical Induction, A(n),
n
X
1
namely
i = n(n + 1), is true for all n ∈ N.
2
i=1
i=
13
4.5
How to prove that a function is ...
4.5.1
How to prove that a function is injective
Recall the definition of injective function. The function f : A → B is injective means that
for any x1 , x2 ∈ A, if f (x1 ) = f (x2 ), then x1 = x2 . This is a universal statement and an
implication – at this point you know how to prove such statements.
Example 20. Let f : R → R be given by f (x) = 2x + 1. Show that f is injective.
Proof. Let x1 , x2 ∈ R and assume that f (x1 ) = f (x2 ), that is, 2x1 + 1 = 2x2 + 1. Therefore,
2x1 = 2x2 and finally x1 = x2 . We conclude that f is injective.
Example 21. Let f : R → R be defined by f (x) = x2 . Show that f is not injective.
Comment. Note that we are required to prove the negation of f being injective, namely the
negation of “for any x1 , x2 ∈ A, if f (x1 ) = f (x2 ), then x1 = x2 ”, which is
there exist x1 , x2 ∈ A such that f (x1 ) = f (x2 ) and x1 6= x2 .
Proof. Choose x1 = −3 and x2 = 3. Note that f (x1 ) = 9 = f (x2 ) but x1 6= x2 . Therefore f
is not injective.
4.5.2
How to prove that a function is surjective
To prove that a function f : A → B is surjective, show that for all y ∈ B, there exists x ∈ A
with f (x) = y. More precisely, start by taking an arbitrary, but fixed, y ∈ B, construct an
x ∈ A, and show that f (x) = y.
Useful tip to construct an x ∈ A: work backwards to find x that satisfy the equation
f (x) = y.
Note that the method of proving surjectivity is similar to Example 17, i.e. statements of the
form “for all ... there exists ...”.
Example 22. Let f : R → R be given by f (x) = 2x + 1. Show that f is surjective.
Comment. For any y ∈ R, we want to find x ∈ R such that f (x) = y, namely 2x + 1 = y.
Rewriting this as x = y−1
gives us the correct choice of x. (We sometimes call this technique:
2
working backwards). Now we write the formal proof.
Proof. Let y ∈ R. Choose x = y−1
. Therefore,
2
y−1
y−1
f (x) = f
=2
+ 1 = y − 1 + 1 = y.
2
2
Thus f is surjective.
Example 23. Let f : R → R be defined by f (x) = x2 . Show that f is not surjective.
Comment. Note that we are required to prove the negation of f being surjective, namely
the negation of “for all y ∈ B, there exists x ∈ A with f (x) = y”, which is
14
there exists y ∈ B, such that for all x ∈ A, f (x) 6= y.
For this example, we need to find y ∈ R such that for all x ∈ R, x2 6= y. Any negative
number will be a correct choice for y. We write the formal proof.
Proof. Choose y = −1. Let x ∈ R. Since x2 ≥ 0, we conclude that x2 6= −1. Therefore f is
not surjective.
4.5.3
How to prove that a function is bijective
Prove that the given function is both injective and surjective.
4.6
4.6.1
Other methods of proofs
How to prove that two statements are equivalent
To prove that P is equivalent to Q, or P if and only if Q, prove both implications (P ⇒ Q)
and (Q ⇒ P ).
Example 24. Show that for any n ∈ N, n is even if and only if n2 is even.
Solution. Let n ∈ N. You need to show two implications:
(i) if n is even, then n2 is even; and
(ii) if n2 is even, then n is even; and
Proof of (ii) is Example 8. Note also that we already proved (i) in Example 7. Statement (i)
is the contrapositive of the statement in Example 7. Try to write the formal proof yourself!
4.6.2
How to prove that two sets are equal
To show that A = B, prove that A ⊆ B (assume x ∈ A, show that x ∈ B) and B ⊆ A
(assume x ∈ B, show that x ∈ A).
Example 25. Show that A = {15n + 3 : n ∈ Z} and B = {15k − 237 : k ∈ Z} are equal.
Proof. First we show that A ⊆ B, i.e. show that if x ∈ A then x ∈ B. Let x ∈ A, i.e.
x = 15n + 3 for some n ∈ Z. Note that
x = 15n + 3 = 15(n + 16) − 237.
Set k := n + 16, and since n ∈ Z, k ∈ Z. Therefore, x = 15k − 237 for some k ∈ Z, that is,
x ∈ B. We conclude that A ⊆ B. Conversely, we now show that B ⊆ A, i.e. show that if
x ∈ B then x ∈ A. Let x ∈ B, that is, x = 15k − 237 for some k ∈ Z. Note that
x = 15k − 237 = 15(k − 16) + 3.
Set n := k − 16 which is an integer since k ∈ Z. Thus, x = 15n + 3 for some n ∈ Z, that is,
x ∈ A. Therefore, B ⊆ A. We conclude that A = B.
15
Comment. In the proof above, we use the fact that for any natural numbers m, n, if m2 < n2 ,
then m < n. Try to prove this!
4.6.3
How to prove that two numbers are equal
To show that a = b:
• Prove that a ≤ b and a ≥ b; or,
• Prove that a − b = 0.
A useful application of the above method is to show that two functions are equal. To show
that f (x) = g(x) for all x:
• Prove that f (x) ≤ g(x) and f (x) ≥ g(x) for all x; or,
• Prove that f (x) − g(x) = 0 for all x.
4.6.4
How to prove something is unique
Assume that there are two objects and show that both objects are the same; or use prove by
contradiction: suppose that there are two distinct objects, show that both objects are the
same, thus contradicting the supposition that both objects are distinct.
Example 26. Let a, b ∈ R with a 6= 0. Show that the solution to the equation ax + b = 0
is unique.
Proof. Assume that there exist two solutions x1 and x2 to the equation ax + b = 0, i.e.
ax1 + b = 0,
(1)
ax2 + b = 0.
(2)
b = −ax1 .
(3)
and
We can rewrite (1) as
and substituting the value of b as given in (3) to (2), we get
ax2 − ax1 = 0,
(4)
ax1 = ax2 .
(5)
or equivalently
Since a 6= 0, we conclude that x1 = x2 .
16
Appendix A: How to do proofs?
• A good first step is to write down in complete sentences what is given and what is to
be proven.
• Once you clearly understand what is given and what is to be proven, you must decide on a method of proof. Restate the theorem in different ways, for instance in its
contrapositive, if necessary.
• Next, you might want to review known results that could be relevant to your proof.
• From this point on, it is a matter of experience and intuition, but keep in mind that
proving theorems is not an easy task, so don’t be discouraged. As you read through
the proofs in the textbook and lectures, observe the techniques and try to make them
part of your own repertoire.
Appendix B: Some advice on writing mathematics
When you write mathematics, bear in mind that someone else will read your work. There
are two points that you should remember:
1. Have mercy on the reader. Do not make it difficult for them – especially when your
work is going to be marked/graded.
2. The responsibility of communication lies with you. You have to ensure that your reader
understands what you write.
More practical advice:
1. Write in sentences. Avoid writing string of symbols and arrows. Treat mathematical
objects like words.
2. Use punctuation. For example,
“let x = 4a + 3b where a ∈ R b ∈ Z”
should have commas, capitalised letters, connectives, and full stop
“Let x = 4a + 3b, where a ∈ R and b ∈ Z.”
3. Explain what you are doing. For instance, introduce your proof by explaining what
you are assuming and what you are going to show.
4. Explain your assertions (give reasons).
5. Say what you mean. Writing f (x) = 5 is ambiguous. For which x? Is it one x or all x?
Write clearly such as “f (x) = 5 for some x ∈ R” or f (x) = 5” for all “x ∈ R”. Note
that both of these have different meaning!
6. Equal means equal. For instance, avoid writing
“Factors of 6 = 2 and 3.”
17
This reads as follows: Factors of six equals two and three. It is true that 6 is equal to
the product of 2 and 3, and thus has 2 and 3 as factors, but it is not equal to “2 and
3”. It is better to write
“The prime factors of 6 are 2 and 3.”
Only use the equal sign when both objects to the left and to the right of the equal sign
are truly identical.
7. Call things by their correct name. For instance, “x2 + 2x + 1” is an expression, “x2 +
2x + 1 = 0” is an equation, while “x2 + 2x + 1 ≥ 0” is an inequality. When writing
function, state the domain, codomain, and how your function is defined, for instance
f : R → R is given by f (x) = x2 + 2x + 1.
8. Write explicitly. Avoid using the word ‘it’, tell your reader explicitly what ‘it’ refers
to.
9. Use connecting phrases. For instance, avoid writing
x2 + 2x + 1 = 0
(x + 1)2 = 0
x = −1
How are they related? It is better to write: “We want to find the root of the equation
x2 + 2x + 1 = 0. Note that x2 + 2x + 1 = 0 can be rewritten as (x + 1)2 = 0. We
conclude that x = −1 is a root of the equation x2 + 2x + 1 = 0.”
10. Proofread your work.
18
Download