You are on page 1of 32

SETS AND FUNCTIONS

SETS AND MAPPINGS

B. O. ONASANYA1,2
1 Chongqing Three Gorges University, Wanzhou, P. R. China,
2 University of Ibadan, Ibadan, Nigeria
SETS AND FUNCTIONS

Outline

1 SETS AND FUNCTIONS


Sets
Functions
SETS AND FUNCTIONS

Sets

Set
A set is a well-defined collection of objects, which are called the
elements of the set.
Sets will be denoted by capital letters A, B, C, · · · , and their
elements by lower case letters a, b, c, · · · . a ∈ A means that a
is an element of the set A and the negation of it is a 6∈ A.
SETS AND FUNCTIONS

Sets

Set
Sets can be defined by writing their elements in braces, as in
{a, b, c, d}. It can also be by the description of the elements.
A = {a|a has propertyP} is the set of all objects with the
property P.
The number of elements of a set A is denoted by |A|.
SETS AND FUNCTIONS

Sets

Power Set
Let A be a nonempty set. The set P(A) is the set of all subsets
of A.

Example
Let A = {1, 2, 3},
P(A) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, A}.
SETS AND FUNCTIONS

Sets

Example
(1) N = {1, 2, 3, 4, · · · }, set of natural numbers
(2) Z = {0, ±1, ±2, ±3, ±4, · · · }, set of integers
(3) Q = { ba |a, b ∈ Z, b 6= 0}, set of rational numbers
(4) R = {x| − ∞ < x < ∞}, set of real numbers
(5) C = {a + ib|ab ∈ R}, set of complex numbers

Remark
Let A be any of the sets (1)-(5). A∗ is the set of nonzero
elements of A.
SETS AND FUNCTIONS

Sets

Remark
Here is an example of a set described by property.

Example
B = {x ∈ Z|x = 2n + 1 ∀n ∈ Z} = {±1, ±3, ±5, · · · }
SETS AND FUNCTIONS

Sets

Definition
The empty set is the set having no elements and is denoted by
∅ or {}.

Definition
Let A and B be two sets. If every element of A is an element of
B, we write
A⊆B
and say that A is a subset of B, or that A is contained in B.
SETS AND FUNCTIONS

Sets

Note that empty set is considered as a subset of any set.


Definition
If A ⊆ B and B ⊆ A, then A and B are said to be equal, and
denoted by
A = B.
The negation of A = B is A 6= B.

Definition
The notation A ⊂ B is used if A ⊆ B and A 6= B. If A ⊂ B, we
say that A is a proper subset of B.
SETS AND FUNCTIONS

Sets

Some useful notions


(1) ∩ means intersection
(2) ∪ means union
(3) Ac means complement of A
(4) P(X ) means power set of X , a set of all subsets of X , a set
in which every subset of X is an element
(5) |.| means cardinality of a set, number of elements in the
set.
SETS AND FUNCTIONS

Sets

Example
Let X = {1, 2, 3} as the universal set.
(1) P(X ) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, X }
(2) |X | = 3
(3) ξ universal set, a set of all elements
(4) |P(X )| = 2|X | = 23 = 8
(5) Let A = {2, 3} be subset of X . Ac = {1}
SETS AND FUNCTIONS

Sets

Definition
The union of A and B is the set of all objects which belong to A
or B or both and is denoted by
A ∪ B = {x|x ∈ A or x ∈ B or both},

Definition
The intersection of A and B consists of all objects that belong to
both A and B and is denoted by A ∩ B = {x|x ∈ A and x ∈ B}.
SETS AND FUNCTIONS

Sets

Definition
The relative complement of B in A is

A − B = {x|x ∈ A and x 6∈ B}.

Frequently one has to deal only with subsets of some fixed set
U, called the universal set. If A ⊆ U, then the complement of A
in U is A = U − A.
SETS AND FUNCTIONS

Sets

Definition
Let A1 , A2 , · · · , An be sets. An n-tuple of elements from
A1 , A2 , · · · , An is element (a1 , a2 , · · · , an ) with ai ∈ Ai , where
i = 1, 2, · · · , n.
The set of all n-tuples is denoted by

A1 × A2 × · · · × An ,

which is called the set product (or cartesian product) of


A1 , A2 , · · · , An .
SETS AND FUNCTIONS

Sets

Exercise
1. Let A, B, C be sets such that A ∩ B = A ∩ C and
A ∪ B = A ∪ C. Prove that

B = C.

2. If A, B, C are sets, establish the following:


(a) (A − B) − C = A − (B ∪ C).
(b) A − (B − C) = (A − B) ∪ (A ∩ B ∩ C).
SETS AND FUNCTIONS

Sets

Definition
Let X be a nonempty set. The collection {Ai } of subsets of X is
said to be a partition of X if
(1) for any a ∈ X , a ∈ Ai for some i
(2) Ak ∩ Aj 6= ∅ if Ak = Aj

Definition
Alternatively, {Ai } is a partition of X if
(1) for any a ∈ X , a ∈ Ai for some i
(2) Ak ∩ Aj = ∅ if Ak 6= Aj
The sets Ai s are called the blocks, parts or cells of the partition.
SETS AND FUNCTIONS

Sets

Example
(1) Let X = {1, 2, 3, · · · , 9} and identify which of the following
is a partition of X :
(i) [{1, 3, 5}, {2, 6}, {4, 8, 9}]
(ii) [{1, 3, 5}, {2, 4, 6, 8}, {5, 7, 9}]
(iii) [{1, 3, 5}, {2, 4, 6, 8}, {7, 9}]
(2) [{2n + 1|n ∈ Z}, {2n|n ∈ Z}] is a partition of Z
SETS AND FUNCTIONS

Sets

Some algebra of sets


(1) A ∩ A = A, A ∪ A = A (Idempotent Law)
(2) (A ∪ B) ∪ C = A ∪ (B ∪ C), (A ∩ B) ∩ C = A ∩ (B ∩ C)
(Associative Law)
(3) A ∩ B = B ∩ A, A ∪ B = B ∪ A (Commutative Law)
(4) A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C),
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) (Distributive Law)
(5) (A ∪ B)c = Ac ∩ B c , (A ∩ B)c = Ac ∪ B c (De Morgan’s Law)
SETS AND FUNCTIONS

Functions

Function
Let A and B be two sets. A function or mapping from A to B, in
symbols
f : A → B,
is a rule which assigns to each element a of A a unique
element f (a) of B, called the image of a under f . The sets A
and B are the domain and codomain of f respectively. The
image of the function f is

Im(f ) = {f (a)|a ∈ A},

which is a subset of B.
SETS AND FUNCTIONS

Functions

Function
A function f : A → B is called injective (or one-one) if
f (a) = f (b) always implies that a = b , that is, distinct elements
of A have distinct images in B under f .
f : A → B is surjective (or onto) if each element of B is the
image under f of at least one element of A, that is, Im(f ) = B.
f : A → B is said to be bijective (or a one-one correspondence)
if it is both injective and surjective.
SETS AND FUNCTIONS

Functions

Example
(a) f : R → R where f (x) = ex is injective but not surjective.

150

100
ex

50

0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
x
SETS AND FUNCTIONS

Functions

Example
(b) f : R → R where f (x) = x(x − 1)(x − 2) is surjective but not
injective. Note that any line parallel to the x-axis meets the
curve at least once, so f is surjective. However, f is not injective
since f (0) = 0 = f (1) = f (2) but 0 6= 1 6= 2.

0.4

0.3

0.2

0.1
f(x)

-0.1

-0.2

-0.3

-0.4
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
x
SETS AND FUNCTIONS

Functions

Example
(c) The identity mapping f : R → R where f (x) = x is bijective.

0.9

0.8

0.7

0.6
f(x)

0.5

0.4

0.3

0.2

0.1

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
x
SETS AND FUNCTIONS

Functions

Example
(d) f : R → R where f (x) = x 2 is neither injective nor surjective.

3.5

2.5
f(x)

1.5

0.5

0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
x
SETS AND FUNCTIONS

Functions

Example
(e) The constant mapping f : X → Y where f (x) = r is neither
injective nor surjective. But, if f : X → {r }, it is only surjective.
Consider when r = 2.

2.8

2.6

2.4

2.2
f(x)

1.8

1.6

1.4

1.2

1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
x
SETS AND FUNCTIONS

Functions

Remark
The composition of two functions f : A → B and g : B → C,
where A, B, C are sets, graphically shown as g ◦ f : A → C and
defined by
g ◦ f (a) = g(f (a)),
is also a function.
The following proposition shows that the composition of
functions is associative law.
SETS AND FUNCTIONS

Functions

Proposition
If A, B, C, D are sets, f : A → B, g : B → C and h : C → D are
functions, then
h ◦ (g ◦ f ) = (h ◦ g) ◦ f .

Proof:
For any x ∈ A, we have

(h ◦ (g ◦ f ))(x) = h((g ◦ f )(x))


= h(g(f (x)))
= (h ◦ g)(f (x))
= ((h ◦ g) ◦ f )(x),

thus the associative law is valid.


SETS AND FUNCTIONS

Functions

Proposition
Composition of two injective mappings is also injective.

Proof:
Let f and g be injective and assume that

(f ◦ g)(x) = (f ◦ g)(y )
⇒ f (g(x)) = f (g(y ))
⇒ g(x) = g(y ), since f is injective
⇒x = y , since g is injective.
SETS AND FUNCTIONS

Functions

Proposition
If f ◦ g is injective, only g must be injective but f needs not be.

Proof:
If f ◦ g is injective, let

g(x) = g(y )
⇒ f (g(x)) = f (g(y ))
.
⇒ (f ◦ g)(x) = (f ◦ g)(y ),
⇒x = y , since (f ◦ g is injective.

Hence, g is injective.
SETS AND FUNCTIONS

Functions

Proof:
To show that f is not we use counter example. Let g = 2x and
 x
2, for even x,
f (x) = (1)
x + 1, for oddx

g(a) = g(b) ⇒ 2a = 2b ⇒ a = b and


(f ◦ g)(x) = x ⇒ (f ◦ g)(a) = (f ◦ g)(b) ⇒ a = b, in which case
g and (f ◦ g) are injective. But f (1) = 2 = f (4) and 1 6= 4.
Hence, f is not injective.
SETS AND FUNCTIONS

Functions

Some facts
Functions f : A → B and g : B → A are said to be mutually
inverse if f ◦ g = idB and g ◦ f = idA . If g 0 is another inverse for
f , then g = g 0 , for by the associative law we have
g 0 ◦ (f ◦ g) = g 0 ◦ idB = g 0 = (g 0 ◦ f ) ◦ g = idA ◦ g = g. Therefore
f has a unique inverse if it has one at all; we write

f −1 : B → A

for the unique inverse of f , if it exists.


SETS AND FUNCTIONS

Functions

Exercises
1. Which of the following functions is/are injective, surjective,
bijective?
(a) f : R → Z with f (x) = [x], where [x] denotes the largest
integer less or equal to x.
(b) f : R → R+ with f (x) = ex , where R+ stands for the set of
positive real numbers.
(c) f : A × B → B × A where f ((a, b)) = (b, a).

You might also like