Home

P-Adic Numbers

2023-12-03

Every mathematician knows that 0.999...=10.999... = 1. There are a few ways to prove that. Perhaps the simplest is to deconstruct the decimal: 0.999...=0.9+0.09+0.009+...0.999... = 0.9 + 0.09 + 0.009 + .... This is an infinite geometric series with first term 0.90.9 and common ratio 0.10.1; the formula for the sum of an infinite geometric series tells us that it’s equal to 0.91−0.1=1\frac{0.9}{1 - 0.1} = 1.

This infinite series gives us a shortcut to a lot of other fractions. 99=9×1199 = 9 \times 11, so we know that 111=0.090909...\frac{1}{11} = 0.090909.... Going the other direction, you might know that 17=0.142857142857...\frac{1}{7} = 0.142857142857..., which tells us that 999999=7×142857999999 = 7 \times 142857.

Let’s consider a different “number”. What if, instead of repeating 99s to the right of the decimal point, we repeated 99s to the left of the decimal point? What is ...999999...999999 equal to?


Your first guess might be “infinity”, which in the number system we’re used to, is accurate. We can also write this as 9+90+900+9000+...9 + 90 + 900 + 9000 + ..., which is a divergent series with no limit. So “infinity” isn’t a bad first guess.

Just for fun, though, let’s apply our formula for an infinite geometric series to this series. 9+90+900+...9 + 90 + 900 + ... is an infinite geometric series with first term 99 and common ratio 1010, so the formula (if we could apply it) would give us a sum of 91−10=−1\frac{9}{1 - 10} = -1. That can’t be right, can it?


What happens if we add 11 to our “number”? Normally, when we add 11 to a number, we add it to the ones place; if that overflows, we add the rest to the tens place, and so on, until it stops overflowing.

For our number, when we add 11 to the ones place, it indeed overflows (leaving us with 00 in the ones place); when we add the 11 from the overflow to the tens place, it overflows again. This continues forever; our result looks like ...000000...000000, with a 11 that keeps on moving to the left forever.

Interesting! This looks a lot like 00; if ...999999+1=0...999999 + 1 = 0, there’s another piece of evidence suggesting that ...999999=−1...999999 = -1.


Let’s try one more thing. What happens if you multiply ...999999...999999 by itself? We can multiply this the same way we learned to multiply normally; first we multiply the top number by the ones digit of the bottom number, then the tens digit (shifting left by 1), etc. When we’re done, we add up all of the partial products to get our final product.

…999999×…999999_…999991…999910…999100…991000…910000+…100000_…000001 \begin{array}{r} \ldots 999999 \\ {\times}\ \underline{\ldots 999999} \\ \ldots 999991 \\ \ldots 999910 \\ \ldots 999100 \\ \ldots 991000 \\ \ldots 910000 \\ {+}\ \underline{\ldots 100000} \\ \ldots 000001 \end{array}

You can try this yourself; no matter how many partial products you compute, the numbers always cancel, and our result is 11.


To recap, so far, we’ve found that ...999999+1=0...999999 + 1 = 0 (just like −1+1=0-1 + 1 = 0), ...999999×...999999=1...999999 \times ...999999 = 1 (just as −1×−1=1-1 \times -1 = 1), and with our infinite series formula, ...999999=−1...999999 = -1.

At this point, we might start to think that we’ve discovered something. If ...999999...999999 acts like −1-1 in all the important ways, maybe it’s equivalent to −1-1 in a sense. This “sense” is called the 10-adic numbers (10 refers to the fact that we’re using base 10); digit strings that go on forever to the left.

What other numbers can we write using 10-adic numbers?

By similar logic as above ...999998=−2...999998 = -2 in this system (because ...999998+2=0...999998 + 2 = 0), and so on; we can write every negative integer as a 10-adic number instead.

What about fractions? What’s 13\frac{1}{3} in 10-adic numbers? Well, we know that ...999999÷3=...333333...999999 \div 3 = ...333333, so ...333333=−13...333333 = -\frac{1}{3}. Since −13+13=0-\frac{1}{3} + \frac{1}{3} = 0, we must have 13=...666667\frac{1}{3} = ...666667.

See if you can find 17\frac{1}{7}, 111\frac{1}{11}, and 19\frac{1}{9} on your own (bonus points for computing 19\frac{1}{9} in at least three different ways, using what we’ve already found!).


What about 12\frac{1}{2}? The “trick” we’ve used above doesn’t work, since 2 isn’t a factor of any repeating string of 9s. In fact, we can convince ourselves quite easily that 12\frac{1}{2} can’t be represented as a 10-adic number; if it were, and the units digit of that representation was aa, then we must have 2a≡1(mod10)2a \equiv 1 \pmod{10}, which is impossible. The same is true for 15\frac{1}{5}, by similar logic.

In fact, any fraction which contains a factor of 2 or 5 in the denominator (when fully simplified) cannot be expressed as a 10-adic number (see if you can prove that). All other fractions, however, can.


Finally, let’s talk about a couple of interesting examples of 10-adic numbers. If you take the number 5 and square it, you get 25; square 25, and you get 625; square 625, and you get 390625. If you continue this process indefinitely, you’ll notice that the end of these numbers converges to a 10-adic constant, a=...256259918212890625a = ...256259918212890625. Notice that sometimes intermediate results won’t match the entire string, as aa ends in 90625 but not 390625; however, the process will eventually converge on aa.

Similarly, if you start with the number 6 and raise it to the fifth power, you get 7776; raise 7776 to the fifth power, and you get a very long number ending in 376. If you repeat this process indefinitely, you end up with another 10-adic constant, b=...743740081787109376b = ...743740081787109376.

These two numbers seem like ordinary 10-adic numbers; however, if you put them together, they start behaving strangely.

Let’s try adding them first.

…890625+…109376_…000001 \begin{array}{r} \ldots 890625 \\ {\plus}\ \underline{\ldots 109376} \\ \ldots 000001 \end{array}

Now let’s try multiplying them.

…890625×…109376_…343750…343750…187500…625000…000000+…500000_…000000 \begin{array}{r} \ldots 890625 \\ {\times}\ \underline{\ldots 109376} \\ \ldots 343750 \\ \ldots 343750 \\ \ldots 187500 \\ \ldots 625000 \\ \ldots 000000 \\ {+}\ \underline{\ldots 500000} \\ \ldots 000000 \end{array}

I encourage you to try this process, as long as it takes to convince yourself that the sum is indeed 1 and the product is indeed 0.

So what’s going on here? Why is this happening, and what does it mean?


One thing to know is that mathematicians really hate it when this happens. There’s a rule that if ab=0ab = 0, either a=0a = 0 or b=0b = 0; this is true in our number system, but also in most other systems that mathematicians like to use. When it breaks, something has gone wrong.

Let’s talk a little bit about why this breaks. The root of the problem is that 10 is composite. Because 10 has two prime factors and not just one, 10-adic numbers don’t behave the way we want them to. In fact, every 10-adic number acts like two numbers; how it behaves mod 2, 4, 8, … and mod 5, 25, 125, ….

In our example, a≡1mod2na \equiv 1 \mod{2^n} for every integer n>0n \gt 0, and a≡0mod5na \equiv 0 \mod{5^n} for every integer n>0n \gt 0. Conversely, b≡1mod2nb \equiv 1 \mod{2^n} for every integer n>0n \gt 0, and b≡0mod5nb \equiv 0 \mod{5^n} for every integer n>0n \gt 0. In a sense, we can think of aa as the pair (1,0)(1,0) and bb as the pair (0,1)(0,1). Multiplying these pairwise gives us (0,0)(0,0), which is equivalent to 00, and adding gives (1,1)(1,1), which (it can be shown) is equivalent to 11.


In fact, the “p” in “p-adic numbers” stands for “prime”, and these numbers are usually constructed from prime numbers. For a prime p, p-adic numbers obey all the rules we want them to obey, and in fact become a very useful tool for all sort of applications. These ideas were even used in Andrew Wiles’ proof of Fermat’s Last Theorem.


Sources: