# fun proof about infinities

There are more real numbers between any two real numbers than there are natural numbers.

For any pair of real numbers `x`

and `y`

, assign each natural number to a
real number equal to `x + (y - x) * p`

, where `p`

is formed by
concatenating the natural numbers from the assignment index to infinity.

```
1: x + (y-x) * 0.123456789101112131415161718192021...
2: x + (y-x) * 0.2345678910111213141516171819202122...
3: x + (y-x) * 0.345678910111213141516171819202122...
4: x + (y-x) * 0.4567891011121314151617181920212223...
5: x + (y-x) * 0.567891011121314151617181920212223...
6: x + (y-x) * 0.6789101112131415161718192021222324...
7: x + (y-x) * 0.789101112131415161718192021222324...
8: x + (y-x) * 0.8910111213141516171819202122232425...
9: x + (y-x) * 0.910111213141516171819202122232425...
10: x + (y-x) * 0.1011121314151617181920212223242526...
11: x + (y-x) * 0.1112131415161718192021222324252627...
12: x + (y-x) * 0.1213141516171819202122232425262728...
13: x + (y-x) * 0.1314151617181920212223242526272829...
14: x + (y-x) * 0.1415161718192021222324252627282930...
15: x + (y-x) * 0.1516171819202122232425262728293031...
16: x + (y-x) * 0.1617181920212223242526272829303132...
17: x + (y-x) * 0.1718192021222324252627282930313233...
18: x + (y-x) * 0.1819202122232425262728293031323334...
...
```

Since `p`

is always less than `1`

, `x + (y - x) * p`

will always be between
`x`

and `y`

. Since `p`

is never `0`

or `1`

, `x + (y - x) * p`

will never
be equal to either `x`

or `y`

.

Now, take first digit of `p`

from the first number, second digit of the
second, and so on

```
1: x + (y-x) * 0. 1 23456789101112131415161718192021...
2: x + (y-x) * 0.2 3 45678910111213141516171819202122...
3: x + (y-x) * 0.34 5 678910111213141516171819202122...
4: x + (y-x) * 0.456 7 891011121314151617181920212223...
5: x + (y-x) * 0.5678 9 1011121314151617181920212223...
6: x + (y-x) * 0.67891 0 1112131415161718192021222324...
7: x + (y-x) * 0.789101 1 12131415161718192021222324...
8: x + (y-x) * 0.8910111 2 13141516171819202122232425...
9: x + (y-x) * 0.91011121 3 141516171819202122232425...
10: x + (y-x) * 0.101112131 4 151617181920212223242526...
11: x + (y-x) * 0.1112131415 1 61718192021222324252627...
12: x + (y-x) * 0.12131415161 7 1819202122232425262728...
13: x + (y-x) * 0.131415161718 1 920212223242526272829...
14: x + (y-x) * 0.1415161718192 0 21222324252627282930...
15: x + (y-x) * 0.15161718192021 2 2232425262728293031...
16: x + (y-x) * 0.161718192021222 3 242526272829303132...
17: x + (y-x) * 0.1718192021222324 2 52627282930313233...
18: x + (y-x) * 0.18192021222324252 6 2728293031323334...
...
```

This gives you `0.135790123417102326...`

, which we'll call `r`

.

Now we create a second number `q`

from that one. Any digits that are less
than `9`

, we add `1`

to them. Any `9`

, we turn into a `0`

.

This gives you `0.246801234518213437...`

.

The number `x + (y-x) * q`

will be a number between `x`

and `y`

, which does
not appear in the list.

The only way that it *could* appear on the list is if `x + (y-x) * p`

was
equal to `x + (y-x) * q`

, for some value of `p`

. Which means, that `p`

would have to be equal to `q`

.

But `q`

can't be the first `p`

, because the first digit is different. It
can't be the second `p`

, because the second digit is different. And so on.

Because each of the numbers in our mapping have an infinite decimal place,
there is an infinite number of ways we could form a `r`

and `q`

and end up
with a number not on the list. For example, we could form `r`

by starting
with a 0, and then taking the second digit of the first number in the
mapping, the third digit of the second number in the mapping, and so on.

And there are also an infinite number of strategies we could use to
transform `r`

into `q`

. We could do that same rotation strategy on the
first number, then the inverse rotation on the second (ie, subtract 1 from
each digit that isn't a 0, and replace any 0 with a 9), then the original
rotation on the third, and so on. Or we could rotate by 2 numbers instead
of 1 (so 0-7 are incremented by 2, and 8-9 are decremented by 8).

Or we could say that any `0`

is turned into a `1`

, and any non-`0`

digit is
turned into a `0`

. Or we could do the `0`

/`1`

transform a million times,
and then switch to a rotation transform.

Each such strategy will produce a `q`

to generate a number between `x`

and
`y`

which does not correspond to any natural number in the one to one
mapping.

Therefore, there are infinitely more numbers in any range of real numbers than there are natural numbers.

This is basically Cantor's proof.

But in fact, we don't even have to use the diagonal. The coefficients in
our mapping all are greater than `0.1`

. The smallest will be those
corresponding to increasingly large powers of 10, but they'll never get all
the way to `0.1`

, because no natural number is a `1`

followed by an
infinite number of zeroes. So `x + (y-x) * 0.1`

also does not appear on
the list. Neither does any number with a coefficient less than `0.1`

, of
which there are infinitely many more than there are natural numbers, as
just proven.