Chap Ens
Chap Ens
In this chapter we review the foundations and notations of naı̈ve set theory. We
will define sets and the notions of functions, relations and operations on sets
that are required in this text. The reader who is well acquainted with basic
mathematics can browse through the present chapter.
1.1 Sets
Remark 1.2 Some authors, mainly French, among them Bourbaki, denote in-
clusion by ⊂; so, to avoid ambiguities, strict inclusion is denoted by ⊆
/
.
The Cartesian product of two sets E and F is the set of all ordered pairs
consisting of an element of E and an element of F :
E × F = {(x, y) / x ∈ E and y ∈ F } .
1
2 1. Sets and functions
E1 × · · · × En = {(x1 , . . . , xn ) / x1 ∈ E1 , . . . , xn ∈ En } .
Example 1.3
• E = ∅, and ∅ = E.
• A ∩ ∅ = ∅, A ∪ E = E, A △ E = A.
• A ∩ A = A ∪ A = A ∪ ∅ = A △ ∅ = A ∩ E = A = A.
• A \ B = A ∩ B.
• A \ A = A △ A = ∅.
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) and
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) .
These properties are to be found again in the study of lattices (see Chapter 2,
Section 2.5) and in the study of Boolean algebras (see Chapter 4).
Notations
=⇒ (resp. ⇐⇒) stands for ‘implies’ (resp. ‘if and only if’).
∃e ∈ E (resp. ∀e ∈ E) stands for ‘there exists an e in E’ (resp. ‘for any e in E’).
Sets 3
1.2 Functions
1.2.1 Definitions
Intuitively, a mapping f from E to F assigns to each element x of E a unique
element f (x) of F . The slightly more general notions of correspondence and
function will also be of use. Formally, the definitions are as follows.
Let E and F be two sets. A correspondence from E to F is a triple
f = (E, F, Γ), where Γ is a subset of E × F . We say that E is the pre-domain of
f , F is the co-domain of f and Γ is the graph of f . The set
Dom(f ) = {x ∈ E / ∃y ∈ F, (x, y) ∈ Γ}
Im(f ) = {y ∈ F / ∃x ∈ E, (x, y) ∈ Γ}
f (X) = {y ∈ F / ∃x ∈ X, (x, y) ∈ Γ}
f −1 (Y ) = {x ∈ E / ∃y ∈ Y, (x, y) ∈ Γ}
Example 1.5
• The identity mapping on E defined by f (x) = x for any x of E is denoted
by idE : E −→ E.
• The function χA : E −→ {0, 1} defined by:
1 if e ∈ A,
χA (e) =
0 if e ∈
/ A,
is called the characteristic function of the subset A of E.
A mapping f : E −→ F is said to be one-to-one or injective (resp. onto or
surjective, bijective or a one-to-one correspondence) if any element y ∈ F has at
most (resp. at least, exactly) one preimage by f . We thus have:
• f is injective if and only if ∀x, y ∈ E, f (x) = f (y) =⇒ x = y.
• f is surjective if and only if ∀y ∈ F , ∃x ∈ E, y = f (x).
• f is bijective if and only if ∀y ∈ F , ∃!x ∈ E, y = f (x), i.e. if f is both
injective and surjective. (The symbol ∃! means ‘there exists a unique’.)
Exercise 1.5 Let f : E −→ F be a mapping and let (Ai )i∈I be a partition of F . Note:
f (E) = {f (e) / e ∈ E}. Show that f −1 (Ai ) i∈I is almost a partition of E, by which
we mean that some f −1 (Ai ) may be empty, thus preventing f −1 (Ai ) i∈I from being a
partition of E. Give a sufficient condition for all the sets f −1 (Ai ) to be non-empty. ♦
Exercise 1.6 Let f : E −→ F be a mapping. Find a necessary and sufficient condition
for ensuring that the image by f of any partition of E is a partition of F . Assume that
if f is injective, then f (A ∩ B) = f (A) ∩ f (B) (see Exercise
1.8), and
recall that the
image of a partition (Ai )i∈I of E is defined by f (Ai )i∈I = f (Ai )i∈I . ♦
Let f : E −→ F and g: F −→ G be two mappings. The composition of f and
g is the mapping g ◦ f : E −→ G defined by g ◦ f (x) = g(f (x)). For instance,
if f : E −→ F is a mapping, we have f ◦ idE = idF ◦ f = f . The composition
of mappings is associative; hence, parentheses can be omitted and we can write
h ◦ g ◦ f.
1.2.2 Properties
We present some useful properties of sets and mappings.
Let f : E −→ F be a mapping, let A and B be two subsets of E and let C and
D be two subsets of F . We have:
f (A ∪ B) = f (A) ∪ f (B) and f (A ∩ B) ⊆ f (A) ∩ f (B) ,
f −1 (C ∪ D) = f −1 (C) ∪ f −1 (D) and f −1 (C ∩ D) = f −1 (C) ∩ f −1 (D) .
If, moreover, f is injective, then f (A ∩ B) = f (A) ∩ f (B). These properties are
easily proved and can be generalized to arbitrary unions or intersections.
6 1. Sets and functions
1. f injective ⇐⇒ ∀X ⊆ A, f −1 (f (X)) = X ,
2. f surjective ⇐⇒ ∀Y ⊆ B, f (f −1 (Y )) = Y . ♦
Exercise 1.9 Let E be a set and let A and B be two subsets of E. Consider the
mapping
f : P(E) −→ P(A) × P(B)
X 7−→ (X ∩ A, X ∩ B) ,
1. injective,
2. surjective and
3. bijective. ♦
1. Show that
(i) g ◦ f injective =⇒ f injective,
(ii) g ◦ f surjective =⇒ g surjective.
2. Find an example for which g ◦ f is bijective, f is non-surjective and g is non-
injective.
3. Show that
(i) g ◦ f injective and f surjective =⇒ g injective,
(ii) g ◦ f surjective and g injective =⇒ f surjective. ♦
1.3 Cardinals
We easily deduce from this proposition that two integers n and m are equal if
and only if there exists a bijection from [n] to [m]. A set E is finite if there exists
an integer n and a bijection from E to [n]. This integer n is unique and is called
the cardinality of E; it is denoted by |E|.
Let E and F be finite sets and f : E −→ F be a mapping. With these notations,
we have
f injective ⇐⇒ ∀y ∈ F, |f −1 ({y})| ≤ 1 ,
f surjective ⇐⇒ ∀y ∈ F, |f −1 ({y})| ≥ 1 and
f bijective ⇐⇒ ∀y ∈ F, |f −1 ({y})| = 1 .
Example 1.10 Let n be the number of strings that can be coded with sixteen
bits. Each string is a sequence of 0s and 1s of length 16 and can be viewed as a
mapping from [16] to IB = {0, 1}. Hence, n = 216 = 65 536.
Exercise 1.16 A more picturesque way of stating Proposition 1.8 is the ‘pigeonhole
principle’. If n < m and a flock of m pigeons flies into n pigeonholes then there must
be at least one pigeonhole with two or more pigeons in it. More precisely, show that a
pigeonhole will contain at least p pigeons, where p is an integer p ≥ m/n. ♦
The notion of cardinality can be generalized to infinite sets in such a way that
the following properties are verified for any two sets E and F :
(i) |E| ≤ |F | ⇐⇒ there exists an injection from E to F .
(ii) |E| ≥ |F | ⇐⇒ there exists a surjection from E to F .
(iii) |E| = |F | ⇐⇒ there exists a bijection from E to F .
Exercise 1.17 From the above relations, we deduce that if there exists both an injec-
tion and a surjection from E to F then there exists a bijection from E to F . Prove this
result directly. ♦
Lastly, notice that there exist uncountable sets. This follows from the following
result.
Operations and relations 9
Proposition 1.11 Let E be a set and let P(E) be the set of subsets of E. We
have
|E| < |P(E)| .
Proof. We show by contradiction that there exists no bijection between E and
P(E). Assume that f : E −→ P(E) is a bijective mapping, and let A = {x ∈
E / x 6∈ f (x)}. Assume that there exists an a ∈ E such that A = f (a):
• If a ∈ A, we deduce from the definition of A that a 6∈ A: contradiction.
• Similarly, the hypothesis a 6∈ A leads to a contradiction.
Hence, A has no preimage by f , and this proves that f is not surjective and hence
not bijective.
Hence, there exists no bijective mapping from E to P(E), and the sets E and
P(E) thus have different cardinalities. The result is then deduced from the fact
that the mapping f : E −→ P(E) defined by f (x) = {x} is injective. ⊓
⊔
We deduce that P(IN) is uncountable.
Exercise 1.19 Consider the set U of sequences (un )n∈IN with values ranging over
{0, 1}, i.e. ∀n ∈ IN, un ∈ {0, 1}. (Sequences are studied in Chapter 7.) Show that U is
uncountable. ♦
Example 1.13 The set IN together with addition + and its unit 0 is a commu-
tative monoid. The set IN together with multiplication × and its unit 1 is also a
commutative monoid.
Example 1.14 The set P(E) equipped with intersection (or union) is a commu-
tative monoid. The set of mappings from E to itself equipped with the compo-
sition of mappings is a non-commutative monoid if E has at least two elements.
The set of square n × n matrices with real-valued entries in IR is a monoid,
non-commutative if n > 1, for the operation of multiplication of matrices.
A special case of monoids, discussed in more detail in Chapter 11 because of
their importance in computer science, consists of the free monoids.
Definition 1.15 Let A be a finite set called the alphabet, whose elements are
called letters. The free monoid over A, denoted by A∗ , is the set of strings written
with letters of the alphabet A. A string u is just a finite sequence of letters.
Given a string u, the number of elements of its sequence is called the length of u
and is denoted by |u|. If the string u of length n is the sequence (u1 , u2 , . . . , un ), it
is simply denoted by u = u1 u2 · · · un . For instance, aaba, acebdacebd, a, b, aa and
aaa are strings over the alphabet A = {a, b, c, d, e}. The empty string, denoted by
ε, is a special string of A∗ containing no letters (the empty sequence). The oper-
ation of the monoid A∗ is called concatenation. The concatenation of two strings
u = u1 u2 · · · un and v = v1 v2 · · · vm is the string u · v = u1 u2 · · · un v1 v2 · · · vm .
For instance, aaba · cde = aabacde. The unit for concatenation is of course the
empty string ε.
Definition 1.16 A set E equipped with an operation ∗ is a group if it is
a monoid and every element has an inverse, i.e. ∀e ∈ E, ∃e′ ∈ E such that
e ∗e′ = e′ ∗e = 1l (where 1l denotes the unit for ∗). If, moreover, ∗ is commutative,
the group is said to be commutative.
Example 1.17 The set ZZ of integers equipped with the addition operation is a
commutative group. If E and operation ∗ form a monoid then the set of invertible
elements of E is a group. In particular, the set of invertible n × n square matrices
with real-valued entries in IR is a group, non-commutative if n > 1, for the
operation of multiplication of matrices.
Operations and relations 11
Example 1.20
1. The following sets define relations on E = IN:
• the set {(n, m) / n ≤ m},
• the set {(n, m) / n ≤ m ≤ 2n},
• the set {(n, m) / n ≤ m and ∃k : n2 + m2 = k 2 }.
2. For any set A, inclusion is a relation on E = P(A).
1.4.3 Set-theoretic operations on relations
Because a relation is a set, we can easily define:
• the complement R of a relation R; R is the complement of R in E × E:
(e, e′ ) ∈ R ⇐⇒ (e, e′ ) 6∈ R ,
A relation R is said to be
• reflexive if ∀e ∈ E, eRe,
• irreflexive if ∀e, e′ ∈ E, e R e′ =⇒ e 6= e′ ,
• symmetric if ∀e, e′ ∈ E, e R e′ =⇒ e′ R e ,
• antisymmetric if ∀e, e′ ∈ E, e R e′ and e′ R e =⇒ e = e′ ,
• transitive if ∀e, e′ , e′′ ∈ E, e R e′ and e′ R e′′ =⇒ e R e′′ .
Exercise 1.23
1. Show that if R is left (resp. right) complete then R−1 is right (resp. left) complete.
2. Show that
(i) IdE ⊆ R.R−1 if and only if R is left complete ,
(ii) IdE ⊆ R−1 .R if and only if R is right complete .
3. Show that R ∩ R−1 and R ∪ R−1 are symmetric.
4. Show that if R and R′ are transitive, then R ∩ R′ is transitive, but R ∪ R′ is not
necessarily transitive.
5. Show that R+ is transitive.
6. Show that if R is transitive then R = R+ , and that if R is reflexive and transitive
then R = R∗ . ♦
Exercise 1.25 Is the relation ‘n R m if and only if n and m have a common divisor
different from 1’ transitive? ♦
Exercise 1.26 Let E be the finite set {e1 , ..., en }, and let R be a binary relation on
E. We represent R by an n × n matrix, MR , with entries ranging over {0, 1} as follows:
1 if ei R ej ,
n
mi,j =
0 otherwise.
Example 1.22
(i) The equality on a set E is an equivalence relation, denoted by both = and
IdE (see Section 1.4.3).
(ii) Let n be an integer greater than or equal to 2. The relation on ZZ: ‘x and
y have the same remainder when divided by n’ is an equivalence relation. It
is denoted by both x ≡ y[n] and x ≡ y mod n, and we say that ‘x and y are
congruent modulo n’.
The intersection R ∩ R′ of two equivalence relations is also an equivalence
relation, but the union R ∪ R′ and the product R.R′ need not be equivalence
relations.
Proposition 1.23 If R is an arbitrary relation, (R ∪ R−1 )∗ is an equivalence
relation, and it is the least equivalence relation containing R.
Proof. By definition, (R ∪ R−1 )∗ is reflexive and transitive. Since R ∪ R−1 is
symmetric, (R ∪ R−1 )∗ also is symmetric.
Clearly, (R ∪ R−1 )∗ contains R. Let R′ be an equivalence relation containing
R. Since R′ is symmetric, it also contains R ∪ R−1 , and since it is reflexive and
transitive, it contains (R ∪ R−1 )∗ . ⊓
⊔
Exercise 1.27 Show that if R and R′ are two equivalence relations, the least equiva-
lence relation containing R and R′ is (R ∪ R′ )+ . ♦
Proposition 1.25
1. ∀e ∈ E , e ∈ [e]R ,
2. ∀e, e′ ∈ E, e R e′ =⇒ [e]R = [e′ ]R ,
3. If [e]R ∩ [e′ ]R 6= ∅ , then [e]R = [e′ ]R .
Proof. The first point is obvious because e R e. To show the second point,
consider e′′ ∈ [e′ ]R ; then e′ R e′′ and, as e R e′ , we also have e R e′′ and
e′′ ∈ [e]R . Hence, [e′ ]R ⊆ [e]R . Conversely, [e]R ⊆ [e′ ]R for the same reasons.
Lastly, if e′′ ∈ [e]R ∩ [e′ ]R , then e R e′′ and e′′ R e′ , and hence e R e′ and
[e]R = [e′ ]R . ⊓
⊔
Operations and relations 15
x R y ⇐⇒ Fx ⊆ Fy .
1.4.7 Congruences