# Why is this proof of $\mathbb{N}\times\mathbb{N}$ being countable not formal?

My copy of Introduction to Real Analysis: Bartle and Sherbert gives:

Theorem: The set $$\mathbb{N}\times\mathbb{N}$$ is countable.

Informal Proof: Recall that $$\mathbb{N}\times\mathbb{N}$$ consists of all ordered pairs $$(m,n)$$, where $$m,n \in \mathbb{N}$$. We can enumerate these pairs as:

$$(1,1), \text{ } (1,2),\text{ } (2,1), \text{ }(1,3), \text{ }(2,2), \text{ }(3,1), \text{ }(1,4) \text{ }...$$ according to the increasing sum $$m+n$$, and increasing $$m$$ $$...$$

Note that while this argument is satisfying in that it shows exactly what the bijection of $$\mathbb{N}\times\mathbb{N}\to\mathbb{N}$$ should do, it is not a 'formal proof', since it doesn't define this bijection precisely.

My trouble is understanding where the formality is lost, the proof which is given in the appendix is long and a bit scary. Can anyone tell how this is informal?

• Anytime you see $\ldots$ its a dead give-away that the proof is informal. To make the proof formal, you need to give an explicit description of the function $\mathbb{N} \rightarrow \mathbb{N} \times \mathbb{N}$ and then prove it is a bijection. – goblin Jul 1 '14 at 13:06
• Against what the text says, and the "explanations" below, the argument you showed defined a bijection precisely. It does not use formulas, but that is irrelevant. The definition is precise, and verifying that it works is an easy exercise. – Andrés E. Caicedo Jul 2 '14 at 18:05
• I agree with Andres. Also, you certainly don't have to provide an explicit bijection to show that $\mathbb N \times \mathbb N$ is countable $-$ it suffices to show that a bijection exists. – TonyK Jul 2 '14 at 18:19
• The argument as written in the quoted text is not, to me, a proof: it is just a description of an idea which, when carried out, will given a proof. It is a proof only in that anyone knowledgeable should, hopefully, complete it. – Mariano Suárez-Álvarez Jul 3 '14 at 5:56
• @MarianoSuárez-Alvarez (But the definition is given: Enumerate the pairs $(m,n)$ increasing $m+n$, and for each fixed $m+n$, increasing $m$. There is nothing else to "give". There is much to check.) – Andrés E. Caicedo Jul 5 '14 at 6:46

Let's examine what the book says: To show that $\mathbb N\times\mathbb N$ is countable, we need to exhibit a bijection from $\mathbb N\times \mathbb N$ onto $\mathbb N$.

The authors of the book describe the bijection by saying: Enumerate the pairs $(m,n)$ according to the increasing sum $m+n$ and, for each fixed $m+n$, according to increasing $m$.

[Just for fun, let's list some of the pairs in order: Since $m,n\in\mathbb N$, then $m+n\ge2$, so the first value of $m+n$ is $2$. There is only one pair $(m,n)$ with that sum, namely $(1,1)$. The next possible value for $m+n$ is $3$. The equation $m+n=3$ has two solutions in the natural numbers, namely $m=2,n=1$ and $m=1,n=2$. The description tells us we first list $(1,2)$ and then $(2,1)$. The next value is $m+n=4$, and the pairs of solutions are listed as $(1,3),(2,2),(3,1)$. They will be followed by $(1,4),(2,3),(3,2),(4,1)$, in that order. Etc. So the list begins: $$(1,1),(1,2),(2,1),(1,3),(2,2),(3,1),(1,4),(2,3),(3,2),(4,1),(1,5),\dots$$ For example, this means that if $f$ is the function we have described, then $f(2,1)=3$, and if $f(a,b)=10$, then $(a,b)=(4,1)$.]

Does this assign a natural number as a value to each pair $(m,n)$ of natural numbers? Yes.

(In fact, there is an easy algorithm that allows us to find that value, although that is irrelevant: The algorithm itself is not very imaginative: Just go on listing first the pairs with sum $2$, then those with sum $3$, then those with sum $4$, and so on, until $(m,n)$ is listed, and then count the elements that have been listed so far to find where in the list $(m,n)$ appears, and that is the number assigned to it.)

Is this assignment unambiguous? Yes.

Of course. The description is unambiguous, there is no leeway at all in how to produce the list. So, so far, we know that we have a function with domain all of $\mathbb N\times\mathbb N$ and range in $\mathbb N$.

[We can say more if needed, but I think this is just clutter at some point: For each fixed natural number $k$, there are only finitely many pairs $(m,n)$ with $m+n=k$. In fact, we can identify them all, since $m+n=k$ implies that $m\le k$, so $m$ is one of $1,2,\dots,k-1,k$, and for each of these options there is a unique value of $n$ that works, namely $n=k-m$. What does that buy us? Well, given any pair $(m,n)$, if we define $k$ by $k:=m+n$, there are only finitely many pairs $(a,b)$ with $a+b\le k$, so we can list them in a finite list, in the ordering described -- first order by the size of $a+b$, and among those with the same $a+b$, order by the size of $a$ -- so that indeed we assigned to $(m,n)$ a number, because finite unions of finite sets are finite (or, more to the point in our case, the concatenation of finitely many finite lists is still a finite list), and this number is well defined. If pressured, we could produce a formula for what number it is that we assigned to $(m,n)$ but, again, there is no need.]

If a natural number $n$ is assigned to a pair $(a,b)$, is this the only pair that $n$ is assigned to? Obviously.

Any list with at least $n$ elements has only one element in the $n$th position. This means that the function we have is injective.

Is the range of this function an initial segment of $\mathbb N$? Yes.

We are listing the numbers, after all. This means we are not skipping any values. If $f(a,b)=20$, then the list has assigned the numbers $1,2,\dots,19$ to other pairs $(m,n)$ as well.

Is the range all of $\mathbb N$? Yes.

Obvious: For any $k$, according to the description of the list, thee pairs $(1,1),(2,2),\dots,(k,k)$ are listed in that order, with possibly many other numbers interpolated between them. So the list of numbers has length at least $k$, so some pair has been assigned the number $k$. We have now shown that the function we have is also surjective.

That's it, that's the proof. Can it be expanded? Of course. We can add much to it, but it seems utterly unnecessary. My point here is that, as explanations go, there is really not much to say. The bijection was indeed unambiguously and precisely defined (in spite of what the authors say).

The sketch in the book is not a full proof: It did not argue that this description indeed gives us a function, that its domain is all of $\mathbb N\times\mathbb N$, that the function is injective, its range is an initial segment of $\mathbb N$ and, in fact, that this initial segment is all of $\mathbb N$. Those are all the details we needed to verify to check we had a bijection. But, as these things go, we really were not missing much in terms of details anyway.

A piece of advice: Read the details of the proof in the book, even if "long and a bit scary". If nothing else, out of curiosity. If the book is not saying more than what I say above, then at the end we see that there was not much to be scared of. If the book goes into additional details, at the end we may know even more about this bijection, and understand it better. Perhaps the book will expand in great detail some of the items I essentially called trivial in this write-up, and perhaps in the context of the book, it makes sense that these details are needed, and not quite as trivial as I believe. (But if this is the case, it will only make sense if you are familiar with the book, and with what the authors allow themselves to assume through it. It will not be something you can discern just from reading the details in that appendix.)

Or perhaps you will see that the authors are worrying unnecessarily, which may well be the case. Whichever the outcome, it seems you'll gain from the experience. As you can see from the comments and the many answers, it is not that there is universal consensus among mathematicians on what we allow ourselves to assume (even depending on the audience). That is always interesting to experience, I think it makes mathematics feel more real and alive, which is always good to realize.

They say precisely why: "it doesn't define this bijection precisely". Anything which assumes that you understand what it's getting at is not going to be formal.

I recommend trying to figure out how to define it precisely. Let me know if you need help.

There are also much easier bijections: $2^{n-1}(2m-1)$ gives us you a bijection (assuming $\mathbb{N}$ does not contain $0$, which from the excerpt you gave is indeed the case).

• If $\mathbb N$ does not contain zero, you need $2^{n-1}(2m-1)$ to get a bijection... – Thomas Andrews Jul 1 '14 at 12:54
• No, $m,n\neq 0$, since we just assumed $\mathbb N$ does not contain $0$. – Thomas Andrews Jul 1 '14 at 12:56
• @ThomasAndrews Thanks for pointing that out. – Hayden Jul 1 '14 at 12:58
• I don't understand. Why really is it not formal? – karp2345 Jul 1 '14 at 12:59
• @Hayden: An explicit formula isn't required. Otherwise you would be in big trouble proving that the rational numbers are countable. – gnasher729 Jul 2 '14 at 18:01

Define a function f: N -> N x N recursively as follows:

f (1) = (1, 1)
f (n + 1) = (1, x + 1)     if f (n) = (x, y) and y = 1,
f (n + 1) = (x + 1, y - 1) if f (n) = (x, y) and y ≠ 1.


Now you only have to prove that f (i) ≠ f (j) whenever i ≠ j, and that for every pair (x, y) there is an i such that f (i) = (x, y). Which I didn't do, so this isn't a formal proof either, but it should make it obvious what's missing.

I agree with Andrés E. Caicedo's answer, but to bring the proof up a notch to quality standards, the following two lines can be added:

$\quad$ The finite diagonals $D_k \; (m + n = k$) partition $\mathbb N\times\mathbb N$.

$\quad$ Each diagonal $D_k$ comes equipped with a linear ordering.

If you want some formal apparatus to put this to rest, we have the following (countable means finite or countably infinite):

Theorem 1: Let $(D_k)_{\, k \in \mathbb N}$ be an indexed family of disjoint nonempty countable sets. Also, for each $k$, let there be defined a linear ordering $\le_k$ on $D_k$ making it a well-ordered set isomorphic to $\mathbb N$ when $D_k$ is infinite. Then there exists a bijective correspondence

$\tag 1 C: \bigcup D_k \to \mathbb N$

Proof
First prove theorem 1 for the case when all $D_k$ are finite sets, in which case $C$ has a 'natural construction' (see proof here). You can then set up a bijection $\mathbb{N} \rightarrow \mathbb{N} \times \mathbb{N}$ and use that (together with a partitioning argument) to complete this proof by handling the

$\text{ Is this } D_k \text{ finite or infinite?}$

questions in some structured manner. $\qquad \blacksquare$

Note: The proof of the above theorem was informal, omitting some details that can be handled in slightly different ways. This is different from an informal proof that has all the 'guardrails' in place, as in the OP's question.

I am not sure how ZFC experts would view this theorem. If we have a family of countable sets, indexed by $\mathbb N$, with each set 'a copy' of $\mathbb N$', then I suppose we don't need AOC to know that the union (indexed over $\mathbb N$) of those '$\mathbb N$' sets is countable.