Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
12 views15 pages

Introduction to Naïve Set Theory

Uploaded by

phoebemi860
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views15 pages

Introduction to Naïve Set Theory

Uploaded by

phoebemi860
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Sets, relations, functions, and proofs

Michael Franke

Basic notions of (naïve) set theory; sets, elements, relations between


and operations on sets; relations and their properties; functions and
their properties. Examples of informal proofs: direct, indirect and
counterexamples.

1 Naïve set theory

1.1 Sets, elements, universe

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 = {2, 4, 6, 8, . . . } [set of even integers bigger than 0]

Y = {2, 4, 6, 8, . . . , 20} [set of even integers no bigger than 20]

Z = Russell, Wittgenstein, Frege, . . . 2 2 This would only be a good definition if



[set of authors to read]
the way to fill the “. . . ” was absolutely clear.
To describe sets by a characteristic property of its elements, we might
write:

X = x | x is an even integer


Y = x | x is an even integer no bigger than 20




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”).

An example is the following definition of natural numbers:

(i) 0 is a natural number

(ii) if n is a natural number, then so is n + 1

(iii) nothing else is a natural number

Another example is the definition of a simple formal language L. Unlike the


previous example, we here define a set of symbols:5 5 Examples of elements of L by this def-
inition are: “three”, “twenty minus three”,
1. words for all natural numbers are elements of L (e.g., “one”, “two”, . . . ) “twenty minus three plus four”. Not an
element of L are “minus three”, “plus one
2. if x, y ∈ L, then so are the strings: two”, “one plus minus two”.

“x plus y” “x minus y”

3. no string which is not constructible by this procedure is in L


sets, relations, functions, and proofs 3

1.3 Important numerical sets to be familiar with

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.

Z = {. . . , −2, −1, 0, 1, 2, . . . } [set of integers]

Q = { p/q | p ∈ Z, q ∈ N \ {0}} [set of rational numbers]

R = {π, 0, e, . . . } [set of real numbers]

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 . . . } | = ∞

1.5 Relations between sets

A set Y can contain another set X. Inversely, a set X can be an element of


another set Y. We then write X ∈ Y. For example:
X = {a, b}

Y = {c, d, X} = {c, d, {a, b}}


It is important to note that {a, b} ∈ Y but a < Y.
If all of the elements of X are also in Y, we say that X is a subset of Y, or
that Y is a superset of X, and we write X ⊆ Y. If X ⊆ Y and there is at least
one element in Y which is not in X, we say that X is a proper subset of Y, or
that Y is a proper superset of X, and we write X ⊂ Y. If X is not a (proper)
subset of Y, we write X * Y (X 1 Y). Some examples:

{a, b} ⊆ {a, b, c} {a, b} ⊂ {a, b, c}

{a, b} * {a, c} {a, b} 1 {a, b}

1.6 Operations on sets


Operations on sets take one or several sets as input and return another set. We
consider here the power set operation and different kinds of logical opera-
tions.
The power set P(X) of X is the set of all subsets of X:

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

P(X) = {∅, {a} , {b} , {a, b}} | P(X) | = 22 = 4

The following operations on sets correspond to logical operators (and, or,


not). For any sets X and Y:

X ∩ Y = {z | z ∈ X and z ∈ Y} [intersection]

X ∪ Y = {z | z ∈ X or z ∈ Y} [union]

X \ Y = {z | z ∈ X and z < Y} [difference] Figure 2: Venn diagrams of set operations.

X = {z ∈ U | z < X} [complement9 ] 9 We need an explicit universe to interpret


the complement operation.
Here are some examples:

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

Exercise 1. Provide a natural language paraphrase for each of the following


sets:

a. A = {5, 7, 9, 11, 13, . . . }

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}

Write out the results of the following set operations:

a. X ∩ Y c. X \ Y e. Y \ Y

b. X ∪ Y d. Y \ Z f. X ∩ X

Exercise 3. For each of the following statements, determine whether it is


true or false, using the sets X, Y and Z as defined above:

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

2.1 Formal vs. informal 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.

describe the gist of it in more comprehensible language, usually a mix of


natural language, specialized jargon and mathematical notation. When we
speak of proofs from here on, think: informal proof.

2.2 Why proofs?

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.

2.3 Proof strategies

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:

(i) refutation by counterexample

(ii) direct proof

(iii) indirect proof

(iv) inductive proof

Refutation by counterexample. The perhaps easiest kind of proof is refutation


by counterexample. It can be used to prove the falsety of a claim that some
general law is true. Below is an example. The claim in Proposition 1 is a 12 We should not confuse mathematical
general statement about any two sets X and Y. But it is false. We can show statements with statistical generalizations,
that it is false by giving just a single instance of X and Y which refutes it.12 which might tolerate exceptions. It is irrele-
vant that there are other pairs of sets X and
Proposition 1. The following claim is false: For any sets X and Y, if X ∈ Y, Y for which the claim would be true, such
as: X = {a}, Y = {a, {a}}.
then all the elements of X are also elements of Y.

Proof. A counterexample to the claim in question is given by the following


two sets:

X = {a, b}

Y = {c, d, X} = {c, d, {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

Here is a second example.

Proposition 2. The following claim is false: If X ∪ Y , ∅, then X ∩ Y , ∅.

Proof. A counterexample is X = {a} and Y = {b}, because clearly {a} ∪ {b} =


{a, b} , ∅, but {a} ∩ {b} = ∅. 

Direct proof. A direct proof of a statement proceeds by unraveling definitions and


axioms until what needs to be shown is plain to see.

Proposition 3. For any X, ∅ ⊆ X.

Proof. Consider an arbitrary set X. For a set Y be a subset of X, it is required


that all elements of Y are also in X. Another way of putting this is that there
cannot be a single element y ∈ Y for which y < X. Since the empty set
contains no elements at all, there cannot be any element in it, which is not
also in X. 

If the statement to be proven is a conditional with if and then, then the


direct proof may also use the content of the if part as part of its derivation.

Proposition 4. If X ∩ Y , ∅, then | X ∪ Y | > 0.

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.

different, there needs to be an entity x such that x ∈ ∅1 and x < ∅2 or x ∈ ∅2


and x < ∅1 . But since both ∅1 and ∅2 are empty, there cannot be such an entity
x. Hence, there cannot be two empty sets. 
sets, relations, functions, and proofs 8

And another example, this time for a conditional statement. Notice that
now the reductio assumption is slightly more complicated.

Proposition 6. If X ⊆ Y and Y ⊆ X, then X = Y.

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.

contradiction to our initial assumption. 

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:

1. anchor: the symbol “*” is part of F

2. step: if f ∈ F , then so is “( f )”

3. exhaustion: nothing else is in F

Proposition 7. Each f ∈ F contains the exact same number of opening and


closing parentheses.

Proof. The inductive proof is over the number n of opening parentheses.


Inductive base. Any element in F which has no opening parentheses
is necessarily added to F by the recursive anchor. But since the recursive
anchor introduces neither opening nor closing parentheses, the number of
opening and closing parentheses for n = 0 is equal.
Inductive assumption. We assume that any string f ∈ F with n = k − 1
opening parentheses has the same number of opening and closing parenthe-
ses.
Inductive step. We now need to show that a string f ∈ F with n = k
opening parentheses also has n = k closing parentheses. Indeed, the only
way in which f can have n > 0 opening parentheses is by application of
the recursive step. Therefore, f must be of the form f = “(g)” where string
g ∈ F has k − 1 opening parentheses. By inductive assumption, g has the
same amount of opening and closing parentheses. But since f = “(g)”, and
so exactly one parenthesis of each type is added to g, f must have an equal
number of parentheses, too. 

Here is another, more difficult application of an inductive proof.

Proposition 8. The cardinality of the power set of finite set X is | P(X) | =


2| X | .
sets, relations, functions, and proofs 9

Proof. The inductive proof is over the cardinality of set X.


Inductive base. If | X | = 0, we know that X = ∅, so that P(X) = {∅}. The
cardinality of {∅} is indeed 2| X | = 20 = 1.18 18 Though strictly speaking unnecessary,

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.

| X | = n, given the inductive assumption. Let X be an arbitrary set with


| X | = n. Let x ∈ X and Y = X \ {x}. By inductive assumption, | P(Y) | = 2| Y | .
The power set of X contains all sets in the power set of Y. It additionally also
contains a version of each element in P(Y) that also contains x.19 But that 19 This may be intuitively clear, but it

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.

Exercise 5. Previously, in Section 1, we defined a simple formal language L


recursively as the smallest set such that:

1. all words for natural numbers, i.e., “one”, “two”, . . . , are in L

2. if x, y ∈ L, then so are the strings:

“x plus y” “x minus y”

Prove the following statement with an inductive proof strategy: No element


of L is a string that contains the work “bread.”

Exercise 6. Using the set L as constructed above, use an indirect proof to


show that the length of elements of L is unbounded (i.e., for any x ∈ L there
is a y ∈ L such that y has strictly more words than x.)
sets, relations, functions, and proofs 10

3 Relations

While sets capture (what philosophers call) the extensional meaning of a


property like “x is red”, in terms of the set of all red objects (from a relevant
universe), a relation captures the extensional meaning of expressions like “x
is in love with y”.

3.1 Tuples, Cartesian products

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:

hBerlin, London, Berlin, Parisi

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}:

X × Y = {ha, ci , ha, di , hb, ci , hb, di}

X × X = {ha, ai , ha, bi , hb, ai , hb, bi}

X × X × Y = {ha, a, ci , ha, b, ci , hb, a, ci , hb, b, ci ,

ha, a, di , ha, b, di , hb, a, di , hb, b, di}

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; . . .

Suppose we live in a world in which these are the facts:

L = {h j, ji , h j, si , hm, si , hs, mi} ⊂ P × P

We can visualize relation L in a diagram, like shown in Figure 4, where we j m


• •
draw elements as dots (possibly with labels) and where we draw an arrow
from element x to element y whenever hx, yi is part of the relation.

Another example is the binary relation “n1 is the predecessor of n2 ” on the s
set N of natural numbers. The predecessor relation P ⊆ N × N, shown in Figure 4: Diagram of relation L.
Figure 5, is defined as:

P = {h0, 1i , h1, 2i , h2, 3i , . . . } 0 1 2


• • • ...
For a binary relation R ⊆ X × Y, there are several shortcut notations to Figure 5: The predecessor relation on N.
express the same content as when we write “hx, yi ∈ R”:
prefix notation: Rxy

infix notation: xRy

postfix notation: xyR


From here on we will predominantly use prefix notation, except for known
mathematical relations like ≤ or =.
If R ⊆ X × Y is a binary relation, the domain of R is

dom(R) = {x ∈ X | there is some y ∈ Y with Rxy}

The range of R is

range(R) = {y ∈ Y | there is some x ∈ X with Rxy}

The negation of n-place relation R ⊆ X1 × · · · × Xn is

R = (X1 × · · · × Xn ) \ R

The converse of 2-place relation R ⊆ X × Y is

R−1 = {hy, xi | Rxy} ⊆ Y × X

Claim 9. The following is false: If R ⊆ X × X, then dom(R) = range(R).

Proof. A counterexample is L0 = L \ {h j, ji}, with L being the “love relation”


introduced above in Figure 4. Notice that: L = {h j, ji , h j, si , hm, si , hs, mi}
and so L0 = {h j, si , hm, si , hs, mi}. According to L0 everybody loves someone
so dom(L0 ) = { j, m, s}, but nobody loves John, so j < range(L0 ) = {m, s}. 
sets, relations, functions, and proofs 12

3.3 Properties of binary relations

Binary relation R ⊆ X × X is26 26 In definitions like these, we often write


“iff” which can be read as “if and only if” or
reflexive iff Rxx for all x ∈ X “exactly if”.

irreflexive iff Rxx for no x ∈ X

symmetric iff for all x, y ∈ X if Rxy then also Ryx

asymmetric iff for no x, y ∈ X both Rxy and Ryx

anti-symmetric iff for all x, y ∈ X if Rxy and Ryx, then x = y

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

connected iff for all x, y ∈ X either Rxy or Ryx or x = y

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.

Proposition 10. If R ⊆ X × X is reflexive, then dom(R) = range(R).

Proof. Let R ⊆ X × X be reflexive and assume towards contradiction that


dom(R) , range(R). The latter means that there is either an x ∈ dom(R) with
x < range(R), or that there is x < dom(R) with x ∈ range(R). But if we take
an arbitrary x ∈ X, then by reflexivity Rxx. So x ∈ dom(R) and x ∈ range(R),
which contradicts our assumption. 

Proposition 11. If R ⊆ X × X is asymmetric, it is also irreflexive.

Proof. If R ⊆ X × X is not irreflexive, then there is at least one x∗ ∈ X such


that Rx∗ x∗ . But then there is also a pair x, y ∈ X (namely with x = x∗ and
y = x∗ ) such that Rxy and Ryx. So R is not asymmetric.27  27 This is a proof by contraposition. To
show that “if A, then B” we show that “if
Binary relation R ⊆ X × X is an equivalence relation iff R is reflexive, sym- not B, then not A”. This is justified because
p ← q and ¬q → ¬p are logically equiva-
metric and transitive. Equivalence relations are interesting because they clus- lent in propositional logic (as we will learn
ter elements by some criterion of sameness. Whence also the name. Given later).
appropriate domains, the following are examples of equivalence relations:

. . . and . . . have the same shoe size

. . . and . . . are born in the same year


sets, relations, functions, and proofs 13

. . . and . . . have the same color (see Figure 6)

. . . and . . . have the same cardinality

Figure 6: Example of an equivalence


relation based on property “. . . and . . . have
Based on different properties of relations, we can also define various notions
the same color”.
of “ordering”. Binary relation R ⊆ X × X is a
partial weak order iff R is reflexive, anti-symmetric and transitive
[example: relation “⊆” on P(Y)]

partial strict order iff R is irreflexive, asymmetric and transitive


[example: relation “⊂” on P(Y)]

linear weak order iff R is a partial weak order and connected


[example: relation “≤” on N]

linear strict order iff R is a partial strict order and connected


[example: relation “<” on N]

Exercise 7. Which proof strategy is used in the proof of Proposition 10?

Exercise 8. Which properties do the following binary relations, expressed


here in natural language, on the set of all human beings have?

a. x is taller than y c. x is the father of y

b. x is the same person as y d. x has the same first name as y

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

Which properties does R have? Is R a partial weak/strict order? Is it a linear


weak/strict order? Is it an equivalence relation?
sets, relations, functions, and proofs 14

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) = x + 1 alt.: x 7→ x + 1 [the successor function]

f (x) = x alt.: x 7→ x [the identity function]

f (x) = x2 alt.: x 7→ x2

The construction f : x 7→ “the son of x” is not necessarily a function. We


might deal with a domain28 X where some person has no son, or where some 28 Since a function is a special kind of

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.

injective iff f (x1 ) = f (x2 ) implies x1 = x2

surjective iff for each y ∈ Y there is an x ∈ X with f (x) = y

bijective iff f is injective and a surjective

Alternatively, we may say that f is an injection, surjection or a bijection.


The former notions help to define an ordering on cardinalities of sets that
covers our intuitions for finite sets and gives interesting results for infinite
sets as well. If X and Y are arbitrary sets, we define:

| X | ≤ | Y | iff there exists an injection f : X → Y

| X | = | Y | iff there exists a bijection f : X → Y

| X | < | Y | iff | X | ≤ | Y | and | X | , | Y |

iff there exists injection f : X → Y but no surjection g : X → Y

We can now prove that there are “different infinities”. In particular, | N | ≮


| Q |, but | N | < | R |.
sets, relations, functions, and proofs 15

Exercise 10. Which of the following natural language expressions is such


that its meaning could be captured by a function f : X → Y (rather than just a
relation which is not a function)?

a. x admires y c. x is the same person as y

b. x is the father of y d. x self-identifies as gender y

Exercise 11. Look at the following relation R ⊆ {a, b, c, d} × {u, v, w, x, y, z}:

R = {ha, vi , hb, zi , hc, zi , ha, wi}

Is this a function? If so, is it an injection, surjection or a bijection? If not, can


you make a minimal change so that it is a function (e.g., adding or subtracting
some element in R)? Then, after any change, is it now an injection, surjection
or a bijection?

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?

You might also like