<<

Great Theoretical Ideas In Computer Science V. Adamchik CS 15-251 Outline Lecture 20 Carnegie Mellon University

Cantor’s Legacy Diagonalization Cantor’s theorem Cantor’s

Cantor (1845–1918) Galileo (1564–1642)

Galileo: Dialogue on Two New Sciences, 1638 If I should ask further how many squares there are one might reply truly that there are as many as the corresponding of square- Salviati Simplicio roots, since every square has its own square-root and every square-root its own square… I take it for granted that you know which of the are squares … Neither is the number of squares less I am quite aware that a and which are not. than the totality of all the numbers, … squared number is one which results from the … nor the latter greater than the former, … multiplication of another number by itself. Very well… If I assert that all numbers, … and finally, the attributes “equal,” including both squares and non-squares, “greater,” and “less,” are not applicable are more than the squares alone, I shall to infinite, but only to finite, quantities. speak the truth, shall I not?

Let’s review this argument Cantor’s Definition

ℕ = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, … }

Sets A and B have the same S = { 0, 1, , , 4, , , , , 9, … } ‘cardinality’ (size), written |A| = |B|, if there exists a bijection between them. “All numbers include both S ⊊ ℕ squares and non-squares.”

“Every square has its own There is a square-root and every bijection square-root its own square…” between ℕ and S.

1 Reminder: what’s a bijection? Cantor’s Definition

It’s a perfect matching between A and B.

It’s a mapping f : A → B which is: Sets A and B have the same an injection ‘cardinality’ (size), written |A| = |B|, (i.e., ‘one-to-one’: f(a)≠f(b) if a≠b) if there exists a bijection between them. & a surjection (i.e., ‘onto’: ∀b∈B, ∃a∈A s.t. f(a)=b). E.g.: |ℕ| = |Squares| It’s a f : A → B which has an because the function f : ℕ → Squares , f−1 : B → A (also a bijection). defined by f(a)=a2 is a bijection.

If A and B are infinite sets Do N and E have the same cardinality? do we always have |A| = |B|? N = { 0, 1, 2, 3, 4, 5, 6, 7, … }

E = { 0, 2, 4, 6, 8, 10, 12, … }

That’s exactly what I was wondering in 1873… f(x) = 2x is 1-1 onto.

Let’s try some examples!

Do N and Z have the same cardinality? Transitivity Lemma

N = { 0, 1, 2, 3, 4, 5, 6, 7, … } Lemma: If f: AB is 1-1 onto, and Z = { …, -2, -1, 0, 1, 2, 3, … } g: BC is 1-1 onto. Then h(x) = g(f(x)) defines a function h: AC that is 1-1 onto f(x) = x/2 if x is odd -x/2 if x is even Hence, N, E, and Z all have the same cardinality. The odd numbers in N map to the positive in Z. The even numbers in N map to negative integers in Z.

2 A Natural Intuition A Natural Intuition

Let’s re-examine the set Z. Consider listing Intuitively, what does it mean to find a bijection them in the following . between a set A and N ? First, list the positive integers (and 0):

Then, list the negative integers: It means to list the elements of A in some order so that if you read down the list, every will 0, 1, 2, 3, 4, . . ., -1, -2, -3, -4, . . . get read. What is wrong with this ?

If you start reading down the list, you will never actually get to the negatives!

A Natural Intuition Do N and ℚ have the same cardinality?

How about this list? 0, 1, -1, 2, -2, 3, -3, 4, -4, . . . N = { 0, 1, 2, 3, 4, 5, 6, 7, …. }

ℚ For any n, at most |2n| integers come = The Rational Numbers before it in the list, so it will definitely get read.

Don’t jump to conclusions! No way!

The rationals are dense: between any two there is a third. You can’t There is a clever way to list the rationals, list them one by one without leaving one at a time, without missing a single one! out an infinite number of them. First, let’s warm up with another interesting example:

N can be paired with N × N

3 Theorem: N and N × N have the Theorem: N and N × N have the

… same cardinality … same cardinality

4 4 6 3 3 The point (x,y) The point (x,y) represents the 7 represents the 2 2 3 ordered pair (x,y) 4 (x,y) 1 1 1 8

0 5 0 0 2 9 0 1 2 3 4 … 0 1 2 3 4 …

Onto the Rationals!

The point at x,y represents x/y The point at x,y represents x/y

Cantor’s 1877 letter to Dedekind:

“I see it, but I don't believe it! ” N and ℚ have the same cardinality.

The rational numbers ℚ are countable.

4 Is {0,1}* countable? Let’s do one more example.

Let {0,1}* denote the set of all binary strings of any finite Yes, this is easy. Here is my listing: length.

ϵ, 0, 1, 00, 01, 10, 11, 000, 001, 010, 011, 100, 101, Is {0,1}* countable? 110, 111, 0000,…

Length 0 Length 1 strings Length 2 strings Length 3 strings strings in binary order in binary order in binary order

Thus:

The set of all possible Java/C/Py programs is countable. Onto the Reals! The set of all possible finite length pieces of English text is countable. Is ℝ countable?

I asked Dedekind this in Cantor proved ℝ is uncountable November, 1873. in December 1873.

ℝ = { ½, 2, ,…} To do this, he invented a very important technique called “…if you could prove that ℝ is uncountable, it “Diagonalization” would have an application in number theory: a new proof of Liouville’s theorem that there are transcendental numbers!”

5 Theorem: |R|  |N| || Theorem: {0,1}∞ is NOT countable.

Suppose for the sake of contradiction that you We will instead prove that can make a list of all the infinite binary strings. the set of all infinite binary strings, ∞ denoted {0,1} , is uncountable. 0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0… ∞ Suppose {0,1} , is countable, thus there is a 1: 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1… bijection f: N -> R 2: 1 0 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 0 1 1…

We will show that this is not a surjection. 3: 0 0 1 1 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0… 4: 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1… … …

Theorem: {0,1}∞ is NOT countable. Theorem: {0,1}∞ is NOT countable.

Consider the string formed by the ‘diagonal’: the k-th bit in the (k-1)-st string Next, negate each bit of the string on the diagonal: 0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0… 1 0 0 0 1 0… 1: 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1… 2: 1 0 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 0 1 1… It can’t be anywhere on the list, since it differs 3: 0 0 1 1 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0… from every string on the list! 4: 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1… 5: 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0… Contradiction. … …

ℝ is uncountable. Even the set [0,1] of all reals Continuum Hypothesis between 0 and 1 is uncountable. The cardinality of natural numbers

|ℕ| = ℵ0 (aleph zero or naught)

This is because there is a bijection There are no infinite sets with cardinality less ℵ0 ∞ between [0,1] and {0,1} . Question: Is there a set S with |ℕ| < S < |ℝ|? ℵ1 is the It’s just the function f which maps each or smallest set larger than ℵ0 ℵ0 real number between 0 and 1 to its ℵ0 < S < 2 = ℵ1? binary expansion! This is called the Continuum Hypothesis. Cantor spent a really long time trying to prove |ℝ| = ℵ1, with no success.

6 The Continuum Hypothesis We know there are at least cannot be proved or disproved 2 . from the standard of ! (the number of naturals, the number of reals.)

This has been proved! Are there more?

Kurt Godel, 1940

Definition: Cantor's Theorem: The power set of a set has a greater than the set itself, S The power set of S is the set of all of S. |S| < |P(S)| P(S)  The power set is denoted as P(S). For example A {A} P({0,1}) = {, {0}, {1}, {0, 1}} {B} {C} B {A,B} Proposition: {B,C} If S is finite, the power set of S has C {A,C} |S| cardinality 2 {A,B,C}

It follows from this that there is an unending succession of different and greater infinite sets.

Cantor’s Theorem The cardinal numbers

S Theorem: There is no an onto map from S onto 2 |N| = ℵ0 < ℵ1 < ℵ2 < …

Proof: ℵk is the smallest set larger than ℵk-1 Assume, for a contradiction, that there is an S onto map f : S  2 . It suffices to find some Are there any more infinities? B of S that is not in the range of f.

Let B = {x  S | x  f(x) } Let S = {k | k  N } P(S) is provably larger than any of them!! We constructed B so that, for every element x in S, the set B differs from f(x): No single is big enough to count the

number of infinities! B ≠ f(x) because x  B iff x  f(x)

7 Continuum Hypothesis The cardinal numbers Exercise

ℵ0 < ℵ1 < ℵ2 < …

The power sets Consider all |S| < |P(S)| < |P(P(S))| < … with integer coefficients.

Question: ℵ1= |ℝ| ? What is the cardinality of Question: are there cardinals this set? between S and P(S)?

Exercise Exercise

Consider all polynomials Consider the algebraic with rational coefficients. numbers.

What is the cardinality of What is the cardinality of this set? this set?

Exercise Exercise

Consider the Consider Rn. transcendental numbers.

What is the cardinality of What is the cardinality of this set? this set?

8 “I see it, but I don't believe it” Cantor’s set

Rn can be put in Tiny sets (measure zero) 1-1 correspondence with [0,1]. with uncountably many points

Cantor’s set Cantor’s set

Cantor Set is formed by repeatedly cutting out the open middle third of a line segment [0,1] (leaving end points) : What remains is called the Cantor set

How much did we remove?

1/3 What is the size of the Cantor set? 2/9 4/27

Cantor’s set Cantor’s set

How much did we remove? Thinking of the size as a length, we removed everything.

Therefore, the Cantor set is very tiny. 1 2 4  2k-1     1 ...  k 3 9 27 k1 3

9 Cantor’s set Cantor’s set

On the other hand, the Cantor set is not We will show that the empty, since we did not remove the end Cantor set is uncountable points 0, 1, 1/3, 2/3,…

Cantor’s set Cantor’s set: second step

Consider the  1 2  Consider the  1 2  ternary  ,   0.1 , 0.2  ternary  ,   0.013, 0.023  3 3  9 9  representation 3 3 representation of every number of every number  7 8   ,   0.21 , 0.22  in [0,1] in [0,1]  9 9  3 3 After removing the first middle third remaining numbers are in the form After removing, remaining numbers are in the form 0.0xxx and 0.2xxx [0.0xxx to 0.01), [0.02xxx to 0.21), [0.22xxx to 1) (no 1s in the first digit) (no 1s in the first two digits)

Note, 0.13 = 0.022222…3 Note, 0.213 = 0.2022222…3

Cantor’s set

Problem

The Cantor set is a set of numbers whose ternary decimal representations consist entirely of 0’s and 2’s. Does 1/12 belong to the Cantor set?

1/12 = 0.0(02)3

10 Cantor’s set Cantor’s set

Can you find a 1-1 map between {0,1} The one-to-one map between {0,1} and and the Cantor set? the Cantor set is called the “Devil's Staircase” . To see this bijection, take a number from the Cantor set in ternary notation, divide its digits by 2, and you get all coefficients in binary notation.

Cardinality

|ℕ| = ℵ0 Diagonalization |ℝ| = c = 2ℵ0 ℵ0 Continuum Hypothesis ℵ1=2 Cantor’s theorem |S| < |P(S)| < |P(P(S))| < … Here’s What Cantor’s set You Need to Know…

11