Sets and Functions 2022
Sets and Functions 2022
a ∈ A.
Otherwise, we write
a∈
/ A.
If A contains no elements, it is the empty set, denoted by ∅.
Two sets are equal if they have exactly the same elements. In other words,
A = B ⇔ (x ∈ A ⇔ x ∈ B ).
All the elements that we will consider are assumed to belong to a universe
set U.
We use the bracket notation {} to refer to a set.
Example
The sets {1, 2, 3} and {3, 2, 1} are the same, because the ordering does
not matter. The set {1, 1, 2, 3, 3} is also the same set as {1, 2, 3}, because
we are not interested in repetitions.
One may specify a set explicitly, that is by listing all the elements the set
contains, or implicitly, using a predicate :
{x : P (x )}.
Definition
The Cardinality |A| of a set A is the number of distinct elements of A. If
|A| is finite, then A is said to be finite. Otherwise, A is said to be infinite.
Example
1 | ∅ | = 0 while |{ ∅ }| = 1.
2 |{1, 2, 5}| = 3.
A ∪ B = {x : x ∈ A ∨ x ∈ B }.
Definition
The intersection of A and B is
A ∩ B = {x : x ∈ A ∧ x ∈ B }.
Example
If A = {1, 2, 3, 4} and B = {3, 4, 5, 6}, then
A ∪ B = {1, 2, 3, 4, 5, 6}
and
A ∩ B = {3, 4}.
Theorem
Let A and B be finite sets. Then we have
|A ∪ B | = |A| + |B | − |A ∩ B |.
Definition
The sets A and B are disjoint when A ∩ B = ∅.
Definition
The set difference of B from A is
A \ B = {x : x ∈ A ∧ x ∈
/ B }.
A = U \ A = {x : x ∈ U ∧ x ∈
/ A}.
Example
Let U = {1, 2, · · · , 10}, A = {1, 2, 3, 4, 5} and B = {3, 4, 5, 6, 7, 8}.
Then
A \ B = {1, 2}
and
A = {6, 7, 8, 9, 10}.
Use Venn diagram to illustrate.
Example
R \ Q : irrational numbers.
A ∪ (B ∩ C ) ̸ = (A ∪ B ) ∩ C .
A ∪ (B ∪ C ) = (A ∪ B ) ∪ C ,
and
A ∩ (B ∩ C ) = (A ∩ B ) ∩ C ,
then we can write A ∪ B ∪ C and A ∩ B ∩ C .
Definition
The Cartesian product of A and B is
A × B = {(a, b ) : a ∈ A ∧ b ∈ B }.
Example
If A = {1, 2} and B = {0, 1, 2},
A × B = {1, 2} × {0, 1, 2} = {(1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)}.
A × B = {(1, ∅), (1, {1, 5}), (2, ∅), (2, {1, 5}), (7, ∅), (7, {1, 5})}.
A × B × C = {(a, b, c ), a ∈ A ∧ b ∈ B ∧ c ∈ C },
A × B × C × D = {(a, b, c, d ), a ∈ A ∧ b ∈ B ∧ c ∈ C ∧ d ∈ D },
and
An = {(a1 , a2 , · · · , an ) : ai ∈ A ∧ i = 1, 2, · · · , n }.
Rn = R × R × · · · × R (n times) is the Cartesian n −space.
December 10, 2021 20 / 40
SUBSETS
We have then
A ⊈ B ⇔ ∃x, x ∈ A ∧ x ∈
/ B.
Example
Let A = {1, 2, 3} and B = {1, 2, 5}. Then A ⊈ B because ∃ 3 ∈ A and
3∈/ B.
When A ⊆ B but A ̸= B, we say that A is a proper subset of B, and we
write A ⊂ B ).
Example
N ⊂ Z ⊂ Q ⊂ R ⊂ C.
The set Z plays the role of an index set, a set whose only purpose is to
enumerate the elements of the family. Each element of an index set is
called an index. If we let I = Z and Ai = [i, i + 1[, the family can be
written as
F = {Ai : i ∈ I }.
Theorem
Let A, B, C be sets. Then
1 ∅ ⊆ A.
2 A = B ⇔ A ⊆ B ∧ B ⊆ A.
3 If A ⊆ B and B ⊆ C , then A ⊆ C .
Example
P ({1, 2, 3}) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}
Definition
Let f : E → F be a function.
1 If x ∈ E , f (x ) is the image of x under f .
preimage of y under f .
Example
Let E = {1, 2, 3} and F = {a, b }. Then we can define a function
f : E → F by setting f (1) = f (2) = a and f (3) = b.
a is the image of 1 under f .
1 is the preimage of a under f .
Definition
For a function f : E −→ F , A ⊆ E , and B ⊆ F , the image of A is
f (A) = {y ∈ F : ∃x ∈ A, y = f (x )}.
f −1 (B ) = { x ∈ E : f (x ) ∈ B } .
Example
Let f : R −→ R, f (x ) = x 2 , Then
1 f ([−1, 1]) = [0, 1].
2 f −1 ({1}) = {1, −1}.
3 f −1 ({−1}) = ∅.
Definition
A function f : E → F is injective if we have
Example
The function f : Z → Z defined by f (x ) = x 2 , ∀x ∈ Z, is not injective
since f (1) = f (−1).
The function g : N → N defined by g (x ) = x 2 , ∀x ∈ N, is injective.
Definition
A function f : E → F is surjective if we have
∀y ∈ F , ∃x ∈ E , y = f (x ).
Example
The function f : Q → Q defined by f (x ) = 2x is surjective. Indeed,
y y
∀y ∈ Q, ∃x = ∈ Q : f (x ) = 2 · = y .
2 2
The function g : Z → Z defined by g (x ) = 2x is not surjective. Indeed,
∃y = 1 ∈ Z, ∀x ∈ Z, g (x ) = 2x ̸= 1.
December 10, 2021 35 / 40
Bijective function
Definition
A function that is both injective and surjective is said to be bijective.
Example
f : [0, +∞[ → [0, +∞[
x 7 → f (x ) = x 2
is bijective.
Theorem
Let f : E → F be a function. Then f is bijective if and only if
∀y ∈ F , ∃!x ∈ E : f (x ) = y .
f (x ) = y ⇔ x = f −1 (y )
Definition
f −1 is called the inverse of f
Example
f : [0, +∞[−→ [0, +∞[ defined by √ f (x ) = x 2 is bijective.
Its inverse is given by f −1 (x ) = x.
Definition
Let f : E −→ F and g : F −→ G be functions. The composed function
g ◦ f : E −→ G is defined by :
∀x ∈ E , g ◦ f (x ) = g (f (x )).
Example
Let f , g : R −→ R where f (x ) = x 2 and g (x ) = x + 1. Then
(g ◦ f )(x ) = g (x 2 ) = x 2 + 1,
while
(f ◦ g )(x ) = f (x + 1) = (x + 1)2 = x 2 + 2x + 1.
Therefore, in general
g ◦ f ̸= f ◦ g .
December 10, 2021 39 / 40
Composition
Theorem
Let f : E −→ F , g : F −→ G and h : G −→ H be functions. Then we
have
h ◦ (g ◦ f ) = (h ◦ g ) ◦ f .
Theorem
Let f : E −→ F be a bijective function, then f −1 ◦ f = IdE and
f ◦ f −1 = IdF .