3.6  Cardinal Arithmetic

Section 2.5 counted finite sets, and Section 2.3 proved the laws of powers mn+k=mnmk and (mn)k=mnk by induction (Proposition 2.3.4). For finite sets these numbers count functions: YX has mn elements when Y has m and X has n (Section 1.5, before Example (All functions between two small sets)). This section asks what is left of that arithmetic when the sets are infinite and all we have are bijections.

3.6.1. The plane and the line

A square has two dimensions and a segment has one. Surely the plane R×R has more points than the line? The injection x↦(x,0) gives |R|≤|R×R|, and it seems that the other half of the plane should be left over.

A second question. Is NN, the set of sequences of natural numbers, bigger than R? A real number in [0,1) is only a sequence of digits below 10, while a sequence in NN may use any natural number at every place, so NN looks bigger.

Guess both answers before reading on. The plane is a product, NN is a power, and the line will turn out to be a power too: a power of 2.

3.6.2. Adding sizes: disjoint unions

For finite sets that do not meet, Section 2.5 added sizes by taking the union (Proposition 2.5.5). So define the sum of two sets as their union? With A=B={0} we want two elements, and A∪B={0} has one. The union counts the shared element once. The cure is to tag every element with the name of the set it came from, so that the two copies cannot overlap.

A disjoint union keeps a labeled copy of each set, so nothing is counted twice.

Definition 3.6.1 (Disjoint Union)

Let A and B be sets. Their disjoint union is A⊔B:=(A×{0})∪(B×{1}). The maps ιA:A→A⊔B, ιA(a):=(a,0), and ιB:B→A⊔B, ιB(b):=(b,1), are the inclusions.

In words: every element of A⊔B is (a,0) with a∈A or (b,1) with b∈B, and not both, since (a,0)=(b,1) would give 0=1 by the characteristic property of pairs (Definition 1.4.1). By the same property each inclusion is injective, the two images are disjoint, and together they make up A⊔B. So a function on A⊔B may be defined by giving its values on the two tagged parts separately: these are the two cases that cannot overlap, as in the proof of Proposition 3.1.5.

Example (Two copies of ℕ)

Show that |N⊔N|=|N|.

Solution. This is the merging of two lists from the proof of Proposition 3.1.5, now as a bijection. Let e(n,0):=2n and e(n,1):=2n+1, for n∈N; by the unwinding above this defines e:N⊔N→N. For the decoder, let d(m):=(q,r), where m=2q+r with q∈N and r∈{0,1}; the pair exists and is unique by the claim in that proof, and (q,r)∈N⊔N. Then d(e(n,r))=(n,r) by the uniqueness, and e(d(m))=2q+r=m. By Theorem 1.6.4, e is a bijection.

This is the first encoding of the section: e writes a pair as one number, and d reads it back. The method box comes with the next one.

Quick check.

  • (a) With a≠b, list the elements of {a,b}⊔{a} and of {a,b}∪{a}. (b) What is ∅⊔B? (c) If A∩B=∅, give a bijection A∪B→A⊔B.

Solution.

  • (a) {a,b}⊔{a}={(a,0),(b,0),(a,1)}, three elements; {a,b}∪{a}={a,b}, two. (b) ∅⊔B=B×{1}, since ∅×{0}=∅; and b↦(b,1) is a bijection B→∅⊔B. (c) Send x to (x,0) if x∈A and to (x,1) if x∈B. The cases do not overlap, since A∩B=∅, so this is a function. Its inverse sends (a,0)↦a and (b,1)↦b.

Warning. No subtraction. For numbers, m+k=n+k gives m=n. For sets, |{0}⊔N|=|∅⊔N| although |{0}|≠|∅|: the map sending (0,0)↦0 and (n,1)↦n+1 is a bijection {0}⊔N→N, and (n,1)↦n is a bijection ∅⊔N→N (Exercise B4 (a) has the details). Every law below is proved by a bijection, never borrowed from the numbers.

3.6.3. Multiplying, raising to powers, and comparing

Products A×B (Definition 1.4.2) and sets of functions YX (Section 1.5) are the other two operations. If A has m elements and B has n, then A×B has mn elements and BA has nm, as Exercise C2 of Section 2.5 counts. The base is written on the line and the exponent is the domain: YX is the set of functions from X to Y.

Before any law, we check that the three operations see only sizes.

Proposition 3.6.1 (Sums, Products and Powers Respect Size)

Let A,A′,B,B′ be sets with |A|=|A′| and |B|=|B′|. Then

  • (a) |A⊔B|=|A′⊔B′|;
  • (b) |A×B|=|A′×B′|;
  • (c) |AB|=|A′B′|.

Idea. Carry each element across along the bijections: on each tagged part for (a), on each coordinate for (b), and for (c) by composing a function with the bijections on both sides. The inverses carry everything back.

Proof. Let α:A→A′ and β:B→B′ be bijections, with two-sided inverses α−1 and β−1 (Theorem 1.6.4).

  • (a) Send (a,0)↦(α(a),0) and (b,1)↦(β(b),1); this is a function by the two-part rule after Definition 3.6.1. The same rule with α−1 and β−1 undoes it on each part, so it is a two-sided inverse.

  • (b) Send (a,b)↦(α(a),β(b)). The map (a′,b′)↦(α−1(a′),β−1(b′)) is a two-sided inverse, by Definition 1.4.1.

  • (c) For f∈AB, the composite α∘f∘β−1 is a function B′→A′. Let Θ(f):=α∘f∘β−1 and Λ(g):=α−1∘g∘β for g∈A′B′. By Proposition 1.5.3 and α−1∘α=idA, β−1∘β=idB, Λ(Θ(f))=(α−1∘α)∘f∘(β−1∘β)=f, and Θ(Λ(g))=g in the same way. In each part, Theorem 1.6.4 gives a bijection.

Remark. The proposition lets us replace either set by an equinumerous one without changing the size of the result. An answer computed from representatives must not depend on which representatives we used. Compare “send p/q to p” in Section 1.5 (Example (Relations that are not functions)), which fails exactly this test.

The comparison ≤ of Definition 3.4.1 is respected as well, with one exception.

Proposition 3.6.2 (Monotonicity)

Let A,A′,B,B′ be sets with |A|≤|A′| and |B|≤|B′|. Then

  • (a) |A⊔B|≤|A′⊔B′|;
  • (b) |A×B|≤|A′×B′|;
  • (c) if A′≠∅, then |AB|≤|A′B′|.

Idea. Carry the injections across, as in the previous proof. For powers, a function on B must be extended to all of B′, and the extension needs a value to put on the points that B does not reach.

Proof. Let u:A→A′ and v:B→B′ be injections. (a), (b): the maps of the previous proof with u, v in place of α, β are injective, by Definition 1.4.1.

  • (c) Fix a0∈A′. For f∈AB define F(f):B′→A′ by F(f)(b′):={u(f(b))if b′=v(b) for some b∈B,a0if b′∉v(B). In the first case b is unique, since v is injective, so F(f) is a function. If F(f)=F(g), then for every b∈B, u(f(b))=F(f)(v(b))=F(g)(v(b))=u(g(b)), so f(b)=g(b), since u is injective. Hence f=g (Proposition 1.5.1), and F is an injection AB→A′B′.

A non-example by minimal change. Drop “A′≠∅” from (c), and take A=A′=∅, B=∅, B′={0}. Then |B|≤|B′|, but ∅∅ has one element, the empty function (Proposition 1.5.2), while ∅{0}=∅; there is no injection from a one-element set into ∅. The proof used a0 exactly once, and here there is no a0. (If A′=∅, then A=∅ too, since a function into ∅ has empty domain.)

Quick check. Where does the proof of (c) use that v is injective? Where does it use that u is injective?

Solution. Injectivity of v makes F(f) a function: the point b with v(b)=b′ must be unique. Injectivity of u makes F injective: u(f(b))=u(g(b)) must give f(b)=g(b).

3.6.4. Encoding: the diagonals of ℕ × ℕ

Section 3.1 showed N×N countable by an injection. At the scratch work for Theorem 3.1.6 it set aside the list along the diagonals, because writing a formula for the position of (m,n) and checking that every position is used takes real work. The Quick check before 3.4’s Looking-ahead remark got |N×N|=|N| from Theorem 3.4.3 without ever seeing a bijection. Here is the work, done.

For s∈N, the triangular number τs:=∑i=1si (Definition 2.3.1) has τ0=0 and τs+1=τs+s+1. It counts the points on the diagonals m+n=0,1,…,s−1, which hold 1,2,…,s points.

Example (The diagonal pairing of ℕ × ℕ with ℕ)

Show that π(m,n):=τm+n+n is a bijection N×N→N.

Idea (Scratch work). What must the code record? Which diagonal the point is on, s=m+n, and its place on that diagonal, n∈{0,…,s}; from s and n we read back m=s−n. The diagonals before diagonal s hold 1+2+⋯+s=τs points, so the code counts them and adds the place. Small values: diagonal 0 gives 0; diagonal 1 gives 1,2; diagonal 2 gives 3,4,5. The decoder must find, for each k, the diagonal it falls on.

Givens Goal
(m,n)∈N×N π(m,n)∈N
k∈N exactly one (m,n) with τm+n+n=k
gap every k∈N is τs+n with s,n∈N, n≤s, in exactly one way

Existence by induction on k: stepping from k to k+1 moves one place along the diagonal, or, at its end, to the start of the next one. Uniqueness: diagonal s fills the block τs,…,τs+s, just below τs+1, so different diagonals give different numbers.

Solution.

Claim. For every k∈N there are s,n∈N with n≤s and k=τs+n, and the pair (s,n) is unique.

Proof. Existence, by Theorem 2.2.1 from 0. First, 0=τ0+0. Suppose k=τs+n with n≤s. If n<s, then k+1=τs+(n+1) with n+1≤s. If n=s, then k+1=τs+s+1=τs+1+0.

Uniqueness. First, τj+1=τj+j+1>τj for every j, so if s<s′, then τs+1≤τs′, by Theorem 2.2.1 on s′ from s+1. Now let τs+n=τs′+n′ with n≤s and n′≤s′, and suppose s≠s′; by symmetry s<s′. Then τs+n≤τs+s<τs+1≤τs′≤τs′+n′, a contradiction. So s=s′, and then n=n′.

The bijection. π(m,n)∈N, since τm+n∈N, by Theorem 2.2.1 on s from τ0=0 and τs+1=τs+s+1 with Lemma 2.1.1 (b). For k∈N, write k=τs+n by the claim and set δ(k):=(s−n,n), where s−n∈N because n≤s (Lemma 2.1.1 (d)); the uniqueness in the claim makes δ a function. Then π(δ(k))=τ(s−n)+n+n=τs+n=k. And δ(π(m,n))=(m,n), by the uniqueness applied to k=τm+n+n, where s=m+n≥n. By Theorem 1.6.4, π is a bijection.

A table of the first values: π(0,0)=0, π(1,0)=1, π(0,1)=2, π(2,0)=3, π(1,1)=4, π(0,2)=5. Decoding 11: τ4=10≤11<15=τ5, so 11=τ4+1 and δ(11)=(3,1).

Example (Method: build a bijection by encoding and decoding)

Template. (1) Say what an element of the source must record for nothing to be lost. (2) Choose a code: a rule sending each element to an element of the target, and check that it lands there. (3) Write the decoder: a rule reading an element of the source back from each element of the target, and check that it is a function, with exactly one answer for each input. (4) Check both round trips and cite Theorem 1.6.4.

When to use it. The two sets carry the same information arranged differently: two numbers in one, a pair of sequences in one sequence, a function of two variables as a function with function values.

The usual failure. Checking one round trip only: δ∘π=id alone shows only that π is injective (Theorem 1.6.1). A decoder that is not a function, with two readings of one code or none (the interleaving of decimals, later in this section). If the decoder works on part of the target only, keep the injection and use Example (Method: injections both ways).

Warning. An injective code is not yet a bijection. The code 2m3n of Theorem 3.1.6 is injective, but 5 is not a value, and no decoder is defined at 5. Step (3) of the method, a decoder defined on the whole target, is what makes π a bijection.

Quick check. Compute π(3,2) and δ(47).

Solution. π(3,2)=τ5+2=15+2=17. For 47: τ9=45≤47<55=τ10, so 47=τ9+2, and δ(47)=(9−2,2)=(7,2). Check: π(7,2)=τ9+2=47.

3.6.5. The laws of exponents, for all sets

For numbers, mn+k=mnmk and (mn)k=mnk. Read through the sets these numbers count, each law says that two sets of functions are the same size, and for sets we must find the bijection.

Theorem 3.6.3 (Laws of Cardinal Arithmetic)

For all sets A,B,C,X,Y,Z:

  • (a) |A⊔B|=|B⊔A|, |(A⊔B)⊔C|=|A⊔(B⊔C)|, |A×B|=|B×A| and |(A×B)×C|=|A×(B×C)|;
  • (b) |A×(B⊔C)|=|(A×B)⊔(A×C)|;
  • (c) X∅ has exactly one element, and |X{0}|=|X|;
  • (d) |XY⊔Z|=|XY×XZ|;
  • (e) |(X×Y)Z|=|XZ×YZ|;
  • (f) |(XY)Z|=|XY×Z|.

Idea (Scratch work). For (d): what is an element of each side? On the left, a function h defined on the tagged copies of Y and Z. On the right, a pair (f,g) with f:Y→X and g:Z→X. A function on two disjoint pieces is the same thing as a function on each piece. So cut h into its two pieces by composing with the inclusions, and glue a pair back together piece by piece.

Givens Goal
h∈XY⊔Z an element of XY×XZ: (h∘ιY,h∘ιZ)
(f,g)∈XY×XZ one h with h∘ιY=f and h∘ιZ=g
gap h(y,0):=f(y), h(z,1):=g(z) is a function: the parts do not overlap (after Definition 3.6.1)

Proof.

  • (d) Let Φ(h):=(h∘ιY,h∘ιZ) for h∈XY⊔Z. For (f,g)∈XY×XZ, let Ψ(f,g) be the function h:Y⊔Z→X with h(y,0):=f(y),h(z,1):=g(z)(y∈Y, z∈Z). This is a function, because every element of Y⊔Z has exactly one of the two forms. Then Φ(Ψ(f,g))=(f,g): for y∈Y, h(ιY(y))=h(y,0)=f(y), so h∘ιY=f by Proposition 1.5.1, and likewise h∘ιZ=g; the pairs are equal by Definition 1.4.1. And Ψ(Φ(h))=h: the two functions agree at every (y,0) and every (z,1), which are all the points of Y⊔Z, so they are equal by Proposition 1.5.1. By Theorem 1.6.4, Φ is a bijection.

  • (e) For g∈(XY)Z, each g(z) is a function Y→X. Let Φ(g):Y×Z→X, Φ(g)(y,z):=g(z)(y). For h∈XY×Z and z∈Z, the rule y↦h(y,z) is an element of XY; let Ψ(h):Z→XY send z to it. Then Φ(Ψ(h))(y,z)=Ψ(h)(z)(y)=h(y,z) for all (y,z), so Φ(Ψ(h))=h. And Ψ(Φ(g))(z) is the function y↦g(z)(y), which is g(z); so Ψ(Φ(g))=g. Here Proposition 1.5.1 is used twice: first for functions on Y, then for functions on Z. By Theorem 1.6.4, Φ is a bijection.

The remaining parts are proved by the same kind of regrouping; the maps are in the fold below.

Second readingThe other laws

Each map below has the stated inverse, and each round trip is one line of Proposition 1.5.1 and Definition 1.4.1. As a sample, the associativity of ⊔ has three cases, one for each form of element; on ((b,1),0) the map gives ((b,0),1), and the inverse, reading the tag 1 outside and the tag 0 inside, returns ((b,1),0).

  • (a) A⊔B→B⊔A: (a,0)↦(a,1), (b,1)↦(b,0); it is its own inverse, with the roles of A and B exchanged. (A⊔B)⊔C→A⊔(B⊔C): ((a,0),0)↦(a,0), ((b,1),0)↦((b,0),1), (c,1)↦((c,1),1); the three forms of the source do not overlap, and the inverse reads the three forms of the target back. A×B→B×A: (a,b)↦(b,a). (A×B)×C→A×(B×C): ((a,b),c)↦(a,(b,c)), with inverse (a,(b,c))↦((a,b),c).

  • (b) A×(B⊔C)→(A×B)⊔(A×C): (a,(b,0))↦((a,b),0) and (a,(c,1))↦((a,c),1); the inverse moves the tag back inside.

  • (c) X∅={(∅,X)}, the empty function, by Proposition 1.5.2 (a). The map f↦f(0) is a bijection X{0}→X, with inverse sending x to the function 0↦x.

  • (d) Let p1(x,y):=x and p2(x,y):=y on X×Y. The map h↦(p1∘h,p2∘h) from (X×Y)Z to XZ×YZ has the inverse (f,g)↦(z↦(f(z),g(z))).

Law (f) is called currying: a function of two variables becomes a function whose values are functions. For finite sets with m, n and k elements, the theorem gives back mn+k=mnmk and (mn)k=mnk with no induction in sight; the induction has moved into the counting of Section 2.5. Nothing in the proof used finiteness.

Example (Method: prove a law of sizes by a bijection of sets)

Template. (1) Write out what an element of each side is: a tagged element, a pair, a function, a function with function values. (2) Find the map that only regroups: compose with the inclusions, pair the coordinates, or curry. (3) Write the reverse regrouping. (4) Check both round trips with Proposition 1.5.1 and Definition 1.4.1, and cite Theorem 1.6.4.

When to use it. A law familiar from numbers, such as mn+k=mnmk, is claimed for sets of any size; or a size is to be computed by rewriting a set step by step.

The usual failure. Computing with symbols, as in “|X||Y|+|Z|=|X||Y||X||Z|”, when no number |X| exists and the step is the law itself: (N9) of Logic and Proof, Example (What is not allowed). Dropping the tags: with ∪ in place of ⊔ the law fails: for X={0,1} and Y=Z={0}, XY∪Z has 2 elements and XY×XZ has 4 (Exercise B4 (b)).

Quick check. Let X={0,1}, Y={a} and Z={b,c}. How many elements has each side of (d)? Let h(a,0)=1, h(b,1)=0, h(c,1)=1. What is Φ(h)?

Solution. Y⊔Z={(a,0),(b,1),(c,1)} has three elements, and a function from it to {0,1} is fixed by three values, each 0 or 1: 2⋅2⋅2=8 functions. On the right, XY has 2 elements and XZ has 4, so the product has 2⋅4=8. And Φ(h)=(f,g) with f(a)=1, g(b)=0, g(c)=1.

3.6.6. Subsets are 0–1 functions

Section 1.5 stated, for every set, that subsets and 0–1 functions match, and gave both maps: send f to {x:f(x)=1} and A to 1A. Here are the two round trips, which make 2 a base like any other.

Theorem 3.6.4 (Subsets and 0–1 Functions)

For every set X, the map A↦1A is a bijection P(X)→{0,1}X, with inverse f↦{x∈X:f(x)=1}. In particular |P(X)|=|{0,1}X|.

Proof. For A⊆X, 1A∈{0,1}X (Example (First functions) (d)), and {x∈X:1A(x)=1}=A by the definition of 1A. For f∈{0,1}X, let S:={x∈X:f(x)=1}. For x∈S, 1S(x)=1=f(x). For x∈X∖S, f(x)≠1, so f(x)=0=1S(x). So 1S=f (Proposition 1.5.1). By Theorem 1.6.4, A↦1A is a bijection.

Section 2.5 (the fold after Proposition 2.5.8), Section 3.3 (after Corollary 3.3.3) and Section 3.4 (the Quick check after Proposition 3.4.2) quoted this correspondence; it is now a theorem to cite.

Corollary 3.6.5 (No Set Is the Size of Its 0–1 Functions)

For every set X, |X|<|{0,1}X|.

Idea. One injection is easy; for strictness, move a bijection over to P(X) with the theorem just proved, where Cantor’s theorem forbids it.

Proof. The map x↦1{x} is injective, since 1{x} takes the value 1 at x only; so |X|≤|{0,1}X|. A bijection X→{0,1}X, followed by the inverse of the bijection of Theorem 3.6.4, would be a bijection X→P(X) (Theorem 1.5.4 (c)), in particular a surjection, against Theorem 3.3.2.

So N, {0,1}N, {0,1}{0,1}N, … grow strictly at each step, and there is no largest size.

3.6.7. No set of all sets, once more

Section 3.3 (consequence (i) after Theorem 3.3.2) saw that Russell’s argument is Cantor’s, with the rule f(x)=x and RA in the role of D. What is new here is a proof by sizes of the last clause of Theorem 1.2.4: there is no set of which every set is an element.

Suppose U were such a set. Every subset of U is a set, hence an element of U, so P(U)⊆U. Define f:U→P(U) by f(u):=u if u∈P(U), and f(u):=∅ otherwise. It is onto: each S∈P(U) lies in U, and f(S)=S. This contradicts Theorem 3.3.2.

Cantor’s set for this f, D={u∈U:u∉f(u)}, agrees with RU={u∈U:u∉u} on P(U), and contains every u∈U∖P(U), since u∉∅. The unrestricted collection {x:x∉x} is never formed.

3.6.8. The size of the line

The hook asked about R×R; first R itself. A real number in [0,1) is a digit sequence, a function Z>0→{0,…,9}. So R should be a power, and that power should be a power of 2.

Theorem 3.6.6 (The Line Is a Power of Two)

|R|=|{0,1}N|=|P(N)|.

Idea. Injections both ways (Example (Method: injections both ways)). Into the 0–1 sequences, the digits are encoded and the laws do the bookkeeping. Out of them, a 0–1 sequence is read as decimal digits 0 and 1, which contain no 9.

Proof. Let T:={0,1,…,9} and W:=TZ>0, the set of digit sequences (Definition 3.3.1).

|[0,1)|≤|W|. This is the step of the proof of Theorem 3.3.4. Send x to its expansion not ending in all 9s: one exists by (D1), and only one by (D3), so the rule is a function and no choice is made. It is injective, since a digit sequence is an expansion of only one number, by (D2).

|W|≤|{0,1}N|. The map n↦n+1 is a bijection N→Z>0 (inverse m↦m−1, Lemma 2.1.1 (c)), so |W|=|TN| (Proposition 3.6.1 (c)). The map j↦1{j} injects T into {0,1}T, so |TN|≤|({0,1}T)N| (Proposition 3.6.2 (c), as {0,1}T≠∅), and this is |{0,1}T×N| by Theorem 3.6.3 (f). A pair (j,n) is recorded by one number, by the method of Example (Method: build a bijection by encoding and decoding): the code (j,n)↦10n+j is a bijection T×N→N, whose decoder takes quotient and remainder on division by 10 (Theorem 2.2.3, with the quotient in N as in the claim in the proof of Proposition 3.1.5). So |{0,1}T×N|=|{0,1}N| (Proposition 3.6.1 (c)). Composing the maps gives an injection W→{0,1}N (Theorem 1.5.4 (a)).

|{0,1}N|≤|[0,1)|. For b∈{0,1}N, let ck+1:=b(k) for k∈N: a digit sequence with digits 0 and 1 only. By (D2) it is an expansion of exactly one yb∈[0,1], and yb≤t1+110≤210 by Definition 3.3.1 at n=1, so yb∈[0,1). If b≠b′, the two digit sequences differ. If also yb=yb′, they would be two different expansions of one number, and by (D3) one of them would end in all 9s; but neither contains a 9. So yb≠yb′, and b↦yb is injective.

Conclusion. By Proposition 3.4.1 (b) and Theorem 3.4.3, |[0,1)|=|{0,1}N|. By Example (The real line and its intervals), |[0,1)|=|R|, and by Theorem 3.6.4, |{0,1}N|=|P(N)|. Chaining with Proposition 2.5.1 proves the theorem.

The first step is the one of Exercise C1 of Section 3.4. What is new is the middle step, where the laws reduce the bookkeeping to the one-line code (j,n)↦10n+j in place of the set E(x) of that exercise, and the last, where the digits 0 and 1 suffice because (D3) needs only that no 9 appears. Neither step needed binary expansions of real numbers.

Remark (Notation in other books). Many books treat sizes as objects, called cardinal numbers, and write ℵ0 for the size of N and 2ℵ0, or c, for the size of R. Making a size into an object needs more set theory than this book uses (Section 2.5, the fold after Proposition 2.5.1). Here “|A|=2ℵ0” can be read only as shorthand for |A|=|{0,1}N|. Whether some subset of R is strictly bigger than N and strictly smaller than R is the continuum hypothesis; it is known to be neither provable nor refutable from the usual axioms of set theory, if those axioms are consistent.

Quick check. Which step of the proof of Theorem 3.6.6 uses the axiom of choice?

Solution. None. The expansion of x is picked by a rule (“the one not ending in all 9s”), every other map is a formula, and Theorem 3.4.3 was proved without choice (Section 3.4).

3.6.9. Back to the plane

Example (Interleaving digits)

The natural map [0,1)×[0,1)→[0,1) interleaves digits. If x=0.a1a2… and y=0.b1b2…, with the expansions not ending in all 9s, let F(x,y):=0.a1b1a2b2…; the inverse splits the digits of z into the odd and the even places. Is F a bijection?

Solution. F is a function into [0,1). The expansions of x and y are fixed by the rule, as in the last proof. Let c be the interleaved sequence: c2k−1:=ak, c2k:=bk. It has infinitely many places that are not 9 (those of a), so it does not end in all 9s, and by (D2) it is an expansion of exactly one z∈[0,1]. To see z<1, let n be the first place with cn≤8 (Theorem 2.1.3). Every earlier digit is 9, so by Proposition 2.3.6 tn≤(1−10−(n−1))+8⋅10−n=1−2⋅10−n, and z≤tn+10−n≤1−10−n<1.

F is injective. If F(x,y)=F(x′,y′)=z, both interleaved sequences are expansions of z and neither ends in all 9s, so by (D3) they are equal. Then a=a′ and b=b′, and x=x′, y=y′ by (D2).

F is not onto. Take z=111=0.090909…. The truncations at even places are t2j=999(1−100−j)=111−111100−j (Proposition 2.3.6 with r=1100), and the inequalities of Definition 3.3.1 hold at every place. This expansion has no tail of 0s and no tail of 9s, so by (D3) it is the only expansion of 111. A preimage (x,y) would need b=9,9,9,…; but b was the expansion of y not ending in all 9s.

The splitting “inverse” named “the y∈[0,1) whose expansion is 999…” without checking that such a y exists: that is (N14) of Logic and Proof, Example (What is not allowed). So the direct route gives an injection and no bijection. The injection is enough (Example (Method: injections both ways)), and the laws give a bijection with no digit-fiddling.

Theorem 3.6.7 (The Plane Is the Size of the Line)

|R×R|=|R|.

Idea. By the method of Example (Method: prove a law of sizes by a bijection of sets): replace R by {0,1}N and rewrite the plane step by step.

Proof. By Theorem 3.6.6 and Proposition 3.6.1 (b), |R×R|=|{0,1}N×{0,1}N|. By Theorem 3.6.3 (d), this is |{0,1}N⊔N|. By Example (Two copies of ℕ) and Proposition 3.6.1 (c), this is |{0,1}N|, which is |R| by Theorem 3.6.6. Chaining with Proposition 2.5.1 proves the theorem.

Read through the maps, the composite on 0–1 sequences sends (a,b) to the sequence with a(n) at place 2n and b(n) at place 2n+1: the interleaving of Exercise B3 of Section 3.4. The trouble with decimals has gone because 0–1 sequences, unlike numbers, have no double expansions. That price is paid once, in the proof of Theorem 3.6.6.

Theorem 3.6.8 (Sequences of Natural Numbers)

|NN|=|R|.

Idea. By the method of Example (Method: prove a law of sizes by a bijection of sets), with injections both ways: a 0–1 sequence is already a sequence of natural numbers, and a natural number is recorded by a 0–1 sequence.

Proof. Send b∈{0,1}N to the same rule with codomain N. This map is injective: two sequences with the same image have the same value at every point, so they are equal (Proposition 1.5.1). In the other direction, n↦1{n} is an injection N→{0,1}N, so |NN|≤|({0,1}N)N| (Proposition 3.6.2 (c), as {0,1}N≠∅). This is |{0,1}N×N| (Theorem 3.6.3 (f)), and that is |{0,1}N| by Example (The diagonal pairing of ℕ × ℕ with ℕ) and Proposition 3.6.1 (c). By Proposition 3.4.1 (b) and Theorem 3.4.3, |NN|=|{0,1}N|, which is |R| by Theorem 3.6.6.

Exercise B4 (d) of Section 3.4 reached the equality |NN|=|{0,1}N| through graphs and P(N×N).

Corollary 3.6.9 (Sequences of Real Numbers)

|RN|=|R|.

Proof. In one chain, |RN|=|({0,1}N)N|=|{0,1}N×N|=|{0,1}N|=|R|, by Proposition 3.6.1 (c) with Theorem 3.6.6, then Theorem 3.6.3 (f), then Example (The diagonal pairing of ℕ × ℕ with ℕ) with Proposition 3.6.1 (c), and Theorem 3.6.6 again, chained by Proposition 2.5.1. No further appeal to Theorem 3.4.3 is needed beyond the one inside Theorem 3.6.6.

So both guesses of the hook were wrong. The plane is no bigger than the line, and NN is no bigger either. For every infinite set X it is in fact true that |X×X|=|X| and |X⊔X|=|X|; in general these cannot be proved without the axiom of choice (the first is equivalent to it), and this book does not prove them.

Quick check. Show that |RN×R|=|R|.

Solution. By Corollary 3.6.9 and Proposition 3.6.1 (b), |RN×R|=|R×R|, which is |R| by Theorem 3.6.7; chain with Proposition 2.5.1.

Remark (Looking ahead). Respecting size, Proposition 3.6.1, is an instance of a requirement that Section 4.2 names: a rule stated through representatives must give the same answer for all of them. There it is called well-definedness, and it is what makes functions on quotient sets possible.

3.6.10. Exercises

A. Check your understanding

Exercise (A1)
  • (a) True or false, for every set A: |∅⊔A|=|A|; ∅×A=∅; A∅ has exactly one element; ∅A=∅.
  • (b) Under the bijection of Theorem 3.6.3 (f) with X=Y={0,1} and Z={0}, which element of (XY)Z corresponds to h(y,z):=y?
  • (c) Give an injection R⊔N→R.
  • (d) The proof of Theorem 3.6.6 reads a 0–1 sequence as decimal digits 0 and 1. Which other pairs of digits give an injection into [0,1) in the same way? Why does the pair 0 and 9 not follow from (D3) alone?

Solution.

  • (a) True: ∅⊔A=A×{1}, and (a,1)↦a is a bijection onto A. True: no pair has a first coordinate in ∅. True, by Proposition 1.5.2 (a). False: for A=∅, ∅∅ has one element, the empty function; the claim holds for every non-empty A, by Proposition 1.5.2 (b).

  • (b) The g with g(0)=id{0,1}, since g(0)(y)=h(y,0)=y for both y∈{0,1}.

  • (c) Send (x,0)↦x/(1+|x|), which lies in (−1,1) (Example (The real line and its intervals)), and (n,1)↦n+1≥1. Each part is injective (the first is a bijection onto (−1,1), the second cancels the 1), and the values of the two parts are disjoint, so the map is injective.

  • (d) Any pair that misses 9 works unchanged: a sequence with no 9s cannot end in all 9s, so (D3) rules out two different expansions of one number, and the first digit is at most 8, so yb≤810+110<1. Any pair that misses 0 gives an injection too, since a sequence with no 0s cannot end in all 0s; but if the pair contains 9, the sequence of all 9s goes to 1, so the target must be widened to [0,1], which Example (The real line and its intervals) also covers. (The digits 1 and 2, used in Exercise C1 of Section 3.4, miss both.) With the digits 0 and 9, one sequence could end in all 9s and another in all 0s, which is exactly the situation (D3) allows; so (D3) alone does not decide whether b↦yb is injective, and a further computation at the first differing place would be needed.

B. Practice

Exercise (B1: Encodings)

Prove each equality by an explicit bijection and its inverse.

Solution.

  • (a) Send (n,r)↦3n+r. The inverse sends m to (q,r), the quotient and remainder of m on division by 3 (Theorem 2.2.3, with q∈N as in the claim in the proof of Proposition 3.1.5). Both round trips follow from the uniqueness in the division algorithm.

  • (b) For c∈{0,1}N let Φ(c)(n):=2c(2n)+c(2n+1)∈{0,1,2,3}. For the inverse, given d∈{0,1,2,3}N, write d(n)=2qn+rn with qn,rn∈{0,1} (division by 2, unique), and set c(2n):=qn, c(2n+1):=rn. This defines c on all of N, since each m∈N is 2n or 2n+1 for exactly one n. The round trips follow from the two uniqueness statements and Proposition 1.5.1.

  • (c) Let E(m,n,k):=π(π(m,n),k). The decoder sends k′ to (m,n,k), where δ(k′)=(j,k) and δ(j)=(m,n). The round trips follow from δ∘π=id and π∘δ=id, each used twice, together with the characteristic property of triples (the paragraph after the proof of Corollary 3.1.7). For example, E(1,0,1)=π(π(1,0),1)=π(1,1)=4.

Exercise (B2: More laws)

By the method of Example (Method: prove a law of sizes by a bijection of sets), prove for all sets A,B,X:

  • (a) |P(A⊔B)|=|P(A)×P(B)|;
  • (b) |X{0,1}|=|X×X|.

Solution.

  • (a) Directly: send S↦({a∈A:(a,0)∈S},{b∈B:(b,1)∈S}), with inverse (S1,S2)↦(S1×{0})∪(S2×{1}). The round trips hold because every element of A⊔B is (a,0) or (b,1), and not both (after Definition 3.6.1). Or by laws: |P(A⊔B)|=|{0,1}A⊔B| by Theorem 3.6.4, which is |{0,1}A×{0,1}B| by Theorem 3.6.3 (d), which is |P(A)×P(B)| by Theorem 3.6.4 twice with Proposition 3.6.1 (b).

  • (b) Send f↦(f(0),f(1)), with inverse sending (x,x′) to the function 0↦x, 1↦x′. Or from (c) and (d) of Theorem 3.6.3, since {0,1} is the same size as {0}⊔{0}, by 0↦(0,0), 1↦(0,1).

Exercise (B3: Sets the size of the line, used later)

Prove:

  • (a) |N×R|=|R|;
  • (b) |R⊔R|=|R|;
  • (c) |Rk|=|R| for every integer k≥2.

Solution.

  • (a) x↦(0,x) injects R into N×R. In the other direction, N×R⊆R×R, so the inclusion followed by a bijection R×R→R (Theorem 3.6.7) is an injection N×R→R. Apply Theorem 3.4.3.

  • (b) Unwinding Definition 3.6.1, R⊔R=(R×{0})∪(R×{1})=R×{0,1}, a subset of R×R; so it injects into R as in (a). And x↦(x,0) injects R into R⊔R. Apply Theorem 3.4.3.

  • (c) By Theorem 2.2.1 with n0=2. The base case k=2 is Theorem 3.6.7. Step: the map ((x1,…,xk),xk+1)↦(x1,…,xk+1) is a bijection Rk×R→Rk+1, by the characteristic property of tuples (the paragraph after the proof of Corollary 3.1.7). So |Rk+1|=|Rk×R|=|R×R|=|R|, by the hypothesis with Proposition 3.6.1 (b), then Theorem 3.6.7, chained by Proposition 2.5.1. (The book has no 1-tuples and defines Xk for k≥2 only, so the induction starts at 2.)

Exercise (B4: Prove or disprove)

Prove each true statement and refute each false one with a counterexample. Here A,B,C,X,Y,Y′,Z are sets.

  • (a) If |A⊔C|=|B⊔C|, then |A|=|B|.
  • (b) |XY∪Z|=|XY×XZ|.
  • (c) If |Y|≤|Y′|, then |XY|≤|XY′|.
  • (d) |N{0,1}|=|{0,1}N|.
  • (e) If |A|<|B| and C≠∅, then |A×C|<|B×C|.
  • (f) There is a set X with |{0,1}X|≤|X|.

Solution.

  • (a) False. Take A={0}, B=∅, C=N. The map (0,0)↦0, (n,1)↦n+1 is a bijection {0}⊔N→N, with inverse 0↦(0,0) and m↦(m−1,1) for m≥1 (Lemma 2.1.1 (c)). And (n,1)↦n is a bijection ∅⊔N=N×{1}→N. So both sides are the size of N, while |{0}|≠|∅|.

  • (b) False. Take X={0,1} and Y=Z={0}. Then Y∪Z={0}, and XY∪Z has 2 elements, while XY×XZ has 2⋅2=4. Finite sets with different numbers of elements are not equinumerous (Corollary 2.5.4). The statement is true when Y∩Z=∅, by Quick check 1 (c) with Proposition 3.6.1 (c), and Theorem 3.6.3 (d).

  • (c) False. Take X=∅, Y=∅, Y′={0}: this is the non-example after Proposition 3.6.2. It is true when X≠∅, by Proposition 3.6.2 (c).

  • (d) False. The map f↦(f(0),f(1)) is a bijection N{0,1}→N×N, with inverse sending (m,n) to the function 0↦m, 1↦n. Since N×N is countable (Theorem 3.1.6), there is an injection N×N→N (Theorem 3.1.2), and so an injection N{0,1}→N (Theorem 1.5.4 (a)). If N{0,1} were the same size as {0,1}N, composing would inject {0,1}N into N, making it countable (Theorem 3.1.2), against Theorem 3.3.1. Base and exponent do not commute.

  • (e) False. Take A={0}, B={0,1}, C=N; then |A|<|B| (Corollary 2.5.4 for “no bijection”). But |{0}×N|=|N|, by (0,n)↦n, and |{0,1}×N|=|N|: the map (r,n)↦(n,r) is a bijection {0,1}×N→N⊔N, and Example (Two copies of ℕ) finishes.

  • (f) False. For every X, x↦1{x} gives |X|≤|{0,1}X|, so |{0,1}X|≤|X| would give |X|=|{0,1}X| by Theorem 3.4.3, against Corollary 3.6.5.

C. Going deeper

Exercise (C1: Functions from the line to the line)

Prove that |RR|=|P(R)|. Deduce that there is no surjection R→RR.

Solution (Hint 1). Replace the base R by {0,1}N, then curry.

Solution (Hint 2). You will need |N×R|=|R|.

Solution. Let β:R→{0,1}N be a bijection (Theorem 3.6.6). Then |RR|=|({0,1}N)R|=|{0,1}N×R|=|{0,1}R|=|P(R)|, by Proposition 3.6.1 (c) with β and idR; then Theorem 3.6.3 (f) with Y=N, Z=R; then Exercise (B3: Sets the size of the line, used later) (a) with Proposition 3.6.1 (c), now in the exponent; then Theorem 3.6.4; chained by Proposition 2.5.1.

For the second part, let Θ:RR→P(R) be a bijection. If s:R→RR were onto, then Θ∘s:R→P(R) would be onto (Theorem 1.5.4 (b)), against Theorem 3.3.2. Since x↦cx, where cx(t):=x for all t, is an injection R→RR (evaluate at 0), and a bijection would be a surjection, |R|<|RR| (Definition 3.4.1): there are more functions R→R than real numbers.

Marking scheme. (10 points) - 2: replaces the base R by {0,1}N, citing the bijection and Proposition 3.6.1 (c). - 3: applies currying in the right direction: (XY)Z with Y=N, Z=R, to reach {0,1}N×R. - 2: uses |N×R|=|R| together with respecting size in the exponent. - 1: passes from {0,1}R to P(R). - 2: rules out a surjection by composing with the bijection and citing Theorem 3.3.2. Any other complete route (for example graphs into P(R×R), an injection P(R)→RR and Theorem 3.4.3) earns the 8 points of the first part, split between the two injections. Fatal errors (0 for the step): computing with symbols as if sizes were numbers (“cc=2ℵ0c”) with no bijection behind each step.

Exercise (C2: Find the error)

Claim: {0,1}N is countable.

Proof. Send b to the natural number N(b):=∑kb(k)2k. Different sequences have different binary digits, so N is injective, and an injection into N makes a set countable (Theorem 3.1.2).

Is the conclusion true? Where does the argument fail? What does it prove?

Solution. The conclusion is false: {0,1}N is uncountable (Theorem 3.3.1).

The error is in the first line. N(b) is named before it is shown to exist: (N14) of Logic and Proof, Example (What is not allowed). The sum is infinite whenever b has infinitely many 1s, and Section 2.3 defines only finite sums (Definition 2.3.1); no natural number is “1+2+4+⋯”. The all-1 sequence is a witness: it has no value under N.

What survives. On the sequences that are eventually 0, the sum is finite (∑k<Kb(k)2k for any K past the last 1), and N is defined there. It is injective once the uniqueness of binary digits is proved, which Exercise R1 below does not do (R1 gives existence only). The countability of that set follows anyway, with no binary digits: changing the codomain from {0,1} to N injects it into the set of eventually zero functions N→N of Exercise (R4), at the end of this section, which is countable; compose with an injection of that set into N (Theorem 3.1.2, Theorem 1.5.4 (a)).

Marking scheme. (10 points) - 2: says the conclusion is false, citing Theorem 3.3.1. - 3: names the failing step, an infinite sum named as a natural number, with (N14). - 2: gives a witness, such as the all-1 sequence. - 2: says what the argument does prove: the eventually zero sequences form a countable set. - 1: flags that the injectivity of N on them needs the uniqueness of binary digits, which is not proved. Fatal errors (0 for the step): calling the conclusion true; locating the error in “an injection into N makes a set countable”, which is correct.

Exercise (C3: Rearrangements of ℕ)

Let B be the set of bijections N→N. Exercise C2 of Section 3.3 showed that B is uncountable. Prove that it has exactly the size of R: |B|=|R|.

Solution. Up. Every bijection N→N is a function N→N, so B⊆NN, and the inclusion followed by a bijection NN→R (Theorem 3.6.8) is an injection B→R.

Down. For b∈{0,1}N, let σb:N→N swap 2n and 2n+1 when b(n)=1, and fix them when b(n)=0; this is a function, since each m∈N is 2n or 2n+1 for exactly one n. It is its own inverse, so σb∈B (Theorem 1.6.4). The map b↦σb is injective, since b(n)=1 exactly when σb(2n)=2n+1. This is the construction of Exercise (C2: Permutations of the naturals).

Composing the Up injection with a bijection R→{0,1}N (Theorem 3.6.6) gives |B|≤|{0,1}N| (Proposition 3.4.1 (b)); by Theorem 3.4.3, |B|=|{0,1}N|, and this is |R| by Theorem 3.6.6.

Marking scheme. (10 points) - 3: shows |B|≤|R|, through B⊆NN and Theorem 3.6.8. - 3: defines σb and shows that it is a bijection of N. - 2: shows that b↦σb is injective, by reading b(n) off σb(2n). - 2: concludes by Theorem 3.4.3 and Theorem 3.6.6. Fatal errors (0 for the step): concluding |B|=|R| from “B is uncountable and B⊆NN” alone, with no injection from a set the size of R into B.

R. Review

Exercise (R1)

Prove that every integer n≥1 is a sum of distinct powers of 2: there are an integer r≥1 and natural numbers k1>k2>⋯>kr with n=2k1+2k2+⋯+2kr.

Solution. We use Theorem 2.2.2 with n0=1. Let n≥1, and suppose every integer m with 1≤m<n is such a sum.

The largest power of 2 not above n. The set T:={k∈N:2k>n} is non-empty, since 2n≥1+n>n by Theorem 2.3.7 with x=1. By Theorem 2.1.3 it has a least element m (the method of Example (Method: the least element)). Since 20=1≤n, 0∉T, so m≥1, and K:=m−1∈N (Lemma 2.1.1 (c)). As K<m, K∉T; so 2K≤n<2K+1. The step. Let s:=n−2K, so 0≤s<2K+1−2K=2K. If s=0, then n=2K, a sum with r=1. If s≥1, then s<n, because 2K≥1. By the hypothesis, s=2k1+⋯+2kr with k1>⋯>kr. Each 2ki≤s<2K, so ki<K (if ki≥K, then 2ki≥2K by Proposition 2.3.4 (e)). Hence n=2K+2k1+⋯+2kr,K>k1>⋯>kr, a sum of distinct powers of 2. By Theorem 2.2.2, every n≥1 is such a sum. For example 13=23+22+20.

The base 1 is the right one: 0 is not a sum of one or more powers of 2, since each power is positive.

Exercise (R2)

Show that ∀x∃yR(x,y)⊬∃y∀xR(x,y) by a counter-model whose domain is N. Say in words what the two sentences say when R(x,y) is read as “x<y”.

Solution. Let M have domain N and RM:={(d,e)∈N×N:d<e}. Both formulas are sentences, so no assignment matters.

The premise is true. ∀x∃y(x<y) says “every natural number has a larger one”. For each d∈N, e:=d+1∈N has d<e.

The conclusion is false. ∃y∀x(x<y) says “some natural number is larger than every natural number”. For any e∈N, the choice d:=e gives d<e false, so no e works.

So M is a counter-model, and ∀x∃yR(x,y)⊭∃y∀xR(x,y). By the soundness statement of Logic and Proof, Section 7.2 (the subsection “From counter-models to non-derivability”), a counter-model shows non-derivability: ∀x∃yR(x,y)⊬∃y∀xR(x,y).

This is the converse of Logic and Proof, Proposition 5.6.2 with the variables renamed and the two places of R exchanged (read R(x,y) as R(y,x)), and the counter-model is the one of Logic and Proof, Example (The swap of ∃ and ∀): there the domain was Z and R was read as >; with the roles of the variables exchanged, R read as < and the domain cut down to N, the same witnesses work, as checked above. In the premise the larger number y is chosen after x and depends on it; the conclusion asks for one y in advance.

Exercise (R3)

For an integer n≥1, how many truth functions with n inputs are there? Prove your answer.

Solution. There are 22n. A truth function with n inputs (Logic and Proof, Definition 4.4.4) assigns a truth value to each row (a1,…,an); read a row as the function i↦ai on {1,…,n}, and let L be the set of rows.

There are 2n rows. The map sending a row to {i∈{1,…,n}:ai=T} is a bijection L→P({1,…,n}) (injective and surjective by Example (Method: proving injectivity) and Example (Method: proving surjectivity)): a row is determined by the places where it is T, and every set of places arises: given A⊆{1,…,n}, the row with ai=T for i∈A and ai=F otherwise maps to A, and two rows with the same T-places agree at every i, since each ai is T or F. Since {1,…,n} has n elements, Proposition 2.5.8 gives 2n subsets, so L has 2n elements (compose the bijections).

There are 22n truth functions. In the same way, a truth function f is determined by the set {ρ∈L:f(ρ)=T}⊆L, and every subset of L arises (the same two checks, with f↦{ρ:f(ρ)=T} in place of the row map); so the truth functions are in bijection with P(L), which has 22n elements by Proposition 2.5.8 again. For n=1,2,3 this gives 4,16,256.

Exercise (R4)

A function f:N→N is eventually zero if there is N∈N with f(n)=0 for every n≥N. Is the set of eventually zero functions countable?

Solution. Yes. The tool is a countable union of countable sets. For N∈N let ZN be the set of f:N→N with f(n)=0 for every n≥N; the set of eventually zero functions is Z:=⋃N∈NZN. Each ZN is countable:

  • Z0 has one element, the zero function, so it is countable.
  • For N=1, f↦f(0) is a bijection Z1→N: a function in Z1 is determined by its value at 0, and every value occurs.
  • For N≥2, f↦(f(0),…,f(N−1)) is a bijection ZN→N×⋯×N (N factors), by the same reasoning and the characteristic property of tuples; the product is countable by Corollary 3.1.7, and so is ZN (compose a surjection N→N×⋯×N with the inverse bijection, Proposition 3.1.4).

By Theorem 3.2.3, Z is countable. (That theorem uses Axiom 3.2.1; here it could be avoided, since each ZN comes with an explicit listing, but the question did not ask for that.)

Why the look-alike fails. A diagonal argument, as in Theorem 3.3.1, builds from a list f0,f1,… of eventually zero functions the function g(n):=fn(n)+1. It differs from every fn, but g(n)≥1 for every n, so g is not eventually zero: it is not in Z, and nothing is contradicted. A diagonal argument proves uncountability only when the diagonal object stays inside the set; this is the usual failure named in Example (Method: the diagonal).