# Improving my understanding of Cantor's Diagonal Argument

I studied Cantor's Diagonal Argument in school years ago and it's always bothered me (as I'm sure it does many others). In my head I have two counter-arguments to Cantor's Diagonal Argument. I'm not a mathy person, so obviously, these must have explanations that I have not yet grasped.

My first issue is that Cantor's Diagonal Argument (as wonderfully explained by Arturo Magidin) can be viewed in a slightly different light, which appears to unveil a flaw in the argument. If we assume that s_f is an image of f at some index n, then it does not make sense to define s_f as $s_f=(s_1,s_2,s_3,…,s_n,…)$ where $$$s_k = \begin{cases}0 & \mathrm{if\ } f(n)_n = 1\\1 & \mathrm{if\ } f(n)_n = 0\end{cases}$$$

since then the $n$th element of $s_f$ would be defined as the opposite of itself. Since Cantor's Diagonal Argument uses this definition that wouldn't make sense if s_f has an index, then s_f must not have an index, and from there it seems obvious that they would reach the conclusion that s_f is not an image of f. Isn't that begging the question?

My second issue is more complicated, and less articulate, but basically that when I attempt to put numbers into Cantor's Diagonal Argument, I could demonstrate that the "missing" element was the within a constant distance from the last element in the "series", which means all of the infinite other numbers must be before it, which means no matter how long you count, you'd never reach it. For example, if one puts these in the most obvious order of "counting" 0000..., 1000..., 0100...., 1100..., 0010... then the element to be found is obviously the element where all $s_k = 1$, which would be the "last" element in that ordering. But that also seems to apply to the counting numbers, which also seems to violate Cantor's Arguments.

-
Would you reconsider your wording following "I could demonstrate ..."? What do you mean by distance, last, and series? – The Chaz 2.0 Apr 12 '12 at 16:29
@TheChaz: In programming, we call that "Rubberducking". I totally understand making me clarify my intent. – Mooing Duck Apr 12 '12 at 17:01
Note: I do not "try to find $s_f=f(n)$ for some $n$." I prove that $s_f\neq f(n)$ for every $n$. The proof of this is by showing that $s_f(n)\neq f(n)(n)$, which proves that $s_f\neq f(n)$, since they are both functions and two functions are equal if and only if they have the same domain and the same value at every element of the domain ($s_f$ and $f(n)$ both have the same domain, but we show that they don't have the same value at all points). There is no circularity, and in fact there is no proof by contradiction either in the presentation I give. – Arturo Magidin Apr 12 '12 at 17:21
For your last sentence, see Why Doesn't Cantor's Diagonal Argument Also Apply to Natural Numbers? – Rahul Apr 12 '12 at 17:33
After studying all these answers for over an hour until well after my head hurt, I realized that I was defining f(n) with a particular n as matching the definition, instead of attempting to find the n that matched that definition. By forcing a particular f(n) to have the value of s_f I ran into the element defined in terms of itself issue. So the whole thought was stupid from the get-go. – Mooing Duck Apr 12 '12 at 18:08

This might be putting the cart before the horse, but let me address your second issue.

when I attempt to put numbers into Cantor's Diagonal Argument, I could demonstrate that the "missing" element was the within a constant distance from the last element in the "series"

This seems to be a surprisingly common confusion. There is no "last element" of an infinite series. An infinite series goes on forever, which means that there is no end, which means that there is no element at the end. It's like asking what the last digit of $\pi$ = 3.14159... is.

When we say something is an element of an infinite series, what we mean is it is the $n$th element of the series for some natural number $n$. For example, the 1st digit of $\pi$ is 3, the 2nd digit is 1, the 3rd digit is 4, the 100th digit is 7, and so on. If you say that 2 appears in the digits of $\pi$, you have to be able to show some $n$ for which the $n$th digit of $\pi$ is 2. It won't do to say that it is "the last one", because that doesn't mean anything.

Now perhaps we can see the flaw in your second argument:

For example, if one puts these in the most obvious order of "counting" 0000..., 1000..., 0100...., 1100..., 0010... then the element to be found is obviously the element where all $s_k=1$, which would be the "last" element in that ordering.

Not really. Your ordering only covers the binary sequences with a finite number of ones. And those are indeed countable, as your ordering shows! But where does 01010101..., for example, appear in your ordering? (Don't say "halfway through".) That sequence, and the sequence with all ones, and many others, none of them are the $n$th element of your ordering. In other words, they do not appear in your ordering.

But that also seems to apply to the counting numbers, which also seems to violate Cantor's Arguments.

No, because there is no last natural number. If you applied the diagonal argument to the natural numbers, you would produce a sequence of digits with infinitely many nonzero digits. Your conclusion would be that you have produced a digit sequence which does not appear in the list of natural numbers, which is correct, because there is no natural number with an infinite number of digits.

-
This is very well written, and along with Rahul Narain's link, says that "integers" that are infinitely repeating are not "natural numbers", which was definitely the flaw in that part of my reasoning. I guess that means I don't have the right definition of "natural numbers", but even so, that solves that issue. – Mooing Duck Apr 12 '12 at 17:43
They're not integers, either. They're just infinite sequences of digits. – Rahul Apr 12 '12 at 17:46
That was why I put integers in quotes, because I didn't know the right term. Sorry for the confusion. I shouldn't have put the natural numbers in quotes, I shouldn't have done that. – Mooing Duck Apr 12 '12 at 17:49

My first issue is that Cantor's Diagonal Argument seems to beg the question.

It's a proof by contradiction. We assume that every real number is listed, and construct an element that cannot be in the list (the "diagonal element"), contradicting our assumption. Consequently we deduce the negation of the assumption: the real numbers are not denumerable.

As far as your second question is concerned, here's an initial stab. If I've missed your intent, let me know and I'll try to reframe as necessary.

To construct the diagonal element, "counting" is not required: we don't need to physically go through every tuple listed by $f$. Every digit of $s_f$ is given by its definition (over $f$).

But really your question is answered just by considering the set $\mathbb{N}$ with its natural order: it has a first element, $0$, but no last element. So even if it were important that we iterate through every element, there would be no element without a predecessor (apart from $0$). So the scenario you suggest can't happen.

-
I can see that that is the intent, but the proof doesn't make sense (to me) if the element is in the list. It appears to be impossible to construct $s_f$ by the definition given if the element is in the list, as it defines one element to be the opposite of itself. The concepts appear incompatible to me. – Mooing Duck Apr 12 '12 at 16:44
The diagonal element isn't in the list. The point here is that given any such enumeration of reals, we can find a real which does not appear in the list. – Benedict Eastaugh Apr 12 '12 at 16:49
@MooingDuck: Try thinking about it like this: Do you agree that $a_{11}$ is just a $0$ or a $1$? Do you agree that $a_{22}$ is just a $0$ or a $1$? Do you, in fact, for every $i$ agree that $a_{ii}$ is just a $0$ or a $1$? Then surely there is no problem in defining $s_f$? – gspr Apr 12 '12 at 16:49
@gspr: I do agree that each $a_{nn}$ is either a $0$ or a $1$, and that $s_f$ is comprised only of $0$s and $1$s, but the definition of each element of $s_f$ is defined in terms of an another set from $f$, which for $f(n)$ means an element is defined in terms of itself, in a way that is impossible. Benedict: That comment does not appear to add to the discussion. – Mooing Duck Apr 12 '12 at 16:54
@MooingDuck: I don't know if your doubt has been cleared up yet, or if this was written afterwards your last comment on the question. But: The definition of $s_f$ depends only on $f$ being a function $f\colon\mathbb{N}\to 2^{\mathbb{N}}$; nothing more. It is a consequence of the definition of $s_f$ that in fact $s_f\neq f(n)$ for all $n$. The definition depends on nothing except what $f$ is: the fact that $f$ is a function with domain $\mathbb{N}$, and that every $f(n)$ is a function with domain $\mathbb{N}$ and values in $\{0,1\}$. – Arturo Magidin Apr 12 '12 at 19:25

"Begging the question" means "assuming what you are trying to prove." Proof by contradiction is different. You assume the negation of what you are trying to prove, and then derive a contradiction. You can then conclude that what you are trying to prove must be correct since its negation leads to a problem.

-
I realize that the intent is proof by contradiction, but since the definition of s_f is impossible, by claiming it is possible, that excludes the possibility of s_f being in f, which is begging the question. – Mooing Duck Apr 12 '12 at 16:50
@MooingDuck: If I give you an infinite list of zeros and ones, why can't you make another infinite list of zeros and ones that's opposite to the list I gave you at every place? Just take what I gave you, and flip every entry. – gspr Apr 12 '12 at 16:51
@MooingDuck: No. $f$ is a given function with domain $\mathbb{N}$ and images in $2^{\mathbb{N}}$; the images of $f$ are "sequences" (not series), and they are not sets (except in the general sense that in set theory "everything is a set). The values of $f$ are themselves function. $s_f$ is a function, as is $f$ and each $f(m)$. – Arturo Magidin Apr 12 '12 at 17:25
@MooingDuck: Note that the proof you link to is not a proof by contradiction (despite what everyone here is writing). It's a direct proof of the proposition: "If $f\colon\mathbb{N}\to 2^{\mathbb{N}}$ is a function with domain $\mathbb{N}$ and image in the set of all functions from $\mathbb{N}$ to $2$, then $f$ is not onto; that is, there exists $s_f\in 2^{\mathbb{N}}$ such that $s_f\notin \mathrm{Im}(f)$." – Arturo Magidin Apr 12 '12 at 17:27
By the way, I do like to see the correct use of the phrase "begging the question." I've heard newscasters say things like "Which begs the question, which candidate will succeed?" Totally wrong! – Grumpy Parsnip Apr 12 '12 at 18:29

Suppose I could list all the relevant Real numbers in a list so that each one had a serial number which was a positive integer.

I could then construct a number not on the list by taking the opposite of each diagonal element in turn. Check this can be done - it is well-defined.

Check: what we get is a number, and it should be on the list. But we can see that it isn't - it disagrees with every number on the list by the way we constructed it, and that is a contradiction.

So something must be wrong - you can see that, by what you have written. And you suggest resolving it by saying that the diagonal number can't be constructed. But that can't be the mistake, because the recipe for that is so easy, and it is clearly well-defined. There isn't a way of having a number on the list which thwarts the recipe.

We can also check easily that what we construct is a number and it should be on the list.

So the only thing which can have gone wrong is the original assumption - that must be wrong. And because we didn't specify any particular method for creating the list, we only assumed that the list existed, we can't get round it by changing the list or by finding a cunning method. The only possibility left is that no such list exists.

-

The comment by Marc Bennett appears convincing. However there is one important aspect yet to be considered, namely that (occasionally) one real number can be represented by two different infinite strings. To be precise, a binary string S followed by 01111111111... represents the same number as the binary string S followed by 100000000000... This can be verified easily, by summing the infinite string of 1's.

Now let us construct a list of real numbers R, represented by strings S: R(1) = 0.5 S(1) = {1} R(2) = 0.25 S(2) = {0,1} R(3) = 0.75 S(3) = {1,1} R(4) = 0.125 S(4) = {0,0,1} R(5) = 0.375 S(5) = {0,1,1} R(6) = 0.625 S(6) = {1,0,1} R(7) = 0.875 S(7) = {1,1,1} etcetera.

Applying Cantor's diagonal method, leads to the construction of a real number X represented by the string {0,0,1,1,1,1,1,1,1...}. As shown above, this string is equivalent to the string {0,1,0,0,0,0....} which represents the real number X = 0.25. And this number is on our list as the second entry: X = R(2). So this is an example where the diagonal method fails.

-
No; you are confusing the incarnation of the proof that attempts to deal with the case of real numbers in $(0,1)$ represented by binary expansion, and the incarnation here which deals with the set of functions from $\mathbb{N}$ to $\{0,1\}$. As a function, the binary string $011111\cdots$ does not represent the same function as the binary string $10000\cdots$; because we are interpeting these strings as functions with domain $\mathbb{N}$ and codomain $\{0,1\}$, and not as real numbers. When dealing with functions, there is not "dual representation" problem at all. – Arturo Magidin May 6 '12 at 4:16
In other words, as sequences, it is false that the string $0,0,1,1,1,\ldots$ is "equivalent" to the string $0,1,0,0,0,\ldots$. It is true that they map to the same real number under the mapping $\{a_1,a_2,a_3,\ldots\}\mapsto \sum 2^{-a_i}$, but we aren't going all the way to the real numbers. Binary strings are not real numbers, they are sequences (that is, functions). – Arturo Magidin May 6 '12 at 4:21
Thank you. You are right that the original poster asked a question about Cantor's argument in relation to strings representing functions. However Mark Bennett in his response applied Cantor's reasoning to Real Numbers. In that case one has to be a bit more careful, as my example demonstrates. – M. Wind May 6 '12 at 19:43

Cantor's diagonal argument (to prove that $\mathbb{R} > \mathbb{N}$), is not based on counting the elements of both sets (which is used afterwards in the concept of transfinite numbers), but in the fact that they cannot be put into an 1-1 correspondence between them and since the set $\mathbb{N}$ is contained in $\mathbb{R}$ thus $\mathbb{R}$ is a strictly greater set.

The diagonal argument shows that this attempted 1-1 mapping fails. This is all, no explicit counting is done, since one deals with infinite (which btw literally means "not finished") sets.

-

## protected by Asaf KaragilaOct 5 '14 at 21:55

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).