Lecture Notes in Foundations of Mathematics
Lecture Notes in Foundations of Mathematics
3 Relations
Definition 3.1.1
Let A and B be two sets. An ordered pair is (a, b) 6= {a, b} for a ∈ A and b ∈ B. We say
that (a, b) = (c, d) if and only if a = c and b = d.
Definition 3.1.2
Let A and B be two sets. The (Cartesian or cross) product of A and B, denoted by A × B,
is defined by
A × B = {(a, b) : a ∈ A and b ∈ B}.
Remark 3.1.1
Example 3.1.1
Solution:
A×B = {(1, a), (1, b), (2, a), (2, b), (3, a), (3, b)}, and
B×A = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)}.
39
40 Chapter 3. Relations
B A
3 × ×
b × × × 2 × ×
a × × × 1 × ×
1 2 3
A a b
B
A×B B×A
Example 3.1.2
Solution:
B
3
2
A × B = {(a, b) : a ∈ A and b ∈ B}.
1 • •
0 1
A
A×B
Theorem 3.1.1
Proof:
Theorem 3.1.2
2. (A × B) ∩ (C × D) = (A ∩ C) × (B ∩ D).
3. (A × B) ∪ (C × D) ⊆ (A ∪ C) × (B ∪ D).
Proof:
Proof of (1.a):
Proof of (2):
(x, y) ∈ (A × B) ∩ (C × D) iff (x ∈ A ∧ y ∈ B) ∧ (x ∈ C ∧ y ∈ D)
iff (x ∈ A ∧ x ∈ C) ∧ (y ∈ B ∧ y ∈ D)
iff (x ∈ A ∩ C) ∧ (y ∈ B ∩ D)
iff (x, y) ∈ (A ∩ C) × (B ∩ D).
Remark 3.1.2
Definition 3.1.3
Definition 3.1.4
Example 3.1.3
Let A = {1, 2, {3}, 4} and B = {a, b, c, d}. Find the domain and range of R, where
Solution:
The Dom(R) = {1, 2, {3}} ⊆ A and the Rng(R) = {a, c, d} ⊆ B. Note that Dom(R) 6= A
and Rng(R) 6= B.
Example 3.1.4
Let A = {1, 3, 5, 7} and B = {2, 6}. Let R ⊆ A × B defined by R = {(a, b) ∈ A × B : a < b}.
Find R along with its domain and range.
Solution:
A B
→
R
R = {(1, 2), (1, 6), (3, 6), (5, 6)} 1•
Dom(R) = {1, 3, 5} 3• •2
Example 3.1.5
Let R = {(x, y) ∈ R × R : y = x2 + 3}. Find the domain and the range of the relation R.
Solution:
Definition 3.1.5
For any set A, the relation IA is the identity relation on A and is defined by
IA = {(a, a) : a ∈ A},
Definition 3.1.6
Definition 3.1.7
Example 3.1.6
R = {(a, 1), (b, 2), (c, 2), (c, 3), (c, 4)} ⊆ A × B, and
S = {(1, w), (2, x), (2, z), (3, y), (4, y)} ⊆ B × C.
Solution:
R−1 = {(1, a), (2, b), (2, c), (3, c), (4, c)} ⊆ B × A.
S ◦R = {(a, w), (b, x), (b, z), (c, x), (c, z), (c, y)} ⊆ A × C.
A B C A B
→ → →
R S S ◦R
a• • •x a• •x
1
• •y =⇒ •y
2
b• b•
• •z •z
3
c• • •w c• •w
4
Example 3.1.7
Solution:
Note that
Example 3.1.8
Solution:
Theorem 3.1.3
1. (R−1 )−1 = R.
2. T ◦ (S ◦ R) = (T ◦ S) ◦ R.
3. (S ◦ R)−1 = R−1 ◦ S −1 .
Proof:
Example 3.1.9
Let A = [2, 4] and B = (1, 3) ∪ {4}. Let R be the relation on A × R with xRy iff x ∈ A and
let S be the relation on R × B with xSy iff y ∈ B. Find R ∩ S and R ∪ S.
Solution:
5 5
4 • • 4
3 ◦ ◦ 3 • •
2 2
1 ◦ ◦ 1 • •
1 2 3 4 5 1 2 3 4 5
R∩S R∪S
Exercise 3.1.1
Exercise 3.1.2
Definition 3.2.1
Example 3.2.1
Let A = {1, 2, 3, 4} and R1 = {(1, 2), (2, 3), (1, 3)}, R2 = {(1, 1), (1, 2)}, R3 = {(3, 4)},
R4 = {(1, 2), (2, 1)}, and R5 = {(1, 1), (2, 2), (3, 3), (4, 4)}. Decide which relation is reflexive,
symmetric, transitive.
Solution:
Example 3.2.2
Solution:
Clearly, xRx for all x ∈ Z except for x = 0, thus R is not reflexive. If xRy, then xy > 0 or
yx > 0 which imples that yRx. Thus, R is symmetric. If xRy and yRz, then xy > 0 and
yz > 0. Considering the cases of y ∈ Z − {0}, we have
1. case 1: y > 0, then x > 0 and z > 0 which implies that xz > 0 and thus xRz.
2. case 1: y < 0, then x < 0 and z < 0 which implies that xz > 0 and thus xRz.
In either cases, R is transitive on Z. Note that R is not reflexive and thus it is not an
equivalence relation on Z.
48 Chapter 3. Relations
Example 3.2.3
Let R be the relation on Z given by xRy iff x − y is even. Show that R is an equivalence
relation on Z.
Solution:
Definition 3.2.2
which reads ”the class of x modulo R” or ”x mod R. The set of all equivalence classes is
called A modulo R and is defined by
Example 3.2.4
Let R = {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1)} be an equivalence relation on A = {1, 2, 3}. Find:
Example 3.2.5
Solution:
Therefore, N = 1 ∪ 2.
Theorem 3.2.1
Proof:
Definition 3.2.3
Let m 6= 0 be a fixed integer. Then ”≡m ” denotes the relation on Z and is defined by
x≡y mod m or x ≡m y ⇔ m | x − y,
Zm = {0, 1, 2, · · · , m − 1}.
Example 3.2.6
Solution:
Theorem 3.2.2
Proof:
Exercise 3.2.1
Exercise 3.2.2
Exercise 3.2.3
Exercise 3.2.4
Let R be a relation on N so that xRy iff 3 | x + 2y. Show that R is an equivalence relation
on N. Find the equivalence class of 1.
Exercise 3.2.5
Definition 3.3.1
Let A be a set and A be a family of subsets of A. A is called a partition of A if and only if:
1. if X ∈ A, then X 6= φ.
2. if X, Y ∈ A, then either X = Y or X ∩ Y = φ.
[
3. X = A.
X∈A
Example 3.3.1
1. The set of even natural numbers and odd natural numbers is a partition of N.
4. The set {{ male students, female students }} is a partition for the set of all students in
Kuwait University.
Theorem 3.3.1
Let A 6= φ and let R be an equivalence relation on A. Then, the family A/R = {x/R : x ∈ A}
is a partition of A.
Proof:
Do it your self!
3.4. Ordering Relations 53
Definition 3.4.1
A relation R on a set A is called antisymmetric if for all x, y ∈ A, if xRy and yRx, then
x = y.
Definition 3.4.2
A relation R on a set A is called a partial order (or partial ordering) for A if R is reflexive,
antisymmetric, and transitive. In that case, A is called a partially ordered set or a poset.
Example 3.4.1
Show that ”⊆” is a partial order relation on P(A) for any set A.
Solution:
Example 3.4.2
Let R be a relation on N so that aRb ⇔ a | b for all a, b ∈ N. Show that R is a partial order
on N.
Solution:
Example 3.4.3
Let R be a relation on N so that aRb iff 2 | a + b with a ≤ b for all a, b ∈ N. Show that N is
a poset with respect to R.
Solution:
Definition 3.4.3
Theorem 3.4.1
If R is a partial order for a set A and B ⊆ A, then if the least upper bound (or greatest lower
bound) for B exists, then it is unique.
3.4. Ordering Relations 55
Proof:
Assume that x and y are both least upper bound for B. Since x is an upper bound and y
is the least upper bound, thus yRx. Similarly, since y is an upper bound and x is the least
upper bound, thus xRy. Since R is antisymmetric, xRy and yRx, implies x = y.
Example 3.4.4
Let A = [0, 6) ⊂ R be a poset with respect to ”≤”, and let B = { 12 , 3, 5} and C = {1, 12 , 13 , · · · }
be two subsets of A. Find sup(B), inf(B), sup(C), and inf(C).
Solution:
sup(B): Note that 5, 5.1, 5.35, 5.9, and so on are all considered upper bounds for B since for
example b ≤ 5 for all b ∈ B. Then, sup(B) = 5 since 5 ≤ x for all upper bounds for B.
inf(B): 0, 12 , 14 , 45
1
and so on are all considered lower bounds for B since for example 1
4
≤ b for
1 1
all b ∈ B. Then, inf(B) = 2
since 2
≤ x for all lower bounds x for B.
sup(C): The set of upper bounds for C consists of {1, 2, 1.5, 3, 5, 5.5, · · · } while the sup(C) =
1.
inf(C): The set of upper bounds for C consists of {0} and the inf(C) = 0.
Note that, if A = (0, 6), then C would has no inf(C).
Example 3.4.5
Let A = {1, 2, 3, 4, 5, 6} and consider P(A) with the partial ordering ”⊆”. Let B =
n o
{1, 2}, {1, 2, 3}, {1, 2, 6} . Find sup(B) and inf(B).
Solution:
Upper bound for B are like {1, 2, 3, 6}, {1, 2, 3, 4, 6}, {1, 2, 3, 5, 6}, and A it self. Therefore,
[
sup(B) = {1, 2, 3, 6} = X. On the other hand, φ, {1}, {2}, and {1, 2} are all lower
X∈B \
bounds for B while the inf(B) = {1, 2} = X.
X∈B
56 Chapter 3. Relations
Exercise 3.4.1
Let R be a relation on N so that xRy iff y = 2k x for some integer k ≥ 0. Show that N is a
poset with respect to R.
Chapter
4 Functions
Definition 4.1.1
1. Dom(f ) = A,
2. if (x, y) ∈ f and (x, z) ∈ f , then y = z.
Example 4.1.1
Let A = {1, 2, 3} and B = {a, b, c}. Let R1 = {(1, a), (2, b), (2, c), (3, c)}, R2 =
{(1, a), (2, c), (3, b)}, and R3 = {(1, a), (2, c)} be three relations on A × B. Decide whether
R1 , R2 , and R3 a function.
Solution:
R1 is clearly not a function since (2, b) and (2, c) both are in R1 where b 6= c. R2 satisfies the
conditions of Definition 4.1.1 and so it is a function from A to B.
R3 is not a function from A to B; however, it is a function from {1, 2} to {a, c}.
57
58 Chapter 4. Functions
Example 4.1.2
Solution:
Example 4.1.3
Solution:
Example 4.1.4
Solution:
We first show that Dom(f ) = R. Clearly, Dom(f ) ⊆ R by the definition of f . Next, let
x ∈ R. Then there is y = 2x + 5 ∈ R and hence (x, y) ∈ f . That is x ∈ Dom(f ).
Now assume that (x, y), (x, z) ∈ f , we want to show that y = z. But since y = 2x + 5 and
z = 2x + 5, we have y = z. Therefore, f is a function from R to R.
Theorem 4.1.1
Two functions f and g are equal iff (i) Dom(f ) = Dom(g), and (ii) for all x ∈ Dom(f ),
f (x) = g(x).
Proof:
” ⇒ ”: Assume that f = g. Proof of (i): If x ∈ Dom(f ), then (x, y) ∈ f = g for some y and
hence x ∈ Dom(g). Thus, Dom(f ) ⊆ Dom(g). Similarly, if x ∈ Dom(g), then (x, y) ∈ g = f
4.1. Functions as Relations 59
for some y and hence x ∈ Dom(f ). Thus, Dom(g) ⊆ Dom(f ). Therefore, Dom(f ) = Dom(g).
Proof of (ii): Let x ∈ Dom(f ). Then for some y, (x, y) ∈ f = g. Thus, f (x) = y = g(x).
” ⇐ ”: Assume that Dom(f ) = Dom(g) and that for all x ∈ Dom(f ), f (x) = g(x). Suppose
that (x, y) ∈ f , then there is y such that y = f (x) and x ∈ Dom(f ) = Dom(g). Thus,
y = f (x) = g(x) which implies that (x, y) ∈ g and hence f ⊆ g. Now suppose that (x, y) ∈ g.
Then there is y such that y = g(x) = f (x) for x ∈ Dom(f ). Thus, y = f (x) and (x, y) ∈ f .
Hence g ⊆ f . Therefore, f = g.
60 Chapter 4. Functions
Definition 4.2.1
Example 4.2.1
Solution:
Definition 4.2.2
Example 4.2.2
Solution:
Clearly, f |A = f , f |{1} = {(1, a)}, and f |{2,4} = {(2, a), (4, c)}.
4.2. Constructions of Functions 61
Remark 4.2.1
Example 4.2.3
Let f = {(1, 2), (3, 5), (4, 2)} and g = {(1, 2), (3, 6), (5, −10)}. Find f ∩ g and f ∪ g and decide
whether either of those relation is a function.
Solution:
• f ∪ g = {(1, 2), (3, 5), (4, 2), (3, 6), (5, −10)} which is not a function (by the definition)
since 3 maps to two different values, namely 5 and 6.
62 Chapter 4. Functions
Definition 4.3.1
Remark 4.3.1
onto
f : A −−→ B ⇐⇒ (∀b ∈ B)(∃a ∈ A)(f (a) = b).
Example 4.3.1
Let f (x) = x + 2 and g(x) = x2 + 1 for all x ∈ R. Determine whether f and g are onto R.
Solution:
• f is onto: Let y ∈ R (in the range of f ), then there exists x ∈ R such that y = x + 2 or
x = y − 2. Thus, f (x) = f (y − 2) = (y − 2) + 2 = y. Thus, f is onto R.
√
• g is not onto: Let y ∈ R, then y = x2 + 1 so x = ± y − 1. So, y must be greater than
or equal to 1. If we choose y = 0, then x 6∈ R and hence g is not onto R.
Example 4.3.2
Let f : N × N → N be a function defined by f (m, n) = 2m−1 (2n − 1). Show that f is onto N.
Solution:
We show that N ⊆ Rng(f ). That is, for all s ∈ N, there exists (m, n) ∈ N × N such that
f (m, n) = s. We consider the following two cases of s.
Thus, N ⊆ Rng(f ).
4.3. Functions That are Onto; One-to-One Functions 63
Therefore, f is onto N.
Theorem 4.3.1
onto
2. If f : A → B, g : B → C, and g ◦ f : A −−→ C, then g is onto C.
Proof:
Definition 4.3.2
Remark 4.3.2
1−1
A function f : A −−→ B is one-to-one if and only if
Example 4.3.3
Solution:
Example 4.3.4
1
Determine whether f : R → R is one-to-one, where f (x) = .
x2 +1
Solution:
1 1
= 2 ⇒ a2 + 1 = b2 + 1 ⇒ a2 = b2 ⇒ a = ±b.
a2 +1 b +1
Example 4.3.5
Solution:
Assume that f (a, b) = f (x, y) for (a, b), (x, y) ∈ N × N. Then, 2a−1 (2b − 1) = 2x−1 (2y − 1).
Consider the following cases:
1. if a > x: 2a−1 (2b − 1) = 2x−1 (2y − 1) ⇒ 2a−x (2b − 1) = (2y − 1) which is impossible.
| {z } | {z }
even odd
2. if a < x: 2a−1 (2b − 1) = 2x−1 (2y − 1) ⇒ (2b − 1) = 2x−a (2y − 1) which is impossible.
| {z } | {z }
odd even
Thus, the only possible case is the third case which suggests that (a, b) = (x, y). Therefore,
f is 1-1.
4.3. Functions That are Onto; One-to-One Functions 65
Theorem 4.3.2
1−1 1−1
2. If f : A → B and g : B → C, and g ◦ f : A −−→ C, then f : A −−→ B.
Proof:
1. Assume that (g ◦ f )(x) = (g ◦ f )(y) for some x, y ∈ A. Then, g(f (x)) = g(f (y)). Since,
g is 1-1, f (x) = f (y), and since f is 1-1 as well, x = y. Therefore, g ◦ f is 1-1.
2. Assume that f (x) = f (y) for x, y ∈ A. Then g(f (x)) = g(f (y)) implies that (g ◦f )(x) =
(g ◦ f )(y). Since g ◦ f is 1-1, x = y. Thus, f is 1-1.
Remark 4.3.3
1. f is onto B iff for all b ∈ B, the horizontal line y = b intersects the graph of f at least
once.
2. f is one-to-one iff for all b ∈ B, the horizontal line y = b intersects the graph of f at
most once.
Example 4.3.6
Let f : R → R and g : R → R be two function. Use the Horizontal line test to decide whether
f (x) = x2 and g(x) = x3 are onto, one-to-one, or neither.
Solution:
We apply the horizontal line test on both f and g. In f , we see that on one place the line
crosses the curve in two points, so f is not one-to-one, and it does not cross the curve in
another place so it is not onto. However, in g, the line crosses the curve exactly once in any
place, so it is one-to-one and onto.
66 Chapter 4. Functions
f (x) = x2 g(x) = x3
f is not 1-1
• • •
•
f is not onto
Definition 4.3.3
Example 4.3.7
Solution:
No. Since f −1 = {(2, 1), (2, 4)} where 2 is mapped to two distinct elements.
Theorem 4.3.3
Example 4.3.8
x−1
Let f (x) = 2x + 1 and let g(x) = . Show that g = f −1 .
2
Solution:
4.3. Functions That are Onto; One-to-One Functions 67
Theorem 4.3.4
Proof:
1. ” ⇒ ”: Assume that f −1 is a function. Let f (x) = f (y) = z, then (x, z), (y, z) ∈ f .
Thus, (z, x), (z, y) ∈ f −1 . Since f −1 is a function, x = y. Therefore, f is 1-1.
” ⇐ ”: Assume that f is 1-1. Let (x, y), (x, z) ∈ f −1 (we need to show that y = z).
Then, (y, x), (z, x) ∈ f . Since f is 1-1, y = z. Thus, f −1 is a function. By Definition
3.1.6, Dom(f −1 ) = Rng(f ) and Rng(f −1 ) = Dom(f ).
2. Assume that f −1 is a function. Let f −1 (x) = f −1 (y) = z, then (x, z), (y, z) ∈ f −1 .
Thus, (z, x), (z, y) ∈ f and since f is a function, x = y. Therefore, f −1 is 1-1.
Definition 4.3.4
Theorem 4.3.5
1−1 1−1
Let f : A −−→ B and g : B −−→ C. Then,
onto onto
1−1
1. g ◦ f : A −−→ C is a bijection.
onto
1−1
2. f −1 : B −−→ A is a bijection.
onto
Proof:
1. By Theorem 4.3.1 and Theorem 4.3.2, if f and g are one-to-one and onto, the composite
function g ◦ f is also one-to-one and onto.
Definition 4.4.1
A B
f −1
f −1 (Y ) Y
X f (X)
f
Example 4.4.1
Let f : R → R be defined by f (x) = 2x + 2. Find f ({1, 4}), f ([1, 2]), f (N), f −1 ({2, 3}), and
f −1 ([2, 4]).
Solution:
f (x) = 2x + 2
• f ({1, 4}) = {4, 10}.
6
• f ([1, 2]) = [4, 6]. 5
4
3
• f (N) = {4, 6, 8, 10, 12, · · · }.
2
1
• f −1 ({2, 3}) = {0, 21 }.
1 2 3 4
Example 4.4.2
Let f (x) = x2 be a function from R to R. Find f ([1, 2]), f ([0, 1]), f ({2}), f ([−2, −1] ∪ [1, 2]),
and f −1 ([1, 4]).
Solution:
f (x) = x2
−3 −2 −1 0 1 2 3
−1
• f ([1, 4]) = [−2, −1] ∪ [1, 2].
Example 4.4.3
Solution:
Theorem 4.4.1
n o n o
Let f : A → B and let Xi : i ∈ I ⊆ A and Yi : i ∈ I ⊆ B. Then,
!
\ \
1. f Xi ⊆ f (Xi ).
i∈I i∈I
!
[ [
2. f Xi = f (Xi ).
i∈I i∈I
4.4. Images of Sets 71
!
−1
f −1 (Yi ).
\ \
3. f Yi =
i∈I i∈I
!
−1
f −1 (Yi ).
[ [
4. f Yi =
i∈I i∈I
Proof:
!
\ \
Proof of (1): Let b ∈ f Xi , then b = f (a) for some a ∈ Xi . Thus, a ∈ Xi for every
i∈I i∈I \
i ∈ I so that b = f (a). Hence, for every i ∈ I, b ∈ f (Xi ). Therefore, b ∈ f (Xi ).
i∈I
Proof of (2):
!
[ [
Let b ∈ f Xi ⇔ b = f (a) for some a ∈ Xi
i∈I i∈I
⇔ b = f (a) for some a ∈ Xi for some i ∈ I
Proof of (3):
!
−1
a = f −1 (b) for some b ∈
\ \
Let a ∈ f Yi ⇔ Yi
i∈I i∈I
⇔ a = f −1 (b) for some b ∈ Yi for every i ∈ I
f −1 (Yi ) .
\
⇔ a∈
i∈I
Example 4.4.4
Let f : N × N → N be defined by f (m, n) = 2m−1 (2n − 1), and let Y = {3, 10}. Find the
inverse image of Y .
Solution:
• f −1 ({3}) = (m, n) such that 3 = f (m, n) = 2m−1 (2n − 1). Since 2 - 3, 2m−1 = 1.
Then m − 1 = 0 or m = 1. In that case, 3 = 2n − 1 and hence n = 2. Therefore,
f −1 ({3}) = (m, n) = (1, 2).
72 Chapter 4. Functions
• f −1 ({10}) = (m, n) such that 10 = f (m, n) = 2m−1 (2n − 1). After factoring 10, we get
10 = 21 · 5. Thus, 2 | 10 and hence 2m−1 = 21 . Then, m − 1 = 1 and so m = 2. As a
result of that, 10 = 22−1 (2n − 1). Thus, 10 = 2(2n − 1) which implies n = 3. Therefore,
f −1 ({10}) = (2, 3).
Example 4.4.5
Solution:
Example 4.4.6
1−1
Let f : A −−→ B. Prove that if X ⊆ A, then f (A − X) = f (A) − f (X).
Solution:
” ⊆ ”: Let y ∈ f (A − X), then there exists x ∈ A − X such that y = f (x). That is, x ∈ A and
x∈
/ X. Thus, f (x) ∈ f (A) and f (x) ∈
/ f (X) (since f is 1-1). Therefore, f (x) ∈ f (A) − f (X)
and hence y ∈ f (A) − f (X).
” ⊇ ”: Let y ∈ f (A) − f (X). Then, y ∈ f (A) and y ∈
/ f (X). Thus, there exists x ∈ A such
that y = f (x) and x ∈
/ X (since if x ∈ X, then f (x) ∈ f (X) which is not the case). Thus,
x ∈ A − X and thus f (x) ∈ f (A − X) which implies y ∈ f (A − X).
4.4. Images of Sets 73
Exercise 4.4.1
Exercise 4.4.2