0% found this document useful (0 votes)
13 views10 pages

SEHH2241 Lecture 5

Uploaded by

f5nrhsbkr9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views10 pages

SEHH2241 Lecture 5

Uploaded by

f5nrhsbkr9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

SEHH2241 L101/102 Lecture #5 Sem1 2022

1 Functions
Let A and B be nonempty sets. A function (or map/mapping) f from A to B is an assignment of
exactly one element of B to each element of A. We write f (a) = b if b is the unique element of B
assigned by the function f to the element a ∈ A. If f is a function from A to B,we write f : A → B.
Moreover, we say that A is the domain of f and B is the codomain of f . In addition, we may write
f
f (a) = b by a 7→ b or a 7→ b when the map f is clear.

Definition 1. Suppose f : A → B.

(1) The domain A of f is the set of all possible inputs.

(2) The codomain B of f is the set where the outputs belong to.

(3) The range (or image) is the subset of B defined by

range(f ) := {f (x) : x ∈ A} .

(4) the direct image of a subset A′ ⊆ A is the subset of B defined by

f (A′ ) = {f (a) ∈ B : a ∈ A′ }.

(5) the inverse image (or pre-image) of a subset B ′ ⊆ B is the subset of A defined by

f −1 (B ′ ) = {x ∈ A : f (x) ∈ B ′ }.

1
a
2
b
3
c
4
d

Figure 1: A mapping from {a, b, c, d} to {1, 2, 3, 4}.

1
In general, we can illustrate a function by

f
a f (a)
f

range(f )

A B

Figure 2: The function f maps A to B.

2 Operators on Functions

Definition 2. Let f, g : A → B. Then the followings are also functions:

• the (pointwise) addition f + g : A → B defined by (f + g)(x) := f (x) + g(x).

• the (pointwise) multiplication f g : A → B defined by (f g)(x) := f (x)g(x).

Definition 3. Let f : A → B and g : B → C. Then the composition g ◦ f : A → C is defined


by (g ◦ f )(x) := g(f (x)).

g◦f

f g

A B C

Figure 3: The functions f maps A to B, g maps B to C, and g ◦ f maps A to C.

2
f
A B
g
g◦f
C
Figure 4: Commutative diagram.

For example, suppose f : Z → Z × Z and g : Z × Z → Z defined by

f (x) = (n, 2n) and g(m, n) = m − n.

Then g ◦ f : R → R is given by

(g ◦ f )(x) = g(f (x)) = g(n, 2n) = n − 2n = −n.

Remark. In general, the functions composition is

(1) associative: h ◦ (g ◦ f ) ≡ (h ◦ g) ◦ f ≡ h ◦ g ◦ f .

(2) noncommutative: g ◦ f 6= f ◦ g

3 Some important functions


There are some important functions in this course:

(1) the identity function idA : A → A defined by idA (x) := x for every x ∈ A.

(2) the ceiling function ⌈·⌉ : R → Z defined by ⌈x⌉ := min{n ∈ Z : n ≥ x} = the least integer
greater than or equal to x.

(3) the floor function ⌊·⌋ : R → Z defined by ⌊x⌋ := max{n ∈ Z : n ≤ x} = the greatest integer
less than or equal to x.

(4) the characteristic function (or indicator function) χA : U → {0, 1} defined by



1 if x ∈ A

χA (x) :=
0 if x ∈

/A

given A ⊆ U.

3
For example, if A = {5, π, −3.2}, then

(1) idA (5) = 5, idA (π) = π, idA (−3.2) = −3.2

(2) ⌈5⌉ = 5, ⌈π⌉ = 4, ⌈−3.2⌉ = −3

(3) ⌊5⌋ = 5, ⌊π⌋ = 3, ⌊−3.2⌋ = −4

(4) χA (5) = χA (π) = χA (−3.2) = 1, χA (2241) = 0.

4 Injectivity

Definition 4. A function f : A → B is injective (or one-to-one) if for every a, b ∈ A,


a 6= b =⇒ f (a) 6= f (b), or equivalently f (a) = f (b) =⇒ a = b.

Example. The function f : R → R given by f (x) = 3x + 1 is injective since

f (a) = f (b)

=⇒ 3a + 1 = 3b + 1

=⇒ 3a = 3b

=⇒ a = b.

Example. The function g : R → R given by g(x) = x2 is NOT injective since f (1) = f (−1) but
1 6= −1. However, if we restrict the domain and codomain of g to R>0 , then g is injective

g(a) = g(b)

=⇒ a2 = b2

=⇒ a2 − b2 = 0

=⇒ (a − b)(a + b) = 0

=⇒ a = b or a = − b (rej.)

=⇒ a=b

Remark. There are two equivalences of f : A → B being injective:

f : A → B is injective ⇐⇒ f (x) = y has at most one solution ⇐⇒ f has left inverse.

4
Definition 5 (Increasing and Decreasing Functions). Let f : A → R and I ⊆ A be an interval.
Then we say

(1) f is strictly increasing on I if f (x1 ) < f (x2 ) for x1 < x2 in I.

(2) f is strictly decreasing on I if f (x1 ) > f (x2 ) for x1 > x2 in I.

Theorem. Let f : A → R and I ⊆ A be an interval. Then if f is either strictly increasing


or strictly decreasing, then f is injective.

Proof. We first suppose f is strictly increasing. Consider the equality f (a) = f (b). If a < b, then
f (a) < f (b) by assumption. Similarly, if a > b, then f (a) > f (b). Therefore the only case for
f (a) = f (b) is when a = b. The case of f being strictly decreasing is similar.

5 Surjectivity

Definition 6. A function f : A → B is surjective (or onto) if for every y ∈ B, there exists


x ∈ A such that f (x) = y.

Example. The function f : R → R given by f (x) = 3x + 1 is surjective since for every y ∈ R, there
y−1
exists x = such that
3
 
y−1
f (x) = 3 + 1 = (y − 1) + 1 = y.
3

Example. The function f : R → R given by f (x) = n2 is not onto since there exists y = −1 ∈ R
such that for every x ∈ R, f (x) 6= −1.

Remark. There are three equivalences of f : A → B being surjective:

f : A → B is surjective ⇐⇒ range(f ) = B

⇐⇒ f (x) = y has at least one solution

⇐⇒ f has right inverse.

We just prove the first equivalence f : A → B is surjective ⇐⇒ range(f ) = B here.

5
Proof. (=⇒) Suppose f : A → B is surjective. To show range(f ) = B, we need to show both
range(f ) ⊆ B and B ⊆ range(f ). Fortunately, the inclusion range(f ) ⊆ B is automatically true by
the definition of the range of a function. To show B ⊆ range(f ), since f is surjective, then every
y ∈ B implies y = f (x) for some x ∈ A, hence y = f (x) ∈ range(f ).
(=⇒) Suppose range(f ) = B. Then every element y in B is also an element in range(f ). Therefore
for every y ∈ B, we can write y = f (x) for some x ∈ A, which is just the definition of onto.

6 Bijectivity

Definition 7. A function f : A → B is bijective if f is both injective and surjective.

Similar to matrices, we say a function f : A → B is invertible if there exists a function g : B → A


such that for every x ∈ A and y ∈ B,

(g ◦ f )(x) = x and (f ◦ g)(y) = y,

or equivalently,
g ◦ f ≡ idA and f ◦ g ≡ idB .

Such function g is denoted by f −1 , the inverse of f .

Remark. There are two equivalences of f : A → B being bijective:

f : A → B is bijective ⇐⇒ f (x) = y has exactly one solution ⇐⇒ f is invertible.

f
a = f −1(b) f (a) = b
f −1

A B

Figure 5: The functions f maps A to B, and f −1 maps B to A.

6
1 1 1
a a a
2 2 2
b b b
3 3 3
c c c
4
one-to-one, not onto d one-to-one and onto
onto, not one-to-one

1 1
a a
2 2
b b
3 3
c c
4
not a map
neither one-to-one nor onto

Figure 6: Examples of different types of correspondences.

Example. The function f : R → R given by f (x) = 3x + 1 is bijective by showing either

(1) it is both injective and surjective by the previous examples, or


x−1
(2) there is a function g : R → R defined by g(x) = such that for every x, y ∈ R,
3
(3x + 1) − 1
(g ◦ f )(x) = g(f (x)) = g (3x + 1) = = x,
3

and    
y−1 y−1
(f ◦ g)(y) = f (g(y)) = f =3 + 1 = (y − 1) + 1 = y.
3 3

Note that such function g is unique. Indeed, the inverse of any invertible function f : A → B is
unique.

Proof. Suppose there are two inverses g and h of a function f : A → B, i.e. (g ◦ f )(x) = x for every
x ∈ A and (f ◦ h)(y) = y for every y ∈ B. Then for every y ∈ B,

g(y) = g ((f ◦ h)(y)) = (g ◦ (f ◦ h)) (y) = ((g ◦ f ) ◦ (h)) (y) = (g ◦ f )(h(y)) = h(y)

as functions composition is associative.

7
Exercise 1. Determine whether the following functions are injective, surjective or bijective.

(a) f : R → R given by f (x) = 2x − 3.

(b) g : N → Z given by g(n) = n3 − n.


2x
(c) h : R − {−1} → R − {2} given by h(x) = .
x−1
(d) p : N → Q given by p(n) = 3/n.

(e) F : Z × Z → Z given by F (n) = ⌈n/2⌉.



2n

if n ≥ 0
(f) G : Z → N given by f (n) = .
−2n + 1 if n < 0

(g) H : Z × (Z − {0}) → Q given by H(p, q) = p/q.

(h) det : {all 2 × 2 matrices} → R given by det(A) = the determinant of A.

Exercise 2. Find a function of f : N → N which is

(a) onto but not one-to-one. (c) both one-to-one or onto.

(b) one-to-one but not onto. (d) neither one-to-one nor not onto.

Exercise 3. Let f : A → B and g : B → C. Show that

(a) if f and g are injective, then so does g ◦ f .

(b) if f and g are surjective, then so does g ◦ f .

(c) if f and g are bijective, then so does g ◦ f . Moreover, find the inverse of g ◦ f .

(d) if g ◦ f is injective, then so does f .

(e) if g ◦ f is surjective, then so does g.

8
Exercise 4. Let A = 2Z and B = {2n + 1 : n ∈ Z}. Define two functions f : A × B → B × A
and g : B × A → B × B by

f (a, b) = (a + b, a) and g(c, d) = (c + d, c).

(a) Write the domain and codomain of g ◦ f .

(b) Determine whether g ◦ f is one-to-one or onto.

Exercise 5. Let f : Z → Z be a function such that f (m+n) = f (m)+f (n) and f (−n) = −f (n).
Show that

(a) f (0) = 0.

(b) f is injective if and only if f (n) = 0 has unique solution n = 0. (Hint: Apply the result
from part(a) in only-if part.)

7 Cardinalities
Definition 8. A set S is called finite if it has only finite number of elements; otherwise, it is
called infinite. Denote the number of elements of S by |S|, called the cardinality of S.

For example, |{1, 2, 3, 4}| = 4, |{α, β}| = 2, |∅| = 0.

Exercise 6. For any finite set A and B, show that

(a) |A ∪ B| = |A| + |B| − |A ∩ B|.

(b) |A × B| = |A||B|.

(c) |P(A)| = 2|A| .

For any two finite sets, we can determine whether they have the same cardinality by computing each
of the cardinality. However this doesn’t work for infinite cases. Therefore, we need to find a definition
that works for two sets, both finite or both infinite, having the same cardinality.

9
Definition 9. Let A and B be sets. Then |A| = |B| if there exists a bijection f : A → B.

Example. Consider the following two sets A = {1, 2, 3, · · · } and B = {0, 1, 2, 3, · · · }. Intuitively, the
set B looks like it has one more element than the set A. However, one can define a map f : A → B
by f (n) = n − 1. This map f is indeed a bijection (exercise :)). Hence |A| = |B|.

Exercise 7. Show that



(n − 1)/2 if n is odd

(a) Show that f : N → Z given by f (n) = is a bijection.
−n/2

if n is even

(b) |N| = |Z|.

Exercise 8. State whether each of the following statements is always true or sometimes
false. If it is true, give a proof. Otherwise, give a counter example or reason.

(a) If |A| = |B|, then A = B.

(b) If A = B, then |A| = |B|.

(c) If A ⊂ B, then |A| < |B|.

(d) If f, g : A → B are invertible, then f + g is also invertible.

(e) If g : A → range(A) is injective, then g is bijective.


 
p
(f) The assignment f : Q → Z given by f = p is a function.
q
(g) Every Function f : Z → Z satisfies f (mn) = mf (n).

10

You might also like