Lecture Slides MATH255 Week 4
Lecture Slides MATH255 Week 4
Dr Chayne Planiden
Dr Chayne Planiden 1/ 35
Week 4: Relations and Functions
Definition
A pair (a, b) is an ordered pair if it has the property
(a, b) = (c, d) ⇔ a = c ∧ b = d.
Definition
The Cartesian product A × B is the set of all ordered pairs
with first element from A and second element from B.
A × B = {(a, b) : a ∈ A, b ∈ B}
Dr Chayne Planiden 2/ 35
Relations
Dr Chayne Planiden 3/ 35
Relations
Definition
A relation R from A to B is a subset of A × B that is defined by
some rule that relates elements of A with elements of B. We
say that a is related to b, denoted by aRb, if (a, b) ∈ R.
Dr Chayne Planiden 4/ 35
Relations
(a) Since x, y ∈ S and x + z = y for some z ∈ N, R is all pairs
(x, y ) such that x < y .
R = {(x, y ) : x < y }
(b) R = {(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)}
(c) .
Dr Chayne Planiden 5/ 35
Relations
Dr Chayne Planiden 6/ 35
Relations
Dr Chayne Planiden 7/ 35
Relations
Relations are sets, so all the set operators seen so far can be
applied to relations.
Example. On R, R1 = {(x, y ) : x = y }, R2 = {(x, y ) : x = −y }.
What are R1 ∪ R2 and R1 ∩ R2 ?
R1 ∪ R2 = {(x, y ) : x = ±y }, R2 = {(0, 0)}.
Dr Chayne Planiden 8/ 35
Relations
Definition
Let R be a relation from A to B. The domain and range of R
are the following.
Dr Chayne Planiden 9/ 35
Relations
dom R, ran R.
R = (1, 1), 2, 12 , 3, 31 , . . . , (−1, −1), −2, − 21 , −3, − 13 , . . .
Definition
Let R be a relation from A to B. The inverse relation R −1 from
B to A is define
Definition
Let R be a relation on A. Then R is
1 reflexive if ∀ x ∈ A, xRx;
2 symmetric if ∀ x, y ∈ A, xRy → yRx;
3 transitive if ∀ x, y , z ∈ A, xRy ∧ yRz → xRz.
Example. Let A = {0, 1, 2, 3}, R = {(0, 0), (0, 2), (1, 1), (2, 0), (2, 2), (3, 3)}.
Prove R is an equivalence relation.
Since (0, 0), (1, 1), (2, 2), (3, 3) ∈ R, we have that R is reflexive.
(0, 2) ∈ R → (2, 0) ∈ R and vice versa, and trivially (0, 0) ∈
R → (0, 0) ∈ R, etc., so we have that R is symmetric.
(0, 0), (0, 2) ∈ R → (0, 2) ∈ R; (1, 1), (1, 1) ∈ R → (1, 1) ∈ R
(2, 0), (0, 0) ∈ R → (2, 0) ∈ R; (2, 0), (0, 2) ∈ R → (2, 2) ∈ R
(2, 2), (2, 0) ∈ R → (2, 0) ∈ R; (2, 2), (2, 2) ∈ R → (2, 2) ∈ R
(3, 3), (3, 3) ∈ R → (3, 3) ∈ R; (0, 0), (0, 0) ∈ R → (0, 0) ∈ R
So we have that R is transitive.
Definition
Let R be an equivalence relation on A. For each a ∈ A, the
equivalence class of a, denoted by [a], is the set of all
elements of A that are related to a.
[a] = {x ∈ A : xRa}
Example. Let A = {0, 1, 2}, R = {(0, 0), (1, 1), (2, 2), (0, 1), (1, 0)}.
Find [0], [1], [2].
[0] = {x ∈ A : xR0} = {0, 1}
[1] = {x ∈ A : xR1} = {0, 1}
[2] = {x ∈ A : xR2} = {2}
Example. What do the equivalence classes of the identity rela-
tion on R look like? R = {(x, x) : x ∈ R}
1 1
1
2 = x ∈ R : xR 2 = 2
[0] = {0}
[−2.4] = {−2.4} . . .
Definition
A relation f from A to B is a function iff for each x ∈ A there is
at most one y ∈ B such that (x, y ) ∈ f .
Definition
Let f : A → B be a function. Then f is injective (one-to-one) iff
for all x1 , x2 ∈ A,
f (x1 ) = f (x2 ) ⇔ x1 = x2 .
That is, each element of the range is the image of only one
element of the domain.
Note. An injective function satisfies the horizontal line test.
f ({1, 2}) = 2
f ({1, 3}) = 2
Definition
A function f : A → B is surjective (onto) iff ran f = B. That is,
∀ y ∈ B ∃ x ∈ A s.t. f (x) = y .
y +1
y = 4x − 1 → x = ∈R YES
4
Therefore, f is surjective.
4 For instance, let y = 2. Then
2+1 3
2 = 4x − 1 → x = = 6∈ Z .
4 4
Therefore, f is not surjective.
Definition
The inverse of a function f , denoted by f −1 , is also a function iff
f is bijective, i.e. injective and surjective.
x−2
Example. Let f : R → R, f (x) = x+1 . Find the domain and range
of f , prove f is bijective and find f −1 .
The domain is the set of all allowable inputs, so only the −1
causes a problem (division by zero): dom f = R \{−1}. The
range of f is the domain of f −1 , so let’s wait on that.
Injective. Let f (x1 ) = f (x2 ). Then
x1 − 2 x2 − 2
= ⇔ (x1 − 2)(x2 + 1) = (x1 + 1)(x2 − 2)
x1 + 1 x2 + 1
⇔x1 x2 − 2x2 + x1 − 2 = x1 x2 + x2 − 2x1 − 2
⇔ − 2x2 + x1 = x2 − 2x1 ⇔ 3x1 = 3x2 ⇔ x1 = x2
Therefore, f is injective.
x −2
y= ⇔ y (x + 1) = x − 2 ⇔ xy + y = x − 2
x +1
2+y
⇔x(1 − y ) = 2 + y ⇔ x = ∈ R,
1−y