Introduction to Naïve Set Theory
Introduction to Naïve Set Theory
Michael Franke
A set is a collection of entities. We use notation with curly braces “{. . .}” to
represent such a collection. If we have entities a and b, examples of sets are:
X = {a} Y = {a, b}
The entity a is an element of X and Y. We write this as a ∈ X and a ∈ Y. The Figure 1: Passage first introducing the
intuitive notion of a set from (the English
entity b is not an element of X. We write this as b < X. translation of) Georg Cantor’s Beiträge zur
A set is individuated by the elements it contains. This means that the order Begründung der transfiniten Mengenlehre
from 1915.
of representation of elements is irrelevant. For example, {a, b} = {b, a}. This
also means that whenever any two sets (however obtained) contain the same
elements, they are identical. In other words, for any two sets X and Y to be
different, there has to be at least one element x ∈ X such that x < Y or some
y ∈ Y such that y < X.
It is possible for a set to have no element at all. This set is called the empty
set and we refer to it with the symbol ∅. 1 U need not be a set itself; it can be
Occasionally we might wish to specify the universe U of all entities which something bigger. But that is best left aside
are under consideration.1 Any specification of a set is then implicitly re- here. The whole concept of a universe might
seem confusing at first sight. It is possible
stricted to entities in U. not to deeply understand what it is good
for in the greater scheme of things, and still
understand everything of current relevance
1.2 Ways of describing or defining sets
about naïve set theory.
Three main methods for describing or defining sets exist:
1. by listing elements
2. by characteristic property
3. by recursive definition
The text above already gave examples for describing sets by listing elements.
Sometimes we use notation “. . . ” to indicate a range of elements when there
is a clear intuitive ordering relation among them. Or we use “. . . ” to abbre-
viate the obvious other members, even if there is no natural ordering. For
example:
sets, relations, functions, and proofs 2
X = x | x is an even integer
Z = x | x is a famous logician
To narrow down a reference set explicitly, we would write:3 3 With a universe U in place, we should
read a description like
X = {x ∈ {1, 2, 3, . . . } | x is even} X = x | property of x , as
X = x ∈ U | property of x .
Y = {x ∈ {1, 2, 3, . . . , 20} | x is even}
Y = x ∈ y | y is a logician | x is famous
To describe sets by recursive definition, we must:4 4 Recursive definitions are useful because
they allow for easier proofs and easier
(i) anchor the recursion further definitions. This will become clear
when we look at a recursive definition of
(ii) specify a recursion step the formulas of a logical language, to which
we will then assign a meaning by exploiting
the original recursive definition (keyword:
(iii) exclude elements untouched by anchor or recursive steps “Tarski truth conditions”).
“x plus y” “x minus y”
Important sets to be familiar with are:6 6 Notice the commonly used “double-
stroke notation” for the capital letters used
N = {0, 1, 2, 3, . . . } [set of natural numbers] to refer to these special sets.
1.4 Cardinality
The number of elements in a set is called its cardinality. We write | X | for the
cardinality of X. The cardinality of X can be infinite. We then write | X | = ∞
and say that X is an infinite set.7 If X is not an infinite set, it is called a finite 7 Actually, infinite sets can have different
cardinalities, so that writing | X | = ∞
set. Examples:
could be misleading. For example,
| N | = | Q | < | R |. But this is not im-
| {a} | = 1 | {a, b} | = 2 portant for us at the moment.
|∅| = 0 | {2, 4, 6, 8 . . . } | = ∞
P(X) = {Y | Y ⊆ X}
If X is finite, the cardinality of P(X) is 2| X | .8 For example: 8 This is because we decide | X | times
whether to include an element or not; so we
collect all outcomes of | X | binary decisions.
sets, relations, functions, and proofs 4
X = {a, b} |X| = 2
X ∩ Y = {z | z ∈ X and z ∈ Y} [intersection]
X ∪ Y = {z | z ∈ X or z ∈ Y} [union]
X = {a, b, c} X ∪ Y = {a, b, c, d}
Y = {b, c, d} X \ Y = {a}
X ∩ Y = {b, c} Y \ X = {d}
A number of facts follows from the definitions so far. Some are shown in
Figure 3. To conclusively show that something follows from a definition, we
need the concept of a proof, the topic of the next section. Figure 3: Some facts. NB: The complement
of set X is written as X 0 in this list.
sets, relations, functions, and proofs 5
b. B = N \ A
c. C = {c ∈ Z | −2 ≤ c ≤ 2}
d. D = N ∩ C
Exercise 2. Let’s assume the following definitions (assuming that the uni-
verse is U = X ∪ Y ∪ Z):
X = {a, b, c, d}
Y = {y | y is a vowel} = {a, e, i, o, u}
Z = {z | z is an even natural number smaller than 5}
a. X ∩ Y c. X \ Y e. Y \ Y
b. X ∪ Y d. Y \ Z f. X ∩ X
a. X ⊂ Y c. X ∩ Y ⊆ X e. X ∪ Z ⊆ X
b. Y ∈ X d. | X | = | Y | f. X ∩ Y 1 X
sets, relations, functions, and proofs 6
2 Proofs
There are two general kinds of proofs. Formal proofs are rigid rule-based
derivations operating on a formal language in a specific proof system.10 10 Formal proofs will be dealt with later in
Informal proofs, if done well, follow the structure of a formal proof but only the context of a logic.
Nothing can be known for certain, except mathematical-logical truth.11 11 This is a strategically bold claim
Proofs are the anchors of infallible, necessarily true knowledge. A proposi- to clearly emphasize the significance of
mathematical-logical knowledge. Please feel
tion which has a valid proof must necessarily be true (in the system of logic highly provoked and intrigued. Please push
and given the assumptions used to prove it). Therefore, proofs are the founda- back, question and doubt!
tion of the only unshakable knowledge humankind is capable of.
There are different kinds of proof strategies, which can be applied in different
kinds of situations. Here we will look at the following four proof strategies:
X = {a, b}
Although X ∈ Y and a ∈ X, it is not true that a ∈ Y.13 13 To mark the end of a proof, we here
use the symbol . Another common end-of-
proof notation is “QED”, short for quod erat
demonstrandum (what was to be shown).
sets, relations, functions, and proofs 7
Proof. Suppose that X ∩ Y , ∅. This means that there must be at least one
element z that is in both X and Y. But then the number of elements that are in
either X or Y must be at least one and so bigger than zero.
Indirect proof. Direct proofs can sometimes be hard (even impossible), while
a different strategy, namely an indirect proof is much easier. To indirectly
prove a claim, we assume the logical opposite of what needs to be shown and
derive from it a contradiction. This strategy is therefore also called reductio
ad absurdum or proof by refutation. This is best demonstrated with a series of
examples.
Let us start with an indirect proof for Proposition 3, for which we had a
direct proof above already. The proposition is that: For any X, ∅ ⊆ X.
Proof. Assume that there is an X for which ∅ * X.14 Then there must be an 14 Here is the reductio assumption. We
simply assume the opposite of what we want
element in ∅ which is not in X. But there are no elements in ∅. So, we have a
to show.
contradiction.15 15 We derive a contradiction from the
assumption that what needed to be shown is
Here is another example. false. Hence, what needed to be shown must
be true.
Proposition 5. There can be at most one empty set.
Proof. Suppose that there are two empty sets.16 Call them ∅1 and ∅2 . Sets 16 This is the reductio assumption that the
are individuated by the elements that they contain. So for ∅1 and ∅2 to be opposite of what we want to show is true.
And another example, this time for a conditional statement. Notice that
now the reductio assumption is slightly more complicated.
Proof. Let us assume that X ⊆ Y and Y ⊆ X and also that X , Y.17 The 17 We assume that the content of the
latter means that there must be some element x ∈ X such that x < Y or some if -statement is true and we also assume,
towards deriving a contradiction, that the
element y ∈ Y such that y < X. If there is an x ∈ X with x < Y, it cannot be content of the then-statement is false,
that X ⊆ Y. If there is an y ∈ Y with y < X, it cannot be that Y ⊆ X. This is a contrary to what the proposition says.
Inductive proof. There are also inductive proofs. These are more complicated, as
they consist of three steps: the inductive base, the inductive assumption and
the inductive step.
Inductive proofs are often useful in connection with recursive definitions.
Let us consider a very simple example first. We use the following recursive
definition of a set F of (flowery) strings:
2. step: if f ∈ F , then so is “( f )”
Inductive assumption. Assume that the claim is true for any set with cardi- we might also check the case of n = 1 just to
be sure: If | X | = 1, we know that X = {x}, so
nality of at most n > 0. that P(X) = {∅, {x}}, the cardinality of which
Inductive step. We need to show that the claim is true for any set X with is 2| X | = 2.
means that the cardinality of P(X) is | P(X) | = 2 × | P(Y) | = 2 × 2n−1 = 2n . might also be proven (as a so-called lemma).
It is in this sense that these proofs are all
informal: they do not spell out each and
every piece of the derivation which may be
Exercise 4. Show that X ∩ X = ∅ for any set X. plausible enough to be left out.
“x plus y” “x minus y”
3 Relations
Recall that sets are individuated by their elements, but not by the way in
which these elements are picked out or arranged. In particular {x, y} = {y, x}.
An ordered pair, written as hx, yi, is sensitive to ordering information, so that:
hx, yi , hy, xi. We generalize the notion of an ordered pair to an n-tuple,
written as hx1 , x2 , . . . , xn i.20 , 21 An n-tuple contains more information than 20 We can allow for 1-tuples as well and
the set of elements which occur in that n-tuple. For example, we might be think of them as just the element itself, i.e.,
hai = a.
interested in the unordered set of cities that Hans visited last summer: 21 3-tuples are also called triples; 4-tuples
quadruples; 5-tuples quintuples . . .
x | x is a city Hans visited last summer = {London, Paris, Berlin}
or we might be interested in the cities that Hans visited in the order in which
he actually visited them:
The set does not give us information about the order, but also does not con-
tain duplicates. The tuple does.
The Cartesian product of sets X1 , X2 , . . . , Xn is the set of all n-tuples
hx1 , x2 , . . . , xn i such that xi is an element from set Xi :22 22 If we identify 1-tuples with the single
element itself (see sidenote above), the
X1 × X2 × . . . × Xn = {hx1 , x2 , . . . , xn i | x1 ∈ X1 , x2 ∈ X2 , . . . , xn ∈ Xn } Cartesian product of a single set X is X
itself: {hxi | x ∈ X} = {x | x ∈ X} = X.
The sets forming a Cartesian product need not be different from each other.
Here are some examples for sets X = {a, b} and Y = {c, d}:
The n-place Cartesian product with the same set X can also be written as
X n :23 23 For example the set R3 is a three di-
mensional vector space. Numerical tuples,
like the elements of R3 are vectors.
}=X
n
X × X {z
| × ··· × X
n times
sets, relations, functions, and proofs 11
3.2 Relations
An n-place relation R is a set of n-tuples R ⊆ X1 × · · · × Xn .24 , 25 For example, 24 Instead of “n-place” we might also say
consider the set of people P = { j, m, s} of John, Mary and Sue and the binary “n-ary” and speak of the arity of a relation.
25 A 1-place relation on set X is just a
relation L ⊆ P × P which encodes who loves whom: subset of X; a 2-place relation is called
binary relation; a 3-place relation is called
L = {hx, yi ∈ P × P | x loves y} ternary relation; . . .
The range of R is
R = (X1 × · · · × Xn ) \ R
transitive iff for all x, y ∈ X if Rxy and Ryz, then also Rxz
intransitive iff for all x, y ∈ X if Rxy and Ryz, then not Rxz
The relation L in Figure 4 does not have any of the properties above. For
example, it is not reflexive because there is an element, namely m, for which
Lmm is false. It is also not irreflexive because there is an element, namely j,
for which L j j is true. It is not transitive, because although L js and Lsm it is
not the case that L jm.
The relation “n1 is the predecessor of n2 ” from Figure 5 is irreflexive,
asymmetric and intransitive. It is intransitive, because whenever x is the
predecessor of y we have x + 1 = y, and whenever y is the predecessor of z we
have y + 1 = z. But then x + 2 = z, so x is not the predecessor of z.
Exercise 9. Consider the set N = {0, 1, 2, . . . } of natural numbers and the bi-
nary relation R ⊆ N × N defined as follows:
n o
R = hx, yi | x, y ∈ N and y = x2
4 Functions
Intuitively, a function maps each element from set X to exactly one element
from some set Y (where it is also possible that X = Y). Functions capture
uniquely referring expressions such as “the head of state x” or “the first name
of x” or “the height of x” (see Figure 7).
Formally, a function f : X → Y is a relation f ⊆ X × Y such that for every
x ∈ X there is a unique y ∈ Y with hx, yi ∈ f . We write f (x) for the unique
Figure 7: Example of function correspond-
y ∈ Y with hx, yi ∈ f . Alternative notation is f : x 7→ f (x). Examples of ing to description “the height of x”.
functions f : N → N in alternative notation styles are:
f (x) = x2 alt.: x 7→ x2
person has more than one son. relation, all relevant terminology defined for
relations (e.g., domain, range, inverse, . . . )
A function f : X → Y is applies.
Exercise 12. Consider the claim that any function f which is not an injec-
tion is a surjection. Is this true or false? Whatever you think it is, can you
prove it?