Down the Rabbit Hole

An introduction to $p$-adic numbers
The Cheshire Cat, reclining and pointing at the title

Decimal expansions

Every real number can be expressed by a decimal expansion.

Most numbers have a unique expansion, but some have two different expansions:

\[ 0.999999999\ldots \;=\; 1.000000000\ldots \]
Why?

Why is $0.99999\ldots = 1$?

$0.999999\ldots = 1$
$1 - 0.9 = 0.1$ $1 - 0.99 = 0.01$ $1 - 0.999 = 0.001$ $1 - 0.9999 = 0.0001$ $1 - 0.99999 = 0.00001$ $1 - 0.999999 = 0.000001$ $1 - 0.999999\ldots = 0.000000\ldots$

Through the looking glass

We are quite comfortable with numbers that carry on forever to the right of the decimal point. But have you ever considered numbers that carry on forever to the left?

\[ \ldots 64832397985356295141.3 \;=\; \vas{\textbf{???}} \]

This seems crazy, but let's see where the idea takes us.

First, let's try to figure out the value of

\[ x = \ldots 999999999. \]
Alice, thinking

What is $\ldots 99999$?

\[ \ldots 99999 \mathrel{\overset{\vas{?}}{=}} -1 \]
The Mad Hatter, facing the calculation

But that would imply…

1 1 1 1 1 ⋯99999 +1
⋯ 0 0 0 0 0
If $\ldots 99999 = -1$, then that would imply that $\ldots 99999 + 1 = 0$, which seems absurd, but...
Rightmost column
\[ 9 + 1 = 10 \]
Write down 0, carry the 1.
Next column
\[ \pink{1} + 9 = 10 \]
Write down 0, carry the 1.
Next column
\[ \pink{1} + 9 = 10 \]
Write down 0, carry the 1.
Next column
\[ \pink{1} + 9 = 10 \]
Write down 0, carry the 1.
Next column
\[ \pink{1} + 9 = 10 \]
Write down 0, carry the 1.
And the next, and the next…
\[ \pink{1} + 9 = 10 \]
Every column gives a 0 and passes the 1 along. It never comes back down.

It appears that $\ldots 99999 + 1 = 0$ works out after all!

But what about multiplication?

We saw that $\ldots 99999 = -1$ was consistent with addition. But what about multiplication? For example, we know that $(-1)^2 = 1$. But what does $(\ldots 99999)^2$ work out to be?
Rightmost digit × first number: units column
\[ 9 \times 9 = 81 \]
Write down 1, carry the 8.
Next column (tens)
\[ 9 \times 9 + \pink{8} = 89 \]
Write down 9, carry the 8.
Next column (hundreds)
\[ 9 \times 9 + \pink{8} = 89 \]
Write down 9, carry the 8.
Next column (thousands)
\[ 9 \times 9 + \pink{8} = 89 \]
Write down 9, carry the 8.
Next column (ten-thousands)
\[ 9 \times 9 + \pink{8} = 89 \]
Write down 9, carry the 8.
…and on it goes
\[ 9 \times \ldots 99999 = \ldots 99991 \]
Every further column gives a 9.
Second digit × first number, shifted one place: tens column
\[ 9 \times 9 = 81 \]
Write down 1, carry the 8.
Next column (hundreds)
\[ 9 \times 9 + \pink{8} = 89 \]
Write down 9, carry the 8.
Next column (thousands)
\[ 9 \times 9 + \pink{8} = 89 \]
Write down 9, carry the 8.
Next column (ten-thousands)
\[ 9 \times 9 + \pink{8} = 89 \]
Write down 9, carry the 8.
…and on it goes
\[ 9 \times \ldots 99999 = \ldots 99991 \]
The same row again, shifted one place to the left.
A pattern emerges
Every digit of the second number gives the same row, each one shifted one more place to the left. Now we add the columns.
Units column
\[ 1 \]
Just a 1.
Tens column
\[ 9 + 1 = 10 \]
Write down 0, carry the 1.
Hundreds column
\[ 9 + 9 + 1 + \pink{1} = 20 \]
Write down 0, carry the 2.
Thousands column
\[ 9 + 9 + 9 + 1 + \pink{2} = 30 \]
Write down 0, carry the 3.
Ten-thousands column
\[ 9 + 9 + 9 + 9 + 1 + \pink{3} = 40 \]
Write down 0, carry the 4.
And every column after that…
\[ \underbrace{9 + \cdots + 9}_{k} + 1 + \pink{(k-1)} = 10k \]
Always a multiple of 10: write down 0, carry on.

So $(\ldots 99999)^2 = \ldots 00001 = 1$, just as $(-1)^2 = 1$.

888888888 ⋯99999 ×⋯99999
4321 ⋯99991 ⋯9991 ⋯991 ⋯91 ⋯1 ⋮
⋯00001

What's going on here???

Common sense tells us that $\ldots 99999$ is not a number.

The Cheshire Cat, fading

…but these “proofs” that $\ldots 99999 = -1$ make it feel like there's something there.

Two options

  1. Shrug your shoulders. Write this off as a curiosity and never think about this again.
  2. Keep an open mind. Embrace the mystery of the unknown. Follow me down this rabbit hole.

Dr. Hensel's wonderful numbers

\[\begin{aligned} x &= \ldots \vas{8424731}\\ &= \cdots + \vas{8}\cdot 10^5 + \vas{4}\cdot 10^4 + \vas{2}\cdot 10^3 + \vas{7}\cdot 10^2 + \vas{3}\cdot 10 + \vas{1}. \end{aligned}\]

The main objection to $x$ being a number is that this sum clearly does not converge to a real number.

In 1897, Kurt Hensel discovered that we can build a rigorous mathematical theory of an alternate numerical universe in which infinite sums like this do converge:

\[ \text{The } \vas{\text{10-adic numbers}}\ \ZZ_{10}. \]
Portrait of Kurt Hensel
Kurt Hensel (1861–1941)

The 10-adic numbers $\ZZ_{10}$

A 10-adic number is an expression of the form

\[ \cdots + \vas{a_4}10^4 + \vas{a_3}10^3 + \vas{a_2}10^2 + \vas{a_1}10 + \vas{a_0} \]

with digits $a_i$ satisfying $0 \leq a_i \leq 9$. We write $\ldots \vas{a_4a_3a_2a_1a_0}$ as a shorthand.

Addition and multiplication work just like you would expect.

Key observation

If $\vas{a}$ and $\vas{b}$ are 10-adic numbers, then the $n$th digit of $\vas{a + b}$ or $\vas{a\cdot b}$ only depends on the $k$th digits of $\vas{a}$ and $\vas{b}$ with $k \leq n$.

⋯472938 +⋯851647
⋯324585
⋯472938 ×⋯851647
⋯228886

What about subtraction?

Addition and multiplication work in the familiar way, but what about subtraction?

  • Subtraction is just addition with negatives: \(\,\, a - b = a + (-b). \)
  • So, how do negatives work? \( -(\ldots 5429831) = \vas{\textbf{???}} \)
Check: do they really add up to zero?
1111111 ⋯5429831 +⋯4570169
⋯0000000
Question

Can you see the shortcut for calculating the negative of a 10-adic number?

Recall

$-1 = \ldots 99999$

\[\begin{aligned} \htmlData{fragment-index=1}{-(\ldots 5429831)} &\htmlData{fragment-index=1}{{}= (-1)(\ldots 5429831)} \\ &\htmlData{fragment-index=2}{{}= (\ldots 99999)(\ldots 5429831)} \\ &\htmlData{fragment-index=3}{{}= \ldots 4570169} \end{aligned}\]

What other familiar numbers are hiding in $\ZZ_{10}$?

Consider the following 10-adic number with repeating digits,

We can use the same trick we used on $\ldots 99999$ to solve for $x$.

So $-\tfrac{1}{11}$ is a 10-adic number.
Some fractions live in $\ZZ_{10}$ too!

Question

For which 10-adic numbers $n$ is $\tfrac{1}{n}$ also 10-adic?

I claim $\tfrac{1}{5}$ does not belong to $\ZZ_{10}$.

Powers

Some sequences of integers which obviously diverge in the real numbers $\RR$ turn out to converge in $\ZZ_{10}$.

$2^{5^n}$$n$

The digits are stabilizing from the right.

The sequence $2^{5^n}$ converges to a limit in $\ZZ_{10}$!

Question

What is this limit $b = \lim_{n\to\infty} 2^{5^n}$?

\[ b^5 = \Big(\lim_{n\to\infty} 2^{5^n}\Big)^5 \htmlData{fragment-index=4}{{}= \lim_{n\to\infty} 2^{5^{n+1}}} \htmlData{fragment-index=5}{{}= b,} \]

so $b = \ldots 879186432$ is a solution of the equation

\[ \vas{x^5 = x}. \]

Mysterious limit

Recall that $b = \lim_{n\to\infty} 2^{5^n} = \ldots 879186432$ is a solution of

Thus $b$ must be a root of one of these factors.

$b \neq 0, \pm 1$, so $b$ must be a root of $x^2 + 1$.

\[ \text{But } b^2 + 1 = \ldots 212890625 \neq 0 \]

Huh?

Consider the product $\,b(b^2 + 1)$.

\[ \begin{gathered} b(b^2 + 1) = 0 \\ b,\; b^2 + 1 \neq 0 \end{gathered} \]

Powers

Let's look at the powers of $b = \ldots 879186432$.

Question

What happens if we replace $2$ and $5$ by different numbers?

$n$$b^n$

Zero divisors

An important property of $\,\RR$

If $mn = 0$, then $m = 0$ or $n = 0$.

$\ZZ_{10}$ does not have this property!

\[ b(b^2 + 1) = (\ldots 87918643\vas{2})\,(\ldots 21289062\vas{5}) = 0. \]
  • We call numbers with this strange property zero divisors.
  • Not obvious, but the existence of zero divisors in $\ZZ_{10}$ stems from the factorization $10 = 2\cdot 5$.

In other words, $\ZZ_{10}$ has zero divisors because $10$ is not prime.

From $10$ to $n$ to $p$

For any integer $n \geq 2$, positive integers can be written in base $n$ using the digits $0, 1, \ldots, n-1$:

\[ 7 = \vas{1}\cdot 2^2 + \vas{1}\cdot 2 + \vas{1} = \vas{111} \ \text{(Base 2)}, \qquad\quad 7 = \vas{1}\cdot 5 + \vas{2} = \vas{12} \ \text{(Base 5)}. \]

The $n$-adic numbers $\ZZ_n$ consist of all expressions of the form

\[ \cdots + \vas{a_4}n^4 + \vas{a_3}n^3 + \vas{a_2}n^2 + \vas{a_1}n + \vas{a_0}, \qquad 0 \leq a_i \leq n-1. \]
Primes to the rescue

If $n = p$ is a prime number, then there are no zero divisors in the $p$-adic numbers $\ZZ_p$.

Just as every number $n$ factors into a product of primes, every $n$-adic number system decomposes into a product of $p$-adics according to the factorization of $n$. \[ 10 = 2 \cdot 5 \,\,\Longrightarrow\,\, \ZZ_{10} \cong \ZZ_2 \times \ZZ_5 \]

This decomposition is (a fancy version of) the Chinese Remainder Theorem.

Decomposing $10$-adics

\[ \ZZ_{10} \cong \ZZ_2 \times \ZZ_5 \]

Every $10$-adic number decomposes into a $2$-adic and $5$-adic number in a way that respects arithmetic.

$\ZZ_{10}$$\ZZ_2$$\ZZ_5$
711112
1001100100400
…830261947…010111011…021340242
…999999999…111111111…444444444
…666666667…010101011…131313132
…909090909…001011101…211402114

Recall $b = \lim_{n\to\infty} 2^{5^n} = \ldots 879186432$.

  • Suppose $b$ decomposes as $b \mapsto (b_2, b_5)$.
  • Since $b(b^2 + 1) = 0$ in $\ZZ_{10}$, we must also have \[\begin{aligned} b_2(b_2^2 + 1) &= 0 \ \text{ in } \ZZ_2, \\ b_5(b_5^2 + 1) &= 0 \ \text{ in } \ZZ_5. \end{aligned}\]
  • But $2$ and $5$ are prime, so $\ZZ_2$ and $\ZZ_5$ have no zero divisors. Hence $b_2$ and $b_5$ are forced to pick a factor.
$b$$b_2$$b_5$
…879186432…000000000…032431212
\[ b_5^2 = \ldots 444444444 = -1 \ \text{in } \ZZ_5 \]

So $b_5 = \sqrt{-1}$ in $\ZZ_5$!

Does every $\ZZ_p$ have $\sqrt{-1}$?

We saw that $\sqrt{-1} = \ldots 032431212$ in $\ZZ_5$. Does $\sqrt{-1}$ live in every $\ZZ_p$?

Suppose $(\ldots a_4 a_3 a_2 a_1 a_0)^2 = -1$ in $\ZZ_3$.

⋯$a_4$$a_3$$a_2$$a_1$$a_0$ ×⋯$a_4$$a_3$$a_2$$a_1$$a_0$
⋯22222
  • $a_0$ can only be $0$, $1$, or $2$ in base $3$.
  • Squaring these digits in base $3$: \[\begin{aligned} \vas{0}^2 &= \vas{0} \\ \vas{1}^2 &= \vas{1} \\ \vas{2}^2 &= 4 = \vas{1} \cdot 3 + \vas{1} = \vas{11} \ \text{(base 3)} \end{aligned}\]

Hence we can never get a $2$ as the ones digit of a square.

Thus $\ZZ_3$ cannot have a square root of $-1$!

So when does $\ZZ_p$ contain $\sqrt{-1}$?

2357111317192329313741434753596167717379838997⋯
$\ZZ_p$ has $\sqrt{-1}$ $\ZZ_p$ does not have $\sqrt{-1}$

What is the pattern?

$\ZZ_p$ contains $\sqrt{-1}$ exactly when $p$ leaves a remainder of $1$ when divided by $4$.

\[ p \equiv 1 \bmod 4 \]

How often is $p \equiv 1 \bmod 4$?

Percentage of the first $n$ primes with $p \equiv 1 \bmod 4$

Chebyshev's bias

The $p$-adic prism

Following the dubious identity $\ldots 999999 = -1$ down the rabbit hole led us to the wonderful world of $p$-adic numbers.

  • Each $p$-adic number system is a parallel arithmetic universe to our familiar real numbers $\RR$.

We only get a complete picture by considering $\RR$ together with all the $p$-adics.

The White Rabbit, running with his pocket watch
$\ZZ$
$\RR$
$\ZZ_2$
$\ZZ_3$
$\ZZ_5$
$\ZZ_7$
$\ZZ_{11}$
$\ZZ_{13}$
$\vdots$
Thanks!
QR code linking to https://tghyde.github.io/notes/ Slides
Tweedledum and Tweedledee