Safe Sets 6
Safe Sets 6
3.3.1 Definition. (Finite and infinite sets) A set A is finite iff it is either
empty, or is in 1-1 correspondence with {x ∈ N : x ≤ n}. This “normalized”
small set of natural numbers we usually denote by {0, 1, 2, . . . , n}.
If a set is not finite, then it is infinite.
3.3.3 Remark. One must be careful when one attempts to explain finiteness
via counting by a human.
For example, Achilles† could count infinitely many objects by constantly
accelerating his counting process as follows:
He procrastinated for a full second, and then counted the first element. Then,
he counted the second object exactly after 1/2 a second from the first. Then
he got to the third element 1/22 seconds after the previous, . . . , he counted the
n th item at exactly 1/2n−1 seconds after the previous, and so on forever.
Hmm! It was not “forever”, was it? After a total of 2 seconds he was done!
You see (as you can easily verify from your calculus knowledge (limits)),‡
1 1 1 1
1+ + 2 + . . . + n−1 + . . . = =2
2 2 2 1 − 1/2
So “time” is not a good determinant of finiteness!
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
3.3. Finite and Infinite Sets 65
Proof. First off, the claim holds if X = ∅, since then any such f equals ∅ and
its range is empty.
Let us otherwise proceed by way of contradiction, and assume that the theo-
rem is wrong: That is, assume that it is possible to have such onto functions,
for some n and well chosen X.
Since I assume there are such n > 0 values, suppose then that the smallest
n that allows this to happen is, say, n0 , and let X0 be a corresponding set “X”
that works, that is,
Let us call H be the set of all x such that f (x) = n0 , for short, H =
f −1 ({n0 }). ∅ =
6 H ⊆ X0 ; the 6= by ontoness.
Case 1. n0 ∈ H. Then removing all pairs (a, n0 ) from f —all these have a ∈
H— we get a new function f 0 : X0 − H → {0, 1, . . . , n0 − 1}, which is
still onto as we only removed inputs that cause output n0 .
This contradicts minimality of n0 since n0 − 1 works too!
0
1
Case 2. n0 ∈
/ H.
If n0 ∈
/ X0 , then we argue exactly as in Case 1 and we just remove the
base “H” of the cone (in the picture) from X0 .
Otherwise, we have two subcases:
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
66 3. Relations and functions
0
1
0
1
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
3.3. Finite and Infinite Sets 67
Now let
Def
X = {0, . . . , n} − Y
and
Def
g0 = g − Y × N
The “g − Y × N” above is an easy way to say “remove all pairs from g that have
their first component in Y ”.
Thus, g 0 : X → {0, . . . , n, n + 1} is onto, contradicting 3.3.4 because X ⊆
{0, . . . , n} ⊂ {0, . . . , n, n + 1}.
Proof. By 3.3.1 the opposite case requires that there is an n and a function
f : {0, 1, 2, . . . , n} → N that is a 1-1 correspondence. Impossible, since any such
an f will fail to be onto.
Our mathematical definitions have led to what we hoped they would: That N
is infinite as we intuitively understand, notwithstanding Achilles’s accelerated
counting!
N is a “canonical” infinite set that we can use to index the members of many
infinite sets. Sets that can be indexed using natural number indices
a0 , a1 , . . .
b5 , b9 , b13 , b42 , . . .
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
68 3. Relations and functions
We may think that the enumeration above is done by assigning to “42” all of
the members of N as indices, in other words, the enumeration is effected, for
example, by the constant function f : N → {42} given by f (n) = 42 for all
n ∈ N. This is consistent with our earlier definition of indexing (3.1.40).
Now, mathematically,
Some set theorists also define sets that can be enumerated using all the
elements of N as indices without repetitions.
3.3.13 Example. Every enumerable set is countable, but the converse fails.
For example, {1} is countable but not enumerable due to 3.3.8. {2n : n ∈ N} is
enumerable, with f (n) = 2n effecting the 1-1 correspondence f : N → {2n : n ∈
N}.
† Since we are constructing a total onto function to A we need to assume the case A 6= ∅
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
3.3. Finite and Infinite Sets 69
n ←0
while A 6= ∅
a(n) ← min A Comment. Inside the loop ∅ =
6 A ⊆ N, hence min exists.
A ← A − {a(n)}
n ←n+1
end while
Note that the sequence {a(0), a(1), . . . , a(m)} is strictly increasing for any m,
since a(0) is smallest in A, a(1) is smallest in A−{a(0)} and hence the next higher than
a(0) in A, etc.
Will this loop ever exit? Say, yes, when it starts (but does not complete)
the k-th pass through the loop. Thus A became empty when we did A ←
A − {a(k − 1)} in the previous pass, that is A = {a(0), a(1), . . . , a(k − 1)} and
thus, since
a(0) < a91) < . . . < a(k − 1)
we have that the function f : {0, . . . , k − 1} → A given by
then f is 1-1 (by strict increasing property: distinct inputs cause distinct out-
puts), and is trivially total, and onto. Why the latter? Every a ∈ A is reached
in ascending order, and assigned an “n” from N.
A∼B (1)
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
70 3. Relations and functions
B must be infinite, otherwise (3.3.1), for some n, B ∼ {0, . . . , n} and by (1) via
Exercise 3.2.13 we have A ∼ {0, . . . , n}, contradicting that A is infinite. Thus,
by 3.3.14, B ∼ N, hence (again, Exercise 3.2.13 and (1)) A ∼ N. That is, A is
enumerable.
So, if we can enumerate an infinite set at all, then we can enumerate it without
repetitions.
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
3.3. Finite and Infinite Sets 71
group i + j + 1, plus j. Thus the first available position for the first entry of
group (i, j) members is just after this many occupied positions:
(i + j)(i + j + 1)
1 + 2 + 3 + . . . (i + j) =
2
That is,
(i + j)(i + j + 1)
global position of (i, j) is this: +j
2
The function f which for all i, j is given by
(i + j)(i + j + 1)
f (i, j) = +j
2
is the algebraic form of the above enumeration.
There is an easier way to show that N × N ∼ N without diagrams:
By the unique factorisation of numbers into products of primes (Euclid) the
function g : N × N → N given for all m, n by g(m, n) = 2m 3n is 1-1, since Euclid
0 0
proved that 2m 3n = 2m 3n implies m = m0 and n = n0 . It is not onto as it
never outputs, say, 5, but ran(g) is an infinite subset of N (Exercise!).
Thus, trivially, N × N ∼ ran(g) ∼ N, the latter “∼” by 3.3.14.
3.3.18 Remark.
1. Let us collect a few more remarks on countable sets here. Suppose now
that we start with a countable set A. Is every subset of A countable? Yes,
because the composition of onto functions is onto.
a0 , a1 , . . .
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
72 3. Relations and functions
be an enumeration of A and
b0 , b1 , . . .
for B. Now form an infinite matrix with the A-enumeration as the 1st
row, while each remaining row is the same as the B-enumeration. Now
linearise this matrix!
Of course, we may alternatively adapt the unfolding technique to an infinite
matrix of just two rows. How?
a0 , a1 , a2 , . . . (1)
is given.
So, this is an enumeration without repetitions.
Use techniques we employed in this section to propose a new enumeration
in which every ai is listed infinitely many times (this is useful in some
applications of logic).
1 1 0
1 0 1
0 1 1
and we are asked: Find a sequence of three numbers, using only 0 or 1, that
does not fit as a row of the above matrix —i.e., is different from all rows.
Sure, you reply: Take 1 1 1. Or, take 0 0 0.
That is correct. But what if the matrix were big, say, 10350000 × 10350000 , or
even infinite?
Is there a finitely describable technique that can produce an “unfit” row for
any square matrix, even an infinite one? Yes, it is Cantor’s diagonal method or
technique.
He noticed that any row that fits in the matrix as the, say, i-th row, inter-
sects the main diagonal at the same spot that the i-th column does.
Thus if we take the main diagonal —a sequence that has the same length as
any row— and change every one of its entries, then it will not fit anywhere as
a row! Because no row can have an entry that is different than the entry at the
location where it intersects the main diagonal!
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
3.4. Diagonalisation and uncountable sets 73
This idea would give the answer 0 1 0 to our original question. While
1000 11 3 also follows the principle “change all the entries of the diagonal”
and works, we are constrained here to “use only 0 or 1” as entries. More
seriously, in a case of a very large or infinite matrix it is best to have a simple
technique that works even if we do not know much about the elements of the
matrix. Read on!
3.4.3 Example. (Cantor) Let S denote the set of all infinite sequences of 0s
and 1s.
Pause. What is an infinite sequence? Our intuitive understanding of the
term is captured mathematically by the concept of a total function f with left
field (and hence domain) N. The n-th member of the sequence is f (n).J
Can we arrange all of S in an infinite matrix —one element per row? No,
since the preceding example shows that we would miss at least one infinite
sequence (i.e., we would fail to list it as a row), for a sequence of infinitely many
0s and/or 1s can be found, that does not match any row!
But arranging all members of S as an infinite matrix —one element per
row— is tantamount to saying that we can enumerate all the members of S
using members of N as indices.
So we cannot do that. S is not countable!
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
74 3. Relations and functions
The argument from 3.4.3 can be easily modified to get a “row that does not
fit”, that is, a representation
.d0 d1 d2 · · ·
not in the listing.
Well, just let (
2 if aii = 0 ∨ aii = 1
di =
1 otherwise
Clearly .d0 d1 d2 · · · does not fit in any row i as it differs from the expected digit
at the i-th decimal place: should be aii , but di 6= aii . It is, on the other hand,
an infinite decimal expansion, being devoid of zeros, and thus should be listed.
This contradiction settles the issue.
3.4.6 Example. (3.4.3 Revisited) Consider the set of all total functions from
N to {0, 1}. Is this countable?
Well, if there is an enumeration of these one-variable functions
f0 , f1 , f2 , f3 , . . . (1)
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
3.4. Diagonalisation and uncountable sets 75
The same argument as above shows that the set of all functions from N to
itself is uncountable. Taking g(x) = fx (x)+1 also works here to “systematically
change the diagonal” f0 (0), f1 (1), . . . since we are not constrained to keep the
function values in {0, 1}.
3.4.8 Example. (Cantor) What about the set of all subsets of N —P(N) or
2N ?
Cantor showed that this is uncountable as well: If not, we have an enumer-
ation of its members as
S0 , S1 , S2 , . . . (1)
Define the set
Def
D = {x ∈ N : x ∈
/ Sx } (2)
So, D ⊆ N, thus it must appear in the list (1) as an Si . But then i ∈ D iff i ∈ Si
by virtue of D = Si . However, also i ∈ D iff i ∈/ Si by (2). This contradiction
establishes that a legitimate subset of N, namely D, is not an Si . That is, 2N
cannot be so enumerated; it is uncountable.
Note that there is a 1-1 correspondence, let’s call it F , between subsets of N and
the total 0-1-valued functions from N simply given by F (S) = cS . (Exercise!)
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.
76 3. Relations and functions
Thus
{f : f : N → {0, 1} and f is total} ∼ 2N
In particular, the concept of characteristic functions shows that Example 3.4.8
fits the diagonalization methodology. Indeed, the argument in 3.4.8 sets cD (x) =
1 − cSx (x), for all x, because
But then, the argument in 3.4.8 essentially applies the diagonal method to
the list of 0/1 functions cSx , for x = 0, 1, 2, . . ., to show that some 0/1 function,
namely, cD cannot be in the list.
Fragments of “safe” set theory; from the EECS 1028 lecture notes c G. Tourlakis, W 2020.