Simulate
Check the claim with numbers
Two finite sets have the same size when a bijection pairs them off (lesson PG6.2). The same idea measures infinite sets. Can the whole numbers be paired off with ?
Try a list that takes 0 first, then steps out in both directions: . As a formula, place holds for even and for odd .
The first 11 places hold . The first 2,001 places hold every whole number from to 1000, each exactly once.
Conjecture
The map with for even and for odd is a bijection. So can be listed, like .
The first 2,001 places. The proof must show that every whole number gets exactly one place, however far out.
Countable sets
Take a list in which every element of a set appears exactly once. It is a bijection from to : place goes to .
Rule: Countable
A countable set is one whose elements can be listed, each at exactly one place. An infinite countable set is countably infinite: the same size as .
Format 1
Reorder the steps
Here is the proof that is a bijection, with its lines shuffled. Put them in order with the arrows, or drag a line by its handle.
- Surjective as well: a whole number is , and a whole number is , where is odd and at least 1.
- For , an even gives , and an odd gives .
- Both even gives , and both odd gives . Either way .
- So is a bijection from to , and is countable.
- Define by for even and for odd .
- Injective: if , that value is either positive or not, so by the line before, and are both even or both odd.
looks twice as big as , yet the two have the same size. Infinite sets behave differently from finite ones, so claims about their sizes need proofs.
Simulate
Listing pairs
The pairs of whole numbers, , fill an infinite grid. List them along diagonals: , then , then , and so on.
Diagonal holds the pairs with . The cell builds the list for the first 100 diagonals and checks a formula for the place of each pair.
The first 100 diagonals hold 5,050 different pairs, and the formula gives the place of every one. For example, sits at place 24.
The last line compares a row-by-row list, which gives the first million places to row 1. Of the 9 pairs with both entries at most 3, it places only 3. The diagonals place all 9 within the first 13 places.
Conjecture
The diagonal listing is a bijection, so is countable. The pair has the place
5,050 pairs on 100 diagonals. The proof shows the formula gives every pair one place, and uses every place once.
Format 2
Fill the gap
The proof, with its key steps left out. Type each missing piece as you would a quick answer, such as d^2 or (d+1)/2, then check.
The diagonals. Diagonal holds the pairs , listed in order of , so it holds pairs. Every pair lies on exactly one diagonal, , at position along it.
Where a diagonal starts. Before diagonal come diagonals 1 to . By the arithmetic series of lesson 1.5.2, they hold pairs. So the pair at position on diagonal gets place .
Where it ends. The last pair of diagonal , at position , gets place . So diagonal fills the block of places from to , one place per pair.
The next block starts right after, since pairs come before diagonal . So the blocks fill the places in turn, with no gaps and no overlaps.
A bijection. So different pairs get different places, and every place is used: is a bijection from to . Its inverse, which lists the pairs, is a bijection from to .
A check. The pair is on diagonal , and gets place , as the simulation found.
How to type answers
- Powers with
^, brackets round a power that is a sum:r^k,r^(k+1). - Fractions with
/and brackets:(1-r)/(1+r). Multiply with*or side by side:2k+1. - Press Enter in any box to check them all.
The same list, with repeats such as skipped, lists every positive fraction . So the positive rational numbers are countable too.
Format 3
Find the error
A first attempt that lists the pairs row by row. In the simulation, a million places of this list held only 3 of the 9 pairs with entries up to 3. Find the faulty line.
Lesson PG6.4 shows that some infinite sets cannot be listed at all, however cleverly.
Summary card
- A set is countable when it is finite or there is a bijection : a list with every element at exactly one place.
- is countable: list , with for even and for odd .
- is countable: list by diagonals, with at place , where . So are the positive fractions.
- A list must reach every element after finitely many places. Listing row by row never leaves row 1.