Sign in

Libre University uses your GitHub account. Signing in is only needed to sit a final test, so the score is kept on your profile.

Counting the infinite

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, ℕ={1,2,3,…} starts at 1.

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 A and B have the same size, written |A|=|B|, when there is a bijection A→B. And |A|≤|B| means there is an injection A→B, which seats every element of A in its own place in B, perhaps with places to spare. Finally |A|<|B| 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 n elements when it is in bijection with {1,2,…,n}. The lesson on functions counted the injections from an m-element set to an n-element set as n(n-1)⋯(n-m+1), which is 0 when m>n. That is the pigeonhole principle: more than n pigeons in n holes put two in some hole. So no set has both m and n elements with m<n, since one bijection followed by the inverse of the other would inject {1,…,n} into {1,…,m}. 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 n-1 elements when the set has n. 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 n to move to room n+1. Everyone still has a room, nobody shares, and room 1 is free.

The move is s:ℕ→ℕ∖{1}, s(n)=n+1, and it is a bijection. It is injective, since m+1=n+1 gives m=n. It is surjective, since each k in ℕ∖{1} has k≥2, so k-1∈ℕ and s(k-1)=k. So |ℕ∖{1}|=|ℕ|, and by Dedekind's definition ℕ is infinite.

When a coach brings a guest for every natural number, moving each guest from room n to room 2n 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 g:ℕ→A is a list of A, g(1) first, g(2) second, in which every element appears exactly once and is reached after finitely many steps. Cantor wrote ℵ0 for the size of ℕ. Starting ℕ at 0 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: 0,1,-1,2,-2,…

Example. Prove that f:ℕ→ℤ, given by f(n)=n2 for even n and f(n)=1-n2 for odd n, is a bijection, so that ℤ is countable.

The values are integers (1-n is even when n is odd), beginning f(1)=0, f(2)=1, f(3)=-1, f(4)=2. Injective: for even n, f(n)=n2≥1, while for odd n, f(n)=1-n2≤0 because n≥1. So if f(m)=f(n), then m and n have the same parity, and either m2=n2 or 1-m2=1-n2; both give m=n. Surjective: let k∈ℤ. If k≥1, put n=2k, an even natural number, and f(n)=k. If k≤0, put n=1-2k, which is odd and at least 1, so n∈ℕ, and f(n)=1-(1-2k)2=k. Hence f is a bijection and |ℤ|=|ℕ|.

The surjectivity step also found the inverse: f-1(k)=2k for k≥1 and f-1(k)=1-2k for k≤0. So -3 sits at position 7 in the list.

Now you. Prove that g:ℕ→ℤ∖{0}, given by g(n)=n2 for even n and g(n)=-n+12 for odd n, is a bijection.

Answer

For even n, g(n)=n2≥1, and for odd n, g(n)=-n+12≤-1, a nonzero integer. Injective: g(m)=g(n) forces equal parity, since only even inputs give positive values, and then m2=n2 or -m+12=-n+12 gives m=n. Surjective: let k≠0. If k≥1, then n=2k is even and g(n)=k. If k≤-1, then n=-2k-1 is odd and at least 1, and g(n)=--2k-1+12=k. So g is a bijection, listing -1,1,-2,2,…

Pairs of natural numbers

The set ℕ×ℕ is an infinite grid, with (m,n) in row m and column n. Listing row 1 first never reaches row 2. The way out is to list by diagonals. There are exactly s-1 pairs with m+n=s, from (1,s-1) to (s-1,1), so list the diagonal with sum 2, then sum 3, and so on, each by increasing first coordinate:

(1,1),(1,2),(2,1),(1,3),(2,2),(3,1),(1,4),…

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 (m,n) is a formula. With s=m+n, the earlier diagonals hold 1+2+⋯+(s-2)=(s-2)(s-1)2 pairs, and (m,n) is in place m on its own, so its position is

p(m,n)=(m+n-2)(m+n-1)2+m

This is the Cantor pairing function, shifted so that ℕ starts at 1: a polynomial that is a bijection ℕ×ℕ→ℕ, because the list visits every pair once and fills every position. It gives p(1,1)=1, p(1,2)=2, p(2,1)=3 and p(3,5)=6⋅72+3=24, and on the 1770 pairs with m+n≤60 it returns 1 to 1770, 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 A→B and B→A, then there is a bijection A→B.

So |A|≤|B| and |B|≤|A| give |A|=|B|. 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 ab in lowest terms with a∈ℤ and b∈ℕ. With f the bijection ℕ→ℤ above, define h:ℚ→ℕ×ℕ by h(ab)=(f-1(a),b), using that form; its uniqueness is what makes h a function. If h(ab)=h(cd), then f-1(a)=f-1(c), so a=c on applying f, and b=d, so the rationals are equal and h is injective. Then p∘h:ℚ→ℕ is a composite of injections, hence an injection, and n↦n injects ℕ into ℚ. By Schröder and Bernstein, |ℚ|=|ℕ|.

For instance -34 goes to (7,4) and then to p(7,4)=9⋅102+7=52. Position p(4,2)=14 is skipped, since (4,2) would stand for 22, which is not in lowest terms; that is why the theorem is needed.

Now you. Prove that F(a,b)=p(f-1(a),f-1(b)) is a bijection ℤ×ℤ→ℕ, and compute F(-1,2).

Answer

Let G(a,b)=(f-1(a),f-1(b)) from ℤ×ℤ to ℕ×ℕ, and H(m,n)=(f(m),f(n)). Since f and f-1 undo each other in each coordinate, H∘G and G∘H are identities, so G has an inverse and is a bijection. Then F=p∘G is a composite of bijections, hence a bijection, and ℤ×ℤ is countable. With f-1(-1)=3 and f-1(2)=4, F(-1,2)=p(3,4)=5⋅62+3=18.

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 (0,1), and has one trap.

Some numbers have two expansions: 0.4999…=0.5, since the tail 0.0999… is a geometric series with sum 9100⋅109=110. This is the only way it happens. Two different expansions first disagree at some place k, and the later digits can make up at most one unit in place k, which they do only when one tail is all 9s and the other all 0s. So an expansion with no 0 and no 9 is the only expansion of its number. For numbers with two, use the one that does not end in 9s.

Here is the start of a list of numbers in (0,1), with the nth digit of the nth number in bold:

nxnexpansionnth digitnew digit
1π-30.1415926...15
2e-20.7182818...15
32-10.4142135...45
4120.5000000...05
53-10.7320508...54
6ln20.6931471...75

The new digit is 5, unless the diagonal digit is 5, when it is 4. The number 0.555545… built from them differs from every xn in place n.

Example. Prove that there is no surjection ℕ→(0,1).

Let g:ℕ→(0,1) be any function, and let dn,k be the kth digit of g(n), using the expansion chosen above. Put cn=4 if dn,n=5 and cn=5 otherwise, and let y=0.c1c2c3…. Every digit of y is 4 or 5, so 49=0.444…≤y≤0.555…=59, and y∈(0,1). Suppose y=g(n) for some n. The expansion of y has no 0 or 9, so it is the only one y has, and the chosen expansion of g(n) must be it. Then dn,n=cn, contradicting the choice of cn. So y is not a value of g, and g is not surjective.

So (0,1), which is plainly not finite, is uncountable. So is ℝ: a bijection ℝ→ℕ would inject (0,1) into ℕ, while n↦1n+1 injects ℕ into (0,1), and Schröder and Bernstein would make (0,1) countable. The care over 0s and 9s is needed. With the rule "replace each diagonal digit d by 9-d", a list that starts with 0.5000… and has every later diagonal digit 0 produces 0.4999…, which is the first number again.

Now you. Let S be the set of infinite sequences (t1,t2,…) with every term 0 or 1. Prove that there is no surjection ℕ→S.

Answer

Let g:ℕ→S be any function, with g(n)=(tn,1,tn,2,…). Define u by un=1-tn,n, so each un is 0 or 1 and u∈S. For every n, un≠tn,n, so u and g(n) differ in term n and u≠g(n). Hence u is not a value of g, and g 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 nth item at the nth place, is not about decimals. It works for any set A and its power set P(A), the set of all subsets of A.

Theorem (Cantor). For every set A, |A|<|P(A)|.

The map a↦{a} is an injection A→P(A), since {a}={a′} forces a=a′. It remains to show that no F:A→P(A) is surjective. Each F(a) is a subset of A, which may or may not contain a. Collect the elements not in their own image:

D={a∈A:a∉F(a)}

This is a subset of A. Suppose D=F(d) for some d∈A. If d∈D, the definition of D gives d∉F(d)=D. If d∉D, then d∉F(d), which is exactly the condition for d∈D. Either way there is a contradiction, so F is not surjective, there is no bijection, and |A|<|P(A)|.

For a finite set this is n<2n. For ℕ the diagonal is visible: with F(n) as row n, the question "is n∈F(n)?" reads down the diagonal, and D answers each one the other way. Applied repeatedly, the theorem gives an unending ladder, so there is no largest infinity:

|ℕ|<|P(ℕ)|<|P(P(ℕ))|<⋯

The set D 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 F(x)=x, and D becomes {x:x∉x}. Inside a genuine set A, 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.