Asking how many real numbers there are invites the answer "infinitely many", and that answer says nothing until "how many" has a meaning that works for infinite sets.
The previous lesson ranked sets of numbers by order, closed on the least upper bound, and left a prior question: how many reals are there? This lesson answers it with functions alone, assuming injective, surjective and bijective maps, inverses, and the fact that composites of injections (or bijections) are injections (or bijections). As throughout the course, starts at .
Same size without counting
Someone who cannot count can still tell whether there are as many cups as saucers: put one cup on each saucer and see whether anything is left over. That pairing is a bijection, and it is the definition. Sets and have the same size, written , when there is a bijection . And means there is an injection , which seats every element of in its own place in , perhaps with places to spare. Finally means an injection exists and a bijection does not. Identities, inverses and composites make "same size" reflexive, symmetric and transitive.
For finite sets the definition agrees with counting. A set has elements when it is in bijection with . The lesson on functions counted the injections from an -element set to an -element set as , which is when . That is the pigeonhole principle: more than pigeons in holes put two in some hole. So no set has both and elements with , since one bijection followed by the inverse of the other would inject into . Two finite sets have the same size exactly when they have the same number of elements.
It also shows that a finite set is never the same size as a proper subset of itself, which has at most elements when the set has . Richard Dedekind turned this round in 1888 and defined an infinite set as one that is the same size as a proper subset of itself.
Hilbert's hotel
David Hilbert gave the idea its best known picture in a Göttingen lecture of 1924, and George Gamow made it famous in his 1947 book One Two Three... Infinity. A hotel has a room for every natural number, all taken, when a new guest arrives. The manager asks the guest in room to move to room . Everyone still has a room, nobody shares, and room is free.
The move is , , and it is a bijection. It is injective, since gives . It is surjective, since each in has , so and . So , and by Dedekind's definition is infinite.
When a coach brings a guest for every natural number, moving each guest from room to room frees the odd rooms for them, so is the same size as two copies of itself. "The whole is greater than the part" is Euclid's fifth common notion, true for finite collections by the pigeonhole principle and false for infinite ones.
Countable sets
A set is countable when it is finite or the same size as , and uncountable otherwise. A bijection is a list of , first, second, in which every element appears exactly once and is reached after finitely many steps. Cantor wrote for the size of . Starting at instead changes nothing, since the hotel's shift is a bijection between the two versions.
The integers run off in both directions, so listing them in their usual order has no first term. Alternating works:
Example. Prove that , given by for even and for odd , is a bijection, so that is countable.
The values are integers ( is even when is odd), beginning , , , . Injective: for even , , while for odd , because . So if , then and have the same parity, and either or ; both give . Surjective: let . If , put , an even natural number, and . If , put , which is odd and at least , so , and . Hence is a bijection and .
The surjectivity step also found the inverse: for and for . So sits at position in the list.
Now you. Prove that , given by for even and for odd , is a bijection.
Answer
For even , , and for odd , , a nonzero integer. Injective: forces equal parity, since only even inputs give positive values, and then or gives . Surjective: let . If , then is even and . If , then is odd and at least , and . So is a bijection, listing
Pairs of natural numbers
The set is an infinite grid, with in row and column . Listing row first never reaches row . The way out is to list by diagonals. There are exactly pairs with , from to , so list the diagonal with sum , then sum , and so on, each by increasing first coordinate:
Each pair lies on exactly one diagonal, and each diagonal is finite, so every pair appears once and is reached after finitely many steps.
The position of is a formula. With , the earlier diagonals hold pairs, and is in place on its own, so its position is
This is the Cantor pairing function, shifted so that starts at : a polynomial that is a bijection , because the list visits every pair once and fills every position. It gives , , and , and on the pairs with it returns to , each once. So is countable.
The rationals
Between two rationals lies their average, so cannot be listed in increasing order. It can be listed in another, and the quickest proof uses a theorem that turns two injections into a bijection.
Theorem (Schröder and Bernstein). If there are injections and , then there is a bijection .
So and give . Cantor stated the theorem in 1887 and Felix Bernstein, a student in his seminar, proved it in 1897. The proof is left to a later course.
Example. Prove that is countable.
Every rational has exactly one form in lowest terms with and . With the bijection above, define by , using that form; its uniqueness is what makes a function. If , then , so on applying , and , so the rationals are equal and is injective. Then is a composite of injections, hence an injection, and injects into . By Schröder and Bernstein, .
For instance goes to and then to . Position is skipped, since would stand for , which is not in lowest terms; that is why the theorem is needed.
Now you. Prove that is a bijection , and compute .
Answer
Let from to , and . Since and undo each other in each coordinate, and are identities, so has an inverse and is a bijection. Then is a composite of bijections, hence a bijection, and is countable. With and , .
Cantor's diagonal argument
Georg Cantor showed in 1874 that the reals are not countable, and in 1891 gave the proof now called the diagonal argument. It uses decimal expansions of numbers in , and has one trap.
Some numbers have two expansions: , since the tail is a geometric series with sum . This is the only way it happens. Two different expansions first disagree at some place , and the later digits can make up at most one unit in place , which they do only when one tail is all s and the other all s. So an expansion with no and no is the only expansion of its number. For numbers with two, use the one that does not end in s.
Here is the start of a list of numbers in , with the th digit of the th number in bold:
| expansion | th digit | new digit | ||
|---|---|---|---|---|
| 1 | 0.1415926... | 1 | 5 | |
| 2 | 0.7182818... | 1 | 5 | |
| 3 | 0.4142135... | 4 | 5 | |
| 4 | 0.5000000... | 0 | 5 | |
| 5 | 0.7320508... | 5 | 4 | |
| 6 | 0.6931471... | 7 | 5 |
The new digit is , unless the diagonal digit is , when it is . The number built from them differs from every in place .
Example. Prove that there is no surjection .
Let be any function, and let be the th digit of , using the expansion chosen above. Put if and otherwise, and let . Every digit of is or , so , and . Suppose for some . The expansion of has no or , so it is the only one has, and the chosen expansion of must be it. Then , contradicting the choice of . So is not a value of , and is not surjective.
So , which is plainly not finite, is uncountable. So is : a bijection would inject into , while injects into , and Schröder and Bernstein would make countable. The care over s and s is needed. With the rule "replace each diagonal digit by ", a list that starts with and has every later diagonal digit produces , which is the first number again.
Now you. Let be the set of infinite sequences with every term or . Prove that there is no surjection .
Answer
Let be any function, with . Define by , so each is or and . For every , , so and differ in term and . Hence is not a value of , and is not surjective. No trap arises here, because two sequences are equal only when every term agrees.
Cantor's theorem
The diagonal idea, build an object that disagrees with the th item at the th place, is not about decimals. It works for any set and its power set , the set of all subsets of .
Theorem (Cantor). For every set , .
The map is an injection , since forces . It remains to show that no is surjective. Each is a subset of , which may or may not contain . Collect the elements not in their own image:
This is a subset of . Suppose for some . If , the definition of gives . If , then , which is exactly the condition for . Either way there is a contradiction, so is not surjective, there is no bijection, and .
For a finite set this is . For the diagonal is visible: with as row , the question "is ?" reads down the diagonal, and answers each one the other way. Applied repeatedly, the theorem gives an unending ladder, so there is no largest infinity:
The set should look familiar. Russell's paradox, from the lesson on sets, is the set of all sets that are not members of themselves, and Russell reached it in 1901 by studying this proof: run it on a supposed set of all sets with , and becomes . Inside a genuine set , the same self-reference yields a theorem rather than a paradox.
The continuum hypothesis
Two infinite sizes are now in hand: that of , shared by , and , and the strictly larger size of . In 1878 Cantor asked whether anything lies between: is every infinite set of reals either countable or the same size as ? He believed so, and the claim is the continuum hypothesis, first on Hilbert's list of problems in 1900. Kurt Gödel showed in 1940 that it cannot be disproved from the usual axioms of set theory, and Paul Cohen showed in 1963 that it cannot be proved from them either. The axioms the rest of mathematics runs on do not decide it.
The count does settle a difference between two number systems that look alike. The rationals and the reals are both ordered and closed under the four operations, and between any two rationals lies another. Yet the rationals can be listed and the reals cannot, so something about the reals is missing from the rationals. Nothing so far has said what: counting shows the difference exists without locating it. The next lesson names it, as a property of least upper bounds called completeness.