12

In Peter Szekeres's "A Course in Modern Mathematical Physics" problem 1.13 asks: "Prove the set of all real functions $f : \mathbb{R} \to \mathbb{R}$ has a higher cardinality than that of the real numbers by using a Cantor diagonal argument to show it cannot be put in one-to-one correspondence with $\mathbb{R}$."

The proof in the official solutions manual is "Suppose the real functions could be put in one-to-one correspondence with the real numbers. Then they could be labelled by real numbers, $f_x : \mathbb{R} \to \mathbb{R}$, one and exactly one function for each real number $x$. Let $F : \mathbb{R} \to \mathbb{R}$ be the real function defined by $F(x) = f_x (x) + 1$. This function clearly cannot be labelled by any real number, for if $F = f_y$ for some $y \in \mathbb{R}$, then

$$ \begin{equation*} f_y (y) = F(y) = f_y (y) + 1, \end{equation*} $$

an obvious contradiction."

I follow the proof, but how is this a type of Cantor diagonal argument? For example, the proof given on the Cantor's diagonal argument Wikipedia page for uncountable sets seems quite different. Is there some general form of the Cantor diagonal argument I'm missing, or is the Cantor diagonal argument simply any proof of the uncountability of a set?

MattHusz
  • 771

2 Answers2

25

It is the exact same idea: you have a family of functions indexed by the domain of the functions, and you use this fact to construct a function not in the initial family.

(Aside: I really wish authors would stop proving Cantor's Theorem and variants by "contradiction"; it's really a contrapositive proof that has been converted to a "proof by contradiction" by adding the contrary assumption at the top, and then parading it at the end to claim the desired contradiction; just do a contrapositive proof!).

That is, it is an instance of the following argument:

Diagonal Argument. Let $S$ be a nonempty set, and let $X$ be a set with at least two elements. Let $\{f_s\}_{s\in S}$ be a family indexed by $S$, where each $f_s$ is a function $f_s\colon S\to X$ with domain $S$ and codomain $X$. Then there exists a function $g\colon S\to X$ such that $g\neq f_s$ for all $s\in S$.

Proof. Since $X$ has at least two elements, let $a,b\in X$, with $a\neq b$. Define $g$ as follows: given $s\in S$, we let $$g(s) = \left\{\begin{array}{ll} a & \text{if }f_s(s) \neq a;\\ b & \text{if }f_s(s)=a. \end{array}\right.$$ This is a function with domain $S$ and codomain $X$. To show that $g\neq f_s$ for each $s\in S$, let $s_0\in S$. Then $g(s_0) \neq f_{s_0}(s_0)$ by construction. Since two functions $S\to X$ are equal if and only if they take the same value at each and every element of $S$, and $g$ and $f_{s_0}$ take different values at $s_0$, it follows that $g\neq f_{s_0}$, as claimed.

Thus, $g$ is a function from $S\to X$ that is not in our original collection. $\Box$

(Why is it called the "Diagonal Argument"? Because if you imagine your functions as being in a square "table", where the rows and columns are labeled by elements of $s$, with each row describing the values of a function, so that the entry in row $i$ and column $j$ is the value of the $i$th function at $j$, $f_i(j)$, then we are constructing $g$ by looking at the values at the "diagonal" of the table, the entries $(s,s)$.)

This argument is the engine of the proof of Cantor's Theorem (no set can be put in bijective correspondence with its power set), Cantor's second proof of uncountability of the real numbers, and the result you quote.

(I use $a$ and $b$ so I don't have to worry about the Axiom of Choice, which is likely not on your radar; but all you need is a method by which you can take the value $f_s(s)$, and get something different. If your values are taken in $\mathbb{N}$, or in $\mathbb{R}$, you can just "add one", and that will do. All you need is a way to take the value $f_s(s)$, and find some different value in $X$.)

To see this explicitly, let's look at those arguments:

1. Cantor's Theorem. Let $S$ be a set. Then there is no bijection between $S$ and its power set $P(S)$. Explicitly, if $F\colon S\to P(S)$ is any function, then $F$ is not surjective.

Proof. We can think of the power set as being made up of functions with domain $S$ and image $\{0,1\}$ (by using characteristic functions). If $F\colon S\to P(S)$ is any function, then let $f_s\colon S\to \{0,1\}$ be the function corresponding to the subset $F(s)$. Then $\{f_s\}_{s\in S}$ is a family of functions indexed by $S$ with domain $S$ and codomain having at least two elements. By the Diagonal Argument, the function $g\colon S\to \{0,1\}$ given by $$g(s) = \left\{\begin{array}{ll} 1 & \text{if }f_s(s)=0,\\ 0 &\text{if }f_s(s)=1 \end{array}\right.$$ is not in the family, hence not in the image of $F$. $\Box$

Note that thinking about sets and subsets, the definition of $g$ gives the subset $$g = \{ s\in S\mid s\notin F(s)\}$$ which is the way we usually see the proof of Cantor's Theorem.

2. Cantor's second proof of uncountability of the reals numbers. If $F\colon\mathbb{N}\to[0,1]$ is a function, then $F$ is not surjective. In particular, there is no surjection from $\mathbb{N}$ to $[0,1]$.

Proof. Consider the real numbers in $[0,1]$. Let $\mathbb{N}$ denote the positive integers. We think of each such real number $r$ as a function $r\colon\mathbb{N}\to\{0,1,2,3,4,5,6,7,8,9\}$, where $r(k)$ is the $k$th digit in the decimal expression for $r$ (having chosen the expression that does not have a tail of $9$s, if such exists); conversely, every function from $\mathbb{N}$ to $\{0,1,2,3,\ldots,9\}$ determines a real number (thought two different functions make determine the same real number, if one of them has a tail of $9$s... we'll ignore this because we can avoid the issue in the argument). Now let $F\colon\mathbb{N}\to[0,1]$ be a function. We let $f_n$ be the function determined by the real number $F(n)$. We now look at the family $\Bigl\{f_n\colon\mathbb{N}\to\{0,1,\ldots,9\}\Bigr\}_{n\in\mathbb{N}}$, and choose $a$ and $b$ as in the Diagonal Argument to be $5$ and $6$. The Diagonal Argument produces a function $g\colon\mathbb{N}\to\{0,1,2,\ldots,9\}$ that is not in our original family, hence a real number $g$ that is not in the image of $F$, as desired. (Because $g$ only takes values in $\{5,6\}$, the issue of dual decimal representation is irrelevant). $\Box$

Viewing the function $g$ as a real number, we see that it is a real number whose $n$th decimal digit is different from the $n$th decimal digit of the $n$th number in our original list $F$; that is, the usual way the argument is presented.

3. Theorem. The set of function $\mathbb{R}\to\mathbb{R}$ cannot be put in bijective correspondence with $\mathbb{R}$. Equivalently: if $F\colon\mathbb{R}\to \mathbb{R}^{\mathbb{R}}$ is a function, then $F$ is not surjective.

(Here $\mathbb{R}^{\mathbb{R}}$ is the set of function from $\mathbb{R}$ to $\mathbb{R}$)

Proof. Let $F\colon\mathbb{R}\to\mathbb{R}^{\mathbb{R}}$. Let $f_r=F(r)$ for each $r\in \mathbb{R}$. Then $\{f_r\}_{r\in \mathbb{R}}$ is a family of functions from $\mathbb{R}$ to $\mathbb{R}$ indexed by $\mathbb{R}$. By the Diagonal Argument, there is a function $G\colon\mathbb{R}\to\mathbb{R}$ that is not one of the $f_r$; i.e., not in the image of $F$. $\Box$

Here we can construct the function $G$ by picking any two reals as in the Diagonal Argument, or as in the parenthetical comment I made below it, by just defining $G(r)$ to be a number different from $f_r(r)$, for instance $f_r(r)+1$, as the author does.

Arturo Magidin
  • 417,286
  • For users who would like to see some discussion about contrapositive vs contradiction, see Joel David Hamkin's answer here. – Joe Sep 08 '24 at 22:27
  • 1
    @Joe While those are very good comments about why one should prefer a proof by contrapositive over a proof by contradiction, my objection here is that what we have is a proof by contrapositive, to which the line "assume for contradiction that the implication does not hold" is added at the top, and then "which contradicts our assumption that the implication does not hold" is added at the bottom. It isn't really a proof by contradiction, because the contrary assumption is not actually used in the proof. The only time "this function is surjective" is used is to contradict itself at the end. – Arturo Magidin Sep 09 '24 at 16:58
  • Yes, agreed. The reason why I linked the thread was that some users might think “Sure, this is phrased as a proof by contradiction rather than a proof by contrapositive, but who cares?” The reason to care is that a genuine proof by contradiction often conveys little information (other than the statement which you are trying to prove is true). So phrasing a proof by contrapositive as a proof by contradiction undersells the proof, in some sense. – Joe Sep 09 '24 at 17:12
  • Of course these arguments already occur here in many places, e.g. here. $\ \ $ – Bill Dubuque Sep 09 '24 at 18:10
  • Cantor did use proof by contradiction. It just isn't the contradiction most people use. (Nor did he use real numbers, but I'll continue with them.) Cantor proved "If f() is a function from N to [0,1], then there is an r0 in [0,1] that is not mapped by f()." Cantor used that for this paraphrasal: "From this proposition it follows immediately that there is no surjection from N to [0,1]; otherwise we would have the contradiction, that a number r0 would both an element of [0,1], but also not an element of [0,1]." – JeffJo Sep 09 '24 at 20:14
  • @JeffJo It's a direct proof that no function is surjective. – Arturo Magidin Sep 09 '24 at 21:11
  • I don't understand the statement $g = {s \in S \mid s \notin F(s)}$ in the proof of Cantor's theorem. $g$ is a map, so isn't it a subset of the Cartesian product $S \times {0, 1}$? That looks like each element of $g$ is an element of $S$ and not an ordered pair consisting of an element of $S$ and a 0 or 1. Can you point out what I'm misunderstanding? – MattHusz Sep 10 '24 at 15:27
  • @MattHusz: As I noted, maps from $S$ to ${0,1}$ correspond to subsets via characteristic functions. If you interpret $g$ as a subset (given that it is a map from $S$ to ${0,1}$), then it is the given subset. – Arturo Magidin Sep 10 '24 at 15:34
  • @Arturo Magidin It's a direct proof that any qualifying function is not a surjection. That is not quite the same as "no function is surjective." It just needs a small nudge to get there, but it does need that nudge. And yes, there are several ways to do it. The way Cantor nudged it, was by contradiction. All I'm saying is that you can't claim Cantor did not use contradiction, when his paper literally said " ... otherwise we would have the contradiction, ..." – JeffJo Sep 12 '24 at 19:30
  • @JeffJo: Small pieces of his argument are done by contradiction; but the overall argument is not a proof by contradiction that there is no surjection from $\mathbb{N}$ to $\mathbb{R}$, as usually described. This is similar to way that Euclid proves that the set of primes is infinite. The proof is often written as if it is a proof by contradiction ("assume that $p_1,\ldots,p_n$ are all the primes"), whereas Euclid gave a proof of "any finite list of primes is incomplete." Although his argument has a small step argued by contradiction, the overall proof is not by contradiction. Same here. – Arturo Magidin Sep 12 '24 at 19:38
  • @JeffJo Moreover, simply the use of the words "for otherwise we would have a contradiction" does not necessarily mean we have a proof by contradiction. In the argument we know that $g\neq f_n$ because $g(n)\neq f_n(n)$; but we could say "$g$ is not equal to any $f_n$, for if it were then we would have a contradiction by examining the value at $n$." That would be another proof by "fake contradiction" of a direct statement. – Arturo Magidin Sep 12 '24 at 19:42
  • @JeffJo: Finally, I did not say "Cantor did not use contradiction". What I said was that I wish people would stop presenting this proof as if it is a proof by contradiction when it is in fact a proof by contrapositive. So it would appear that your entire correction is based on attributing to me a statement I never made. – Arturo Magidin Sep 12 '24 at 19:44
  • @Arturo Magidin We should stick to Cantor's words when we make claims about what he said. My wish is that people stop rewording what he said, like you do. His proof of the axiom (any function is not a surjection) does not use, or mention, contradiction. His proof of the theorem does mention contradiction, and is a proof by contradiction. The issue is that he did not use the contradiction most people attribute to him ("The assumed surjection is not a surjection"). Which, in fact, is not a valid proof-by-contradiction since it never uses the assumption of a surjection. – JeffJo Sep 13 '24 at 21:48
7

You can think of the diagonal argument for Cantor's theorem as changing all the values on the diagonal of the $\mathbb{N} \times \mathbb{N}$ matrix where the $k$th row specifies the decimal digits of the $k$th integer. Then the new diagonal itself as a sequence can't be any of the original rows.

Now think instead of the "matrix" with a row and a column for each real number. If you could tag all the functions uniquely with a row index then the $x$th row would correspond to the $x$th function. Now change all the diagonal values in the matrix. Then the new diagonal as a function can't be any of the original rows.

This diagonal argument works for any set $S$ to show that the set of functions from $S$ to $\{0,1\}$ (or to any set with at least two elements) must have cardinality strictly greater than $S$.

@BillDubuque points to this answer which describes this proof and its history a little more formally.

Ethan Bolker
  • 103,433
  • 1
    @Stef Nice suggestions thanks. I made the changes. – Ethan Bolker Sep 09 '24 at 12:52
  • 1
    The matrix diagonal change viewpoint is described at length in this answer. The idea predates Cantor's proof, going back to $1871$ when du Bois-Reymond diagonalized on the growth rates of functions in his pioneering studies on "orders of infinity". $\ \ $ – Bill Dubuque Sep 09 '24 at 17:57
  • @BillDubuque Thanks. You know more about what's on this site than most of us. I changed the wording of my answer to get the history right, and added a link to that answer. You can vote to close the question as a duplicate if you think that appropriate. – Ethan Bolker Sep 09 '24 at 18:02