Set Theory
Set Theory
Set Theory
2.1
Set Theory
can be written:
{2n : n is an integer}
The opening and closing curly braces denote a set, 2n
specifies the members of the set, the colon says such
that or where and everything following the colon
are conditions that explain or refine the membership.
All correct mathematics can be spoken in English.
The set definition above is spoken The set of twice
n where n is an integer.
The only problem with this definition is that we
do not yet have a formal definition of the integers.
The integers are the set of whole numbers, both positive and negative: {0, 1, 2, 3, . . .}. We now introduce the operations used to manipulate sets, using
the opportunity to practice curly brace notation.
Definition 2.1 The empty set is a set containing
no objects. It is written as a pair of curly braces with
nothing inside {} or by using the symbol .
As we shall see, the empty set is a handy object.
It is also quite strange. The set of all humans that
weigh at least eight tons, for example, is the empty
set. Sets whose definition contains a contradiction or
impossibility are often empty.
Definition 2.2 The set membership symbol is
used to say that an object is a member of a set. It
has a partner symbol
/ which is used to say an object
is not in a set.
24
Example 2.1 If
S = {1, 2, 3}
then 3 S and 4
/ S. The set membership symbol
is often used in defining operations that manipulate
sets. The set
T = {2, 3, 1}
is equal to S because they have the same members: 1,
2, and 3. While we usually list the members of a set
in a standard order (if one is available) there is no
requirement to do so and sets are indifferent to the
order in which their members are listed.
Definition 2.4 The cardinality of a set is its size.
For a finite set, the cardinality of a set is the number
of members it contains. In symbolic notation the size
of a set S is written |S|. We will deal with the idea
of the cardinality of an infinite set later.
Example 2.2 Set cardinality
For the set S = {1, 2, 3} we show cardinality by writing |S| = 3
T U = {1, 2, 3, 4, 5}
When performing set theoretic computations, you
should declare the domain in which you are working.
In set theory this is done by declaring a universal set.
Definition 2.8 The universal set, at least for a
given collection of set theoretic computations, is the
set of all possible objects.
If we declare our universal set to be the integers then
{ 21 , 32 } is not a well defined set because the objects
used to define it are not members of the universal
set. The symbols { 21 , 23 } do define a set if a universal
set that includes 12 and 23 is chosen. The problem
arises from the fact that neither of these numbers are
integers. The universal set is commonly written U.
Now that we have the idea of declaring a universal
set we can define another operation on sets.
25
2.1.1
Venn Diagrams
AB
Ac
AB
or alternately
S T = {x : (x S) (x
/ T )}
26
(i) Other things being equal, operations are per- Another important tool for working with sets is the
formed left-to-right.
ability to compare them. We have already defined
what it means for two sets to be equal, and so by
(ii) Operations between parenthesis are done first, implication what it means for them to be unequal.
starting with the innermost of nested parenthe- We now define another comparator for sets.
sis.
Definition 2.12 For two sets S and T we say that
(iii) All complimentations are computed next.
S is a subset of T if each element of S is also an
(iv) All intersections are done next.
element of T . In formal notation S T if for all
x S we have x T .
(v) All unions are performed next.
If S T then we also say T contains S which
(vi) Tests of set membership and computations,
can
be
written T S. If S T and S 6= T then we
equality or inequality are performed last.
write S T and we say S is a proper subset of T .
Special operations like the set difference or the
symmetric difference, defined below, are not included Example 2.9 Subsets
in the precedence rules and thus always use paren- If A = {a, b, c} then A has eight different subsets:
thesis.
{a}
{b}
{c}
Example 2.7 Operator precedence
Since complementation is done before intersection
the symbolic definition of the difference of sets can be
rewritten:
S T = {x : x S T c }
{a, b}
{a, c}
{b, c}
{a, b, c}
Proof:
Another way to think about this is that we need numbers that are positive multiples of 2 or 3 (but not both) Let the two sets in question be A and B. Begin by
assuming that A = B. We know that every set is
that are no more than 24.
27
where it is false. It is thus possible for a false mathematical statement to be true most of the time. In
the next chapter we will develop the theory of prime
numbers. For now we will assume the reader has a
modest familiarity with the primes. The statement
Prime numbers are odd is false once, because 2 is a
prime number. All the other prime numbers are odd.
The statement is a false one. This very strict definition of what makes a statement true is a convention
in mathematics. We call 2 a counter example. It is
thus necessary to find only one counter-example to
demonstrate a statement is (mathematically) false.
A note on mathematical grammar: the symbol 2 indicates the end of a proof. On a paper turned in by a
student it is usually taken to mean I think the proof
ends here. Any proof should have a 2 to indicate its
end. The student should also note the lack of calculations in the above proof. If a proof cannot be read
back in (sometimes overly formal) English then it is
probably incorrect. Mathematical symbols should be
used for the sake of brevity or clarity, not to obscure
meaning.
Problems
Problem 2.1 Which of the following are sets? Assume that a proper universal set has been chosen and
answer by listing the names of the collections of objects that are sets. Warning: at least one of these
items has an answer that, while likely, is not 100%
certain.
(i) A = {2, 3, 5, 7, 11, 13, 19}
(ii) B = {A, E, I, O, U }
28
(v) F F .
2
7
3
1
0
4
C
29
2.2
Mathematical Induction
Mathematical induction is a technique used in proving mathematical assertions. The basic idea of induction is that we prove that a statement is true in one
case and then also prove that if it is true in a given
case it is true in the next case. This then permits the
cases for which the statement is true to cascade from
the initial true case. We will start with the mathematical foundations of induction.
(ii) Make a Venn diagram for the sets E, F , and O, We assume that the reader is familiar with the symand explain why this is a Mickey-Mouse problem. bols <, >, and . From this point on we will
denote the set of integers by the symbol Z. The
Problem 2.12 A binary operation is commuta- non-negative integers are called the natural numbers.
tive if x y = y x. An example of a commuta- The symbol for the set of natural numbers is N. Any
tive operation is multiplication. Subtraction is non- mathematical system rests on a foundation of axioms.
commutative. Determine, with proof, if union, inter- Axioms are things that we simply assume to be true.
section, set difference, and symmetric difference are We will assume the truth of the following principle,
commutative.
adopting it as an axiom.
Problem 2.13 An identity for an operation is The well-ordering principle: Every non-empty
an object i so that, for all objects x, i x = x i = set of natural numbers contains a smallest
element.
x. Find, with proof, identities for the operations set
union and set intersection.
The well ordering principle is an axiom that
agrees with the common sense of most people familProblem 2.14 Prove part (ii) of Proposition 2.2.
iar with the natural numbers. An empty set does
not contain a smallest member because it contains
Problem 2.15 Prove that
no members at all. As soon as we have a set of natA (B C) = (A B) C
ural numbers with some members then we can order
those members in the usual fashion. Having ordered
Problem 2.16 Prove that
them, one will be smallest. This intuition agreeing
A (B C) = (A B) C
with this latter claim depends strongly on the fact
the integers are whole numbers spaced out in inProblem 2.17 Prove that
crements of one. To see why this is important consider the smallest positive distance. If such a distance
A(BC) = (AB)C
existed, we could cut it in half to obtain a smaller
Problem 2.18 Disprove that
distance - the quantity contradicts its own existence.
The well-ordering principle can be used to prove the
A(B C) = (AB) C
correctness of induction.
Problem 2.19 Consider the set S = {1, 2, 3, 4}. For
each k = 0, 1, . . . , 4 how many k element subsets does Theorem 2.1 Mathematical Induction I Suppose that P (n) is a proposition that it either true or
S have?
false for any given natural numbers n. If
Problem 2.20 Suppose we have a set S with n 0
elements. Find a formula for the number of different (i) P (0) is true and,
subsets of S that have k elements.
(ii) when P (n) is true so is P (n + 1)
Problem 2.21 For finite sets S and T , prove
Then we may deduce that P (n) is true for any natural
|S T | = |S| + |T | |S T |
number.
30
Proof:
Assume that (i) and (ii) are both true statements. Let S be the set of all natural numbers for
which P (n) is false. If S is empty then we are done,
so assume that S is not empty. Then, by the well
ordering principle, S has a least member m. By (i)
above m 6= 0 and so m 1 is a natural number. Since
m is the smallest member of S it follows that P (m1)
is true. But this means, by (ii) above, that P (m) is
true. We have a contradiction and so our assumption
that S 6= must be wrong. We deduce S is empty
and that as a consequence P (n) is true for all n N.
2
The set of all subsets of a given set is itself an important object and so has a name.
2n
2n + 2n + 1
2n + 2n + 1
2n + 1 + 1
2n + 2
2(n + 1)
31
1
n(n + 1)
2
up lists of numbers. If we wished to sum some formula f (i) over a range from a to b, that is to say
a i b, then we write :
b
X
f (i)
i=a
i=
1
n(n + 1)
2
Compute:
1 + 2 + + (n + 1) =
=
=
=
=
=
1 + 2 + + n + (n + 1)
1
n(n + 1) + (n + 1)
2
1
(n(n + 1) + 2(n + 1))
2
1 2
n + 3n + 2
2
1
(n + 1)(n + 2)
2
1
(n + 1)((n + 1) + 1)
2
Ai
i=1
n
[
Ai
i=1
i=1
f (i)
We now introduce sigma notation which makes problems like the one worked in Example
P 2.12 easier to is the notation for computing the product f (1) f (2)
state and manipulate. The symbol
is used to add f (n). This notation is called Pi notation.
32
Definition
P 2.14 When we solve an expression
Pinvolving
to obtain a formula that does not use
or
. . . as in Example 2.12 then we say we have found a
closed form for the
Pn expression. Example 2.12 finds
a closed form for i=1 i.
(c f (i) + d g(i)) = c
b
X
i=a
f (i) + d
b
X
g(i)
i=a
f3n+3
(2.1)
=
=
f3n+2 + f3n+1
f3n+1 + f3n + f3n+1
(2.2)
(2.3)
2 f3n+1 + f3n
Problems
Problem 2.22 Suppose that S = {a, b, c}. Compute
and list explicitly the members of the powerset, P(S).
Problem 2.23 Prove that for a finite set X that
|X| |P(X)|
Problem 2.30 Compute the sum of the first n positive even numbers.
Problem 2.31 Find a closed form for
n
X
i=1
i2 + 3i + 5
33
2.3. FUNCTIONS
Problem 2.32 Let f (n, 3) be the number of subsets Problem 2.41 Consider the statement All cars are
of {1, 2, . . . , n} of size 3. Using induction, prove that the same color. and the following proof .
f (n, 3) = 61 n(n 1)(n 2).
Proof:
Problem 2.33 Suppose
that we
have
sets
X1 , X2 , . . . , Xn and Y1 , Y2 , . . . , Yn such that Xi Yi .
Prove that the intersection of all the Xi is a subset
of the intersection of all the Yi :
n
\
i=1
Xi
n
\
Yi
i=1
ri =
1 rn+1
1r
Problem 2.37 Prove by induction that the Fibonacci number f5n is a multiple of 5.
Problem 2.38 Prove by induction that the Fibonacci number fn has the value
!n
!n
1+ 5
1 5
5
5
fn =
5
2
5
2
Problem 2.39 Prove that for sufficiently large n the
Fibonacci number fn is the integer closest to
!n
5 1+ 5
5
2
and compute the exact value of f30 . Show your work
(i.e. dont look the result up on the net).
Problem 2.40 Prove that n(n1)(n2)(n3)
is a
24
whole number for any whole number n.
2.3
Functions
34
The reason for defining ordered pairs at this point of ordered pairs {(r2 , r) : r 0}. This function is
is that it permits us to make an important formal well defined because each non-negative real number is
the square of some positive real number.
definition that pervades the rest of mathematics.
Definition 2.17 A function f with domain S and
range T is a set of ordered pairs (s, t) with first element from S and second element from T that has the
property that every element of S appears exactly once
as the first element in some ordered pair. We write
f : S T for such a function.
Example 2.15 Suppose that A = {a, b, c} and B =
{0, 1} then
f = {(a, 0), (b, 1), (c, 0)}
is a function from A to B. The function f : A B
can also be specified by saying f (a) = 0, f (b) = 1 and
f (c) = 0.
The set of ordered pairs {(a, 0), (b, 1)} is not a function from A to B because c is not the first coordinate of any ordered pair. The set of ordered pairs
{(a, 0), (a, 1), (b, 0), (c, 0)} is not a function from A
to B because a appears as the first coordinate of two
different ordered pairs.
In calculus you may have learned the vertical line rule
that states that the graph of a function may not intersect a vertical line at more than one point. This
corresponds to requiring that each point in the domain of the function appear in only one ordered pair.
In set theory, all functions are required to state their
domain and range when they are defined. In calculus
functions had a domain that was a subset of the real
numbers and you were sometimes required to identify
the subset.
Example 2.16 This example contrasts the way
functions were treated in a typical calculus course with
the way we treat them in set theory.
Calculus: find the domain of the function
f (x) = x
Since we know that the square root function exists
only for non-negative real numbers the domain is {x :
x 0}.
Set theory: the function f = x from the nonnegative real numbers to the real numbers is the set
35
2.3. FUNCTIONS
Definition 2.19 Let X, Y, and Z be sets. The composition of two functions f : X Y and g : Y Z
is a function h : X Z for which h(x) = g(f (x))
for all x X. We write g f for the composition of
g with f .
The definition of the composition of two functions
requires a little checking to make sure it makes sense.
Since every point must appear as a first coordinate of
an ordered pair in a function, every result of applying
f to an element of X is an element of Y to which g can
be applied. This means that h is a well-defined set of
ordered pairs. Notice that the order of composition is
important - if the sets X, Y , and Z are distinct there
is only one order in which composition even makes
sense.
is
is
is
is
{x : a < x < b}
{x : a < x b}
{x : a x < b}
{x : a x b}
10
-5
-10
-15
-3
-2
-1
36
some numbers appear twice as second coordinates of Definition 2.24 The inverse of a function f : S
ordered pairs in g. We can use the graph because g is T is a function g : T S so that for all x S,
a function from the real numbers to the real numbers. g(f (x)) = x and for all y T , f (g(y)) = y.
For a function f : S T to be a bijection every
element of S appears in an ordered pair as the first
member of an ordered pair and every element of T
appears in an ordered pair as the second member of
an ordered pair. Another way to view a bijection is as
a matching of the elements of S and T so that every
element of S is paired with an element of T . For
finite sets this is clearly only possible if the sets are
the same size and, in fact, this is the formal definition
of same size for sets.
Definition 2.23 Two sets S and T are defined to be
the same size or to have equal cardinality if there
is a bijection f : S T .
Example 2.22 The sets A = {a, b, c} and Z =
{1, 2, 3} are the same size. This is obvious because
they have the same number of elements, |A| = |Z| = 3
but we can construct an explicit bijection
x
If g(x) = x1
, shown above with its asymptotes
x = 1 and y = 1 then f is a function from the
set H = R {1} to itself. The function was chosen to have asymptotes at equal x and y values; this
is a bit unusual. The function g is a bijection. Notice that the graph intersects any horizontal or vertical line in at most one point. Every value except
x = 1 may be put into g meaning that g is a function
on H. Since the vertical asymptote goes off to in
both directions, all values in H come out of g. This
demonstrates g is a bijection. This means that it has
an inverse which we now compute using a standard
37
2.3. FUNCTIONS
technique from calculus classes.
y
y(x 1) =
xy y =
xy x =
x(y 1) =
x =
which tells us that g 1 (x) =
function is its own inverse.
x
x1
x
x
y
y
y
y1
x
x1
so g = g 1 : the
38
2.3.1
Permutations
n
n!
0
1
1
1
2
2
3
6
4
24
5
120
6
720
7
5040
{(a,a)(b,c)(c,b)}
{(a,b)(b,a)(c,c)}
{(a,b)(b,c)(c,a)}
{(a,c)(b,a)(c,b)}
{(a,c)(b,b)(c,a)}
Notice that the number of permutations of three objects does not depend on the identity of those objects.
In fact there are always six permutations of any set of
three objects. We now define a handy function that
uses a rather odd notation. The method of showing permutations in Example 2.26, explicit listing of
ordered pairs, is a bit cumbersome.
Definition 2.28 Assume that we have agreed on an
order, e.g. a,b,c, for the members of a set X =
{a, b, c}. Then one-line notation for a permutation
f consists of listing the first coordinate of the ordered
pairs in the agreed on order. The table in Example
2.26 would become:
abc
bac
cab
Problems
Problem 2.42 Suppose for finite sets A and B that
f : A B is an injective function. Prove that
|B| |A|
Problem 2.43 Suppose that for finite sets A and B
that f : A B is a surjective function. Prove that
|A| |B|.
Problem 2.44 Using functions from the integers to
the integers give an example of
(i) A function that is an injection but not a surjection.
(ii) A function that is a surjection but not an injection.
acb
bca
cba
Definition 2.29 The factorial of a natural number (iv) A bijection that is not the identity function.
n is the product
Problem 2.45 For each of the following functions
n
Y
from the real numbers to the real numbers say if the
i
n(n 1)(n 2) 3 2 1 =
function is surjective or injective. It may be neither.
i=1
(iii) h(x) =
x x < 0
39
2.3. FUNCTIONS
Interlude
The Collatz Conjecture
One of the most interesting features of mathematics is that it is possible to phrase problems
in a few lines that turn out to be incredibly hard. The Collatz conjecture was first posed
in 1937 by Lothar Collatz. Define the function f from the natural numbers to the natural
numbers with the rule
3n + 1 n odd
f (n) =
n
n even
2
Collatz conjecture is that if you apply f repeatedly to a positive integer then the resulting
sequence of numbers eventually arrives at one. If we start with 17, for example, the result
of repeatedly applying f is:
f (17) = 52, f (52) = 26, f (26) = 13, f (13) = 40, f (40) = 20, f (20) = 10,
f (10) = 5, f (5) = 16, f (16) = 8, f (8) = 4, f (4) = 2, f (2) = 1
The sequences of numbers generated by repeatedly applying f to a natural number are
called hailstone sequences with the collapse of the value when a large power of 2 appears
being analogous to the impact of a hailstone. If we start with the number 27 then 111 steps
are required to reach one and the largest intermediate number is 9232. This quite irregular
behavior of the sequence is not at all apparent in the original phrasing of the problem.
The Collatz conjecture has been checked for numbers up to 5 261 (about 5.764 1018 )
by using a variety of computational tricks. It has not, however, been proven or disproven.
The very simple statement of the problem causes mathematicians to underestimate the
difficulty of the problem. At one point a mathematician suggested that the problem might
have been developed by the Russians as a way to slow American mathematical research.
This was after several of his colleagues spent months working on the problem without
obtaining results.
A simple (but incorrect) argument suggests that hailstone sequences ought to grow indefinitely. Half of all numbers are odd, half are even. The function f slightly more than triples
odd numbers and divides even numbers in half. Thus, on average, f increases the value of
numbers. The problem is this: half of all even numbers are multiples of four and so are
divided in half twice. One-quarter of all even numbers are multiples of eight and so get
divided in half three times, and so on. The net effect of factors that are powers of two is
to defeat the simple argument that f grows on average.
40
Problem 2.46 True or false (and explain): The Problem 2.59 Suppose that X and Y are finite sets
function f (x) = x1
x+1 is a bijection from the real num- and that |X| = |Y | = n. Prove that there are n!
bijections of X with Y .
bers to the real numbers.
Problem 2.47 Find a function that is an injection
of the integers into the even integers that does not
appear in any of the examples in this chapter.
Problem 2.48 Suppose that B A and that there
exists a bijection f : A B. What may be reasonably
deduced about the set A?
Problem 2.63 Compute the number of permutations of a set S with n members that fix at least m < n
points.
sS
Given all the material so far, give and defend reasonable values for the sum and product of an empty
set.
Problem 2.67 Suppose that f : [0, 1] [0, 1] for
1 < < is given by
( + 1)x
,
x + 1
prove that f is a bijection.
f (x) =
2.4. + 1
2.4
41
+1
Problems
42
Interlude
Russells Paradox
Bertrand Arthur William Russell, 3rd Earl
Russell, OM, FRS (18 May 1872-2 February 1970), commonly known as simply
Bertrand Russell, was a British philosopher, logician, mathematician, historian,
religious skeptic, social reformer, socialist
and pacifist. Although he spent the majority of his life in England, he was born in
Wales, where he also died.
Let Q be the set of all sets that do not contain themselves as a member. Consider the
question:Does Q contain itself? If the answer to this question is no then Q, by definition
must contain itself. If, however, Q contains itself then it is by definition unable to contain
itself. This rather annoying contradiction, constructed by Russell, had a rather amusing
side effect.
Friedrich Frege had just finished the second of a three volume set of works called the Basic
Laws of Arithmetic that was supposed to remove all intuition from mathematics and place
it on a purely logical basis. Russell wrote Frege, explaining his paradox. Frege added
an appendix to his second volume that attempted to avoid Russells paradox. The third
volume was never published.
It is possible to resolve Russells paradox by being much more careful about what objects
may be defined to be sets; the category of all sets that do not contain themselves gives rise to
no contradiction (it does give rise to an entire field of mathematics, category theory). The
key to resolving the paradox from a set theoretic perspective is that one cannot assume
that, for every property, there is a set of all things satisfying that property. This is a
reason why it is important that a set is properly defined. Another consequence of Russells
paradox is a warning that self-referential statements are both potentially interesting and
fairly dangerous, at least on the intellectual plane.
The original phrasing of Russells paradox was in terms of normal and abnormal sets. A
set is normal if it fails to contain itself and abnormal otherwise. Consider the set of all
normal sets. If this set is abnormal, it contains itself but by definition the set contains only
normal sets and hence it is itself normal. The normality of this set forces the set to contain
itself, which makes it abnormal. This is simply a rephrasing of the original contradiction.
Puzzle: what does the circuit below have to do with Russells paradox and what use is it?