Professional Documents
Culture Documents
S = {2, 3, 4}
is a set containing three numbers. The letter S is the symbol of the set, and 2, 3, 4 are said to be
elements of S. We use the symbol 2 and 62 to indicate whether an object is an element of a set
or not. In the above set, we say
We may also use the phrases “2 belongs to S”, “2 is in S”, or “S contains 2” to mean 2 2 S.
A set does not need to have numbers to be its elements. We can have a set containing fruits
as well:
A = {apple, orange, banana, grape}.
A set can even contain objects that are not related to each other, such as:
We often deal with sets which are impossible to define by listing its elements. It is more
common to define a set in {object : criteria}-form, such as:
⇢
p
Q= : p and q are integers and q 6= 0. .
q
2 Preliminaries
The left-hand side of the semi-colon : tells what kind, or what form of elements the set contains.
The right-hand side declares criteria and restrictions. In the above example, the form of
elements are fractions, and the requirements are that the denominator and numerator must be
integers, and the denominator
p cannot be zero. In short, Q is the set of all rational numbers. We
can say 12 2 Q but 2 62 Q.
The sets below have universal notations. We will use them often math courses:
A \ B = {x : x 2 A and x 2 B}
A [ B = {x : x 2 A or x 2 B}
A\B = {x : x 2 A and x 62 B}
In words, the intersection A \ B is the set of common elements of A and B. The union A [ B is a
new set putting both elements of A and B together. The complement A\B is the set of elements
in A with elements in B removed. For example, if we let
A = {2n : n 2 N}
B = {3n : n 2 N}
then their intersection A \ B is the set of positive integers which are both multiples of 2 and 3.
In other words, A \ B is the set of positive multiples of 6, i.e.
A \ B = {6n : n 2 N}.
For the union A [ B and the complements A\B, B\A, we can describe them by listing some of
their elements:
Clearly, N\A is the set of all positive odd numbers. A\N is the empty set ;.
1.1 Set Notations 3
⌅Exercise 1.1 Suppose U = {1, 2, 3}, S = {1, 3, 5}, and T = {2, 3, 4}. Find U [ S, S [ T , T [ U ,
U \ S, S \ T , and T \ U . How about (U [ S) [ T and U [ (S [ T )? Are they the same?
⌅ Exercise 1.2 Consider the interval sets (a, b) and (c, d), where a < b and c < d. Under what
conditions on a, b, c, d does the set (a, b) \ (c, d) become an empty set?
⌅ Exercise 1.3 Find an example of two sets A and B such that A\B and B\A are not equal.
To get a better sense of these set operations, we often represent sets using Venn diagrams:
⌅ Exercise 1.5 Try to convince yourself using a Venn diagram that the following are true:
(A \ B) [ C = (A [ C) \ (B [ C)
(A [ B) \ C = (A \ C) [ (B \ C)
⌅ Exercise 1.7 Let R be the set of all real numbers. A = [1, 3] and B = [2, 4] be two closed
intervals. Write down:
(a) (R \ A) \ (R \ B)
(b) B [ A \ (R \ B)
(c) (R \ A) \ B [ (R \ B) \ A
For example,
10
[
(0, i) = (0, 1) [ (0, 2) [ · · · [ (0, 10) = (0, 10)
i=1
10
\
(0, i) = (0, 1) \ (0, 2) \ · · · \ (0, 10) = (0, 1)
i=1
We can even take the intersection or union of infinitely many sets. For example:
[1
1 1 1 1
,1 = , 1 [ , 1 [ , 1 [ · · · = (0, 1].
n=2
n 2 3 4
1.1.3 Subsets
If B contains A, or in other words, A is contained in B, we denote it by:
A⇢B
For example:
N⇢Z⇢Q⇢R⇢C
(10, 20) ⇢ (9, 21)
{4n : n 2 Z} ⇢ {2n : n 2 Z}
Note that by our convention even if A = B, we can also write A ⇢ B (c.f. if a = b, it is not
wrong to write a b). In fact, two sets being equal, i.e. A = B, means we have both A ⇢ B and
B ⇢ A.
⌅ Exercise 1.9 Consider A = {pn : n 2 Z} and B = {qn : n 2 Z} where p and q are non-zero
integers. Under what condition on p and q that we have A ⇢ B?
⌅ Exercise 1.10 Consider the interval sets (a, b) and (c, d) where a < b and c < d. Under what
condition on a, b, c, d that we have (a, b) ⇢ (c, d)?
⌅ Exercise 1.11 Let A = {1, 2, 3, 4, 5, 6}, B = {4, 5, 6, 7, 8, 9}, C = {2, 4, 6, 7}, D = {4, 5}, E =
{5, 6}, F = {4, 6}, and X a set which satisfies the following conditions:
X ⇢ A, X ⇢ B and X 6⇢ C.
to mean “If (A), then (B)”. We call also say (A) implies (B).
However, given that “If (A), then (B)” holds, it does not tell whether “If (B), then (A)” holds.
Using the above examples, certainly it is NOT true that “If the person is a woman, the person is
your mother”. However, it is true that “if you have never dated anyone, then your status is A0”.
The phrase “(B) =) (A)” is called the converse of “(A) =) (B)”.
When both “(A) =) (B)” and “(B) =) (A)” hold, we can say
⌅ Example 1.1 Prove that if x < 3 or x > 0, then (x + 1)2 + (x + 2)2 > 5.
⌅ Solution Here you are given the fact “x < 3 or x > 0”, and you need to show (x + 1)2 +
(x + 2) > 5. Do NOT start your proof by writing (x + 1)2 + (x + 2)2 > 5 and try to show
4
“x < 3 or x > 0”. It is completely illogical! Instead, you should start from:
x< 3 or x > 0.
Also,
x > 0 =) x + 2 > 2 =) (x + 2)2 > 4.
Therefore, in this case, we have (x + 1)2 + (x + 2)2 > 4 + 1 = 5
In both cases, we have (x + 1)2 + (x + 2)2 > 4 + 1 = 5. Therefore, we conclude that
⌅ Example 1.2 Prove that if (x + 1)2 + (x + 2)2 > 5, then x < 3 or x > 0.
⌅ Solution Now you are given that (x + 1)2 + (x + 2)2 > 5, and you need to show “x < 3 or
x > 0” holds. Again you should start your proof from the given condition:
When the product of two numbers is positive, either both numbers are positive, or both
numbers are negative. Therefore, we can deduce that
which implies
(x > 0 and x > 3) or (x < 0 and x < 3).
If both x > 0 and x > 3 hold, it simply mean x > 0. Similarly, “x < 0 and x < 3” simply
mean x < 3. Therefore, the above inequalities imply
x > 0 or x < 3,
as desired.
i The difference between the above two examples is that one asks “If (A), then (B)” whereas
the other asks “If (B), then (A)”. You could see that the solutions can be completely different!
The past HKCEE/HKALE curriculum emphasized a lot over these logical issues. If you
attempted to prove “If (A), then (B)” starting from writing down (B), and derive (A) at the
end, you would get zero mark for that question. It seems nowadays HKDSE is more tolerant
on that, and GCEAL/IB/AP are even more lenient.
⌅ Exercise 1.13 In each blank below, put in one of the symbols (=, =) or ():
(a) I am a student in the Math department I am a student in the School of Science
(b) x(x + 1) > 0 x>0
(c) x2 > 1 x>1
(d) x3 > 1 x>1
(e) x2Z x2Q
8 Preliminaries
“Solve x2 + 5x + 6 = 0.”
x2 + 5x + 6 = 0
=) (x + 2)(x + 3) = 0
=) x + 2 = 0 or x + 3 = 0
=) x = 2 or x = 3
What have been concluded in the above argument is that “If x2 + 5x + 6 = 0, then x = 2 or
x = 3”. Rigorously speaking, it doesn’t mean “If x = 2 or x = 3, then x2 + 5x + 6 = 0”.
However, in this case every =) can actually be replaced by () as every step can be logically
reversed, so we indeed proved
x2 + 5x + 6 = 0 () x = 2 or x = 3.
p p p
However, if we consider the equation x+6+ x+1= 6x + 7, and we try to solve it as
follows, then some issue may arise:
p p p
x + 6 + x + 1 = 6x + 7
p p 2 p 2
=) x + 6 + x + 1 = 6x + 7
p
=) x + 6 + 2 (x + 6)(x + 1) + x + 1 = 6x + 7
p
=) (x + 6)(x + 1) = 2x
Taking the square on both sides again, we get (x+6)(x+1) = 4x2 . Solving
p the p
quadratic p
equation
we get x = 3 or 23 . However, if we put x = 23 into the equation x + 6 + x + 1 = 6x + 7,
we can easily find that it is not a solution. What was wrong?
The issue is that when we square both sides of the equation, this step cannot be reversed.
While it is true that f (x) = g(x) =) f (x)2 = g(x)2 , but it is NOT true that f (x)2 = g(x)2 =)
f (x) = g(x), as f (x) = g(x) is another possibility. What we can only conclude from the above
is that
p p p
“If x + 6 + x + 1 = 6x + 7, then x = 3 or x = 23 .”
Indeed, in the case x = 23 , the LHS is not the same as the RHS.
To summarize, when we solve an equation, it is crucial to check if every step can be reversed.
If not, we may need to verify whether they are solutions at all.
1=2
=) 1 ⇥ 2 = 2 ⇥ 2
=) 2 = 4
=) 2 3=4 3
=) 1=1
=) ( 1)2 = 12
=) 1 = 1.
The set R can be replaced by other sets such as Q or C depending on the context it appears.
Statements in the form of “for all x in set, x has certain property” can also be stated using “if
. . . then . . . ” language. Instead of saying “8m, n 2 Z, m + n 2 Z”, one can also say: “If m, n 2 Z,
then m + n 2 Z”.
We use the symbol 9 to mean “there exists”. For example, “9x 2 R such that 2x + 3 = 1”. It is
the same as saying “2x + 3 = 1 for some x 2 R”. In contrast to English grammar, we can still use
“for some x 2 R” even if there is one x 2 R (namely 1) so that 2x + 3 = 1 holds.
i There is a similar difference in the use of word “or” in Mathematics language and English
grammar. When we say “(A) or (B)” in math, it means that at least one of (A) and (B) holds,
and it includes the possibility that both (A) and (B) holds.
1.2.3 Negation
One typical logic operation in math is to determine the opposite of a statement. Being a math
major, you need to be logical enough to realize that the opposite of “Every HKUST student is A0”
is NOT “Every HKUST student is not A0”, but it should be “There is at least one HKUST student
who is not A0”. In math, we use the word negation to mean the opposite of a statement. We use
the symbol ⇠(A) to mean the negation of the statement (A).
In general, we have
⇠ (For any x 2 S, x has property (P)) = there exists x 2 S, x does not have property (P)
⇠ (there exists x 2 S, x has property (P)) = for any x 2 S, x does not have property (P)
Recall that “If (A), then (B)” means whenever (A) holds, then (B) holds. The negation of it
will mean there is some situation that (A) holds, but (B) does not hold. For example:
10 Preliminaries
statement negation
If Person A is a HKUST student, There is at least one HKUST student who is not A0.
then Person A is A0.
If x < 3 then (x + 1)2 > 4 There exists x with x < 3 such that (x + 1)2 4.
If x > 0 and y > 0, then xy > 0 There exist x, y with x > 0 and y > 0
such that xy 0.
You are NOT going to show that x3 + 2x 5 0 for all real number x, and it is not true either.
Therefore, you need to just tell us one example of real number a such that a3 + 2a 5 0 in
order to disprove (*). We often call this a to be a counter-example. Obviously,
(1)3 + 2(1) 5= 2 0,
so (*) already got disproved. Also you do not need to find ALL a 2 R such that a3 + 2a 5 0.
Just one counter-example is enough to disprove a statement.
Here is another example. We want to disprove:
First think about what is the negation of the statement. It should be:
⇡
| {z⇡} sin 2 .
sin
=0 | {z }
=1
1.2.5 Contrapositive
We have discussed before that “If (A), then (B)” is not the same as “If (B), then (A)”. However, “If
(A), then (B)” is in fact the same as “If ⇠ (B), then ⇠ (A)”. For example, it is true that
“If Typhoon Signal No. 8 is hoisted, then class is cancelled.”
⌅Exercise 1.18 Each statement below is true. Write down their contrapositives and converses,
and determine whether they are true or false.
(a) If n is even, then n2 is even.
(b) If n is odd, then 2n is even.
(c) If p is an odd prime number, then p + 1 is not a prime number.
(P): Suppose there are 10 boxes and 11 balls. We put all these balls into the boxes
(randomly). Then, at least one of the boxes must contain two or more balls.
The statement sounds trivial but it is rather difficult to prove it directly. However, we can
easily prove it by contradiction: Assume the opposite is true: none of the boxes contain two or
more balls. Then, every box contains none or one ball. Since there are 10 boxes, it will conclude
that the number of balls is at most 10. It is a contradiction to the fact that there were 11 balls.
In conclusion, what we assumed is not true, and so at least one of the boxes contain two or more
balls.
Let’s look at a more mathematical example:
p
⌅ Example 1.3 Prove that 2 is irrational.
p
⌅ Solution Method 1 - using unique prime factorization: p
Assume on the contrary that 2 is
rational, then there exist positive integers m, n such that m
2= n , and so 2n2 = m2 . Write m
and n in terms of their unique prime factorizations:
where pM is the largest prime dividing m, and pN is the largest prime dividing n, and
i1 , · · · , iM 0 and j1 , · · · , jN 0 are integers. Then, 2n2 = m2 implies
The index of 2 in the LHS is odd while that in the RHS is even.
p It is impossible by the unique
prime factorization theorem of integers. It concludes that 2 is irrational.
12 Preliminaries
p
Method 2 - without the use of unique prime factorization:pAssume on the contrary that 2 is
rational, then there exist positive integers m, n such that 2 = m n , and we can pick m and n
such that mn is in the simplest form, i.e. m and n have no common factor.
Then, we have 2n2 = m2 . This shows m2 is divisible by 2, and so is m (for a proof, see
exercise below). Write m = 2k for some integer k, then
2n2 = (2k)2 = 4k 2 =) n2 = 2k 2 .
p
⌅ Exercise 1.20 Prove that p is irrational for any prime number p.
p
⌅ Exercise 1.21 Prove that 6 is irrational.
We can give a proof that the empty set ; is a subset of any other set. Recall that A ⇢ B means
for any x 2 A, we have x 2 B. The negation A 6⇢ B means that there exists x 2 A such that
x 62 B.
Now let S be an arbitrary set. We hope to prove by contradiction that ; ⇢ S. Suppose it is not
true, then there exists x 2 ; such that x 62 S. However, it is absurd since ; cannot contain any
element. Therefore, we must have ; ⇢ S.
1.3 Functions 13
1.3 Functions
1.3.1 What is a function?
A function can be regarded as a machine – you give it an input, then after processing it
according to a defined rule, the machine gives you an output. We often denote the input by a
variable x, and the output by f (x). For instance, we can write:
f (x) = x2 + 1
to represent the “machine” that takes the input x and output the value x2 + 1. As such, if we
input the value 2 into this function, it will output the value 22 + 1, or equivalently, 5. In short, we
may simply write:
f (2) = 5.
Likewise, it is easy to verify that f (1) = 2, f (0) = 1, etc.
i If every real number is an allowable input for a function f (x), then we can denote the
domain of f (x) by ( 1, 1), or simply R.
i Consider the function A(r) = ⇡r2 which is the area of a circle with radius r. Although
it is mathematically legitimate to input a negative r into A(r), a circle with negative
or zero radius is not physically meaningful. Therefore, we can take (0, 1) to be the
domain of A(r), instead of R.
i If D is the domain of a function f (x), then any (non-empty) subset E of D can also
taken to be the domain of f (x). When the domain of a function f (x) is not specified,
the domain is usually taken as the largest set in which f (x) is defined.
p
Take f (x) = x as an example. Since [0, 1) can be taken to be the domain of f (x),
we can also declare that its subset [1, 1)pto be the domain of f (x). However, without
any declaration, the domain of f (x) = x is taken to be [0, 1) by default.
2. The codomain of a function f (x) is the set where the outputs belong to. In this course, the
p 1
output of a function is usually a real number, as in the examples f (x) = x, g(x) =
1 x
and A(r) = ⇡r2 we have seen so far. We may simply say R, or ( 1, 1), is the codomain
of f (x), g(x) and A(r).
i The codomain of a function simply indicates what kind of objects the outputs are, but
it does not mean that everything in the codomain is a possible output.
Take the function h(x) = x2 + 1 as an example. Given any input x, the output x2 + 1
is always positive (in fact at least 1). However, it is perfectly fine to say that the
codomain of h is R.
f :D!C
14 Preliminaries
1
For example, we may indicate the domain and codomain of the function g(x) = by
1 x
writing:
g : R\{1} ! R
4. The range of a function f : D ! C is the set of all achievable outputs. It is usually denoted
by f (D) where D is the domain of f . In set notations, the range of f is usually defined by:
f (D) = {f (x) : x 2 D}
For example, the range of h : R ! R defined by h(x) = x2 + 1 is given by h(R) = [1, 1).
i However, if we declare the domain of h to be a smaller set such as [2, 3], then the
range of h will be smaller as it can only output values between 22 + 1 and 32 + 1.
Therefore, the range of h : [2, 3] ! R becomes [5, 10].
i There is no universal way to find the range of a given function, although it is easy
to do so in the above examples. One possible way to find the range is to look at the
graph of the function.
To read off the value of f (1) from the graph, simply locate the point on the curve with 1 as
the x-coordinate, then the y-coordinate of that point will be the value f (1). Similar for f (2) and
all other values f (x).
⌅ Example 1.4 Find the (largest possible) domain of the function defined by the expression:
r
x2 x 2
f (x) =
x 3
By plotting the graph of f using computer softwares, estimate the range of f when the domain
is taken to be the largest possible.
⌅ Solution First we observe that x 3 is a divisor so we need to exclude 3 from the domain.
2
Then, in order for the square root to be meaningful, we need to ensure x x x3 2 is non-negative,
1.3 Functions 15
x2 x 2 0
(x + 1)(x 2) 0
( (
x+1 0 x+10
or
x 2 0 x 20
( (
x 1 x 1
or
x 2 x2
x 2 or x 1
As x > 3 in this case, and (x > 3) and (x 2 or x 1) simply means x > 3, the solution in
this case is x > 3 .
Case 2: x < 3
In this case we need to have x2 x 2 0:
x2 x 20
(x + 1)(x 2) 0
( (
x+10 x+1 0
or
x 2 0 x 20
( (
x 1 x 1
or
x 2 x2
1x2
Since the interval [ 1, 2] lies within x < 3, the solution in this case is simply 1x2.
Overall, the domain of f is given by inequalities 1 x 2 or x > 3, i.e.
[ 1, 2] [ (3, 1).
-2 2 4 6 8 10
16 Preliminaries
From the graph of f , it suggests that the range of f should be in the form of [0, a] [ [b, 1).
Later in the course, we could use differentiation to determine the exact values of a and b. In
fact, the range of f can be shown to be [0, 1] [ [3, 1).
⌅ Exercise 1.22 In the following real functions, find the domain of each of them (always
referring to largest possible domain if not specified):
(a) f (x) = |x|
1
(b) f (x) =
x
x2 4
(c) f (x) =
r x 2
x2 1
(d) f (x) =
p x 2
(e) f (x) = p2 + x x2
(f) f (x) = sin x
1
(g) f (x) =
sin ⇡x
1.3.4 Well-definedness
When we define a function, it is important to keep in mind that:
Each input in the domain must have exactly one output.
It is the case for all examples we have seen so far. An expression with the property that every
input in the domain has exactly one output is said to be well-defined. The expressions below are
not well-defined and so they cannot be regarded as functions.
1. Let the domain be [0, 1). If we define the output f (x) to be a number y such that y 2 = x,
then such an f (x) is not well-defined. If we let the input to be 1, then f (1) is the number y
such that y 2 = 1. There are two possibilities, namely y = 1 or y = 1. Therefore, there are
two possible values for f (1), and so such an f is not well-defined and cannot be regarded
as a function.
2. Let the domain be Q, the set of all rational numbers. Given any input pq where p and q are
integers, we define ✓ ◆
p
f = p.
q
Given an input 12 , we have f ( 12 ) = 1, it seems that the output is simply 1. However, the
input 12 has many other forms, such as 24 that gives f ( 24 ) = 2 as output. The fractions 12
and 24 are regarded as the same input just expressed in two different ways. Now that this
input has at least two possible outputs, so f is not well-defined and cannot be regarded as
a function.
Given a curve on the xy-plane, one can determine whether or not it is the graph of a function
by so-called the vertical line test, i.e. a curve on the xy-plane is the graph of a function of x if
and only if no vertical line intersects the curve at more than one point (see Figures 1.3 and 1.4).
i Although each input of a function must have exactly one output, it is perfectly fine for a
function to give the same output for two or more different inputs. For instance, consider the
function g : R ! R defined by
g(x) = x2 + 1.
Evidently, we have both g(1) = 2 and g( 1) = 2. It is allowed.
1.3 Functions 17
Figure 1.3: pass the vertical line test, hence a graph of function
Figure 1.4: fail the vertical line test, hence not a graph of function
For example, we can easily see that |1| = 1 and | 3| = ( 3). In short, this function turns
any negative number to its positive counterpart, and preserve all non-negative numbers. The
graph of the absolute value function f (x) = |x| is shown in Figure 1.5.
f (x) = |x + 1| + |x 2| .
⌅ Solution As |x + 1| and |x 2| change their form near 1 and 2, we divide the real line into
three intervals:
( 1, 1), [ 1, 2), [2, +1).
When x 2 ( 1, 1), we have both x + 1 < 0 and x 2< 3 < 0, hence
|x + 1| + |x 2| = (x + 1) (x 2) = 2x + 1.
|x + 1| + |x 2| = x + 1 (x 2) = 3.
|x + 1| + |x 2| = x + 1 + x 2 = 2x 1.
To summarize, we have
8
>
< 2x + 1 if x 2 ( 1, 1)
f (x) = 3 if x 2 [ 1, 2) .
>
:
2x 1 if x 2 [2, +1)
⌅ Exercise 1.25 Write down the following function in piecewise form without using any absolute
value:
2 3
f (x) = |x + 1| 2 |x + 1| 3 |x 2| .
Hence, sketch the graph of the function.
1.3 Functions 19
The graph of an even function is reflexively symmetric about the y-axis. Important examples
include:
cos x, x2 , |x| , . . .
The graph of an odd function is 180 -rotationally symmetric about the origin (see Figure
1.7). Important examples include:
i There are many functions that are neither even nor odd. For example: f (x) = x3 + x2 . We
can check that:
f ( x) = ( x)3 + ( x)2 = x3 + x2
which is not f (x) or f (x).
⌅ Exercise 1.26 Show that if f : R ! R is both an even function and an odd function, then
f (x) = 0 for any x 2 R.
20 Preliminaries
⌅ Example 1.6 — Modified from HKALE Pure Math, Paper 2 Q5. For any function f : R ! R, we
define
1 1
F (x) = f (x) + f ( x) and G(x) = f (x) f ( x) .
2 2
(a) Show that F is an even function, and G is an odd function.
(b) Given that p(x), q(x) are both odd functions, and u(x), v(x) are both even functions such
that
p(x) + u(x) = q(x) + v(x) 8x 2 R.
Show that p(x) = q(x) and u(x) = v(x) for any x 2 R.
(c) Show that if f (x) = M (x) + N (x) for any x 2 R, where M is even and N is odd, then
M (x) = F (x) and N (x) = G(x) for any x 2 R.
1 1
F ( x) = f ( x) + f ( ( x)) = f ( x) + f (x) = F (x) 8x 2 R.
2 2
This shows F is even.
To show that G is an odd function, we consider:
1 1 1
G( x) = f ( x) f ( ( x)) = f ( x) f (x) = f (x) f ( x) = G(x)
2 2 2
for any x 2 R. This shows G is odd.
(b) Given that
p(x) + u(x) = q(x) + v(x) 8x 2 R,
this implies
p(x) q(x) = v(x) u(x) 8x 2 R.
Since p(x) and q(x) are odd functions, p(x) q(x) is an odd function too (proof left as an
exercise). Furthermore, v(x) and u(x) are even functions, so v(x) u(x) is an even function
too.
Now that p(x) q(x) and v(x) u(x) are the same function, and it is both odd and even,
so by Exercise 1.26, we conclude that p(x) q(x) = 0 for any x 2 R. This shows p(x) = q(x)
for any x 2 R. Also, v(x) u(x) = p(x) q(x) = 0 for any x 2 R, so we have u(x) = v(x) for
any x 2 R too.
(c) The key observation here is that:
1 1
F (x) + G(x) = f ( x) + f (x) + f (x) f ( x) = f (x) 8x 2 R.
2 2
Therefore, we have
F (x) + G(x) = M (x) + N (x) 8x 2 R.
From (a) and the given conditions, F and M are even, and G and N are odd. Therefore,
results from (b) show F (x) = M (x) and G(x) = N (x) for any x 2 R.
Definition 1.2 — Increasing and Decreasing Functions. Let I be an interval in the domain D of
a function f : D ! R.
• A function f is said to be strictly increasing on an interval I if
Figure 1.8: a function which is increasing on [a, b] and on [c, d], and is decreasing on [b, c]
i If a function f has a property that: f (x1 ) f (x2 ) whenever x1 < x2 , then we can say f is
monotonically increasing. Similar for the term monotonically decreasing.
It is quite obvious from the graph that f (x) = x2 is strictly increasing on [0, 1). For a formal
proof, we consider x1 , x2 2 [0, 1) and x1 < x2 , then
Since x2 x1 > 0 (as x2 > x1 ), and x2 + x1 > 0 as 0 x1 < x2 (note x2 must be positive), we
have f (x2 ) f (x1 ) = (x2 x1 )(x2 + x1 ) > 0. This shows f (x2 ) > f (x1 ).
⌅ Exercise 1.28 Prove that if f : R ! R is an odd function, and f is strictly increasing on [0, 1),
then f is strictly increasing on R.
A function f : D ! E can be regarded as a “map” that relates each element x in the domain
D with an element f (x) in the codomain E. Let f : D ! E and g : H ! K be two functions,
and assume that f (x) is in H for any x in D, then the expression g(f (x)) can be defined.
Definition 1.3 — Composite Functions. Let f : D ! E and g : H ! K be two functions such
that f (D) ⇢ H, then we denote:
⌅ Example 1.7 Let f (x) = x2 and g(x) = x + 1. Find g f and f g. Are they the same?
⌅ Solution
(f g)(x) = f (g(x))
= f (x + 1)
= (x + 1)2
= x2 + 2x + 1
Clearly, g f 6= f g.
1.3.8 Injectivity
Definition 1.4 — Injective Functions. A function f : D ! C is said to be injective (or one-to-
one) if
a 6= b in D =) f (a) 6= f (b).
Equivalently:
f (a) = f (b) where a, b in D =) a = b
i European textbooks often use the term injective, whereas American textbooks often use
one-to-one.
Figure 1.9: An injective function f maps distinct inputs to distinct outputs, while g is not injective
since g(2) = g(3) = b.
and hence
✓ ◆2 !
1 3
(x y) x+ y + y2 = 0.
2 4
1.3 Functions 23
i To argue that any of the above g’s is not injective, it suffices to find one pair of x, y 2 R
such that x 6= y and g(x) = g(y). For example, to argue that g(x) = |x| is not injective,
just explain it by saying g(1) = g( 1) = 1 but 1 6= 1. There is no need to start with the
equation g(x) = g(y) and find all possible distinct pairs x, y in R.
⌅ Exercise 1.30 “Any even function on R is not injective.” Do you agree with this statement?
The horizontal line test can determine whether the function is injective: a function is
injective if and only if every horizontal line intersects its graph at no more than one point.
(g f )(a) = (g f )(b)
Then, we have:
Now we have shown that whenever (g f )(a) = (g f )(b), we must have a = b. Therefore
g f is injective.
1
⌅ Exercise 1.31 Let f (x) = . Find a domain D ⇢ R such that the composition f f is
1 x
defined. Show that f f is injective on D.
1.3.9 Surjectivity
Another important terminology about functions is surjectivity. Recall that given a function
f : D ! C, we just require that each output f (x) is in the codomain C, but we do not require
every value in C is an achievable output. As an example, we consider again the function
g : R ! R defined by g(x) = x2 + 1. We cannot find any real number x such that g(x) = 1. On
the other hand, for the function h : R ! R defined by h(x) = x + 3, we do have the property that
every value in the codomain is attainable (for example, 0 = h( 1), 1 = h( 2), 2 = h( 1), and
generally, for any y 2 R, we have h(y 3) = y). A function whose every value in the codomain is
attainable is called:
Definition 1.5 — Surjective Functions. A function f : D ! C is said to be surjective (or onto) if
for any value y in the codomain C, there is at least one x in the domain D such that y = f (x).
1
⌅ Example 1.9 Prove that f : R ! (0, 1] defined by f (x) = is surjective.
x2 + 1
1
⌅ Solution Given any y 2 (0, 1], we need to see whether 2+1
= y has a solution x 2 R. By
x
r
1
a simple equation-solving, we can easily see that x = ± 1 are solutions. Note that to
y
prove surjectivity, we only require r for each y 2 (0, 1] there is at least one
r solution x for the
1 1
equation f (x) = y. Let’s take x = 1, we need to verify that (1) 1 2 R; and (2)
✓r ◆ y y
1
f 1 = y.
y
1 1
For (1), we recall that y 2 (0, 1], so 0 < y 1 =) 1 =) 1 0. Therefore, it
y y
1.3 Functions 25
r r
1 1
makes sense to write 1, i.e. 1 2 R. For (2), we check by direct computations that
y y
✓ r ◆
1 1 1 1
f 1 = ✓r ◆2 = 1 = 1 = y.
y 1 y 1+1 y
1 +1
y
r
1
To summarize, we have demonstrated that for any y 2 (0, 1], there exists 1 2 R such
✓r ◆ y
1
that f 1 = y. In other words, f : R ! (0, 1] is surjective.
y
⌅ Example 1.10 — Modified from HKALE Pure Math 1986, Paper 1 Q4. Let X be a non-empty set,
and f : X ! X be a function such that f f = f . Show that if f is injective, then f (x) = x for
any x 2 X.
⌅ Solution Note that we are given that f is injective, but not being asked to show f is injective.
We are given that f f = f . That means f (f (x)) = f (x) for any x 2 X. Since f is injective,
so f (a) = f (b) =) a = b. Hence, for any x 2 X
as desired.
x
⌅ Exercise 1.33 Prove that f : R\{ 1, 1} defined by f (x) = is surjective.
x2 1
⌅ Exercise 1.34 The following functions are from R to R. Determine whether they are injective,
surjective or bijective.
(a) f (x) = 9x
(b) f (x) = 2x
8 +2 5
<x 1
, x 6= 1
(c) f (x) = x 1
:
1, x=1
(d) f (x) = x(x2 1)
(e) f (x) = x2 sin x
(f) f (x) = x3 + 1
then f 1
is a function such that:
1 1 1
f (5) = 1, f (7) = 3, f ( 10) = 8.
Proue that f( x) =
,is surjectine f : R { -1 1 }
\ ,
→
R
tRktDmchthetflx
%
P 然 Kgt _
☆ ,雪 x
=±
哥
1 ± 4
y =
() =f
Considr 4
f
+
y ( 1
)
=
⽚
Considw () f
⼾灣 =
州⼚ ⼈繼州州
zylt y(
2
= =
— —
+
— —
H 1
y
2 y (
( 2
= =
)
- )
y Y
= =
灣 R{1
1 ±
ty ε R 雪x }
⼀
: =
ε
,
,
:
flx ) is
-
=
surjectiue -
x
26 Preliminaries
Definition 1.7 — Inverse Function. Let f : D ! C be an injective function, then there exists an
inverse function f 1
: f (D) ! D which is defined by the rule:
1
f (y) = x () y = f (x)
i The domain of f 1 is the range of f and is not necessarily the entire codomain of f . If y is
in the codomain C but not in range of f , then there is no x in D such that y = f (x) and so
f 1 (y) cannot be defined.
⌅ Solution Let a and b be two numbers in ( 1, 1) such that f (a) = f (b), then:
a b
=
1+a 1+b
a(1 + b) = b(1 + a) (cross-multiplication)
a + ab = b + ab
a=b (cancellation of ab)
Hence, f is injective.
1.3 Functions 27
To find f 1
, we first write down y = f (x) and then solve for x in terms of y:
x
y=
1+x
y(1 + x) = x
y + xy = x
y=x xy
y = x(1 y)
y
x=
1 y
Therefore,
1 y
f (y) = .
1 y
i After we learn some curve-sketching skills in later chapters, we can find out the range of
f is (1, 1), and hence (1, 1) is the domain of f 1 .
⌅ Exercise 1.37 The following functions f : R ! R are bijective. Write down the inverse
function f 1 of each of the following:
(a) f (x) = 6x + 4
(b) f (x) = x1013
(c) f (x) = x
8
<1, x 6= 0
(d) f (x) = x
:0, x=0
Composition of f and f 1
f 1
(f (x)) = x for any x in D
f (f 1
(y)) = y for any y in f (D)
Since:
(f 1
f )(x) = f 1
(f (x)) = x for any x in D
Therefore, f 1
f is a function that maps every number x in D to itself. Therefore,
f 1
f = idD
Likewise, f f 1
= idE .
28 Preliminaries
Graph of f 1
⌅ Example 1.12 — HKALE Pure Math 1992 Paper 1, Q6 (modified). Let f : R ! R be bijective,
and a1 < a2 < · · · < an , where n 2. Suppose f is strictly increasing on R. Show that
n
!
1 1X
a1 < f f (ak ) < an .
n
k=1
⌅ Solution (a) Given that a1 < a2 < · · · < an , and f is strictly increasing, we have
Therefore,
n
1X f (a1 ) + f (a2 ) + · · · + f (an ) f (an ) + f (an ) + · · · + f (an )
f (ak ) = < = f (an ).
n n n
k=1
Similarly, we have
n
1X f (a1 ) + f (a2 ) + · · · + f (an ) f (a1 ) + f (a1 ) + · · · + f (a1 )
f (ak ) = > = f (a1 ).
n n n
k=1
To summarize, we have
n
1X
f (a1 ) < f (ak ) < f (an ).
n
k=1
1.3 Functions 29
Note that f 1
(f (x)) = x for any x 2 R, so we conclude that
n
!
1 1X
a1 < f f (ak ) < an .
n
k=1
⌅ Exercise 1.38 Let f : R ! R be bijective, and a1 < a2 < · · · < an , where n 2. Suppose f is
strictly increasing on R.
(a) Define h(x) = 3f (x) + 2. Show that h : R ! R is bijective, and that
✓ ◆
x 2
h 1 (x) = f 1 .
3
1.3.11 Absolute-value
Recall that the absolute-value is defined as:
(
x if x 0
|x| = .
x if x < 0
f (x) = |x| .
x<0 x 0
y<0 xy > 0, hence |xy| = xy; xy 0, hence |xy| = xy
whereas |x| |y| = ( x)( y) = xy whereas |x| |y| = (x)( y) = xy
y 0 xy 0, hence |xy| = xy xy > 0, hence |xy| = xy
whereas |x| |y| = ( x)(y) = xy whereas |x| |y| = (x)(y) = xy
However, beware that generally we only have |x + y| |x| + |y|, and equality holds only
when x and y are of the same sign, i.e. when both 0, or both 0. This result is known as
the triangle inequality, as its higher dimensional version means the sum of any two sides of a
triangle is at least greater that length of the remaining side. Here is the proof:
2 2 2 2
|x + y| |x| + |y| = (x + y)2 |x| 2 |x| |y| |y|
= x2 + 2xy + y 2 x2 2 |x| |y| y2
= 2 xy |xy| 0.
Therefore, we get
2 2
|x + y| (|x| + |y|) .
Since both |x + y| and |x| + |y| are non-negative, we conclude that
|x + y| |x| + |y| .
⌅ Solution Recall that if |a| = 16, then there are two possibilities: a = 16 or a = 16.
Therefore, 3x2 + 20x + 9 = 16 implies
|3x + 1| 2 0
|3x + 1| 2
⌅ Example 1.17 Show that (cos ✓ + i sin ✓)n = cos(n✓) + i sin(n✓) for any n 2 N and ✓ 2 R.
⌅ Solution Let P (n) be the statement “(cos ✓ + i sin ✓)n = cos(n✓) + i sin(n✓) for any ✓ 2 R”.
Then, P (1) obviously holds.
Assume that P (n) is true for some n 2 N, i.e. for this n, we have:
Mathematical induction can also be used to prove inequalities. Here is an example whose
technique is often used in the next chapter.
x1 = 1
p
xn+1 = xn + 1 for any n 2 N
⌅ Solution Let P (n) be the statement “1 xn < xn+1 < 2”. When n = 1, we compute that
p p
x2 = x1 + 1 = 2.
Obviously, we have
1 x1 < x2 < 2.
|{z} |{z}
p
=1 = 2
Here we have used the assumption that xn+1 > xn . This shows xn+2 > xn+1 .
Finally, we argue using that the assumption xn+1 < 2 that:
p p
xn+2 = xn+1 + 1 < 2 + 1 < 2.
Combining all results proved, we have 1 xn+1 < xn+2 < 2, and so P (n + 1) holds.
By induction, we conclude that P (n) is true for all n 2 N.
⌅ Exercise 1.45 — Extracted from HKAL Pure Math 2008 Paper I Q9. Let {x1 , x2 , · · · } and
{y1 , y2 , · · · } be sequences defined by:
x1 = 2 y1 = 8
x2n yn + xn yn2 x2n + yn2
xn+1 = yn+1 = for any n 2 N
x2n + yn2 x n + yn
⌅ Example 1.19 Prove that for any n 2 N, there exist distinct integers x, y, z such that x2 + y 2 +
z 2 = 14n .
⌅ Solution We let P (n) be the statement “there exist distinct integers x, y, z such that x2 +
y + z 2 = 14n ”. Then P (1) is true because 12 + 22 + 32 = 141 , and P (2) is true because
2
42 + 62 + 122 = 142 .
Assume P (n) holds, then there exist distinct integers x0 , y0 , z0 such that
(14x0 )2 + (14y0 )2 + (14z0 )2 = 142 (x20 + y02 + z02 ) = 142 · 14n = 14n+2 ,
and that {14x0 , 14y0 , 14z0 } are distinct integers too, we conclude that P (n + 2) holds.
By induction, we proved P (n) is true for all n 2 N.
1.4 Mathematical Inductions 35
⌅ Exercise 1.47 — HKAL Pure Math 1997. Let {an } be a sequence of real numbers, where
1 1
a0 = 1, a1 = 6, a2 = 45, an an+1 + an+2 an+3 = 0 for all n 2 N [ {0}.
3 27
Prove that an = 3n (n2 + 1) for all n 2 N [ {0}.
Another important variant of mathematical inductions is to assume that P (1), · · · , P (n) are
true to show that P (n + 1) is true.
⌅ Example 1.20 Prove that every integer n 2 is a prime number or a product of prime
numbers.
⌅ Solution Let P (n) be the statement: “n is a prime number or a product of prime numbers”.
Note that we need to show P (n) is true for n 2, so we start with P (2). Obviously, 2 is itself a
prime, so P (2) holds.
Now assume P (2), P (3), · · · , P (n) all hold, and consider P (n + 1). There are two cases: If
n + 1 is itself a prime, then P (n + 1) holds. Otherwise, n + 1 will be a composite number, and
so can be written as n + 1 = km where k, m 2 N\{1}. We must have k, m < n since k, m > 1.
Since P (k) and P (m) are both true by induction assumption, both k and m are products of
prime numbers. This obviously implies n + 1 = km is also a product of prime numbers. Hence
P (n + 1) holds in both cases.
By induction, P (n) is true for any n 2 N\{1}.
⌅ Exercise 1.48 Prove that every integer n 6 can be written as the sum of 2’s and 5’s.
only if a1 = · · · = an ”.
We first use standard induction to prove that P (2k ) is true for any k 2 N. When k = 1, then
2k = 2 and we consider an arbitrarily pair of numbers a1 , a2 0. By the fact that
✓ ◆2
a1 + a2 1
a1 a2 = (a1 a2 ) 2 0,
2 4
we conclude that
✓ ◆2
a1 + a2 a1 + a2 p
a1 a2 =) a1 a2 .
2 2
We have used the fact that a1 a2 0. Equality holds if and only if 14 (a1 a2 )2 = 0, which is
equivalent to a1 = a2 . This shows P (21 ) is true.
Now assume P (2k ) for some k 2 N, and we want to prove P (2k+1 ) is true. By P (2k ) being
true it means that we can apply AM-GM inequality on any 2k numbers. Now we consider any
arbitrary 2k+1 numbers a1 , · · · , a2k+1 0. The key idea is to group these 2k+1 numbers into two
groups, each of which consists of 2k many numbers:
Since P (2k ) is true, we can apply the AM-GM inequality on these 2k many numbers a1 , · · · , a2k :
p
a 1 + · · · + a 2k 2k · 2k
a 1 · · · a 2k .
Similarly, a2k +1 , · · · , a2k+1 are also 2k many non-negative numbers, so we can apply the AM-GM
inequality on them:
p
a2k +1 + · · · + a2k+1 2k · 2k a2k +1 · · · a2k+1 .
Combining both results, we conclude that
a1 + · · · + a2k+1
2k+1
(a1 + · · · + a2k ) + (a2k +1 + · · · + a2k+1 )
=
2k+1
k p p
2 · 2 k
a1 · · · a2k + 2k · 2k a2k +1 · · · a2k+1
(since P (2k ) is true)
2k+1
p p
2 k a · · · a k + 2k a k
1 2 2 +1 · · · a2k+1
=
q 2
p p
2 k
a1 · · · a2k · 2k a2k +1 · · · a2k+1 (since P (2) is true)
p
= 2k+1 a1 · · · a2k a2k +1 · · · a2k+1 .
Equality holds if and only if the two inequalities above are equalities. This happens if and only if
p p
a1 = · · · = a2k , and a2k +1 = · · · = a2k+1 , and 2k
a 1 · · · a 2k = 2k a2k +1 · · · a2k+1 ,
which are equivalent to a1 = · · · = a2k = a2k +1 = · · · = a2k+1 . This proves P (2k+1 ) is true.
By induction, we conclude that P (2k ) is true for any k 2 N.
i One common confusion is why we can apply the induction assumption P (2k ) on the set
of numbers a2k +1 , · · · , a2k+1 , while the statement of P (2k ) is about a1 , · · · , a2k . Note that
P (2k ) being true as the AM-GM inequality holds for ANY a1 , · · · , a2k 0, not a fixed set of
{a1 , · · · , a2k }. After we assume P (2k ) is true, we can apply the AM-GM inequality on ANY
set of 2k non-negative numbers, not just on a1 , · · · , a2k but also on a2k +1 , · · · , a2k+1 . Try
to think about {a1 , · · · , an } in the statement of P (n) as merely labels of numbers. Compare
with the situation that if we assume f (x) 0 for any x 2 R, then it is still true that
f (x + 1) 0 for any x 2 R.
1.4 Mathematical Inductions 37
Next we assume P (n) is true for some n 2, and we want to prove that P (n 1) is true.
From the above remark, assuming P (n) is true means that the AM-GM inequality holds for ANY
set of n non-negative numbers.
To prove that P (n 1) is true, we take an arbitrary set of n 1 numbers x1 , · · · , xn 1 0.
The key trick here is to apply the AM-GM inequality on n numbers, namely:
x1 + · · · + xn 1
x 1 , · · · , xn 1, and .
n 1
As they are all non-negative, we can apply the AM-GM inequality on them since we assume P (n)
is true: r
x1 + · · · + xn 1 + x1 +···+x
n 1
n 1
n x1 + · · · + xn 1
x1 · · · xn 1 · ,
n n 1
which is equivalent to
✓ ◆ n1
x1 + · · · + xn 1 1 x1 + · · · + xn 1
(x1 · · · xn 1) n ,
n 1 n 1
Show that ✓ ◆
f (x1 ) + · · · + f (xn ) x1 + · · · + xn
f 8x1 , · · · , xn 2 [a, b].
n n
⌅ Exercise 1.50 — Modified from HKAL Pure Math 1996. Prove that
✓ ◆m
a1 + · · · + an am m
1 + · · · + an
n n