Section 1. Set theory, mathematical logic
Remark 1.1 (concept of set)
We do not define the notion of set.
We can describe intuitively a set as any collection of elements.
Remark 1.2 (propositions, boolean operations)
We assume that the reader is familiar with the concepts of proposition, value of truth
and boolean operations and, or and not.
One can use the notations P∧Q for P and Q, P∨Q for P or Q and
P for not P.
Remark 1.3 (logical or)
It should be noted that, in everyday language, the meaning of the word "or" is sometimes different
from the meaning of the operator or in mathematical logic.
This can be explained through the following joke.
A man and a woman are talking casually and the man asks "are you married or single ?"
The woman, who is a mathematician specialized in logic, after thinking for a while, answers "yes".
Explanation : in everyday language, the word "or" is often mutually exclusive
and implies a choice between two possibilities.
In mathematical logic, or means simply that at least one of the propositions involved is true.
In programming, there is a different operator called exclusive or
whose meaning is somewhat closer to the everyday language.
Properties 1.4 (commutativity, distributivity)
The boolean operations verify the following properties which are easy to check by giving
propositions P, Q and R all possible truth value combinations.
a) P and Q ≡ Q and P (the conjunction is commutative)
b) P or Q ≡ Q or P (the disjunction is commutative)
c) (P and Q) and R ≡ P and (Q and R) (the conjunction is associative)
d) (P or Q) or R ≡ P or (Q or R) (the disjunction is associative)
e) (P or Q) and R ≡ (P and R) or (Q and R)
(the disjunction is distributive with respect to the conjunction)
f) (P and Q) or R ≡ (P or R) and (Q or R)
(the conjunction is distributive with respect to the disjunction)
Note how operators and and or play symmetric roles with regard to distributivity.
This is very different from arithmetic operators of addition and multiplication :
multiplication is distributive with respect to addition but not the other way around.
g) not (not P) ≡ P
h) not (P and Q) ≡ (not P) or (not Q)
i) not (P or Q) ≡ (not P) and (not Q)
Definition 1.5 (predicate)
A proposition p which depends on a parameter x is called a predicate
and is denoted by p(x).
Remark 1.6 (correspondence between sets and predicates)
To each set A we can associate the predicate x ∊ A.
Conversely, to each predicate we can associate the set of elements where the predicate is true.
Definition 1.7 (intersection, union)
Let A and B be two arbitrary sets.
We call intersection of A and B to the set of all elements which belong
simultaneously to A and to B; this set is denoted by A∩B.
We call union of A and B to the set of all elements which belong
to at least one of A and to B; this set is denoted by A∪B.
Remark 1.8
(link between intersection and and, between union and or)
Recall the association between sets and predicates, remark 1.6.
This association gives a strong link between the intersection of sets and the logical operator and :
x ∊ A∩B ⇔ (x ∊ A) and (x ∊ B).
There is also a strong link between the union of sets and the logical operator or :
x ∊ A∪B ⇔ (x ∊ A) or (x ∊ B).
Properties 1.9 (commutativity, distributivity)
The link shown in remark 1.8 means that
the properties of logical operators (remark 1.4)
imply corresponding properties of intersection and union of sets :
a) A∩B = B∩A (intersection is commutative)
b) (A∩B) ∩ C = A ∩ (B∩C) (intersection is associative)
c) A∪B = B∪A (union is commutative)
d) (A∪B) ∪ C = A ∪ (B∪C) (union is associative)
e) (A∪B) ∩ C = (A∩C) ∪ (B∩C)
(intersection is distributive with respect to union)
f) (A∩B) ∪ C = (A∪C) ∩ (B∪C)
(union is distributive with respect to intersection)
Definition 1.10 (complementary set)
If we assume all possible elements belong to some large, surrounding set 𝒰
(the universe),
we can define the complementary of a given set A as the set ∁A
of all elements which do not belong to A.
Some authors use the notation A
for the complementary set.
In the spirit of remark 1.8,
there is a strong link with the logical operator not.
Thus, properties g), h) and i) in remark 1.4 imply :
a) the complementary of ∁A is A
b) ∁(A∩B) = ∁A ∪ ∁B
c) ∁(A∪B) = ∁A ∩ ∁B
Definition 1.11 (existential and universal quantifiers)
The existential quantifier ∃ and the universal quantifier ∀ transform a predicate
into a regular proposition.
If p(x) is a predicate (a proposition depending on a parameter x ∈ A) then
∃ x ∈ A, p(x)
is a new proposition meaning "there exists an x in A for which p(x) is true".
It can also be formulated as
"there exists at least one x in A for which p(x) is true".
On the other hand, ∀ x ∈ A, p(x) is a different proposition meaning
"for any x ∈ A, p(x) is true".
Note that the expressions ∃ x ∈ A, p(x) and
∀ x ∈ A, p(x) are not predicates,
their value of truth does not depend on a parameter.
In particular ∃ x ∈ A, p(x) and ∃ y ∈ A,
p(y) are two different ways of expressing the very same proposition
(the parameter name, x or y, is meaningless outside that logical expression).
Similarly, ∀ x ∈ A, p(x) and ∀ y ∈ A, p(y)
are exactly the same proposition.
Property 1.12 (negation of quantifiers)
Let p(x) be a predicate on a set A.
Then
not (∀ x ∈ A, p(x)) ≡
∃ x ∈ A, not p(x)
not (∃ x ∈ A, p(x)) ≡
∀ x ∈ A, not p(x)
The importance of understanding these two properties cannot be overstated.
The first of these properties can be intuitively described as follows.
Suppose somebody says "all birds fly".
If I want to explain to this person that their statement is false, I don't say "no bird can fly";
if I say this I will be equally wrong.
I must say
"although most birds do fly, there are birds which do not, like the penguin or the ostrich".
Formally : the negation of "∀ x ∈ {birds}, x flies" is not
"∀ x ∈ {birds}, x does not fly" but "∃ x ∈ {birds}, x does not fly".
Remark 1.13 (quantifiers applied to the void set)
No matter which predicate p we choose,
the proposition ∃ x ∈ ∅, p(x) is always false.
No matter which predicate p we choose,
the proposition ∀ x ∈ ∅, p(x) is always true.
While the first of the statements above should be self-evident, the second one is much less obvious
and actually many people have some degree of trouble accepting it or fully understanding it.
Here is a way to think about it.
Let us apply the first statement to the predicate not p;
so ∃ x ∈ ∅, not p(x) is always false.
Its negation is ∀ x ∈ ∅, p(x) (see property 1.12);
it must be always true.
Questions 1.14
Let p and q be two predicates on a set A.
Are the statements below equivalent ?
a) (∃ x ∈ A, p(x)) and (∃ x ∈ A, q(x)) versus
∃ x ∈ A, (p(x) and q(x))
b) (∀ x ∈ A, p(x)) and (∀ x ∈ A, q(x)) versus
∀ x ∈ A, (p(x) and q(x))
c) (∃ x ∈ A, p(x)) or (∃ x ∈ A, q(x)) versus
∃ x ∈ A, (p(x) or q(x))
d) (∀ x ∈ A, p(x)) or (∀ x ∈ A, q(x)) versus
∀ x ∈ A, (p(x) or q(x))
Answers
In a), the assertion on the left is true if two different x1 and
x2 exist such that p(x1) and p(x2)
are true. The assertion on the right needs x1 and x2
to be the same. Thus, they are not equivalent. The assertion on the right implies the
on on the left. For instance, if p and q are the predicates shown below,
the assertion on the left holds true but not the one on the right.
In b) and c), the two assertions are equivalent.
In d), the assertion on the left implies the assertion on the right but not the other
way around. For instance, if p and q are the predicates shown below,
the assertion on the right holds true but not the one on the left.
Definition 1.15 (cartesian product of two sets)
For two given sets A and B, their cartesian product A × B is
the set of all pairs (a,b), with a ∈ A and b ∈ B.
Definition 1.16
(predicate depending on several parameters)
There are predicates depending on more than one parameter.
For instance, a predicate p(x,y) depending on two parameters,
x ∈ A and y ∈ B, is simply a predicate on A × B.
Such a predicate may be called bi-variate.
Since a predicate on a set A corresponds to a subset of A
(see remark 1.6),
a bi-variate predicate can be viewed as a relation (see definition 2.1).
Remark 1.17
(quantifiers applied to predicates of more than one argument)
One can apply quantifiers to predicates depending on more than one parameter.
For instance, if p(x,y) is a predicate depending on two parameters
x ∈ A and y ∈ B,
then ∀ x ∈ A, p(x,y) is a new predicate
depending on only one parameter y ∈ B.
Thus, it is possible to write entire chains of quantifiers.
For instance, ∀ x ∈ A, ∀ y ∈ B, p(x,y)
is a proposition (does not depend on any parameter).
Of course, ∀ x ∈ A, ∃ y ∈ B, p(x,y) is quite a different proposition,
and so are ∃ x ∈ A, ∀ y ∈ B, p(x,y)
and ∃ x ∈ A, ∃ y ∈ B, p(x,y).
Remark 1.18 (order of quantifiers)
Let p be a predicate depending on (at least) two parameters.
We can switch the order of two existential quantifiers
without changing the meaning of the resulting proposition.
That is, ∃ x ∈ A, ∃ y ∈ B, p(x,y) is exactly the
same proposition as ∃ y ∈ B, ∃ x ∈ A, p(x,y).
Both mean there is a pair (x,y) in A × B such that p(x,y) is true.
Similarly, ∀ x ∈ A, ∀ y ∈ B, p(x,y) yelds exactly
the same as ∀ y ∈ B, ∀ x ∈ A, p(x,y).
Both mean that for any pair (x,y) in A × B, p(x,y) is true.
That is, p is true on A × B.
However, ∃ x ∈ A, ∀ y ∈ B, p(x,y) is very different
from ∀ y ∈ B, ∃ x ∈ A, p(x,y) !
The first statement means there exists a particular x ∈ A,
which we may call x⋆,
such that p(x⋆,y) is true for all y ∈ B.
That is, p is true on {x⋆} × B.
The second statement means that, for each y ∈ B there is an x ∈ A
such that p(x,y) is true; this x may depend (and often does) on the chosen y
and thus may be denoted by x(y).
The importance of understanding the difference between these two situations cannot be overstated.
Challenges 1.19 (order of quantifiers)
Consider A = {a,b,c,d,e} and B = {1,2,3,4}.
Consider the three predicates represented below,
where a cross means true and an empty field means false.
For each of these predicates, determine the value of truth of the following propositions.
a) ∃ x ∈ A, ∃ y ∈ B, p(x,y)
b) ∀ x ∈ A, ∃ y ∈ B, p(x,y)
c) ∃ y ∈ B, ∀ x ∈ A, p(x,y)
d) ∀ y ∈ B, ∃ x ∈ A, p(x,y)
e) ∃ x ∈ A, ∀ y ∈ B, p(x,y)
f) ∀ x ∈ A, ∀ y ∈ B, p(x,y)
Questions 1.20 (order of quantifiers, x ≤ y)
Are the following propositions true or false ?
a) ∃ x ∈ ℕ, ∃ y ∈ ℕ, x ≤ y
b) ∀ x ∈ ℕ, ∃ y ∈ ℕ, x ≤ y
c) ∃ y ∈ ℕ, ∀ x ∈ ℕ, x ≤ y
d) ∀ y ∈ ℕ, ∃ x ∈ ℕ, x ≤ y
e) ∃ x ∈ ℕ, ∀ y ∈ ℕ, x ≤ y
f) ∀ x ∈ ℕ, ∀ y ∈ ℕ, x ≤ y
Answers
a) is true
b) is true
c) is false (there is no y greater than any natural number)
d) is true (it suffices to choose x=y)
e) is true (it suffices to choose as x the lowest natural number)
f) is false
Questions 1.21 (order of quantifiers, x ≤ y)
Are the following propositions true or false ?
a) ∃ x ∈ ℝ, ∃ y ∈ ℝ, x ≤ y
b) ∀ x ∈ ℝ, ∃ y ∈ ℝ, x ≤ y
c) ∃ y ∈ ℝ, ∀ x ∈ ℝ, x ≤ y
d) ∀ y ∈ ℝ, ∃ x ∈ ℝ, x ≤ y
e) ∃ x ∈ ℝ, ∀ y ∈ ℝ, x ≤ y
f) ∀ x ∈ ℝ, ∀ y ∈ ℝ, x ≤ y
Answers
a) is true
b) is true
c) is false (there is no y greater than any real number)
d) is true (it suffices to choose x=y)
e) is false (there is no x smaller than any real number)
f) is false
Questions 1.22
(order of quantifiers, x2 ≤ y)
Are the following propositions true or false ?
a) ∃ x ∈ ℝ, ∃ y ∈ ℝ, x2 ≤ y
b) ∀ x ∈ ℝ, ∃ y ∈ ℝ, x2 ≤ y
c) ∃ y ∈ ℝ, ∀ x ∈ ℝ, x2 ≤ y
d) ∀ y ∈ ℝ, ∃ x ∈ ℝ, x2 ≤ y
e) ∃ x ∈ ℝ, ∀ y ∈ ℝ, x2 ≤ y
f) ∀ x ∈ ℝ, ∀ y ∈ ℝ, x2 ≤ y
Answers
a) is true
b) is true
c) is false (there is no y greater than any square of a real number)
d) is false (it suffices to choose y negative)
e) is false (one can always choose a y smaller than a given value)
f) is false
Questions 1.23
(order of quantifiers, x ≤ y2)
Are the following propositions true or false ?
a) ∃ x ∈ ℝ, ∃ y ∈ ℝ, x ≤ y2
b) ∀ x ∈ ℝ, ∃ y ∈ ℝ, x ≤ y2
c) ∃ y ∈ ℝ, ∀ x ∈ ℝ, x ≤ y2
d) ∀ y ∈ ℝ, ∃ x ∈ ℝ, x ≤ y2
e) ∃ x ∈ ℝ, ∀ y ∈ ℝ, x ≤ y2
f) ∀ x ∈ ℝ, ∀ y ∈ ℝ, x ≤ y2
Answers
a) is true
b) is true
c) is false (there is no number greater than all real numbers)
d) is true (it suffices to choose x=0 or negative)
e) is true (it suffices to choose x=0 or negative)
f) is false
Questions 1.24
(order of quantifiers, n𝜀 > 1)
Are the following propositions true or false ?
a) ∀ 𝜀 > 0, ∃ n ∈ ℕ, n𝜀 > 1
b) ∃ n ∈ ℕ, ∀ 𝜀 > 0, n𝜀 > 1
Answers
a) is true, it suffices to choose some n larger than 1/𝜀
b) is false, it suffices to choose an 𝜀 smaller than 1/n
Remark 1.24.c (use of functions)
In questions 1.20, 1.21,
1.22, 1.23,
1.24, 1.25,
one can imagine two players.
Focusing on 1.24, ...
Questions 1.25
(order of quantifiers, n𝜀 > 1)
Are the following propositions true or false ?
a) ∀ 𝜀 > 0, ∃ N ∈ ℕ, ∀ n ≥ N, n𝜀 > 1
b) ∃ N ∈ ℕ, ∀ 𝜀 > 0, ∀ n ≥ N, n𝜀 > 1
c) ∃ N ∈ ℕ, ∀ n ≥ N, ∀ 𝜀 > 0, n𝜀 > 1
Answers
a) is true (it suffices to choose N greater than 1/𝜀),
b) is false (no matter how large N is, we can always choose an
𝜀 small enough to violate the desired inequality),
c) is identical to b) (switching the order of two universal quantifiers does not change
the meaning of the sentence)
Remark 1.26 (use of functions)
In the sequel, we will dwell on the concept of finite (versus infinite) set.
For defining this concept we will need to use the notion of bijective function,
see definition 3.2.
Question 1.27 (bijections between sets)
Is there any bijection between the sets
{a,b,c,d,e} and {1,2,3,4} ?
Remark 1.28 (about natural numbers)
The negative answer to question 1.27
is a hint at how natural numbers show up as a cognitive necessity.
We can say that the number 5 is a common characteristic of all sets which are in bijection
(in a one-to-one correspondence) with the set of the fingers of one of our hands.
The set {a,b,c,d,e} is one of these sets.
Question 1.29
(bijection between a set and a subset)
Is there any bijection between the set {a,b,c,d,e}
and any of its subsets ?
Answer
Yes, if we take the subset to be {a,b,c,d,e} itself.
Question 1.30
(bijection between a set and a proper subset)
Is there any bijection between the set {1,2,3,...,1000000} and any of its proper subsets ?
A subset A of a set X is said to be proper if A ≠ X.
Answer
No.
Question 1.31
(bijection between ℕ and a proper subset)
Is there any bijection between the set ℕ of natural numbers
and the set of natural numbers starting at 10 {10,11,12,13,...} ?
Answer
Yes, for instance n↦ n+10 (assuming ℕ starts at 0).
Question 1.32 (bijection between ℕ and ℤ)
Is there any bijection between the set of natural numbers ℕ and
the set of integer numbers ℤ ?
Answer
Definition 1.33 (finite sets)
The positive answer to questions 1.31 and 1.32
suggests that there is an important difference between
sets like ℕ or ℤ and other sets like {a,b,c,d,e} or
{1,2,3,...,1000000}.
We say that a set X is infinite
if there is a bijection between X and some proper subset of it.
Naturally, we say that a set X is finite if it is not infinite.
Property 1.34 (bijection between ℕ and ℕ × ℕ)
There is a bijection between ℕ and ℕ × ℕ. Find it. There are several possible answers.
Answer
One possibility is the Cantor pairing function.
Questions 1.35 (are there bijections ?)
a) Is there a bijection between the set of natural numbers ℕ and the set of rational numbers ℚ ?
b) Is there a bijection between the set of natural numbers ℕ and the interval [0,1[ ?
c) Is there a bijection between the intervals [0,1[ and ]0,1[ ?
d) Is there a bijection between the intervals ]0,1[ and ]-1,1[ ?
e) Is there a bijection between the interval [0,1[ and the semi-line [0,+∞[ ?
f) Is there a bijection between the interval ]-1,1[ and the set of real numbers ℝ ?
g) Is there a bijection between the set of natural numbers ℕ and the set of real numbers ℝ ?
h) Is there a bijection between the interval [0,1[ and the square
[0,1[2 ⊂ ℝ2 ?
Answers
a )yes; one can make use of the bijection mentioned in property 1.34
b) no, see e.g. this paper
c) yes
d) yes, f(x) = 2x-1
e) yes, f(x) = tan (pi x /2) or f(x) = x/(1-x)
f) yes, f(x) = tan (pi x /2)
g) no; this can be proven based on questions 1.35.b,
1.35.c, 1.35.d and
1.35.f
h) yes, see e.g. this page
Definition 1.36 (countable set)
We say that a set X is countable if there is a one-to-one correspondence between X and ℕ.
A countable set is infinite.
We say that a set X is uncountable if it is inifite and not countable.
Thus, sets can be classified in three categories : finite sets, countable sets and
uncountable sets.
Remark 1.37 (countable and uncountable sets)
Question 1.35.a can be reformulated as : ℚ is countable.
Question 1.35.g can be reformulated as : ℝ is uncountable.
Remark 1.38 (terminology)
The adjective "countable" is somewhat misleading.
The elements of a set like ℕ or ℚ cannot be "counted" since these sets are infinite.
Rather, they can be organized as a sequence;
thus, an adjective like "sequentiable" could have been used.
However, the word "countable" is widely used in the literature.
Definition 1.39 (set of subsets)
In the rest of this section we will focus on collections of subsets of a given set X.
The set of all subsets of X (including the empty set ∅ and the set X itself)
will be denoted by 𝒫(X).
So, we will focus on subsets of 𝒫(X).
Definition 1.40 (covering)
A collection 𝒜 of non-empty subsets of X
is called a covering of X if
the union of all sets in 𝒜 equals X, that is, ⋃𝒜 = X.
Remark 1.41 (covering of a subset)
Sometimes we will consider a subset C of X and will call covering of C to any
collection 𝒜 of non-empty subsets of X such that the union of all sets in 𝒜
contains C, that is, ⋃𝒜 ⊃ C.
In this case, the collection { A∩C : A∈𝒜 } will be a covering of C in the sense of definition 1.40.
Examples 1.42 (coverings)
The following are examples of coverings of the set of natural numbers ℕ.
a) { ℕ }
b) { {1,2,3}, {i ∈ ℕ : i ≥4} }
c) { the set of even numbers, the set of numbers divisible by 3, the set of odd numbers }
d) { {n} : n ∈ ℕ }
e) { {1,2,3,...,n} : n ∈ ℕ }
Note that coverings a), b) and c) are finite while d) and e) are infinite.
Remark 1.43
(items 1.44 and 1.45 can be read later)
Items 1.44 and 1.45 below
are related to the notion of compact topological space.
Their reading can be postponed.
Definition 1.44 (subcovering)
Let 𝒜 be a covering of X.
Consider 𝒜⋆ a subfamily of 𝒜
(𝒜⋆ is obtained from 𝒜 by eliminating some of the sets).
If 𝒜⋆ still covers X (that is, ⋃𝒜⋆ = X),
we say that 𝒜⋆ is a subcovering of 𝒜.
Questions 1.45 (coverings)
a) Is the family { [n, n+1] : n ∈ ℕ } a covering of ℝ ?
How many intervals can we withdraw from it and still get a covering of ℝ ?
b) Is the family { [-n, n] : n ∈ ℕ } a covering of ℝ ?
How many intervals can we withdraw from it and still get a covering of ℝ ?
c) Is the family { ]-n, n[ : n ∈ ℕ } a covering of ℝ ?
How many intervals can we withdraw from it and still get a covering of ℝ ?
d) Is the family { [n, n+1] : n ∈ ℕ } a covering of ℝ ?
Does it have a finite subcovering ?
e) Is the family { [0, n] : n ∈ ℕ } a covering of ℝ ?
Does it have a finite subcovering ?
f) Is the family { [0, n] : n ∈ ℕ } a covering of [0,+∞[ ?
Does it have a finite subcovering ?
g) Is the family { [1/n,1] : n ∈ ℕ, n > 0 } a covering of [0,1] ?
Does it have a finite subcovering ?
h) Is the family { ]1/n,1] : n ∈ ℕ, n > 0 } a covering of [0,1] ?
Does it have a finite subcovering ?
i) Is the family { ]1/n,1] : n ∈ ℕ, n > 0 } a covering of ]0,1] ?
Does it have a finite subcovering ?
j) Is the family { ]1/n,1[ : n ∈ ℕ, n > 0 } a covering of ]0,1] ?
Does it have a finite subcovering ?
k) Is the family { ]1/n,1[ : n ∈ ℕ, n > 0 } a covering of ]0,1[ ?
Does it have a finite subcovering ?
l) Consider the family of subsets of ]0,1[ in question 1.45.k above.
Add to this family the interval ]0, 0.001[; we obtain a new covering of ]0,1[.
Does it have a finite subcovering ?
Definition 1.46 (partition)
A collection 𝒜 of non-empty subsets of X will be called a
partition of X if
a) the sets in 𝒜 are mutually disjoint, that is, ∀ A,B ∈ 𝒜,
A ∩ B =∅
b) the union of all sets in 𝒜 equals X, that is, ⋃𝒜 = X
In other words, a partition is a covering with mutually disjoint sets.
Question 1.47
Which of the coverings in example 1.42 are partitions ?
Question 1.48 (subpartition)
Let 𝒜 be a partition of X.
If 𝒜⋆ is obtained by withdrawing one or several sets from 𝒜,
can 𝒜⋆ still be a partition of X ?
Answer
No
Remark 1.49
A partition of a set defines an equivalence relation on that set,
see example 4.2.j.
Conversely, any equivalence relation defines a partition, see challenge 4.9.