Section 3.5 defines a set as countable when its members can be listed with a first, a second, a third, and every member at some finite position, and it notes that such a list is a bijection in the language of section 3.4. Prove that the set of ordered pairs of whole numbers is countable by building the list and proving it complete.
List the pairs diagonal by diagonal. Diagonal holds the pairs with , in order of increasing : diagonal 0 is ; diagonal 1 is ; diagonal 2 is ; and so on. Number the positions from 1.
(a) Show that is a bijection from pairs of whole numbers to the positive whole numbers. (b) Give .
Worked solution
Write . Every pair lies on exactly one diagonal, because the sum of its two coordinates is a single whole number, and diagonal holds exactly pairs, one for each choice of from 0 to with . The pairs on diagonals through number , so is preceded by that many pairs and then by further pairs on its own diagonal. Counting positions from 1 gives , which is a positive whole number.
For injectivity, note where the values of a fixed diagonal land. The pairs on diagonal receive the indices from through , which is a block of consecutive whole numbers. The blocks for consecutive diagonals meet end to end and do not overlap, so the index determines ; the value then determines , and follows. Two pairs with the same index therefore have the same diagonal, the same first coordinate, and the same second coordinate. For surjectivity, take any positive whole number . The block endpoints increase with , so exactly one satisfies . Set , which lies between 0 and , and set . Then is a pair of whole numbers with . The map is therefore a bijection.
For the diagonal is , the pairs before it number , and is the third pair on that diagonal, so the index is . The proof establishes the count and the list at once: a bijection with the positive whole numbers is a complete list, which is exactly the definition of countable in section 3.5, and the bijection is the pairing of section 3.4 with one side equal to the whole numbers. Nothing in the argument inspects the size of the sets; it reads the structure that generates the pairs.