0% found this document useful (0 votes)
17 views

MODULE-2 - Relations and Functions

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

MODULE-2 - Relations and Functions

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

22CDT45A

MODULE-2
RELATIONS, AND FUNCTIONS
Relations and Functions: Cartesian Products and Relations.
Relations: Computer Recognition – Zero-One Matrices and Directed Graphs, Properties of
Relations, Equivalence Relations and Partitions, Partial Orders – Hasse Diagrams.
Functions: Plain and One-to- One, Onto Functions. Function Composition, and Inverse
Functions.

Cartesian Products and Relations

Cartesian Products of sets

For sets A, B the Cartesian product, or Cross product, or Product set of A and B is denoted by
𝐴 × 𝐵. Thus, 𝐴 × 𝐵 = {(𝑎, 𝑏)|𝑎 ∈ 𝐴, 𝑏 ∈ 𝐵}.

Example: Let 𝐴 = {1,3,5}, 𝐵 = {2,3} and 𝐶 = {4,6},


Then 𝐴 × 𝐵 = { (1,2), (1,3), (3,2), (3,3), (5,2), (5,3)} and
(𝐴 × 𝐵) ∪ 𝐶 = {(1,2), (1,3), (3,2), (3,3), (5,2), (5,3), 4,6}.

Note: For sets A, B; 𝐴 × 𝐵 ≠ 𝐵 × 𝐴.

Relations

For sets A, B, any subset of 𝐴 × 𝐵 is called a relation (ℛ) from A to B, where ℛ is a set of
ordered pair (𝑎, 𝑏) where 𝑎 ∈ 𝐴 and 𝑏 ∈ 𝐵 and is denoted as 𝑎ℛ𝑏.
If ℛ is a relation from 𝐴 to 𝐴, i.e. if ℛ is a subset of 𝐴 × 𝐴, then ℛ is a binary relation on 𝐴.

Example: Let 𝐴 = {2,3,4}, and 𝐵 = {4,5},


Then ℛ1 = ∅, ℛ2 = {(2,4)}, ℛ3 = { (2,4), (2,5)}, ℛ4 = { (2,4), (3,4), (4,4)}, ℛ5 = 𝐴 × 𝐵,
are some of the relations from 𝐴 to 𝐵.
Here |𝐴 × 𝐵| = 6, there are 26 possible relations from 𝐴 to 𝐵.

Note: For finite sets 𝐴, 𝐵 with |𝐴| = 𝑚 and |𝐵| = 𝑛, there are 2𝑚𝑛 relations from 𝐴 to 𝐵,
including the empty relation as well as the relation 𝐴 × 𝐵 itself.

Problems

1. For any non-empty sets A, B, C, prove the following results:


(a) 𝐴 × (𝐵 ∩ 𝐶) = (𝐴 × 𝐵) ∩ (𝐴 × 𝐶)
(b) 𝐴 × (𝐵 ∪ 𝐶) = (𝐴 × 𝐵) ∪ (𝐴 × 𝐶)
(c) 𝐴 × (𝐵 − 𝐶) = (𝐴 × 𝐵) − (𝐴 × 𝐶)
Sol:
(a) Take any (𝑥, 𝑦) ∈ 𝐴 × (𝐵 ∩ 𝐶)
Then, 𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵 ∩ 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵 and 𝑦 ∈ 𝐶

1
22CDT45A

𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵, and 𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐶


(𝑥, 𝑦) ∈ 𝐴 × 𝐵 and (𝑥, 𝑦) ∈ 𝐴 × 𝐶
(𝑥, 𝑦) ∈ (𝐴 × 𝐵) ∩ (𝐴 × 𝐶)
𝐴 × (𝐵 ∩ 𝐶) ⊆ (𝐴 × 𝐵) ∩ (𝐴 × 𝐶). --------- (1)

Conversely, Take any (𝑥, 𝑦) ∈ (𝐴 × 𝐵) ∩ (𝐴 × 𝐶)


Then, (𝑥, 𝑦) ∈ 𝐴 × 𝐵 and (𝑥, 𝑦) ∈ 𝐴 × 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵, and 𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵 and 𝑦 ∈ 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵 ∩ 𝐶
(𝑥, 𝑦) ∈ 𝐴 × (𝐵 ∩ 𝐶)
(𝐴 × 𝐵) ∩ (𝐴 × 𝐶) ⊆ 𝐴 × (𝐵 ∩ 𝐶). --------- (2)
From (1) and (2), 𝐴 × (𝐵 ∩ 𝐶) = (𝐴 × 𝐵) ∩ (𝐴 × 𝐶).

(b) Take any (𝑥, 𝑦) ∈ 𝐴 × (𝐵 ∪ 𝐶)


Then, 𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵 ∪ 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵 or 𝑦 ∈ 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵, or 𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐶
(𝑥, 𝑦) ∈ 𝐴 × 𝐵 or (𝑥, 𝑦) ∈ 𝐴 × 𝐶
(𝑥, 𝑦) ∈ (𝐴 × 𝐵) ∪ (𝐴 × 𝐶)
𝐴 × (𝐵 ∪ 𝐶) ⊆ (𝐴 × 𝐵) ∪ (𝐴 × 𝐶). --------- (3)

Conversely, Take any (𝑥, 𝑦) ∈ (𝐴 × 𝐵) ∪ (𝐴 × 𝐶)


Then, (𝑥, 𝑦) ∈ 𝐴 × 𝐵 or (𝑥, 𝑦) ∈ 𝐴 × 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵, or 𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵 or 𝑦 ∈ 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵 ∪ 𝐶
(𝑥, 𝑦) ∈ 𝐴 × (𝐵 ∪ 𝐶)
(𝐴 × 𝐵) ∪ (𝐴 × 𝐶) ⊆ 𝐴 × (𝐵 ∪ 𝐶). --------- (4)
From (3) and (4), 𝐴 × (𝐵 ∪ 𝐶) = (𝐴 × 𝐵) ∪ (𝐴 × 𝐶).

(c) Take any (𝑥, 𝑦) ∈ 𝐴 × (𝐵 − 𝐶)


Then, 𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵 − 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵 and 𝑦 ∉ 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵, and 𝑥 ∈ 𝐴 and 𝑦 ∉ 𝐶
(𝑥, 𝑦) ∈ 𝐴 × 𝐵 and (𝑥, 𝑦) ∉ 𝐴 × 𝐶
(𝑥, 𝑦) ∈ (𝐴 × 𝐵) − (𝐴 × 𝐶)
𝐴× (𝐵 − 𝐶) ⊆ (𝐴 × 𝐵) − (𝐴 × 𝐶). --------- (5)

Conversely, take any (𝑥, 𝑦) ∈ (𝐴 × 𝐵) − (𝐴 × 𝐶)


Then, (𝑥, 𝑦) ∈ 𝐴 × 𝐵 and (𝑥, 𝑦) ∉ 𝐴 × 𝐶
𝑥 ∈ 𝐴, 𝑦 ∈ 𝐵, and 𝑥 ∈ 𝐴, 𝑦 ∉ 𝐶
𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵 − 𝐶
(𝑥, 𝑦) ∈ 𝐴 × (𝐵 − 𝐶)
(𝐴 × 𝐵) − (𝐴 × 𝐶) ⊆ 𝐴 × (𝐵 − 𝐶). --------- (6)
From (5) and (6), 𝐴 × (𝐵 − 𝐶) = (𝐴 × 𝐵) − (𝐴 × 𝐶).

2
22CDT45A

2. Let A, B, C, D be non-empty sets. Prove that (𝐴 × 𝐵) ⊆ (𝐶 × 𝐷) if and only if 𝐴 ⊆ 𝐶 and


𝐵 ⊆ 𝐷. What happens to this result if any of the sets is empty?
Sol: First, Suppose that (𝐴 × 𝐵) ⊆ (𝐶 × 𝐷).
Take any 𝑎 ∈ 𝐴 and any 𝑏 ∈ 𝐵, then (𝑎, 𝑏) ∈ (𝐴 × 𝐵).
Since (𝐴 × 𝐵) ⊆ (𝐶 × 𝐷) ⇒ (𝑎, 𝑏) ∈ (𝐶 × 𝐷), therefor 𝑎 ∈ 𝐶 and 𝑏 ∈ 𝐷.
∴ 𝐴 ⊆ 𝐶 and 𝐵 ⊆ 𝐷.
Conversely, suppose that 𝐴 ⊆ 𝐶 and 𝐵 ⊆ 𝐷. Take any (𝑥, 𝑦) ∈ 𝐴 × 𝐵. Then 𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵.
Since 𝐴 ⊆ 𝐶 and 𝐵 ⊆ 𝐷 ⇒ 𝑥 ∈ 𝐶 and 𝑦 ∈ 𝐷, therefore (𝑥, 𝑦) ∈ 𝐶 × 𝐷.
∴ (𝐴 × 𝐵) ⊆ (𝐶 × 𝐷).
Thus proved.

Next, suppose 𝐴 is empty, and take 𝐵 = {1,2}, 𝐶 = {2,4,5}, 𝐷 = {1,3}.


Then, 𝐴 × 𝐵 = ∅ × 𝐵 = ∅. Also, ∅ ⊆ 𝐶 × 𝐷. Therefore, here 𝐴 × 𝐵 =⊆ 𝐶 × 𝐷. But 𝐵 ⊈ 𝐷.
Thus if 𝐴 is empty, then (𝐴 × 𝐵) ⊆ (𝐶 × 𝐷) does not imply that 𝐴 ⊆ 𝐶 and 𝐵 ⊆ 𝐷.

3. Let 𝐴 = {1,2,3} and 𝐵 = {2,4,5}. Determine the following:


(i) |𝐴 × 𝐵|
(ii) Number of relations from A to B.
(iii) Number of binary relations on A.
(iv) Number of relations from A to B that contains (1,2) and (1,5).
(v) Number of relations from A, B that contain exactly five ordered pairs.
(vi) Number of binary relations on A that contain at least seven ordered pairs.

Sol: We have |𝐴| = 𝑚 = 3, |𝐵| = 𝑛 = 3


(i) |𝐴 × 𝐵| = 𝑚𝑛 = 9.

(ii) No. of relations from A to B is 2𝑚𝑛 = 29 = 512.

2
(iii) No. of binary relations on A is 2𝑚𝑚 = 2𝑚 = 29 = 512.

(iv) Let 𝑅1 = {(1,2), (1,5)}.


Every relation from A to B that contains element (1,2) and (1,5) is of the form 𝑅1 ∪ 𝑅2 ,
where 𝑅2 is a subset of ̅̅̅
𝑅1 in 𝐴 × 𝐵. Therefore, the number of such relations is equal to the
̅̅̅
number of subsets 𝑅1 .
Since ̅̅̅
𝑅1 = |𝐴 × 𝐵| − |𝑅1 | = 9 − 2 = 7, the number of subsets of ̅̅̅
𝑅1 is 27 = 128. Thus, there
are 27 = 128 number of relations from A to B that contains (1,2) and (1,5).

(v) Since 𝐴 × 𝐵 contains 9 ordered pairs, the number of relations from A to B that contain
exactly five ordered pairs is precisely the number of ways of choosing five ordered pairs from
nine ordered pairs. This number is ⬚9 𝐶5 = 126 .

(vi) Similarly, the number of binary relations on A that contains at least seven elements (ordered
pairs) is ⬚9 𝐶7 +9 𝐶8 +9 𝐶9 = 46.

3
22CDT45A

Homework
1. For any non-empty sets A, B, C, prove that (𝐴 ∪ 𝐵) × 𝐶 = (𝐴 × 𝐶) ∪ (𝐵 × 𝐶).
2. Let A and B be sets with |𝐵| = 3. If there are 4096 relations from A to B, what is |𝐴|?
3. A binary relation 𝑅 on 𝑁 is defined recursively by (i) (0,0) ∈ 𝑅 and (ii) if (𝑠, 𝑡) ∈ 𝑅 then
(𝑠 + 1, 𝑡 + 7) ∈ 𝑅. Find 𝑅 as a set of ordered pairs.
4. Find x and y in each of the following cases:
(i) (2𝑥 − 3,3𝑦 + 1) = (5,7) (ii) (𝑥 + 2,4) = (5,2𝑥 + 𝑦) (iii) (𝑥, 𝑦) = (𝑥 2 , 𝑦 2 )
5. Let 𝐴 = {1,2,3,4}, 𝐵 = {2,5}, 𝑐 = {3,4,7}. Write down the following:
𝐴 × 𝐵, 𝐵 × 𝐴, 𝐴 ∪ (𝐵 × 𝐶), (𝐴 ∪ 𝐵) × 𝐶, (𝐴 × 𝐶) ∪ (𝐵 × 𝐶).

Matrix of a relation

Consider the sets 𝐴 = {𝑎1 , 𝑎2 , … , 𝑎𝑚 } and 𝐵 = {𝑏1 , 𝑏2 , … , 𝑏𝑛 } of order 𝑚 and 𝑛 respectively.


Let ℛ be a relation from 𝐴 to 𝐵 so that ℛ is a subset of 𝐴 × 𝐵. Now, let
1 𝑖𝑓 (𝑎𝑖 , 𝑏𝑗 ) ∈ ℛ
𝑚𝑖𝑗 = { .
0 𝑖𝑓 (𝑎𝑖 , 𝑏𝑗 ) ∉ ℛ

The 𝑚 × 𝑛 matrix formed by these 𝑚𝑖𝑗 𝑠 is called the adjacency matrix, or the matrix of the
relation ℛ or the relation matrix for ℛ, and is denoted by 𝑀ℛ or 𝑀(ℛ).

Example: Consider the sets 𝐴 = {0,1,2} and 𝐵 = {𝑝, 𝑞} and the relation ℛ from 𝐴 to 𝐵 defined
by ℛ = {(0, 𝑝), (1, 𝑞), (2, 𝑝)}. Write the matrix of the relation ℛ.
Sol: Here, 𝐴 = {𝑎1 , 𝑎2 , 𝑎3 } and 𝐵 = {𝑏1 , 𝑏2 }, where 𝑎1 = 0, 𝑎2 = 1, 𝑎3 = 2, 𝑏1 = 𝑝, 𝑏2 = 𝑞.
𝑚11 = (𝑎1 , 𝑏1 ) = (0, 𝑝) = 1, because (0, 𝑝) ∈ ℛ
𝑚12 = (𝑎1 , 𝑏2 ) = (0, 𝑞) = 0, because (0, 𝑞) ∉ ℛ
𝑚21 = (𝑎2 , 𝑏1 ) = (1, 𝑝) = 0, because (1, 𝑝) ∉ ℛ
𝑚22 = (𝑎2 , 𝑏2 ) = (1, 𝑞) = 1, because (1, 𝑞) ∈ ℛ
𝑚31 = (𝑎3 , 𝑏1 ) = (2, 𝑝) = 1, because (2, 𝑝) ∈ ℛ
𝑚32 = (𝑎3 , 𝑏2 ) = (2, 𝑞) = 0, because (2, 𝑞) ∉ ℛ.
The matrix of the relation ℛ is,
1 0
𝑀ℛ = 𝑀(ℛ) = [0 1].
1 0

Digraph of a relation

• Let ℛ be a binary relation on a finite nonempty set 𝑉. A directed graph (or digraph) 𝐺 on
𝑉 is made up of the elements of 𝑉, called the vertices or nodes of 𝐺, and a subset 𝐸, of ℛ =
𝑉 × 𝑉, that contains the (directed) edges, or arcs, of 𝐺. The set 𝑉 is called the vertex set of
𝐺, and the set 𝐸 is called edge set. Then, graph is denoted by 𝐺 = (𝑉, 𝐸).
• If a relation is pictorially represented by a digraph, a vertex from which an edge leaves is
called the origin or the source for that edge, and a vertex where an edge end is called the
terminus or terminating vertex for that edge.
• A vertex which is neither a source nor a terminus of any edge is called an isolated vertex.
• An edge for which the source and the terminus are one and the same vertex is called a loop.

4
22CDT45A

• The number of edges (arrows) terminating at a vertex is called the in-degree of that vertex
and the number of edges (arrows) leaving a vertex is called the out-degree of that vertex.

Example: Consider the sets 𝐴 = {𝑎, 𝑏, 𝑐, 𝑑} and the relation ℛ=


{(𝑎, 𝑏), (𝑏, 𝑏), (𝑏, 𝑑), (𝑐, 𝑑), (𝑐, 𝑏), (𝑑, 𝑎), (𝑑, 𝑐)} defined on 𝐴. Draw a digraph of this relation
ℛ.
Sol:

Problems

1. Let 𝐴 = {1,2,3,4} and ℛ be a relation on 𝐴 defined by 𝑥ℛ𝑦 if and only if “𝑥 divides 𝑦”,
written 𝑥|𝑦.
(a) Write down ℛ as a set of ordered pairs.
(b) Draw the digraph of ℛ.
(c) Determine the in-degrees and out-degrees of the vertices in the diagraph.
Sol:
(a) By the definition of the given ℛ
ℛ = {(1,1), (1,2), (1,3), (1,4), (2,2), (2,4), (3,3), (4,4)}.
(b) The digraph of ℛ,

(c) In ℛ, for the vertices of 1,2,3,4, the in-degrees are 1,2,2,3 respectively and out-degrees are
4,2,1,1 respectively.

2. Let 𝐴 = {1,2,3,4,6} and ℛ be a relation on 𝐴 defined by 𝑎ℛ𝑏 if and only if “𝑎 is a multiple


of 𝑏”. Represent the relation ℛ as a matrix, draw its digraph and determine the in-degrees
and out-degrees of the vertices in the diagraph.
Sol: By the definition of the given ℛ
ℛ = {(1,1), (2,1), (2,2), (3,1), (3,3), (4,1), (4,2), (4,4), (6,1), (6,2), (6,3), (6,6)}.
The matrix of ℛ is
1 0 0 0 0
1 1 0 0 0
𝑀ℛ = 1 0 1 0 0
1 1 0 1 0
[1 1 1 0 1]

5
22CDT45A

The digraph of ℛ is

In ℛ, for the vertices of 1,2,3,4,6 the in-degrees are 5,3,2,1,1 respectively and out-degrees are
1,2,2,3,4 respectively.

3. Let 𝐴 = {𝑢, 𝑣, 𝑥, 𝑦, 𝑧} and ℛ be a relation on 𝐴 whose matrix is as given below. Determine


ℛ and also draw the associated digraph.
0 1 1 0 0
1 0 1 0 0
𝑀ℛ = 1 1 0 0 1
1 0 0 0 1
[0 0 1 1 0]
Sol: We have,
ℛ = {(𝑢, 𝑣), (𝑢, 𝑥), (𝑣, 𝑢), (𝑣, 𝑥), (𝑥, 𝑢), (𝑥, 𝑣), (𝑥, 𝑧), (𝑦, 𝑢), (𝑦, 𝑧), (𝑧, 𝑥), (𝑧, 𝑦)}

The digraph of ℛ is

Homework

1. Let 𝐴 = {1,2,3,4} and ℛ be a relation on 𝐴 defined by 𝑥ℛ𝑦 if and only if “𝑦 = 2𝑥”,


(a) Write down ℛ as a set of ordered pairs.
(b) Draw the digraph of ℛ.
(c) Determine the in-degrees and out-degrees of the vertices in the diagraph.

2. Find the relation represented by the digraph given below. Also, write down its matrix, and
determine the in-degrees and out-degrees of the vertices in the diagraph.
a)

6
22CDT45A

b)

Properties of Relations

❖ A relation ℛ on a set 𝐴 is called reflexive if for all 𝑥 ∈ 𝐴, (𝑥, 𝑥) ∈ ℛ.


❖ A relation ℛ on a set 𝐴 is called irreflexive if for all 𝑥 ∈ 𝐴, (𝑥, 𝑥) ∉ ℛ.
❖ Relation ℛ on a set 𝐴 is called symmetric if (𝑥, 𝑦) ∈ ℛ ⇒ (𝑦, 𝑥) ∈ ℛ for all 𝑥, 𝑦 ∈ 𝐴.
❖ A relation which is not symmetric is called an asymmetric relation.
❖ For a set 𝐴, a relation ℛ on 𝐴 is called transitive if, for all 𝑥, 𝑦, 𝑧 ∈ 𝐴, (𝑥, 𝑦), (𝑦, 𝑧) ∈ ℛ ⇒
(𝑥, 𝑧) ∈ ℛ.
❖ Given a relation ℛ on a set 𝐴, ℛ is called antisymmetric if for all 𝑎, 𝑏 ∈ 𝐴, ⇒ 𝑎 = 𝑏.
❖ A relation ℛ on a set 𝐴 is called a partial order or partial ordering relation, if ℛ is reflexive,
antisymmetric, and transitive.
❖ An equivalence relation ℛ on a set 𝐴 is a relation that is reflexive, symmetric, and transitive.

Note: If a finite set 𝐴 has 𝑛 elements, then


2
• there are 2𝑛 −𝑛 reflexive relations on 𝐴.
2
• there are 2𝑛 −𝑛 irreflexive relations on 𝐴.
2
• there are 2(𝑛 +𝑛)/2 symmetric relations on 𝐴.
2
• there are 3(𝑛 −𝑛)/2 asymmetric relations on 𝐴.
2
• there are 2(𝑛 −𝑛)/2 relations on 𝐴 that are both reflexive and symmetric.
2
• there are 2𝑛 3(𝑛 −𝑛)/2 antisymmetric relations on 𝐴.
2 2
• there are 2𝑛 − 2.2𝑛 −𝑛 relations on 𝐴 that are neither reflexive nor irreflexive.

Problem:
If 𝐴 = {1, 2, 3, 4,5}, give an example of a relation ℛ on 𝐴 that is
a) Reflexive and symmetric but not transitive
b) Reflexive and transitive but not symmetric
c) Symmetric and transitive but not reflexive.
Sol:
a) 𝑅1 = {(1,1), (2,2), (3,3), (4,4), (5,5), (1,5), (5,1), (5,3), (3,5)} is reflexive because of
(1,1), (2,2), (3,3), (4,4), (5,5), symmetric because of (1,5), (5,1), and (5,3), (3,5) but not
transitive because (1,5), (5,3) then (1,3) should be in relation 𝑅1 by transitive property. But
(1,3) ∉ 𝑅1 .
b) 𝑅2 = {(1,1), (2,2), (3,3), (4,4), (5,5), (1,5)} is reflexive; transitive because (1,5), (5,5) ⇒
(1,5) ∈ 𝑅2 which is true. But 𝑅2 is not symmetric because (1,5) ∈ 𝑅2 but (5,1) ∉ 𝑅2 .

7
22CDT45A

c) 𝑅3 = {(4,4), (5,5), (3,3), (1,5), (5,1), (1,1)} is symmetric because (1,5) ∈ 𝑅3 ⇒ (5,1) ∈
𝑅3 ; transitive because (1,5), (5,1) ⇒ (1,1) ∈ 𝑅3 but not reflexive because (2,2) ∉ 𝑅3 .

Theorem: Let ℛ and 𝒮 be relations on a set 𝐴. Prove the following:


(1) If ℛ and 𝒮 are reflexive, so are ℛ ∩ 𝒮 and ℛ ∪ 𝒮.
(2) If ℛ and 𝒮 are symmetric, so are ℛ ∩ 𝒮 and ℛ ∪ 𝒮.
(3) If ℛ and 𝒮 are antisymmetric, so is ℛ ∩ 𝒮.
(4) If ℛ and 𝒮 are transitive, so is ℛ ∩ 𝒮.

Proof:
(1) Suppose ℛ and 𝒮 are reflexive. Then (𝑎, 𝑎) ∈ ℛ and (𝑎, 𝑎) ∈ 𝒮 for all 𝑎 ∈ 𝐴.
Consequently, (𝑎, 𝑎) ∈ ℛ ∩ 𝒮 and (𝑎, 𝑎) ∈ ℛ ∪ 𝒮. Therefore, ℛ ∩ 𝒮 and ℛ ∪ 𝒮 are
reflexive.
(2) Suppose ℛ and 𝒮 are symmetric. Take any (𝑎, 𝑏) ∈ ℛ ∩ 𝒮. Then (𝑎, 𝑏) ∈ ℛ and (𝑎, 𝑏) ∈
𝒮. Therefore, (𝑏, 𝑎) ∈ ℛ and (𝑏, 𝑎) ∈ 𝒮. Consequently, (𝑏, 𝑎) ∈ ℛ ∩ 𝒮. Hence ℛ ∩ 𝒮 is
symmetric.
Next, take any (𝑥, 𝑦) ∈ ℛ ∪ 𝒮. Then, (𝑥, 𝑦) ∈ ℛ or (𝑥, 𝑦) ∈ 𝒮. Therefore, (𝑦, 𝑥) ∈ ℛ or
(𝑦, 𝑥) ∈ 𝒮. Consequently, (𝑦, 𝑥) ∈ ℛ ∪ 𝒮. Hence ℛ ∪ 𝒮 is symmetric.
(3) Suppose ℛ and 𝒮 are antisymmetric. Take any (𝑎, 𝑏), (𝑏, 𝑎) ∈ ℛ ∩ 𝒮. Then, (𝑎, 𝑏), (𝑏, 𝑎) ∈
ℛ and (𝑎, 𝑏), (𝑏, 𝑎) ∈ 𝒮. By the antisymmetric of ℛ (or 𝒮), it follows that 𝑏 = 𝑎. Thus, ℛ ∩
𝒮 is antisymmetric.
(4) Suppose ℛ and 𝒮 are transitive. Take any (𝑎, 𝑏), (𝑏, 𝑐) ∈ ℛ ∩ 𝒮. Then, (𝑎, 𝑏) ∈ ℛ, (𝑎, 𝑏) ∈
𝒮, (𝑏, 𝑐) ∈ ℛ, (𝑏, 𝑐) ∈ 𝒮. These yield (𝑎, 𝑐) ∈ ℛ and (𝑎, 𝑐) ∈ 𝒮, so that (𝑎, 𝑐) ∈ ℛ ∩ 𝒮.
Therefore, ℛ ∩ 𝒮 is transitive.

Homework
1. Determine the number of relations on 𝐴 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒} that are (a) reflexive (b) symmetric
(c) reflexive and symmetric (d) antisymmetric (e) asymmetric (f) irreflexive.
2. If 𝐴 = {1, 2, 3, 4}, give an example of a relation ℛ on 𝐴 that is
a) Reflexive and symmetric but not transitive
b) Reflexive and transitive but not symmetric
c) Symmetric and transitive but not reflexive.

Equivalence Relations and Partitions

Equivalence Relations

A relation R on a set A is said to be an equivalence relation on A if (i) R is reflexive, (ii) R is


symmetric, and (iii) R is transitive, on A.

Example. Let 𝐴 = {1,2,3,4} and 𝑅 = {(1,1), (1,2), (2,1), (2,2), (3,4), (4,3), (3,3), (4,4)} be a
relation on A. Verify that R is an equivalence relation.
Sol: Firstly we note that, (1,1), (2,2), (3,3), (4,4) belong to R. That is, (𝑎, 𝑎) ∈ 𝑅 for all 𝑎 ∈ 𝐴.
Therefore, 𝑅 is a reflexive relation.
Next, we note that (1,2), (2,1) ∈ 𝑅 and (3,4), (4,3) ∈ 𝑅.

8
22CDT45A

That is, if whenever (𝑎, 𝑏) ∈ 𝑅 then (𝑏, 𝑎) ∈ 𝑅 for 𝑎, 𝑏 ∈ 𝐴. Therefore, R is a symmetric


relation.
Lastly, we note that (1,2), (2,1), (1,1) ∈ 𝑅, (2,1), (1,2), (2,2) ∈ 𝑅, (4,3), (3,4), (4,4) ∈ 𝑅.
That is, if whenever (a,b) ∈ R and (b,c) ∈ R then (a,c) ∈ R, for a,b,c ∈ A. Therefore, R is a
transitive relation.
Accordingly, R is an equivalence relation.

Equivalence Classes
Let R be an equivalence relation on a set A and a ∈ A. Then the set of all those elements x of
A which are related to a by R is called the equivalence class of a with respect to R. This
equivalence class is denoted by 𝑅(𝑎), or [𝑎], or 𝑎̅ . Thus,
𝑎̅ = [a] =R(a) = {x ∈ A | (x,a) ∈ R}
Example. Consider the equivalence relation
R = {(1,1), (1,3), (2,2), (3,1), (3,3)}
Defined on the set A = {1,2,3}.
We find that the elements x of A for which (x,1) ∈ R are x =1, x=3.
Therefore, {1,3} is the equivalence class of 1 (with respect to R); that is,
[1] = {1,3}.
Similarly,
[2] = {2}, [3] = {1,3}.

Partition of a Set
Let A be a nonempty set. Suppose there exist nonempty subsets A1, A2, A3,…, Ak of A such
that the following two condition hold:
(1) A is the union of A1, A2,…, Ak; that is, A=A1 ∪ A2 ∪ A3 ∪ . . . ∪ Ak.
(2) Any two of the subsets A1, A2,…, Ak are disjoint; that is, Ai ∩ Aj =∅ for i ≠ j.

Then the set P = {A1, A2, A3, . . . , Ak} is called a partition of A. Also, A1, A2, A3,…, Ak are
called the blocks or cells of the partition.

Example.

Consider the set A = {1,2,3,4,5,6,7,8}. And its following subsets:


A1 = {1,3,5,7}, A2 = {2,4}, A3 ={6,8}.
We observe that 𝐴 = 𝐴1 ∪ 𝐴2 ∪ 𝐴3 . Also, any two of the subsets A1, A2, A3 are disjoint.
Therefore, P = { A1, A2, A3 } is a partition of A, with A1, A2, A3 as the blocks (cells) of the
partition.
In the above example, if A4 = {1,3,5,} then P1 = {A2, A3, A4 } is not a partition of the set A,
because although the subsets A2, A3, and A4 are mutually disjoint, A is not the union of these
subsets.

9
22CDT45A

Problems

1. Define ℛ on 𝐴 = {1,2,3,4,5,6,7,8,9,10,11,12} by (𝑥, 𝑦) ∈ ℛ if 𝑥 − 𝑦 is a multiple of 5.


(a) Show that ℛ is an equivalence relation on 𝐴.
(b) Determine the equivalence classes and partition of 𝐴 induced by ℛ.
Sol:
(a) Reflexive: For any 𝑎 ∈ 𝐴, 𝑎 − 𝑎 = 5 × 0.
Symmetric: For any 𝑎, 𝑏 ∈ 𝐴, 𝑎 − 𝑏 = 5𝑐 for some 𝑐 ∈ 𝑧. Then 𝑏 − 𝑎 = 5(−𝑐) for some
−𝑐 ∈ 𝑧 so 𝑎ℛ𝑏 ⇒ 𝑏ℛ𝑎.
Transitive: For any 𝑎, 𝑏, 𝑐 ∈ 𝐴, we have 𝑎 − 𝑏 = 5𝑚, 𝑏 − 𝑐 = 5𝑛.
Then (𝑎 − 𝑏) − (𝑏 − 𝑐) = 𝑎 − 𝑐 = 5𝑚 − 5𝑛 = 5(𝑚 − 𝑛).
So 𝑎ℛ𝑏, 𝑏ℛ𝑐 ⇒ 𝑎ℛ𝑐.
Thus ℛ is an equivalence relation on 𝐴.
(b) The equivalence classes are
[1] = [6] = [11] = {1,6,11}; [3] = [8] = {3,8}
[2] = [7] = [12] = {2,7,12}; [4] = [9] = {4,9}
[5] = [10] = {5,10}
Induced partition of 𝐴 by ℛ is
𝐴 = {1,6,11} ∪ {3,8} ∪ {2,7,12} ∪ {4,9} ∪ {5,10}.

2. Let A = {1,2,3,4,5,6,7}. Define by a relation R on a by


𝑅 = {(𝑎, 𝑏)/(𝑎 − 𝑏) 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 3}
Show that R is equivalence relation. Also find the partition of A induced by R.
Sol: Given A = {1,2,3,4,5,6,7} and R = {(a,b)/(a-b) is divisible by 3}
R = {(4,1), (5,2), (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (1,4), (1,7), (2,5), (3,6), 6,3), (4,7),
(7,4), (7,1)}
(i) (a,a) ∈ R => R is reflexive.
ie (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7) ∈ R
(ii) (a,b) ∈ R then (b,a) ∈ R => R is symmetric.
From the relation R, given R is symmetric.
(iii) (a,b) ∈ R and (b,c) ∈ R then (a,c) ∈ R => R is Transitive.
∴ R is equivalence relation.
Equivalence Classes are:
[1] = {1,4,7}
[2] = {2,5}
[3] = {3,6}
[4] = {1,4,7}
[5] = {2,5}
[6] = {3,6}
[7] = {1,4,7}
In which [1], [2], [3] are distinct.
∴ P = {[1], [2], [3]}
P = {(1,4,7), (2,5), (3,6)}
∴ A = (1,4,7) ∪ (2,5) ∪ (3,6)

10
22CDT45A

3. Let A = {1,2,3,4,5}. Define a relation R on A × A by (𝑥1 , 𝑦1 )R (𝑥2 , 𝑦2 ) if and only if


𝑥1 + 𝑦1 = 𝑥2 + 𝑦2 .
a) Verify that R is an equivalence relation on A × A.
b) Determine the equivalence classes [(1,3)], [(2,4)] and [(1,1)].
c) Determine the partition of A × A induced by R.

Sol:(a) For all (x,y) ∈ A × A, we have 𝑥 + 𝑦 = 𝑥 + 𝑦; that is, (x,y) R (x,y). Therefore, R is
reflexive.
Next, take any (𝑥1 , 𝑦1 ) (𝑥2 , 𝑦2 ) ∈ 𝐴 × 𝐴 and suppose that (𝑥1 , 𝑦1 )R(𝑥2 , 𝑦2 ).
Then 𝑥1 + 𝑦1 = 𝑥2 + 𝑦2 . This gives 𝑥2 + 𝑦2 = 𝑥1 + 𝑦1 which means that (𝑥2 , 𝑦2 )R(𝑥1 , 𝑦1 ).
Therefore, R is symmetric.
Next, take any (𝑥1 , 𝑦1 )(𝑥2 , 𝑦2 )(𝑥3 , 𝑦3 ) ∈ 𝐴 × 𝐴 and suppose that (𝑥1 , 𝑦1 )R(𝑥2 , 𝑦2 ). Thus, R is
reflexive, symmetric and transitive. Therefore, R is an Equivalence relation.

(b) We note that


[(1,3)] = {(x, y) ∈ A × A | (x, y) R (1,3)}
= {(x, y) ∈ A × A | x, y = 1+3}
= {(1,3), (2,2), (3,1)}, because A = { 1,2,3,4,5,}
Similarly, [(2,4)] = {1,5), (2,4), (3,3), (4,2), (5,1)}
[(1,1)] = {(1,1)}.

(c) To determine the partition induced by R, we have to find the equivalence classes of all
elements (x, y), of A × A, w.r.t R. From what has been found above, we note that

[(1,1)] = {[(1,1)]},
[(1,3)] = [(2,2)] = [(3,1)],
[(2,4)] = [(1,5)] = [(3,3)] = [(4,2)] = [(5,1)].

The other equivalence classes are


[(1,2)] = {(1,2), (2,1)} = [(2,1)]
[(1,4)] = {(1,4), (2,3) (3,2), (4,1)} = [(2,3)] = [(3,2)] = [(4,1)]
[(2,5)] = {(2,5), (3,4), (4,3), (5,2)} = [(3,4)] = [(4,3)] = [(5,2)]
[(3,5)] = {(3,5), (4,4), (5,3)} = [(4,4) = [(5,3)]
[(4,5)] = {(4,5), (5,4)} = [(5,4)]
[(5,5)] = {(5,5)}
Thus, [(1,1)], [(1,2)], [(1,3)], [(1,4)], [(1,5)], [(2,5)], [(3,5)], [(4,5)] and [(5,5)] are the only
distinct equivalence classes of A × A w.r.t R. Hence the partition of A × A induced by R is
represented by
A × A = [(1,1)] ∪ [(1,2)] ∪ [(1,3)] ∪ [(1,4)] ∪ [(1,5)] ∪ [(2,5)] ∪ [(3,5)] ∪ [(4,5)] ∪ [(5,5)].

Homework
1. Define ℛ on 𝐴 = {1,2,3,4,5,6,7} by (𝑥, 𝑦) ∈ ℛ if 𝑥 − 𝑦 is a multiple of 3.
(a) Show that ℛ is an equivalence relation on 𝐴.
(b) Determine the equivalence classes and partition of 𝐴 induced by ℛ.

11
22CDT45A

(−4, −20), (−3, −9), (−2, −4), (−1, −11), (−1, −3),
2. For 𝐴 = { } define the relation ℛ on 𝐴
(1,2), (1,5), (2,10), (2,14), (3,6), (4,8), (4,12)
by (𝑎, 𝑏)ℛ(𝑐, 𝑑) if 𝑎𝑑 = 𝑏𝑐.
(a) Verify that ℛ is an equivalence relation on 𝐴.
(b) Find the equivalence classes [(2,14)], [(−3, −9)] and [(4,8)].
(c) How many cells are there in the partition of 𝐴 induced by ℛ?

Partial Orders – Hasse Diagrams

A relation ℛ on a set 𝐴 is said to be a partial ordering relation or a partial order on 𝐴 if


(i) ℛ is reflexive, (ii) ℛ is antisymmetric, and (iii) ℛ is transitive, on 𝐴.

A set 𝐴 with a partial order ℛ defined on it is called a partially ordered set or an ordered set
or a poset, and is denoted by the pair (𝐴, ℛ).

The digraph of a partial order drawn is called a poset diagram or the Hasse diagram for the
partial order.

Working rule to draw Hasse diagram

Consider a digraph for the given relation ℛ on a set 𝐴


1. Eliminate loops from the digraph.
2. Suppose in a digraph, there is an edge from a vertex 𝑎 to a vertex b and there is an edge from
a vertex 𝑏 to a vertex c, then there should be an edge from a vertex 𝑎 to a vertex c (because
of transitivity). Eliminate the edge from a vertex 𝑎 to a vertex c.
3. Arrange the digraph in such a way that all the edges are pointing upwards.
3. Draw the lines/ edges between the vertices for a relation ℛ on a set 𝐴 in Hasse diagram.
(no need to put arrows)

Example:
Let 𝐴 = {1,2,3,4} and ℛ = {(1,1, ), (1,2), (2,2), (2,4), (1,3), (3,3), (3,4), (1,4), (4,4)}. Verify
that ℛ is a partial order on 𝐴. Also, write down the Hasse diagram for ℛ.
Sol: The given relation ℛ is reflexive and transitive. Further, ℛ does not contain ordered pairs
of the form (𝑎, 𝑏) and (𝑏, 𝑎) with 𝑏 = 𝑎. Therefore, ℛ is antisymmetric. As such, ℛ is a partial
order on 𝐴.
Hasse diagram:

12
22CDT45A

Problems:

1. Let 𝐴 = {1,2,3,4,6,12}. On 𝐴, define the relation ℛ by 𝑎ℛ𝑏 if and only if ‘𝑎 divides 𝑏’.
Prove that ℛ is a partial order on 𝐴. Draw the Hasse diagram for this relation and matrix of ℛ.
Sol: Given, ℛ = {(𝑎, 𝑏)|𝑎, 𝑏 ∈ 𝐴 and 𝑎 divides 𝑏}
(1,1), (1,2), (1,3), (1,4), (1,6), (1,12), (2,2), (2,4), (2,6), (2,12),
={ }.
(3,3), (3,6), (3,12), (4,4), (4,12), (6,6), (6,12), (12,12)
We see that,
(i) there is (𝑎, 𝑎) ∈ ℛ for all 𝑎 ∈ 𝐴 ⇒ ℛ is reflexive.
(ii) if (𝑎, 𝑏) ∈ ℛ and (𝑏, 𝑐) ∈ ℛ then (𝑎, 𝑐) ∈ ℛ ⇒ ℛ is transitive.
(iii) for all 𝑎, 𝑏 ∈ 𝐴, if 𝑎 divides 𝑏 and 𝑏 divides 𝑎, then 𝑎 = 𝑏 ⇒ ℛ is antisymmetric.
Therefore, ℛ is a partial order on a set 𝐴.

Hasse diagram:

Matrix of ℛ
1 1 1 1 1 1
0 1 0 1 1 1
0 0 1 0 1 1.
𝑀ℛ =
0 0 0 1 0 1
0 0 0 0 1 1
[0 0 0 0 0 1]

2. Draw the Hasse diagram representing the positive divisors of 36.


Sol: The set of all positive divisors of 36 is 𝐷36 = {1,2,3,4,6,9,12,18,36}.
The relation ℛ is given by 𝑎ℛ𝑏 if and only if ‘𝑎 divides 𝑏’, under which
1 is related to all elements of 𝐷36 , 9 is related to 9, 18, 36;
2 is related to 2, 4, 6, 12, 18, 36; 12 is related to 12 and 36;
3 is related to 3, 6, 9, 12, 18, 36; 18 is related to 18 and 36;
4 is related to 4, 12, 36; 36 is related to 36.
6 is related to 6, 12, 18, 36;

Hasse diagram:

13
22CDT45A

3. The Hasse diagram of a partial order ℛ on the set 𝐴 = {1,2,3,4,5,6} is as given below. Write
down ℛ as a subset of 𝐴 × 𝐴. Construct its digraph.

(1,1), (1,4), (1,6), (2,2), (2,5), (2,6), (3,3),


Sol: Given, ℛ = { }.
(3,5), (3,6), (4,4), (4,6), (5,5), (5,6), (6,6)

Digraph:

4. Draw the Hasse diagram of the relation ℛ on 𝐴 = {1,2,3,4,5} whose matrix is given below:
1 0 1 1 1
0 1 1 1 1
𝑀ℛ = 0 0 1 1 1 .
0 0 0 1 0
[0 0 0 0 1]
(1,1), (1,3), (1,4), (1,5), (2,2), (2,3), (2,4),
Sol: Given, ℛ = { }.
(2,5), (3,3), (3,4), (3,5), (5,5), (4,4)

Hasse diagram:

Homework:
1. Let 𝐴 = {1,2,3,4}. On 𝐴, define the relation ℛ by 𝑥ℛ𝑦 if and only if ‘𝑥 divides 𝑦’. Prove
that (𝐴, ℛ) is a poset. Draw the Hasse diagram for this relation and matrix of ℛ.
2. Let 𝐴 = {1,2,3,4,6,8,12}. And ℛ be a partial order on 𝐴 defined 𝑎ℛ𝑏 if and only if ‘𝑎
divides 𝑏’.
(a) Draw the Hasse diagram of the poset (𝐴, ℛ)
(b) Determine the relational matrix for ℛ

14
22CDT45A

(c) Construct the directed graph 𝐺 (on 𝐴) that is associated with ℛ.


3. Determine the matrix and digraph of the partial order whose Hasse diagram is given
below:

Functions – Plain and One-to- One, Onto Functions

❖ For nonempty sets A, B, a function (or mapping) 𝑓 from 𝐴 to 𝐵, denoted by 𝑓: 𝐴 → 𝐵, is a


relation from 𝐴 to 𝐵 such that for each 𝑎 in 𝐴 there is a unique 𝑏 in 𝐵 such that (𝑎, 𝑏) ∈ 𝑓.
Also, written as 𝑏 = 𝑓(𝑎).

𝑓(𝑎) = 𝑏

A B

❖ In 𝑏 = 𝑓(𝑎), 𝑏 is called the image of 𝑎, and 𝑎 is called the preimage of 𝑏, under 𝑓.


• For 𝑓: 𝐴 → 𝐵, if 𝐴1 ⊆ 𝐴 and 𝑓(𝐴1 ) is defined by 𝑓(𝐴1 ) = {𝑓(𝑥)|𝑥 ∈ 𝐴1 }, then
𝑓(𝐴1 ) ⊆ 𝑓(𝐴). (Here 𝑓(𝐴1 ) is called the image of 𝐴1 under 𝑓).
• For 𝑓: 𝐴 → 𝐵, if 𝑏 ∈ 𝐵 and 𝑓 −1 (𝑏) is defined by 𝑓 −1 (𝑏) = {𝑥 ∈ 𝐴|𝑓(𝑥) = 𝑏}, then
𝑓 −1 (𝑏) ⊆ 𝐴. (Here 𝑓 −1 (𝑏) is called the preimage set of 𝑏 under 𝑓).
• For 𝑓: 𝐴 → 𝐵, if 𝐵1 ⊆ 𝐵 and 𝑓 −1 (𝐵1 ) is defined by 𝑓 −1 (𝐵1 ) = {𝑥 ∈ 𝐴|𝑓(𝑥) ∈ 𝐵1 },
then 𝑓 −1 (𝐵1 ) ⊆ 𝐴. (Here 𝑓 −1 (𝐵1 ) is called the preimage of 𝐵1 under 𝑓).
❖ For the function 𝑓: 𝐴 → 𝐵, 𝐴 is called the domain of 𝑓 and 𝐵 is called the codomain of 𝑓.
❖ The subset of 𝐵 consisting of the images of all elements of 𝐴 under 𝑓 is called the range of
𝑓 and is denoted by 𝑓(𝐴).
The range of 𝑓: 𝐴 → 𝐵 is given by 𝑓(𝐴) = {𝑓(𝑥)|𝑥 ∈ 𝐴} and 𝑓(𝐴) is a subset of 𝐵.

❖ A function 𝑓: 𝐴 → 𝐵 is called one-to-one, or injective, if each element of 𝐵 appears at most


once as the image of an element of 𝐴.

15
22CDT45A

❖ A function 𝑓: 𝐴 → 𝐵 is called onto, or surjective, if 𝑓(𝐴) = 𝐵 that is, if for all 𝑏 ∈ 𝐵 there
is at least one 𝑎 ∈ 𝐴 with 𝑓(𝑎) = 𝑏.

❖ If 𝑓: 𝐴 → 𝐵 and 𝐴1 ⊆ 𝐴, then 𝑓|𝐴1 : 𝐴1 → 𝐵 is called the restriction of 𝑓 to 𝐴1 if 𝑓|𝐴1 (𝑎) =


𝑓(𝑎) for all 𝑎 ∈ 𝐴1 .

❖ Let 𝐴1 ⊆ 𝐴 and 𝑓: 𝐴1 → 𝐵. If 𝑔: 𝐴 → 𝐵 and 𝑔(𝑎) = 𝑓(𝑎) for all 𝑎 ∈ 𝐴1 , then we call 𝑔 an


extension of 𝑓 to 𝐴.

Problems:

1. Let 𝑓: 𝑅 ⟶ 𝑅 be defined by
3𝑥 − 5, 𝑥>0
𝑓(𝑥) = {
−3𝑥 + 1, 𝑥≤0
5 −5
(i) Determine 𝑓(0), 𝑓(−1), 𝑓 (3), 𝑓 ( 3 ).
(ii) Find 𝑓 −1 (0), 𝑓 −1 (1), 𝑓 −1 (−1), 𝑓 −1 (3), 𝑓 −1 (−3), 𝑓 −1 (−6).
(iii) What are 𝑓 −1 ([−5,5]) and 𝑓 −1 ([−6,5]) ?
Sol: (i) By definition,
𝑓(0) = (−3 × 0) + 1 = 1, 𝑓(−1) = (−3 × −1) + 1 = 4
5 5 −5 −5
𝑓 (3) = (3 × 3) − 5 = 0, 𝑓 ( 3 ) = (−3 × ) + 1 = 6.
3

16
22CDT45A

5 5
(ii) By definition, we find that 𝑓(𝑥) = 0 only when 𝑥 = 3. ∴ 𝑓 −1 (0) = {3}. (Observe that
𝑓(𝑥) ≠ 0 for 𝑥 ≤ 0).
Similarly, 𝑓 −1 (1) = {𝑥 ∈ 𝑅| 𝑓(𝑥) = 1} = {2,0},
4
𝑓 −1 (−1) = {𝑥 ∈ 𝑅| 𝑓(𝑥) = −1} = {3} Observe that 𝑓(𝑥) ≠ −1 when 𝑥 ≤ 0.
8 −2
𝑓 −1 (3) = {𝑥 ∈ 𝑅| 𝑓(𝑥) = 3} = {3 , }.
3
2
𝑓 −1 (−3) = {3}.
𝑓 −1 (−6) = ∅, because 𝑓(𝑥) ≠ −6 for any 𝑥 ∈ 𝑅.

(iii) We have that 𝑓 −1 ([−5,5]) = {𝑥 ∈ 𝑅| 𝑓(𝑥) ∈ [−5, −5]}


= {𝑥 ∈ 𝑅| − 5 ≤ 𝑓(𝑥) ≤ 5}
When 𝑥 > 0, we have 𝑓(𝑥) = 3𝑥 − 5.
∴ −5 ≤ 𝑓(𝑥) ≤ 5 whenever −5 ≤ (3𝑥 − 5) ≤ 5, or 0 ≤ 3𝑥 ≤ 10, or 0 ≤ 𝑥 ≤ 10/3.
When 𝑥 ≤ 0, we have 𝑓(𝑥) = −3𝑥 + 1.
∴ −5 ≤ 𝑓(𝑥) ≤ 5 whenever −5 ≤ (−3𝑥 + 1) ≤ 5, or −6 ≤ −3𝑥 ≤ 4, or 2 ≥ 𝑥 ≥ −4/3, or
4
− 3 ≤ 𝑥 ≤ 2. Thus,
𝑓 −1 ([−5,5]) = {𝑥 ∈ 𝑅| − 4/3 ≤ 𝑥 ≤ 2 𝑜𝑟 0 ≤ 𝑥 ≤ 10/3}
= {𝑥 ∈ 𝑅| − 4/3 ≤ 𝑥 ≤ 10/3}
= [−4/3,10/3]
Similarly, we find that 𝑓 −1 ([−6,5]) = [−4/3,10/3].

2. Theorem: Let 𝑋 → 𝑌 be a function and 𝐴 and 𝐵 be arbitrary nonempty subsets of 𝑋. Then,


(1) If 𝐴 ⊆ 𝐵, then 𝑓(𝐴) ⊆ 𝑓(𝐵).
(2) 𝑓(𝐴 ∪ 𝐵) = 𝑓(𝐴) ∪ 𝑓(𝐵).
(3) 𝑓(𝐴 ∩ 𝐵) ⊆ 𝑓(𝐴) ∩ 𝑓(𝐵), and the equality holds if 𝑓 is one-to-one.
Proof: Take any 𝑦 ∈ 𝑌. Then,
(1) 𝑦 ∈ 𝑓(𝐴) ⇒ 𝑦 = 𝑓(𝑥) for some 𝑥 ∈ 𝐴
⇒ 𝑦 = 𝑓(𝑥) for some 𝑥 ∈ 𝐵, because 𝐴 ⊆ 𝐵
⇒ 𝑦 ∈ 𝑓(𝐵)
∴ 𝑓(𝐴) ⊆ 𝑓(𝐵).
(2) 𝑦 ∈ 𝑓(𝐴 ∪ 𝐵) ⇒ 𝑦 = 𝑓(𝑥) for some 𝑥 ∈ 𝐴 ∪ 𝐵
⇒ 𝑦 = 𝑓(𝑥) for some 𝑥 ∈ 𝐴 or 𝑥 ∈ 𝐵
⇒ 𝑦 ∈ 𝑓(𝐴) or 𝑦 ∈ 𝑓(𝐵)
⇒ 𝑦 ∈ {𝑓(𝐴) ∪ 𝑓(𝐵)}
∴ 𝑓(𝐴 ∪ 𝐵) ⊆ 𝑓(𝐴) ∪ 𝑓(𝐵) ---------- (i)
Since 𝐴 ⊆ 𝐴 ∪ 𝐵 and 𝐵 ⊆ 𝐴 ∪ 𝐵, it follows that result (1) that 𝑓(𝐴) ⊆ 𝑓(𝐴 ∪ 𝐵) and 𝑓(𝐵) ⊆
𝑓(𝐴 ∪ 𝐵). Therefore, 𝑓(𝐴) ∪ 𝑓(𝐵) ⊆ 𝑓(𝐴 ∪ 𝐵) ------------- (ii)
From (i) and (ii) 𝑓(𝐴 ∪ 𝐵) = 𝑓(𝐴) ∪ 𝑓(𝐵).
(3) 𝑦 ∈ 𝑓(𝐴 ∩ 𝐵) ⇒ 𝑦 = 𝑓(𝑥) for some 𝑥 ∈ 𝐴 ∩ 𝐵
⇒ 𝑦 = 𝑓(𝑥) for some 𝑥 ∈ 𝐴 and 𝑥 ∈ 𝐵
⇒ 𝑦 = 𝑓(𝑥) for some 𝑥 ∈ 𝐴 and 𝑦 = 𝑓(𝑥) for some 𝑥 ∈ 𝐵
⇒ 𝑦 ∈ 𝑓(𝐴) and 𝑦 ∈ 𝑓(𝐵)
⇒ 𝑦 ∈ {𝑓(𝐴) ∩ 𝑓(𝐵)}

17
22CDT45A

∴ 𝑓(𝐴 ∩ 𝐵) ⊆ 𝑓(𝐴) ∩ 𝑓(𝐵) ------------ (iii)


Next, 𝑦 ∈ {𝑓(𝐴) ∩ 𝑓(𝐵)} ⇒ 𝑦 ∈ 𝑓(𝐴) and 𝑦 ∈ 𝑓(𝐵)
⇒ 𝑦 = 𝑓(𝑥1 ) for some 𝑥1 ∈ 𝐴 and 𝑦 = 𝑓(𝑥2 ) for some 𝑥2 ∈ 𝐵
⇒ 𝑦 = 𝑓(𝑥1 ) = 𝑓(𝑥2 )
⇒ 𝑥1 = 𝑥2 if 𝑓 is one-to-one
⇒ 𝑦 = 𝑓(𝑥1 ) for some 𝑥1 ∈ 𝐴 and 𝑥1 ∈ 𝐵
⇒ 𝑦 = 𝑓(𝑥1 ) for some 𝑥1 ∈ 𝐴 ∩ 𝐵
⇒ 𝑦 ∈ 𝑓(𝐴 ∩ 𝐵)
Thus, if 𝑓 is one-to-one, then {𝑓(𝐴) ∩ 𝑓(𝐵)} ⊆ 𝑓(𝐴 ∩ 𝐵). ---------- (iv)
From (iii) and (iv) {𝑓(𝐴) ∩ 𝑓(𝐵)} = 𝑓(𝐴 ∩ 𝐵) when 𝑓 is one-to-one.

3. Let 𝑓: 𝑋 → 𝑌 be a function, and 𝐴 be an arbitrary nonempty subset of 𝑋, and 𝐶 and 𝐷 be


arbitrary subsets of 𝑌. Then, prove the following:
(1) 𝑓 −1 (𝐶 ∪ 𝐷) = 𝑓 −1 (𝐶) ∪ 𝑓 −1 (𝐷)
(2) 𝑓 −1 (𝐶 ∩ 𝐷) = 𝑓 −1 (𝐶) ∩ 𝑓 −1 (𝐷)
(3) 𝑓 −1 (𝐶̅ ) = 𝑓̅̅̅̅̅̅̅̅̅
−1 (𝐶)

Sol:
(1) 𝑓 −1 (𝐶 ∪ 𝐷) = {𝑥 ∈ 𝑋|𝑓(𝑥) ∈ 𝐶 ∪ 𝐷}.
Therefore, for any 𝑥 ∈ 𝐴,
𝑥 ∈ 𝑓 −1 (𝐶 ∪ 𝐷) ⇔ 𝑓(𝑥) ∈ {𝐶 ∪ 𝐷}
⇔ 𝑓(𝑥) ∈ 𝐶 or 𝑓(𝑥) ∈ 𝐷
⇔ 𝑥 ∈ 𝑓 −1 (𝐶) or 𝑥 ∈ 𝑓 −1 (𝐷)
⇔ 𝑥 ∈ {𝑓 −1 (𝐶) ∪ 𝑓 −1 (𝐷)}
∴ 𝑓 −1 (𝐶 ∪ 𝐷) = 𝑓 −1 (𝐶) ∪ 𝑓 −1 (𝐷).
(2) Similarly, for any 𝑥 ∈ 𝐴,
𝑥 ∈ 𝑓 −1 (𝐶 ∩ 𝐷) ⇔ 𝑓(𝑥) ∈ {𝐶 ∩ 𝐷}
⇔ 𝑓(𝑥) ∈ 𝐶 and 𝑓(𝑥) ∈ 𝐷
⇔ 𝑥 ∈ 𝑓 −1 (𝐶) and 𝑥 ∈ 𝑓 −1 (𝐷)
⇔ 𝑥 ∈ {𝑓 −1 (𝐶) ∩ 𝑓 −1 (𝐷)}
∴ 𝑓 −1 (𝐶 ∩ 𝐷) = 𝑓 −1 (𝐶) ∩ 𝑓 −1 (𝐷).
(3) Likewise, for any 𝑥 ∈ 𝐴,
𝑥 ∈ 𝑓 −1 (𝐶̅ ) ⇔ 𝑓(𝑥) ∈ 𝐶̅
⇔ 𝑓(𝑥) ∉ 𝐶
⇔ 𝑥 ∉ 𝑓 −1 (𝐶)
⇔𝑥∈𝑓 ̅̅̅̅̅̅̅̅̅
−1 (𝐶)

∴ 𝑓 −1 (𝐶̅ ) = 𝑓̅̅̅̅̅̅̅̅̅
−1 (𝐶)

Homework
1. Let 𝐴 = {1,2,3,4,5,6} and 𝐵 = {6,7,8,9,10}. If a function 𝑓: 𝐴 → 𝐵 is defined by 𝑓 =
{(1,7), (2,7), (3,8), (4,6), (5,9), (6,9)}, determine 𝑓 −1 (6) and 𝑓 −1 (9). If 𝐵1 = {7,8} and
𝐵2 = {8,9,10}, find 𝑓 −1 (𝐵1 ) and 𝑓 −1 (𝐵2 ).

18
22CDT45A

Function Composition, and Inverse Functions


❖ If 𝑓: 𝐴 → 𝐵, then 𝑓 is said to be bijective, or to be a one-to-one correspondence, if 𝑓 is both
one-to-one and onto.

Example: If 𝐴 = {1,2,3,4} and 𝐵 = {𝑤, 𝑥, 𝑦, 𝑧},


then 𝑓 = {(1, 𝑤), (2, 𝑥), (3, 𝑦), (4, 𝑧)} is a one-to-one correspondence from 𝐴 (on)to 𝐵, and
𝑔 = {(𝑤, 1), (𝑥, 2), (𝑦, 3), (𝑧, 4)} is a one-to-one correspondence from 𝐵 (on)to 𝐴.

❖ The function 𝐼𝐴 : 𝐴 → 𝐴, defined by 𝐼𝐴 (𝑎) = 𝑎 for all 𝑎 ∈ 𝐴, is called the identity function
of 𝐴.
❖ If 𝑓, 𝑔: 𝐴 → 𝐵, we say that 𝑓 and 𝑔 are equal and write 𝑓 = 𝑔, if 𝑓(𝑎) = 𝑔(𝑎) for all 𝑎 ∈
𝐴.
❖ If 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 → 𝐶, then composition function, which is denoted 𝑔 ∘ 𝑓: 𝐴 → 𝐶 by
(𝑔 ∘ 𝑓)(𝑎) = 𝑔(𝑓(𝑎)), for each 𝑎 ∈ 𝐴.

❖ For sets 𝐴, 𝐵, if ℛ is a relation from 𝐴 to 𝐵, then the converse of ℛ, denoted by ℛ 𝑐 , is the


relation from 𝐵 to 𝐴 defined by ℛ 𝑐 = {(𝑏, 𝑎)|(𝑎, 𝑏) ∈ ℛ}.
❖ If 𝑓: 𝐴 → 𝐵, then 𝑓is said to be invertible if there is a function 𝑔: 𝐵 → 𝐴 such that 𝑔 ∘ 𝑓 =
𝐼𝐴 and 𝑓 ∘ 𝑔 = 𝐼𝐵 .
Example. Let 𝐴 = {1,2,3,4}, 𝐵 = {𝑎, 𝑏, 𝑐} and 𝐶 = {𝑤, 𝑥, 𝑦, 𝑧} with 𝑓 ∶ 𝐴 → 𝐵 and 𝑔 ∶ 𝐵 →
𝐶 given by 𝑓 = {(1, 𝑎), (2, 𝑎), (3, 𝑏), (4, 𝑐)}, and 𝑔 = {(𝑎, 𝑥), (𝑏, 𝑦)(𝑐, 𝑧)}. Find 𝑔 ∘ 𝑓.
Sol: (𝑔 ∘ 𝑓) (1) = 𝑔{𝑓(1)} = 𝑔(𝑎) = 𝑥,
(𝑔 ∘ 𝑓) (2) = 𝑔{𝑓(2)} = 𝑔(𝑎) = 𝑥,
(𝑔 ∘ 𝑓) (3) = 𝑔{𝑓(3)} = 𝑔(𝑏) = 𝑦,
(𝑔 ∘ 𝑓) (4) = 𝑔{𝑓(4)} = 𝑔(𝑐) = 𝑧,
Thus, 𝑔 ∘ 𝑓 = {(1, 𝑥), 2(, 𝑥), (3, 𝑦), (4, 𝑧)}.

Example. Let 𝐴 = {1,2,3,4} with 𝑓 ∶ 𝐴 → 𝐴 and 𝑔 ∶ 𝐴 → 𝐴 given by


𝑓 = {(1,4), (2,1), (3,2), (4,3)}, and 𝑔 = {(1,2), (2,3), (3,4), (4,1)}. Prove that 𝑓 and 𝑔
are inverse of each other.
Sol: (𝑔 ∘ 𝑓)(1) = 𝑔{𝑓(1)} = 𝑔(4) = 1 = 𝐼𝐴 (1),
(𝑔 ∘ 𝑓) (2) = 𝑔{𝑓(2)} = 𝑔(1) = 2 = 𝐼𝐴 (2),
(𝑔 ∘ 𝑓) (3) = 𝑔{𝑓(3)} = 𝑔(2) = 3 = 𝐼𝐴 (3),
(𝑔 ∘ 𝑓) (4) = 𝑔{𝑓(4)} = 𝑔(3) = 4 = 𝐼𝐴 (4),
(𝑓 ∘ 𝑔) (1) = 𝑓{𝑔(1)} = 𝑓(2) = 1 = 𝐼𝐴 (1),
(𝑓 ∘ 𝑔) (2) = 𝑓{𝑔(2)} = 𝑓(3) = 2 = 𝐼𝐴 (2)
(𝑓 ∘ 𝑔) (3) = 𝑓{𝑔(3)} = 𝑓(4) = 3 = 𝐼𝐴 (3)
(𝑓 ∘ 𝑔) (4) = 𝑓{𝑔(4)} = 𝑓(1) = 4 = 𝐼𝐴 (4)
Thus, for all 𝑥 ∈ 𝐴, we have (𝑔 ∘ 𝑓)(𝑥) = 𝐼𝐴 (𝑥) and (𝑓 ∘ 𝑔)(𝑥) = 𝐼𝐴 (𝑥).

19
22CDT45A

Therefore 𝑔 is an inverse of 𝑓, and 𝑓 is an inverse of 𝑔.

Theorem. Let 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 → 𝐶 be any two functions. Then the following are true:
(1) If 𝑓 and 𝑔 are one-to-one, so is 𝑔 ∘ 𝑓. (2) If 𝑔 ∘ 𝑓 is one-to-one, then 𝑓 is one-to-one.
(2) If 𝑓 and 𝑔 are onto, so is 𝑔 ∘ 𝑓. (4) If 𝑔 ∘ 𝑓 is onto, then g is onto.

Proof: First, we note that 𝑔 ∘ 𝑓: 𝐴 → 𝐶.


(1) Take any 𝑎1 , 𝑎2 ∈ 𝐴.
(𝑔 ∘ 𝑓) (𝑎1 ) = (𝑔 ∘ 𝑓 )(𝑎2 ) ⇒ 𝑔(𝑓(𝑎1 )) = 𝑔(𝑓(𝑎2 ))
⇒ (𝑓(𝑎1 ) = (𝑓(𝑎2 ), because 𝑔 is one-to-one.
⇒ 𝑎1 = 𝑎2 , because f is one-to-one.
Therefore, 𝑔 ∘ 𝑓 is one-to-one.
(2) Take any 𝑎1 , 𝑎2 ∈ 𝐴.
Then, 𝑓 (𝑎1 ), 𝑓(𝑎2 ) ∈ 𝐵 and
𝑓(𝑎1 ) = 𝑓(𝑎2 ) ⇒ 𝑔(𝑓(𝑎1 )) = 𝑔(𝑓(𝑎2 )), because g is a function from 𝐵.
⇒ (𝑔 ∘ 𝑓 ) (𝑎1) = (𝑔 ∘ 𝑓 ) (𝑎2)
⇒ 𝑎1 = 𝑎2 , because (𝑔 ∘ 𝑓) is one-to-one.
This shows that f is one-to-one.

(3) Take any 𝑐 𝜖 𝐶. Since 𝑔 is onto, there is some 𝑏 𝜖 𝐵 such that 𝑔(𝑏) = 𝑐. Since 𝑏 𝜖 𝐵
and f is onto, there is some 𝑎 𝜖 𝐴 such that 𝑓(𝑎) = (𝑏). Consequently,
(𝑔 ∘ 𝑓 )(𝑎) = 𝑔(𝑓(𝑎)) = 𝑔(𝑏) = 𝑐.
Thus, for any 𝑐 𝜖 𝐶, there is some 𝑎 𝜖 𝐴 such that (𝑔 ∘ 𝑓 )(𝑎) = 𝑐.
Therefore, 𝑔 ∘ 𝑓 is onto.
(4) Take any 𝑐 𝜖 𝐶.
Since 𝑔 ∘ 𝑓 ∶ 𝐴 → 𝐶 is onto, there is some 𝑎 𝜖 𝐴, such that 𝑔(𝑓(𝑎)) = 𝑐.
Since 𝑓 (𝑎) 𝜖 𝐵, this means that , given any 𝑐 𝜖 𝐶, there is an element 𝑓(𝑎) in 𝐵 such
that 𝑔(𝑓(𝑎)) = 𝑐. Therefore, 𝑔 is onto.

Theorem. A function 𝑓: 𝐴 → 𝐵 is invertible if and only if it is one-to-one and onto.


Proof: First suppose that 𝑓 is invertible. Then there exists a unique function 𝑔: 𝐵 → 𝐴 such
that 𝑔 ∘ 𝑓 = 𝐼𝐴 and 𝑓 ∘ 𝑔 = 𝐼𝐵 .
Take any 𝑎1 , 𝑎2 ∈ 𝐴. Then, 𝑓(𝑎1 ) = 𝑓(𝑎2 ) ⇒ 𝑔{𝑓(𝑎1 )} = 𝑔{𝑓(𝑎2 )}
⇒ (𝑔 ∘ 𝑓)(𝑎1 ) = (𝑔 ∘ 𝑓)(𝑎2 )
⇒ 𝐼𝐴 (𝑎1 ) = 𝐼𝐴 (𝑎2 )
⇒ 𝑎1 = 𝑎2 .
This proves that 𝑓 is one-to-one.
Next, take any 𝑏 ∈ 𝐵. Then 𝑔(𝑏) ∈ 𝐴, and 𝑏 = 𝐼𝐵 (𝑏) = (𝑓 ∘ 𝑔)(𝑏) = 𝑓{𝑔(𝑏)}.
Thus, 𝑏 is the image of an element 𝑔(𝑏) ∈ 𝐴 under 𝑓. Therefore, f is onto as well.
Conversely, suppose that 𝑓 is one-to-one and onto. Then, for each 𝑏 ∈ 𝐵 there is unique 𝑎 ∈ 𝐴
such that 𝑏 = 𝑓(𝑎). Now, consider the function 𝑔: 𝐵 → 𝐴 defined by 𝑔(𝑏) = 𝑎.
Then, (𝑔 ∘ 𝑓)(𝑎) = 𝑔{𝑓(𝑎)} = 𝑔(𝑏) = 𝑎 = 𝐼𝐴 (𝑎), and
(𝑓 ∘ 𝑔)(𝑏) = 𝑓{𝑔(𝑏)} = 𝑓(𝑎) = 𝑏 = 𝐼𝐵 (𝑏).
These show that 𝑓 is invertible with 𝑔 as the inverse.
20
22CDT45A

Problem: Let 𝐴 = 𝐵 = ℛ, the set of all real numbers, and the functions 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 →
1
3 1 3
𝐴 be defined by 𝑓(𝑥) = 2𝑥 − 1, ∀𝑥 ∈ 𝐴, 𝑔(𝑦) = {2 (𝑦 + 1)} , ∀𝑦 ∈ 𝐵. Show that each of 𝑓
and 𝑔 is the inverse of the other.
Sol: For any 𝑥 ∈ 𝐴,
1
1
(𝑔 ∘ 𝑓)(𝑥) = 𝑔(𝑓(𝑥)) = 𝑔(𝑦) = { (𝑦 + 1)}3 , where 𝑦 = 𝑓(𝑥)
2
1
1 3
= {2 (2𝑥 3 − 1 + 1)} , because 𝑦 = 𝑓(𝑥) = 2𝑥 3 − 1
= 𝑥.
Thus, 𝑔 ∘ 𝑓 = 𝐼𝐴 .
Next, for any 𝑦 ∈ 𝐵,
1
1 3
(𝑓 ∘ 𝑔)(𝑦) = 𝑓(𝑔(𝑦)) = 𝑓 ({ (𝑦 + 1)} )
2
1 3
1 3
= 2 ({2 (𝑦 + 1)} ) − 1
1
= 2 {2 (𝑦 + 1)} − 1
= 𝑦.
Thus, 𝑓 ∘ 𝑔 = 𝐼𝐵 .
Hence, each of 𝑓 and 𝑔 is the inverse of the other.

Homework
1. Let 𝑓 and 𝑔 be the function from ℛ to ℛ defined by 𝑓(𝑥) = 𝑎𝑥 + 𝑏 and 𝑔(𝑥) = 1 − 𝑥 + 𝑥 2 .
If (𝑔 ∘ 𝑓 )(𝑥) = 9𝑥 2 − 9𝑥 + 3, determine 𝑎, 𝑏.
2. Consider the functions 𝑓 and 𝑔 defined by 𝑓(𝑥) = 𝑥 3 and 𝑔(𝑥) = 𝑥 2 + 1, ∀𝑥 ∈ ℛ. Find
𝑔 ∘ 𝑓, 𝑓 ∘ 𝑔, 𝑓 2 and 𝑔2 .
3. Let 𝐴 = {𝑥|𝑥 𝑖𝑠 𝑟𝑒𝑎𝑙 𝑎𝑛𝑑 𝑥 ≥ −1}, and 𝐵 = {𝑥|𝑥 𝑖𝑠 𝑟𝑒𝑎𝑙 𝑎𝑛𝑑 𝑥 ≥ 0}. Consider the
function 𝑓: 𝐴 → 𝐵 defined by 𝑓(𝑎) = √𝑎 + 1, for all 𝑎 ∈ 𝐴. Show that 𝑓 is invertible and
determine 𝑓 −1 .
1
4. Let 𝐴 = 𝐵 = 𝐶 = 𝑅, and 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 → 𝐶 be defined by 𝑓(𝑎) = 2𝑎 + 1, 𝑔(𝑏) = 3 𝑏,
∀𝑎 ∈ 𝐴, ∀𝑏 ∈ 𝐵. Compute 𝑔 ∘ 𝑓 and show that 𝑔 ∘ 𝑓 is invertible. What is (𝑔 ∘ 𝑓)−1?

21

You might also like