Reading preferences

Optional display controls need JavaScript. All reading content and navigation work without it.

How to use Read

This page follows the source chapter in ordinary reading order. Equations remain native MathML so compatible screen readers and braille systems can navigate their internal structure. Each small source link returns to the exact source line.

Introduction

When Georg Cantor developed set theory in the 1870s, one of his aims was to make palatable the idea of an infinite collection—an actual infinity, as the medievals would say. A key part of this was his treatment of the size of different sets. If asource 16, bsource 16 and csource 16 are all distinct, then the set {a,b,c}source 17 is intuitively larger than {a,b}source 18. But what about infinite sets? Are they all as large as each other? It turns out that they are not.

The first important idea here is that of an enumeration. We can list every finite set by listing all its elements. For some infinite sets, we can also list all their elements if we allow the list itself to be infinite. Such sets are called enumerable. Cantor's surprising result, which we will fully understand by the end of this chapter, was that some infinite sets are not enumerable.

Enumerations and Enumerable Sets

Definition: Informal enumeration

Informally, an enumeration of a set Asource 28 is a list (possibly infinite) of elements of Asource 29 such that every element of Asource 29 appears on the list at some finite position. If Asource 30 has an enumeration, then Asource 31 is said to be enumerable.

source 27

Proposition: Removing repetitions from an enumeration

If Asource 69 has an enumeration, it has an enumeration without repetitions.

source 68

Proof

Suppose Asource 74 has an enumeration x1source 74, x2source 74, … in which each xisource 75 is an element of Asource 75. We can remove repetitions from an enumeration by removing repeated elements. For instance, we can turn the enumeration into a new one in which we list xisource 77 if it is a element of Asource 78 that is not among x1source 78, …, xi1source 79 or remove xisource 79 from the list if it already appears among x1source 80, …, xi1source 80.

End of proof.

The last argument shows that in order to get a good handle on enumerations and enumerable sets and to prove things about them, we need a more precise definition. The following provides it.

Definition: Enumeration as a surjection from the positive integers

An enumeration of a set Asource 88 is any surjective function f:Z+Asource 89.

source 87

Definition: Enumerable sets

A set Asource 115 is enumerable iff it is empty or has an enumeration.

source 113

Example: Enumerating the positive integers and natural numbers

A function enumerating the positive integers (Z+source 119) is simply the identity function given by f(n)=nsource 120. A function enumerating the natural numbers Nsource 121 is the function g(n)=n1source 121.

source 118

Example: Enumerating positive even and odd integers

The functions f:Z+Z+source 125 and g:Z+Z+source 125 given by f(n)=2n andg(n)=2n1source 127 enumerate the even positive integers and the odd positive integers, respectively. However, neither function is an enumeration of Z+source 133, since neither is surjective.

source 124

Exercise: Enumerating the positive square numbers

Define an enumeration of the positive squares 1source 137, 4source 137, 9source 137, 16source 137, …

source 136

Example: Alternating enumeration of the integers from positive inputs

The function f(n)=(1)n(n1)2source 141 (where xsource 142 denotes the ceiling function, which rounds xsource 143 up to the nearest integer) enumerates the set of integers Zsource 144. Notice how fsource 144 generates the values of Zsource 144 by “hopping” back and forth between positive and negative integers: f(1)f(2)f(3)f(4)f(5)f(6)f(7)02122232425262011223source 146 You can also think of fsource 154 as defined by cases as follows: f(n)={0if n=1n/2if n is even(n1)/2if n is odd and >1source 155

source 140

Exercise: Union of two enumerable sets using positive-integer enumerations

Show that if Asource 165 and Bsource 165 are enumerable, so is ABsource 165. To do this, suppose there are surjective functions f:Z+Asource 166 and g:Z+Bsource 167, and define a surjective function h:Z+ABsource 168 and prove that it is surjective. Also consider the cases where Asource 169 or B=source 169.

source 164

Exercise: Enumerable subsets of enumerable sets

Show that if BAsource 173 and Asource 173 is enumerable, so is Bsource 173. To do this, suppose there is a surjective function f:Z+Asource 174. Define a surjective function g:Z+Bsource 175 and prove that it is surjective. What happens if B=source 176?

source 172

Exercise: Finite unions of enumerable sets using induction

Show by induction on nsource 180 that if A1source 180, A2source 180, …, Ansource 180 are all enumerable, so is A1Ansource 181. You may assume the fact that if two sets Asource 182 and Bsource 182 are enumerable, so is ABsource 182.

source 179

Although it is perhaps more natural when listing the elements of a set to start counting from the 1source 187st element, mathematicians like to use the natural numbers Nsource 188 for counting things. They talk about the 0source 189th, 1source 189st, 2source 189nd, and so on, elements of a list. Correspondingly, we can define an enumeration as a surjective function from Nsource 191 to Asource 191. Of course, the two definitions are equivalent.

Proposition: Shifting enumerations between positive and natural indices

There is a surjection f:Z+Asource 195 iff there is a surjection g:NAsource 196.

source 194

Proof

Given a surjection f:Z+Asource 200, we can define g(n)=f(n+1)source 200 for all nNsource 201. It is easy to see that g:NAsource 201 is surjective. Conversely, given a surjection g:NAsource 202, define f(n)=g(n1)source 203.

End of proof.

This gives us the following result:

Corollary: Enumerable sets via surjections from the natural numbers

A set Asource 209 is enumerable iff it is empty or there is a surjective function f:NAsource 210.

source 208

We discussed above that a list of elements of a set Asource 213 can be turned into a list without repetitions. This is also true for enumerations, but a bit harder to formulate and prove rigorously. Any function f:Z+Asource 216 must be defined for all nZ+source 216. If there are only finitely many elements in Asource 217 then we clearly cannot have a function defined on the infinitely many elements of Z+source 219 that takes as values all the elements of Asource 220 but never takes the same value twice. In that case, i.e., in the case where the list without repetitions is finite, we must choose a different domain for fsource 222, one with only finitely many elements. Not having repetitions means that fsource 223 must be injective. Since it is also surjective, we are looking for a bijection between some finite set {1,,n}source 225 or Z+source 225 and Asource 225.

Proposition: Replacing a surjective enumeration by a bijective one

If f:Z+Asource 228 is surjective (i.e., an enumeration of Asource 229), there is a bijection g:ZAsource 229 where Zsource 229 is either Z+source 230 or {1,,n}source 230 for some nZ+source 230.

source 227

Proof

We define the function gsource 234 recursively: Let g(1)=f(1)source 234. If g(i)source 234 has already been defined, let g(i+1)source 235 be the first value of f(1)source 235, f(2)source 236, … not already among g(1)source 236, …, g(i)source 236, if there is one. If Asource 237 has just nsource 237 elements, then g(1)source 237, …, g(n)source 237 are all defined, and so we have defined a function g:{1,,n}Asource 238. If Asource 239 has infinitely many elements, then for any isource 239 there must be a element of Asource 240 in the enumeration f(1)source 240, f(2)source 240, …, which is not already among g(1)source 241, …, g(i)source 241. In this case we have defined a function g:Z+Asource 242.

The function gsource 244 is surjective, since any element of Asource 244 is among f(1)source 245, f(2)source 245, … (since fsource 245 is surjective) and so will eventually be a value of g(i)source 246 for some isource 246. It is also injective, since if there were j<isource 247 such that g(j)=g(i)source 247, then g(i)source 248 would already be among g(1)source 248, …, g(i1)source 248, contrary to how we defined gsource 249.

End of proof.

Corollary: Enumerable sets via bijections from natural initial segments

A set Asource 253 is enumerable iff it is empty or there is a bijection f:NAsource 254 where either N=Nsource 254 or N={0,,n}source 254 for some nNsource 255.

source 252

Proof

Asource 259 is enumerable iff Asource 259 is empty or there is a surjective f:Z+Asource 260. By Proposition: Replacing a surjective enumeration by a bijective one, the latter holds iff there is a bijective function f:ZAsource 261 where Z=Z+source 261 or Z={1,,n}source 262 for some nZ+source 262. By the same argument as in the proof of Proposition: Shifting enumerations between positive and natural indices, that in turn is the case iff there is a bijection g:NAsource 264 where either N=Nsource 265 or N={0,,n1}source 265.

End of proof.

Exercise: Injective and surjective characterizations of enumerability

According to Definition: Enumerable sets, a set Asource 269 is enumerable iff A=source 270 or there is a surjective f:Z+Asource 270. It is also possible to define “enumerable set” precisely by: a set is enumerable iff there is a injective function g:AZ+source 273. Show that the definitions are equivalent, i.e., show that there is a injective function g:AZ+source 275 iff either A=source 275 or there is a surjective f:Z+Asource 276.

source 268

Cantor's Zig-Zag Method

Proposition: Enumerability of pairs of natural numbers

N×Nsource 69 is enumerable.

source 68

Proof

Let f:NN×Nsource 73 take each kNsource 73 to the tuple n,mN×Nsource 74 such that ksource 74 is the value of the nsource 75th row and msource 75th column in Cantor's zig-zag array.

End of proof.

Proposition: Enumerability of finite powers of the natural numbers

Nnsource 115 is enumerable, for every nNsource 115.

source 114

Exercise: Enumerability of finite powers of the positive integers

Show that (Z+)nsource 119 is enumerable, for every nNsource 119.

source 118

Exercise: Enumerability of all finite positive-integer sequences

Show that (Z+)source 123 is enumerable. You may assume Exercise: Enumerability of finite powers of the positive integers.

source 122

Pairing Functions and Codes

Definition: Arithmetic pairing functions and codes

A function f:A×BNsource 52 is an arithmetical pairing function if fsource 53 is injective. We also say that fsource 53 encodes A×Bsource 54, and that f(x,y)source 54 is the code for x,ysource 55.

source 51

Exercise: Enumerating the nonnegative rational numbers

Give an enumeration of the set of all non-negative rational numbers.

source 66

Exercise: Enumerability of all rational numbers

Show that Qsource 71 is enumerable. Recall that any rational number can be written as a fraction z/msource 72 with zZsource 72, mN+source 72.

source 70

Exercise: Enumerating finite binary strings

Define an enumeration of Bsource 76.

source 75

Exercise: Enumerability of finite-arity truth functions

Recall from your introductory logic course that each possible truth table expresses a truth function. In other words, the truth functions are all functions from BkBsource 82 for some ksource 82. Prove that the set of all truth functions is enumerable.

source 79

Exercise: Enumerability of finite subsets of an enumerable set

Show that the set of all finite subsets of an arbitrary infinite enumerable set is enumerable.

source 86

Exercise: Enumerability of finite and cofinite subsets of the natural numbers

A subset of Nsource 92 is said to be cofinite iff it is the complement of a finite set Nsource 93; that is, ANsource 93 is cofinite iff NAsource 94 is finite. Let Isource 94 be the set whose elements are exactly the finite and cofinite subsets of Nsource 95. Show that Isource 96 is enumerable.

source 91

Exercise: Countable unions of enumerable sets

Show that the enumerable union of enumerable sets is enumerable. That is, whenever A1source 101, A2source 101, … are sets, and each Aisource 102 is enumerable, then the union i=1Aisource 102 of all of them is also enumerable. [NB: this is hard!]

source 99

Exercise: Inverting a pairing function to enumerate its product

Let f:A×BNsource 107 be an arbitrary pairing function. Show that the inverse of fsource 108 is an enumeration of A×Bsource 108.

source 106

Exercise: Encoding triples of natural numbers

Specify a function that encodes N3source 112.

source 111

An Alternative Pairing Function

Example: Pairing natural numbers by powers of two

The function h:N2Nsource 87 given by h(n,m)=2n(2m+1)1source 88 is a pairing function for the set of pairs of natural numbers N2source 91.

source 86

Sometimes it is enough to encode pairs of natural numbers N2source 102 without requiring that the encoding is surjective. Such encodings have inverses that are only partial functions.

Example: Injective pair encoding by prime powers

The function j:N2N+source 107 given by j(n,m)=2n3msource 108 is a injective function N2Nsource 111.

source 106

Nonenumerable Sets

Some sets, such as the set Z+source 20 of positive integers, are infinite. So far we've seen examples of infinite sets which were all enumerable. However, there are also infinite sets which do not have this property. Such sets are called nonenumerable.

First of all, it is perhaps already surprising that there are nonenumerable sets. For any enumerable set Asource 26 there is a surjective function f:Z+Asource 27. If a set is nonenumerable there is no such function. That is, no function mapping the infinitely many elements of Z+source 29 to Asource 29 can exhaust all of Asource 30. So there are “more” elements of Asource 30 than the infinitely many positive integers.

How would one prove that a set is nonenumerable? You have to show that no such surjective function can exist. Equivalently, you have to show that the elements of Asource 35 cannot be enumerated in a one way infinite list. The best way to do this is to show that every list of elements of Asource 37 must leave at least one element out; or that no function f:Z+Asource 38 can be surjective. We can do this using Cantor's diagonal method. Given a list of elements of Asource 40, say, x1source 40, x2source 40, …, we construct another element of Asource 40 which, by its construction, cannot possibly be on that list.

Our first example is the set Bωsource 43 of all infinite, non-gappy sequences of 0source 44's and 1source 44's.

Theorem: Non-enumerability of positive-indexed infinite binary sequences

Bωsource 48 is nonenumerable.

source 46

Proof

Suppose, by way of contradiction, that Bωsource 52 is enumerable, i.e., suppose that there is a list s1source 53, s2source 53, s3source 54, s4source 54, … of all elements of Bωsource 54. Each of these sisource 55 is itself an infinite sequence of 0source 55's and 1source 55's. Let's call the jsource 56-th element of the isource 56-th sequence in this list si(j)source 57. Then the isource 57-th sequence sisource 57 is si(1),si(2),si(3),source 58

We may arrange this list, and the elements of each sequence sisource 62 in it, in an array: 12341s1(1)s1(2)s1(3)s1(4)2s2(1)s2(2)s2(3)s2(4)3s3(1)s3(2)s3(3)s3(4)4s4(1)s4(2)s4(3)s4(4)source 64 The labels down the side give the number of the sequence in the list s1source 75, s2source 75, …; the numbers across the top label the elements of the individual sequences. For instance, s1(1)source 76 is a name for whatever number, a 0source 77 or a 1source 77, is the first element in the sequence s1source 78, and so on.

Now we construct an infinite sequence, s¯source 80, of 0source 80's and 1source 81's which cannot possibly be on this list. The definition of s¯source 82 will depend on the list s1source 82, s2source 82, …. Any infinite list of infinite sequences of 0source 83's and 1source 83's gives rise to an infinite sequence s¯source 84 which is guaranteed to not appear on the list.

To define s¯source 87, we specify what all its elements are, i.e., we specify s¯(n)source 88 for all nZ+source 88. We do this by reading down the diagonal of the array above (hence the name “diagonal method”) and then changing every 1source 90 to a 0source 90 and every 0source 91 to a 1source 91. More abstractly, we define s¯(n)source 91 to be 0source 91 or 1source 92 according to whether the nsource 92-th element of the diagonal, sn(n)source 93, is 1source 93 or 0source 93. s¯(n)={1if sn(n)=00if sn(n)=1.source 94 If you like formulas better than definitions by cases, you could also define s¯(n)=1sn(n)source 102.

Clearly s¯source 104 is an infinite sequence of 0source 104's and 1source 105's, since it is just the mirror sequence to the sequence of 0source 105's and 1source 106's that appear on the diagonal of our array. So s¯source 106 is a element of Bωsource 107. But it cannot be on the list s1source 107, s2source 108, … Why not?

It can't be the first sequence in the list, s1source 110, because it differs from s1source 111 in the first element. Whatever s1(1)source 111 is, we defined s¯(1)source 112 to be the opposite. It can't be the second sequence in the list, because s¯source 113 differs from s2source 113 in the second element: if s2(2)source 114 is 0source 114, s¯(2)source 114 is 1source 114, and vice versa. And so on.

More precisely: if s¯source 117 were on the list, there would be some ksource 118 so that s¯=sksource 118. Two sequences are identical iff they agree at every place, i.e., for any nsource 119, s¯(n)=sk(n)source 119. So in particular, taking n=ksource 120 as a special case, s¯(k)=sk(k)source 121 would have to hold. sk(k)source 121 is either 0source 122 or 1source 122. If it is 0source 122 then s¯(k)source 122 must be 1source 122—that's how we defined s¯source 123. But if sk(k)=1source 123 then, again because of the way we defined s¯source 124, s¯(k)=0source 124. In either case s¯(k)sk(k)source 125.

We started by assuming that there is a list of elements of Bωsource 128, s1source 128, s2source 128, … From this list we constructed a sequence s¯source 129 which we proved cannot be on the list. But it definitely is a sequence of 0source 130's and 1source 130's if all the sisource 130 are sequences of 0source 131's and 1source 131's, i.e., s¯Bωsource 131. This shows in particular that there can be no list of all elements of Bωsource 133, since for any such list we could also construct a sequence s¯source 134 guaranteed to not be on the list, so the assumption that there is a list of all sequences in Bωsource 136 leads to a contradiction.

End of proof.

Theorem: Non-enumerability of the power set of the positive integers

(Z+)source 149 is not enumerable.

source 147

Proof

We proceed in the same way, by showing that for every list of subsets of Z+source 154 there is a subset of Z+source 154 which cannot be on the list. Suppose the following is a given list of subsets of Z+source 155: Z1,Z2,Z3,source 156 We now define a set Z¯source 159 such that for any nZ+source 159, nZ¯source 160 iff nZnsource 160: Z¯={nZ+:nZn}source 161 Z¯source 164 is clearly a set of positive integers, since by assumption each Znsource 165 is, and thus Z¯(Z+)source 165. But Z¯source 166 cannot be on the list. To show this, we'll establish that for each kZ+source 167, Z¯Zksource 167.

So let kZ+source 170 be arbitrary. We've defined Z¯source 170 so that for any nZ+source 171, nZ¯source 171 iff nZnsource 171. In particular, taking n=ksource 172, kZ¯source 172 iff kZksource 172. But this shows that Z¯Zksource 173, since ksource 173 is a element of one but not the other, and so Z¯source 174 and Zksource 174 have different elements. Since ksource 175 was arbitrary, Z¯source 175 is not on the list Z1source 176, Z2source 176, …

End of proof.

Exercise: Diagonal proof for the power set of the natural numbers

Show that (N)source 203 is nonenumerable by a diagonal argument.

source 202

Exercise: Diagonal proof for functions on the positive integers

Show that the set of functions f:Z+Z+source 207 is nonenumerable by an explicit diagonal argument. That is, show that if f1source 209, f2source 209, …, is a list of functions and each fi:Z+Z+source 209, then there is some f¯:Z+Z+source 210 not on this list.

source 206

Reduction

We showed (Z+)source 20 to be nonenumerable by a diagonalization argument. We already had a proof that Bωsource 21, the set of all infinite sequences of 0source 22s and 1source 22s, is nonenumerable. Here's another way we can prove that (Z+)source 23 is nonenumerable: Show that if (Z+)source 24 is enumerable then Bωsource 24 is also enumerable. Since we know Bωsource 25 is not enumerable, (Z+)source 26 can't be either. This is called reducing one problem to another—in this case, we reduce the problem of enumerating Bωsource 28 to the problem of enumerating (Z+)source 29. A solution to the latter—an enumeration of (Z+)source 30—would yield a solution to the former—an enumeration of Bωsource 31.

How do we reduce the problem of enumerating a set Bsource 33 to that of enumerating a set Asource 34? We provide a way of turning an enumeration of Asource 35 into an enumeration of Bsource 35. The easiest way to do that is to define a surjective function f:ABsource 36. If x1source 36, x2source 36, … enumerates Asource 37, then f(x1)source 37, f(x2)source 37, … would enumerate Bsource 38. In our case, we are looking for a surjective function f:(Z+)Bωsource 39.

Exercise: Reduction along an injection with positive-integer enumerations

Show that if there is an injective function g:BAsource 42, and Bsource 43 is nonenumerable, then so is Asource 43. Do this by showing how you can use gsource 44 to turn an enumeration of Asource 44 into one of Bsource 44.

source 41

Proof of Theorem: Non-enumerability of the power set of the positive integers by reduction

Suppose that (Z+)source 48 were enumerable, and thus that there is an enumeration of it, Z1source 49, Z2source 49, Z3source 49, …

Define the function f:(Z+)Bωsource 51 by letting f(Z)source 52 be the sequence sksource 52 such that sk(n)=1source 52 iff nZsource 52, and sk(n)=0source 53 otherwise. This clearly defines a function, since whenever ZZ+source 54, any nZ+source 54 either is a element of Zsource 55 or isn't. For instance, the set 2Z+={2,4,6,}source 55 of positive even numbers gets mapped to the sequence 010101source 57, the empty set gets mapped to 0000source 57 and the set Z+source 58 itself to 1111source 58.

It also is surjective: Every sequence of 0source 60s and 1source 60s corresponds to some set of positive integers, namely the one which has as its members those integers corresponding to the places where the sequence has 1source 63s. More precisely, suppose sBωsource 63. Define ZZ+source 63 by: Z={nZ+:s(n)=1}source 65 Then f(Z)=ssource 68, as can be verified by consulting the definition of fsource 69.

Now consider the list f(Z1),f(Z2),f(Z3),source 72 Since fsource 75 is surjective, every member of Bωsource 75 must appear as a value of fsource 76 for some argument, and so must appear on the list. This list must therefore enumerate all of Bωsource 77.

So if (Z+)source 79 were enumerable, Bωsource 79 would be enumerable. But Bωsource 80 is nonenumerable (Theorem: Non-enumerability of positive-indexed infinite binary sequences). Hence (Z+)source 81 is nonenumerable.

End of proof.

Exercise: Non-enumerability of sets of positive-integer pairs

Show that the set of all sets of pairs of positive integers is nonenumerable by a reduction argument.

source 103

Exercise: Functions on the natural numbers by positive-indexed reduction

Show that the set Xsource 109 of all functions f:NNsource 109 is nonenumerable by a reduction argument (Hint: give a surjective function from Xsource 111 to Bωsource 111.)

source 108

Exercise: Infinite natural-number sequences by positive-indexed reduction

Show that Nωsource 115, the set of infinite sequences of natural numbers, is nonenumerable by a reduction argument.

source 114

Exercise: Total and partial zero-valued functions

Let Psource 120 be the set of functions from the set of positive integers to the set {0}source 121, and let Qsource 121 be the set of partial functions from the set of positive integers to the set {0}source 122. Show that Psource 123 is enumerable and Qsource 123 is not. (Hint: reduce the problem of enumerating Bωsource 124 to enumerating Qsource 124).

source 119

Exercise: Binary surjections from the positive integers

Let Ssource 128 be the set of all surjective functions from the set of positive integers to the set {0,1}, i.e., Ssource 129 consists of all surjective f:Z+Bsource 130. Show that Ssource 130 is nonenumerable.

source 127

Exercise: Real numbers by positive-indexed reduction

Show that the set Rsource 135 of all real numbers is nonenumerable.

source 134

Equinumerosity

We have an intuitive notion of “size” of sets, which works fine for finite sets. But what about infinite sets? If we want to come up with a formal way of comparing the sizes of two sets of any size, it is a good idea to start by defining when sets are the same size. Here is Frege:

If a waiter wants to be sure that he has laid exactly as many knives as plates on the table, he does not need to count either of them, if he simply lays a knife to the right of each plate, so that every knife on the table lies to the right of some plate. The plates and knives are thus uniquely correlated to each other, and indeed through that same spatial relationship. (Gottlob Frege, 1884, §70)

The insight of this passage can be brought out through a formal definition:

Definition: Equinumerous sets

Asource 30 is equinumerous with Bsource 30, written ABsource 30, iff there is a bijection f:ABsource 31.

source 29

Proposition: Equinumerosity as an equivalence relation

Equinumerosity is an equivalence relation.

source 34

Proof

We must show that equinumerosity is reflexive, symmetric, and transitive. Let A,Bsource 40, and Csource 40 be sets.

Reflexivity. The identity map IdA:AAsource 42, where IdA(x)=xsource 43 for all xAsource 43, is a bijection. So AAsource 44.

Symmetry. Suppose ABsource 46, i.e., there is a bijection f:ABsource 47. Since fsource 47 is bijective, its inverse f1source 48 exists and is also bijective. Hence, f1:BAsource 49 is a bijection, so BAsource 49.

Transitivity. Suppose that ABsource 51 and BCsource 51, i.e., there are bijections f:ABsource 52 and g:BCsource 52. Then the composition gf:ACsource 53 is bijective, so that ACsource 54.

End of proof.

Proposition: Preservation of enumerability under equinumerosity

If ABsource 58, then Asource 58 is enumerable if and only if Bsource 59 is.

source 57

Proof

Suppose ABsource 69, so there is some bijection f:ABsource 69, and suppose that Asource 70 is enumerable.

Then either A=source 72 or there is a surjective function g:Z+Asource 73. If A=source 73, then B=source 73 also (otherwise there would be a element yBsource 74 but no xAsource 74 with g(x)=ysource 75). If, on the other hand, g:Z+Asource 75 is surjective, then fg:Z+Bsource 76 is surjective. To see this, let yBsource 77. Since fsource 77 is surjective, there is an xAsource 78 such that f(x)=ysource 78. Since gsource 79 is surjective, there is an nZ+source 79 such that g(n)=xsource 79. Hence, (fg)(n)=f(g(n))=f(x)=ysource 81 and thus fgsource 84 is surjective. We have that fgsource 84 is an enumeration of Bsource 85, and so Bsource 85 is enumerable.

If Bsource 96 is enumerable, we obtain that Asource 96 is enumerable by repeating the argument with the bijection f1:BAsource 97 instead of fsource 98.

End of proof.

Exercise: Equinumerosity of disjoint unions

Show that if ACsource 102 and BDsource 102, and AB=CD=source 102, then ABCDsource 103.

source 101

Exercise: Infinite enumerable sets and the natural numbers

Show that if Asource 107 is infinite and enumerable, then ANsource 108.

source 106

Sets of Different Sizes, and Cantor's Theorem

Definition: Cardinality comparison by injection

Asource 27 is no larger than Bsource 27, written ABsource 27, iff there is a injection f:ABsource 28.

source 26

It is clear that this is a reflexive and transitive relation, but that it is not symmetric (this is left as an exercise). We can also introduce a notion, which states that one set is (strictly) smaller than another.

Definition: Strict cardinal inequality

Asource 37 is smaller than Bsource 37, written ABsource 37, iff there is a injection f:ABsource 38 but no bijection g:ABsource 38, i.e., ABsource 39 and ABsource 39.

source 36

It is clear that this relation is irreflexive and transitive. (This is left as an exercise.) Using this notation, we can say that a set Asource 44 is enumerable iff ANsource 44, and that Asource 45 is nonenumerable iff NAsource 45. This allows us to restate

Theorem: Non-enumerability of the power set of the natural numbers as the observation that N(N)source 50. In fact, Georg Cantor (1892) proved that this last point is perfectly general:

Theorem: Cantor's theorem on power sets

A(A)source 57, for any set Asource 57.

source 56

Proof

The map f(x)={x}source 61 is a injection f:A(A)source 61, since if xysource 62, then also {x}{y}source 62 by extensionality, and so f(x)f(y)source 63. So we have that A(A)source 63.

We will now show that there cannot be a surjective function g:A(A)source 71, let alone a bijective one, and hence that A(A)source 73. For suppose that g:A(A)source 73. Since gsource 74 is total, every xAsource 74 is mapped to a subset g(x)Asource 74. We can show that gsource 75 cannot be surjective. To do this, we define a subset A¯Asource 76 which by definition cannot be in the range of gsource 77. Let A¯={xA:xg(x)}.source 78 Since g(x)source 81 is defined for all xAsource 81, A¯source 81 is clearly a well-defined subset of Asource 82. But, it cannot be in the range of gsource 83. Let xAsource 83 be arbitrary, we will show that A¯g(x)source 83. If xg(x)source 84, then it does not satisfy xg(x)source 84, and so by the definition of A¯source 85, we have xA¯source 85. If xA¯source 86, it must satisfy the defining property of A¯source 87, i.e., xAsource 87 and xg(x)source 87. Since xsource 88 was arbitrary, this shows that for each xA¯source 88, xg(x)source 89 iff xA¯source 89, and so g(x)A¯source 90. In other words, A¯source 90 cannot be in the range of gsource 91, contradicting the assumption that gsource 91 is surjective.

End of proof.

Exercise: No injection from a power set into its base set

Show that there cannot be a injection g:(A)Asource 143, for any set Asource 144. Hint: Suppose g:(A)Asource 144 is injective. Consider D={g(B):BA and g(B)B}source 145. Let x=g(D)source 146. Use the fact that gsource 146 is injective to derive a contradiction.

source 142

The Notion of Size, and Schröder-Bernstein

Theorem: Schröder-Bernstein theorem

If ABsource 25 and BAsource 25, then ABsource 26.

source 23

Enumerations and Enumerable Sets

We can specify finite set is by simply enumerating its elements. We do this when we define a set like so: A={a1,a2,,an}.source 23 Assuming that the elements a1source 26, …, ansource 26 are all distinct, this gives us a bijection between Asource 27 and the first nsource 27 natural numbers 0source 28, …, n1source 28. Conversely, since every finite set has only finitely many elements, every finite set can be put into such a correspondence. In other words, if Asource 30 is finite, there is a bijection between Asource 31 and {0,,n1}source 31, where nsource 31 is the number of elements of Asource 32.

If we allow for certain kinds of infinite sets, then we will also allow some infinite sets to be enumerated. We can make this precise by saying that an infinite set is enumerated by a bijection between it and all of Nsource 37.

Definition: Set-theoretic enumeration

An enumeration of a set Asource 40 is a bijection whose range is Asource 41 and whose domain is either an initial set of natural numbers {0,1,,n}source 41 or the entire set of natural numbers Nsource 42.

source 39

Definition: Enumerable and nonenumerable sets in the set-theoretic presentation

A set Asource 59 is enumerable iff either A=source 59 or there is an enumeration of Asource 60. We say that Asource 60 is nonenumerable iff Asource 60 is not enumerable.

source 57

Example: Enumerating natural and positive natural numbers

A function enumerating the natural numbers is simply the identity function IdN:NNsource 71 given by IdN(n)=nsource 71. A function enumerating the positive natural numbers, N+=N{0}source 72, is the function g(n)=n+1source 73, i.e., the successor function.

source 69

Exercise: Injective and surjective tests for set-theoretic enumerability

Show that a set Asource 78 is enumerable iff either A=source 78 or there is a surjection f:NAsource 79. Show that Asource 79 is enumerable iff there is a injection g:ANsource 80.

source 77

Example: Enumerating even and odd natural numbers

The functions f:NNsource 84 and g:NNsource 84 given by f(n)=2n andg(n)=2n+1source 86 respectively enumerate the even natural numbers and the odd natural numbers. But neither is surjective, so neither is an enumeration of Nsource 92.

source 83

Exercise: Enumerating square numbers from natural inputs

Define an enumeration of the square numbers 1source 96, 4source 96, 9source 96, 16source 96, …

source 95

Example: Alternating enumeration of the integers from natural inputs

Let xsource 100 be the ceiling function, which rounds xsource 100 up to the nearest integer. Then the function f:NZsource 101 given by: f(n)=(1)nn2source 103 enumerates the set of integers Zsource 107 as follows: f(0)f(1)f(2)f(3)f(4)f(5)f(6)021222324252620112233source 108 Notice how fsource 115 generates the values of Zsource 115 by “hopping” back and forth between positive and negative integers. You can also think of fsource 117 as defined by cases as follows: f(n)={n2if n is evenn+12if n is oddsource 118

source 99

Exercise: Union of two enumerable sets in the set-theoretic presentation

Show that if Asource 127 and Bsource 127 are enumerable, so is ABsource 127.

source 126

Exercise: Finite unions in the set-theoretic presentation

Show by induction on nsource 131 that if A1source 131, A2source 131, …, Ansource 131 are all enumerable, so is A1Ansource 132.

source 130

Nonenumerable Sets

Theorem: Non-enumerability of zero-indexed infinite binary strings

Bωsource 58 is nonenumerable.

source 56

Proof

Consider any enumeration of a subset of Bωsource 62. So we have some list s0source 63, s1source 63, s2source 63, … where every snsource 63 is an infinite string of 0source 64's and 1source 64's. Let sn(m)source 64 be the nsource 64th digit of the msource 65th string in this list. So we can now think of our list as an array, where sn(m)source 66 is placed at the nsource 66th row and msource 66th column: 01230s0(0)s0(1)s0(2)s0(3)1s1(0)s1(1)s1(2)s1(3)2s2(0)s2(1)s2(2)s2(3)3s3(0)s3(1)s3(2)s3(3)source 67 We will now construct an infinite string, dsource 77, of 0source 77's and 1source 77's which is not on this list. We will do this by specifying each of its entries, i.e., we specify d(n)source 79 for all nNsource 79. Intuitively, we do this by reading down the diagonal of the array above (hence the name “diagonal method”) and then changing every 1source 81 to a 0source 81 and every 1source 82 to a 0source 82. More abstractly, we define d(n)source 82 to be 0source 82 or 1source 82 according to whether the nsource 83-th element of the diagonal, sn(n)source 83, is 1source 84 or 0source 84, that is: d(n)={1if sn(n)=00if sn(n)=1source 85 Clearly dBωsource 92, since it is an infinite string of 0source 92's and 1source 93's. But we have constructed dsource 93 so that d(n)sn(n)source 93 for any nNsource 94. That is, dsource 94 differs from snsource 94 in its nsource 94th entry. So dsnsource 95 for any nNsource 95. So dsource 95 cannot be on the list s0source 96, s1source 96, s2source 96, …

We have shown, given an arbitrary enumeration of some subset of Bωsource 100, that it will omit some element of Bωsource 100. So there is no enumeration of the set Bωsource 101, i.e., Bωsource 101 is nonenumerable.

End of proof.

Theorem: Non-enumerability of the power set of the natural numbers

(N)source 115 is not enumerable.

source 113

Proof

We proceed in the same way, by showing that every list of subsets of Nsource 120 omits some subset of Nsource 120. So, suppose that we have some list N0,N1,N2,source 121 of subsets of Nsource 121. We define a set Dsource 121 as follows: nDsource 122 iff nNnsource 122: D={nN:nNn}source 123 Clearly DNsource 126. But Dsource 126 cannot be on the list. After all, by construction nDsource 127 iff nNnsource 127, so that DNnsource 127 for any nNsource 128.

End of proof.

Exercise: Diagonal proof for functions on the natural numbers

Show that the set of all functions f:NNsource 155 is nonenumerable by an explicit diagonal argument. That is, show that if f1source 157, f2source 157, …, is a list of functions and each fi:NNsource 157, then there is some g:NNsource 158 not on this list.

source 154

Reduction

We proved that Bωsource 20 is nonenumerable by a diagonalization argument. We used a similar diagonalization argument to show that (N)source 22 is nonenumerable. But here's another way we can prove that (N)source 23 is nonenumerable: show that if (N)source 24 is enumerable then Bωsource 24 is also enumerable. Since we know Bωsource 25 is nonenumerable, it will follow that (N)source 26 is too.

This is called reducing one problem to another. In this case, we reduce the problem of enumerating Bωsource 29 to the problem of enumerating (N)source 30. A solution to the latter—an enumeration of (N)source 31—would yield a solution to the former—an enumeration of Bωsource 32.

To reduce the problem of enumerating a set Bsource 34 to that of enumerating a set Asource 35, we provide a way of turning an enumeration of Asource 35 into an enumeration of Bsource 36. The easiest way to do that is to define a surjection f:ABsource 37. If x1source 37, x2source 37, … enumerates Asource 38, then f(x1)source 38, f(x2)source 38, … would enumerate Bsource 38. In our case, we are looking for a surjection f:(N)Bωsource 39.

Exercise: Reduction along an injection with natural-number enumerations

Show that if there is an injective function g:BAsource 43, and Bsource 44 is nonenumerable, then so is Asource 44. Do this by showing how you can use gsource 45 to turn an enumeration of Asource 45 into one of Bsource 45.

source 42

Proof of Theorem: Non-enumerability of the power set of the natural numbers by reduction

For a reduction, suppose that (N)source 49 is enumerable, and thus that there is an enumeration of it, N1source 50, N2source 50, N3source 50, …

Define the function f:(N)Bωsource 52 by letting f(N)source 53 be the string sksource 53 such that sk(n)=1source 53 iff nNsource 53, and sk(n)=0source 54 otherwise.

This clearly defines a function, since whenever NNsource 56, any nNsource 57 either is a element of Nsource 57 or isn't. For instance, the set 2N={2n:nN}={0,2,4,6,}source 58 of even naturals gets mapped to the string 1010101source 59; source 60 gets mapped to 0000source 60; Nsource 60 gets mapped to 1111source 61.

It is also surjective: every string of 0source 63s and 1source 63s corresponds to some set of natural numbers, namely the one which has as its members those natural numbers corresponding to the places where the string contains a 1source 66s. More precisely, if sBωsource 66, then define NNsource 66 by: N={nN:s(n)=1}source 68 Then f(N)=ssource 71, as can be verified by consulting the definition of fsource 72.

Now consider the list f(N1),f(N2),f(N3),source 75 Since fsource 78 is surjective, every member of Bωsource 78 must appear as a value of fsource 79 for some argument, and so must appear on the list. This list must therefore enumerate all of Bωsource 80.

So if (N)source 82 were enumerable, Bωsource 82 would be enumerable. But Bωsource 83 is nonenumerable (Theorem: Non-enumerability of zero-indexed infinite binary strings). Hence (N)source 84 is nonenumerable.

End of proof.

Exercise: Functions on the natural numbers by zero-indexed reduction

Show that the set Xsource 107 of all functions f:NNsource 107 is nonenumerable by a reduction argument (Hint: give a surjective function from Xsource 109 to Bωsource 109.)

source 106

Exercise: Sets of natural-number pairs by reduction

Show that the set of all sets of pairs of natural numbers, i.e., (N×N)source 114, is nonenumerable by a reduction argument.

source 112

Exercise: Infinite natural-number sequences by zero-indexed reduction

Show that Nωsource 119, the set of infinite sequences of natural numbers, is nonenumerable by a reduction argument.

source 118

Exercise: Binary surjections from the natural numbers

Let Ssource 131 be the set of all surjections from Nsource 131 to the set {0,1}source 132, i.e., Ssource 132 consists of all surjections f:NBsource 132. Show that Ssource 133 is nonenumerable.

source 130

Exercise: Real numbers by zero-indexed reduction

Show that the set Rsource 137 of all real numbers is nonenumerable.

source 136