Marvelous Arithmetics of Distance

No reckoning allowed
save the marvelous arithmetics
of distance

         (from Smelling the Wind by Audre Lorde)

Suppose a child comes up to you and says “I know 1 is odd and 2 is even, but I think 4 is more even than 2, and 1/2 is more odd than 1.” You might be tempted to reply “There’s no such thing as ‘more’ or ‘less’ odd; a number either is odd or it isn’t. And fractions aren’t odd or even; they’re just fractions.” But if you did, you’d be missing an opportunity for some serious and far-reaching fun.

Every adult who teaches kids about math should be aware that in advanced mathematics the “school rules” don’t always apply, and a kid who says something that appears to ignore the rules of the road might be intuiting some of this off-road mathematics. In the particular example I gave, if you refrain from correcting the child but instead say “Okay, I’ll play” and help the child explore the consequences of their nonstandard point of view, the two of you might end up re-inventing p-adic numbers!

If you’ve gotten this far in your life without meeting any p-adic numbers, you might think you don’t need these spooky creatures. But beware. Mathematician Paul Garrett writes: “The p-adic integers and related objects are already right under our noses, if only we can see them. … It is unwise to ignore them.”

DECIMALS THROUGH THE LOOKING GLASS

The p in p-adic stands for “prime”, and ten isn’t prime, but let’s start with the ten-adic numbers because you’re probably more comfortable with base ten than with base two, three, or five. You can discover one particularly nice 10-adic number for yourself if you have an integer calculator program with unbounded precision such as Mathematica.1 Pick a positive integer n that ends in 5 and square it; you’ll find that n2 ends in 25. Square again, and you’ll find (n2)2 ends in 625. Likewise ((n2)2)2 ends in 0625, (((n2)2)2)2 ends in 90625, and so on. The successive numbers appear to be converging digit by digit to the digits of the strange “number”

a = ···256259918212890625

I’m sure you’ve seen infinite decimal expansions before, like 1/3 = .3333 · · · and π = 3.1415 · · · , but note that such ordinary decimal expansions go infinitely far out to the right, while a has a decimal expansion that goes infinitely far out to the left.

Likewise, if you start with a positive integer that ends in 6 and repeatedly raise it to the fifth power, you converge digit by digit toward the strange number

b = ···743740081787109376

What’s even stranger is what happens when we mix a with b. For instance, let’s add a and b following the usual rule for adding numbers, working from right to left and carrying 1’s when the sum exceeds 9:

It seems a + b = 1. And if we multiply a and b together using the familiar tabular way of multiplying numbers it seems a × b = 0.

What’s going on here? What game are we even playing?

We’ll come back to that, but first, let’s meet the mathematician who sent us down this strange road.

POWER LIFTING

The main character in today’s story, the mathematician Kurt Hensel, was related through blood and marriage to both Ernst Kummer and Peter Dirichlet, whom we met last month (and whose family ties I mentioned back then). Kurt Hensel was born in 1861; his grandmother, the pianist and composer Fanny Mendelssohn, was a first cousin of Kummer’s first wife Ottilie, while Fanny’s sister Rebecka was the wife of Dirichlet. Personally, I have trouble parsing sentences like the one you just read, and I suspect I’m not alone in this. (Quick quiz: How are Kurt Hensel’s great-grandfather and Ernst Kummer’s first father-in-law related to each other?2) I find a tree-diagram helps (here time goes up the page rather than down):

Hensel’s parents home-schooled the boy up till age nine; thereafter he attended secondary school and university. Kurt’s adviser at university was Leopold Kronecker, whom we also met last month.

At university, Hensel learned about, and became intrigued by, an analogy that preoccupied many mathematicians of his day and continues to inspire research in ours: resemblances, affinities, and echoes linking discrete mathematics with continuous mathematics. In my essay Unlimited Powers I explored how, in the realm of the continuous, power series can be a useful tool for approximating functions. A decent approximation to the sine of an angle whose (radian) measure is x is the number x itself (at least when x is small); a better approximation is xx3/6; an even better approximation is xx3/6 + x5/120; and so on. The first time you learned about power-series, you may have experienced a kind of vertigo, where “up” and “down” switched places; up until then, working with polynomials, you thought of high-exponent terms as being headlines and low-exponent terms as being footnotes, but now, in Power Series Land, the terms with small exponents are the big news. If that reversal threw you for a loop, get ready for something like it but crazier, foreshadowed by those strange numbers a and b we met earlier.

But before that, let’s see how the idea of successive improvement applies to a problem in discrete mathematics: the task of finding all the square roots of 41 in mod 1000 arithmetic. (For a reminder about how modular arithmetic works, see my essay The Triumphs of Sisyphus.)

We might try brute force, but a thousand possibilities is a lot to try. Fortunately, if we work systematically from the last digit to the first digit of our mystery number n (a number whose square ends in 041), we can solve this problem handily. The last digit of n can’t be 0 (since then the last digit of n2 would be 0 rather than 1), or 2, 3, 4, 5, 6, 7 or 8 (since then the last digit of n2 would be 4, 9, 6, 5, 6, 9, or 4, respectively, rather than 1). So the last digit of n must be 1 or 9.

This is fantastic progress; we’ve ruled out 80 percent of all the numbers between 1 and 1000 that we were afraid we’d have to test individually!

We can continue to make progress by working from right to left. For instance, if n ends in 1, and we want n2 to end in 41, the second-to-last digit of n can only be 2 or 7 (try the other eight possibilities and you’ll see that they all fail). We work out all the possibilities for the last two digits and then the last three digits, and then record our successes in a tree, omitting the dead ends:

We’ve found all eight of the mod-1000 square roots of 41.

This iterative method – solving a problem mod m (10 in our example), then mod m2, then mod m3, and so on – is called “lifting”, and the theory of how to do it systematically rather than by trial and error was developed by Kurt Hensel. If we wanted to, we could go on to compute the square roots of 41 in mod 10,000 arithmetic, mod 100,000 arithmetic, etc.3

Note that such a method of successive approximation doesn’t work if you try to find the digits of the solutions by working from left to right. That’s because of a seldom-mentioned but conceptually fundamental asymmetry of decimal numerals: the final digits of x and y determine the final digits of x+y and x×y, but the initial digits of x and y do not determine the initial digits of x+y and x×y. So, even though the initial digits of numbers are the important ones for scientific applications (hey, we even call digits “significant” according to how far to the left they are), the final digits of numbers are the ones that are mathematically better-behaved, and they’re the ones number-theorists care about. But keep in mind that number-theorists have no particular allegiance to the number ten as a base or as a modulus; they’re more likely to prefer moduli that are primes or powers of primes, since as we’ll see these moduli are better behaved than moduli like ten.

GOING ALL THE WAY

Of course, Hensel wasn’t content to do the lifting trick just once, or even finitely often. He figured out how to do it infinitely many times. (Surely by now you know that this is just a thing mathematicians do.) 8212 ≡ 41 (mod 1000) lifts to 38212 ≡ 41 (mod 10000) which lifts to 038212 ≡ 41 (mod 100000) which lifts to 7038212 ≡ 41 (mod 100000) which lifts to . . . you get the idea. We approach a strange number

c = ···736758703821

which when squared according to the usual rules of carrying gives ···000000000041. c should remind you of the a and b we met earlier; they’re all 10-adic numbers. More specifically, they’re all 10-adic integers. Every leftward-infinite string of digits between 0 and 9 represents a 10-adic integer.

(Preview/spoiler: later on we’ll meet 10-adic numbers that aren’t 10-adic integers; they use digits to the right of the invisible decimal point to the right of the rightmost digit in a 10-adic integer. But I like to call the decimal point the “1’s point” to avoid decimo-centrism.)

Natural numbers like 41 correspond to 10-adic integers that begin with infinitely many 0’s. What about negative integers? They correspond to 10-adic integers that begin with infinitely many 9’s; for instance, the infinite digit-string ···999 corresponds to the ordinary integer −1. One way to see this is to consider that −1 is congruent to 9 (mod 10), congruent to 99 (mod 100), congruent to 999 (mod 1000), et cetera (remember, two numbers are congruent mod m if they differ by a multiple of m, the way −1 and 999 differ by a multiple of 1000). Another way to see it is to look at what happens when we take ···001 (the 10-adic integer that corresponds to the natural number 1) and add it to our mystery number ···999 following the rules of 10-adic addition. We end up with all 0’s, which corresponds to the natural number 0. So our mystery number, plus one, equals zero.4 The mystery number behaves just like negative one, so we call it negative one. If this makes you uncomfortable, it should! We haven’t proved that our mystery number has all the same properties as −1; we’ve only shown that it has one of them. Perhaps you’ll feel better if you try squaring ···999 using the natural tabular procedure for multiplying 10-adic integers:

(Here each row between the two horizontal lines gives the result of multiplying ···999999 by just a single 9.) So the square of ···999 is ···001, which lends us further confidence in equating those two 10-adic integers with −1 and +1 respectively. The more correct way to say this is to say that a copy of the integers lives inside the 10-adic integers.

The 10-adics also contain copies of some rational numbers that we might not have been expecting. Consider −1/3, for instance; it’s given by the leftward-infinite decimal · · · 333. To see why this strange number deserves to be called −1/3, notice that when you multiply it by 3 you get · · · 999, which has already earned the right to say that it’s −1 in new clothes. Likewise 1/3 is ···667. (If you don’t see why that final digit is a 7, look at what happens when you add ···333 to ···667.5) We already saw that the irrational number sqrt(41) leads a double life as a 10-adic integer. The same is true of the imaginary number sqrt(−31). (Check it out: squaring ···203620972687 gives ···999999999969, which is the 10-adic avatar of the integer −31.)

On the other hand, the humble fraction 1/10 has no avatar in the 10-adic integers. That’s because when you multiply any 10-adic integer by ···0010, the last digit of the product will be 0, so the product can’t be ···001. But if the absence of 1/10 from our number system distresses you, the problem is easy to fix: just allow numerals that incorporate a 1’s point (you can call it a decimal point; I won’t be offended) to mark the location of the 1’s place immediately to its left, and admit ···000.1 to our system. When we incorporate a 1’s point and allow finitely many digits to its right, we get a bigger number system, called the 10-adic numbers.6 Every rational number has an avatar in the 10-adic numbers; for instance, the 10-adic avatar of 1/6 is ···333.5 (an infinite string of 3’s to the left of the 1’s point and a single 5 to its right).

WHEN (SOME) BIG NUMBERS ARE SMALL

Remember the 10-adic square root of 41 that ended in ···321? Recall that we got it by starting with 1 (whose square gave the desired final digit), progressing to 21 (whose square gave the desired final two digits), and finishing with 321 (whose square gave all three desired digits).

Both 1 and 21 are wrong answers to the original problem because neither 1 squared nor 21 squared ends in 041, but 21 is closer to being right because as we read digits from right to left, the first discrepancy we encounter is in the hundreds place rather than in the tens place.

Think about that for a second. In this kind of problem, a discrepancy in the hundreds place is less significant than a discrepancy in the tens place. 12 differs from 41 by 40 and 212 differs from 41 by 400, but the latter is counts as a “less significant” error because when it’s the rightmost digits you care about, being off by 400 is better than being off by 40. An error of 400 is “smaller” than an error of 40.

We’re going to need a new kind of bigger/smaller dichotomy. I warn you in advance that you’ll need to say goodbye to the mental image of integers evenly spaced on a line with fractions appearing in between; where we’re going, there are no lines. Or at least, there’s no number line of the ordinary kind.

Something else we’re going to have to let go of is the idea that for any two numbers x and y that aren’t equal to each other, either x is bigger than y or y is bigger than x. That’s not the kind of bigness we’re going to need.

We’ll say that the 10-adic size of a 10-adic integer n is (1/10)k where k is the number of 0’s that appear at the right of n. So for instance ···99900 has 10-adic size 1/100.

What about 10-adic numbers that have digits to the right of the 1’s point? When there are k nonzero digits to the right of the 1’s point, we say that the number has 10-adic size 10k. So for instance ···333.21 has 10-adic size 100.

Instead of talking about size, we can talk about distance. We say that 1 and 21 are at distance 1/10 from each other because their difference, 20, has size 1/10; similarly, 21 and 321 are at distance 1/100 from each other because their difference, 300, has size 1/100.

Although we introduced ···999 as a thing in itself, in 10-adic arithmetic we can also think of it quite literally as the value of infinite sum 9 + 90 + 900 + 9000 + · · ·. This infinite sum makes no sense in high school math because the terms are getting bigger and bigger, but if we redefine bigness 10-adically, the successive terms are actually shrinking, so it makes sense that the partial sums approach something. On the other hand, if we try to add 9/10 + 9/100 + 9/1000 + . . . in the 10-adic numbers, the infinite sum doesn’t converge, because the terms are growing. So in the 10-adics, ···999 makes sense but .999··· doesn’t!

The standard proofs of formulas for sums of infinite geometric series (such as 1/2 + 1/4 + 1/8 + · · · = 1 or .999··· = 1) rely on some subtle properties of the real number system that are usually left unstated. Students who balk at these proofs may be rightly sensing that they’re not being told the whole story.

PICTURING P-ADICS

I can explain some of what’s going on using infinite branching trees. Trees with tenfold branching at each layer would be tiresome for me to create and difficult for you to interpret, but trees with twofold branching at each layer can be extended out to three or four levels without taxing the human visual apparatus. Besides, there’s some special stuff that happens in the p-adics when p is prime, and 10 isn’t prime. So at this point I’m going to switch from the 10-adic numbers to the 2-adic numbers.

I don’t want to assume that you’re familiar with base two (also known as binary), so instead of bringing in sums of powers of two as is usually done, I’ll discuss 2-adic representations of integers as play-by-play summaries of a simple solitaire game. This game has just two rules: If a number is even, divide it by 2; if a number is odd, subtract 1 from it and then divide it by 2. Just keep following the rules and see what happens!

Here’s a sample game, starting from the number 11:

11 → 5 → 2 → 1 → 0 → 0 → . . .

I’m going to write it instead from right to left as

where an arrow with a 0 on top means “subtract 0 and divide by 2” (that is, just divide by 2) and an arrow with a 1 on top means “subtract 1 and divide by 2”. In this example, the 0s go on forever. If we record the subtracted numbers (0s and 1s) from right to left, the play-by-play summary gives the standard 2-adic digital expansion of the number we started with; in this case, it’s ···001011.

If we start this game with any positive integer, we always arrive at 0. Not so for negative integers! For instance, try −11:

So the 2-adic digital expansion of −11 is ···110101.7

Fractions with odd denominators fit into this game too, if we call a fraction in reduced form “even” when its numerator is even and “odd” when its numerator is odd. Let’s try 1/3. Its numerator is odd, so we call it odd, which means that our rule tells us to subtract 1 and divide by 2, obtaining (1/3 − 1)/2 = (−2/3)/2 = −1/3. −1/3 is odd too, so we subtract 1 and divide by 2, obtaining (−1/3−1)/2 = (−4/3)/2 = −2/3. Now we have an even number, so we subtract 0 and divide by 2, obtaining (−2/3 − 0)/2 = −1/3, and we’re back at −1/3 again. Forever after we’re forced to alternate between −2/3 and −1/3, alternately subtracting 0 and subtracting 1.

So our play-by-play summary of what got subtracted during this unending game (with time starting at the right and progressing to the left) goes ···010101011, which is the 2-adic digital expansion of 1/3.

If we wanted to include fractions with even denominators in the game, we’d have to change the rules and use digital expansions that feature a 1’s point; this would take us beyond the domain of 2-adic integers into the broader realm of 2-adic numbers. Let’s not do this in the current section, since the picture I’m assembling for you is already going to be mind-bending enough!

So, we’ve got ourselves our 2-adic integers, each of which individually looks like an infinite string of 0’s and 1’s going off to the left. But is there a way to make visual sense of the collection of 2-adic integers, much as the standard number line organizes the real numbers? What does the set of 2-adic integers look like?

We can draw inspiration for a preliminary sketch of the 2-adic integers from the way the number-line organizes the real numbers between 0 and 1. How about this: Start from a line segment of length 1 (shown at the bottom of the figure) and split it into two pieces: the left piece for the 2-adic integers that end in 0 (marked “···0”) and the right piece for the 2-adic integers that end in 1 (marked “···1”), shown just above the original unsplit interval. Now split the left half of the segment into two pieces (one for the 2-adic integers that end in 00 and one for the 2-adic integers that end in 10) and split the right half of the segment into two pieces (one for the 2-adic integers that end in 01 and one for the 2-adic integers that end in 11). Continue in this way, splitting into quarter into eighths and each eighth into sixteenths, ad infinitum.

(As before, time goes from bottom to top.)

There are two problems with this approach to visualizing the 2-adic integers. First, it messes up the usual order of the natural numbers since for instance all the even integers are now placed to the left of all the odd integers – but if we’ve gotten into the true p-adic spirit of things we shouldn’t be surprised or overly concerned, since standard notions of order and size get subverted in the world of p-adic numbers. The second and more serious problem is that we’ve inadvertently housed different numbers in the same room. For instance, 1 (the leftmost odd integer, with digital expansion ···0001) and −2 (the rightmost even integer, with digital expansion ···1110) both get assigned to the midpoint of the original segment. In fact, every round dot in the picture marks a spot on the line claimed by two different numbers. We haven’t created a good picture of the set of 2-adic integers if different 2-adic integers get assigned to the same point!


(image by Ben Orlin, of Math With Bad Drawings fame)

The standard way to fix this is to use Georg Cantor’s “middle-thirds” construction. Instead of dividing the interval into half, divide it into thirds: the leftmost third for the even numbers, the rightmost third for the odd numbers, and the middle third for no numbers at all. (Kind of like the backseat of my car when my two kids were little: one kid sat on the left, one kid sat on the right, and nobody – or better yet, a piece of serious luggage – sat in the middle. The barrier didn’t prevent all fights, but it helped.) Apply this trisection idea at the next level, and the next, and so on, forever. Here’s a picture of the start of the process, in which time again goes from bottom to top.

If you take this procedure out to infinity, each 2-adic integer has an infinitesimal spot on the line to call its own. The collection of all these spots isn’t an interval but a fractal object that’s called the Cantor set (though it was actually discovered by Henry John Stephen Smith ten years earlier). While the real numbers like to stretch out to infinity, p-adic numbers huddle into clusters, and subclusters, and subsubclusters.

It’s time to bring in the trees I promised you. To make Cantor’s “discontinuum” into something that can live and breathe, we’ll attach a circulatory system to it in the form of an infinitely-branching binary tree somewhat reminiscent of the primary bronchi, secondary bronchi, tertiary bronchi, etc. of the lungs:

This life-support system for the 2-adics relates nicely to the way we measure distance between 2-adic integers. If two 2-adic integers agree in their rightmost k digits (but not their rightmost k+1 digits) we say that the 2-adic distance between them is (1/2)k. If you draw the tree picture to scale, the 2-adic distance between two 2-adic integers x and y equals the distance from x to y if, instead of traveling along the number line, you travel from x down the tree to z and then up the tree to y, where z is the most recent common ancestor of x and y in the tree.

Some 2-adic integers have digit-patterns that eventually repeat forever as you go out to the left; these are just rational numbers with odd denominators, dressed up 2-adic clothing. There are other 2-adic integers that don’t repeat; these corresponds to “holes” in the set of rational numbers with odd denominators. But these are not holes of the kind that Cantor (see my essay Things, Names, and Numbers) and Dedekind (see my essay When Five Isn’t Prime) filled; they’re holes you can only see when you’re wearing 2-adic spectacles.

ODDER THAN ODD

The 2-adic integers that end in 1 are often called “units”, on account of the fact that they have reciprocals within the set of 2-adic integers.8 Keep in mind, though, that in the inside-out math we’re engaging in here, the units are the biggest 2-adic integers, not the smallest.


(image by Ben Orlin, of Math With Bad Drawings fame)

There are 2-adic numbers that are bigger than all the 2-adic integers: for instance 1/2 (or more generally any reduced fraction whose denominator is even). Bigger than 1/2 is 1/4, and bigger than 1/4 is 1/8, and so on. If this unfamiliar way of thinking about the “size” of familiar fractions is making your head spin, let me back off from talking about size and instead talk about expanded notions of “evenness” and “oddness”.

This is where we come back to the hypothetical child I mentioned at the very start of the essay, the one who said “I know 1 is odd and 2 is even, but I think 4 is more even than 2, and 1/2 is more odd than 1.” To decide which of two nonzero rational numbers is evener and which is odder, write both in the form ±2a × p/q, where the exponent a is an integer (positive, negative, or zero) and p and q are odd integers. Whichever of the two rational numbers has a larger exponent for the 2 shall be deemed “evener” than the other, and the one with a smaller exponent for the 2 shall be deemed the “odder” of the two. If they have the same same exponent, then it’s a tie. So for instance 12 is “more even” than 18 because 12 is doubly-divisible by 2 while 18 is only singly-divisible by 2, and 1/18 is “more odd” than 1/12 for the exact same reason. Putting it in terms of 2-adic digital expansions, how even a 2-adic number is depends on where its rightmost nonzero digit is: the further to the left that digit is, the more even (or equivalently the less odd) the number is.

Once you get used to it, measuring bigness/oddness this way has numerous uses. One of them has to do with harmonic numbers. These are ordinary numbers obtained by adding the reciprocals of the first n positive integers, as n varies. For instance, the third harmonic number is 1/1 + 1/2 + 1/3, or 5/6. If you compute the first few harmonic numbers (1, 3/2, 11/6, 25/12, 137/60, 49/20, 363/140, 761/280, . . . ) you’ll find that none of them (other than the initial term 1) are integers. But can you prove it? That is, can you prove that for every n bigger than 1, the nth harmonic number isn’t an integer? Viewed through 2-adic spectacles, the crucial pattern becomes easy to spot. The second and third terms are of 2-adic size 2. The next four are of 2-adic size 4. The next eight are of 2-adic size 8. And so on.9

Another interesting application of 2-adic spectacles is Paul Monsky’s solution to a problem posed by Fred Richman: Can a square be dissected into an odd number of triangles all having equal area? Here’s a near-miss: a dissection of the square into five triangles of roughly equal area.

Three of the five have area 1/5, but one has area 1/10 while the last has area 3/10. The thing to notice here is that although 1/5 is a 2-adic unit, 1/10 and 3/10 aren’t (both have even denominators). If there were a way to dissect a square into five triangles of area 1/5, all five areas would be 2-adic integers (since 1/5 is a 2-adic integer). But Monsky’s key lemma shows that when you dissect a square into triangles, the areas can’t all be 2-adic units; at least one of them (actually, at least two of them) must have 2-adic digits to the right of the 1’s point. Now that’s not a problem if you want to dissect the square into an even number of equal-area triangles; if n is even, 1/n isn’t a 2-adic integer. But if n is odd, you can’t have a dissection of the square into triangles of area 1/n, because then all the areas would be 2-adic integers, and Monsky’s lemma says that can’t happen.10 For more on Monsky’s theorem, see Matt Baker’s blog-essay (listed in the References).

BY THE LIGHT OF ALIEN SUNS

Now that you’ve seen the 10-adics and the 2-adics, you can probably guess what the 3-adic integers are like: they’re represented by infinite strings of 0’s, 1’s, and 2’s with a rightmost digit but no leftmost digit.

The Veritaseum video “Mathematicians Use Numbers Differently From The Rest of Us” gives a nice application of 3-adic integers to an ancient problem: Find a nonzero rational number x such that x2 + x4 + x8 is the square of a rational number.

Let’s approach the problem 3-adically. x = 1+3 = 4 solves the problem mod 9, x = 1+3+9 = 13 solves the problem mod 27, x = 1+3+9+27 = 40 solves the problem mod 81, and so on. So x = 1+3+9+27+… is a solution to the problem in the 3-adic numbers. But wait a minute: the infinite sum 1+3+9+27+… converges to −1/2 in the 3-adics!11 So x = −1/2 is a rational solution to the original problem.12

Look at what happened: we found a nonzero rational solution (x, y) to the equation x2 + x4 + x8 = y2 by getting closer and closer to it, but not according to the usual notion of closeness; rather, according to 3-adic closeness.

For every prime p, we can define the p-adic integers as idealized base-p expansions that go out infinitely far to the left. The set of p-adic integers is written as p (not to be confused with the mod-p number system, though of course they’re related). And if we allow a 1’s point at the right and allow some (finitely many) base-p digits to the right of the 1’s point, we get the set of p-adic numbers, written as ℚp. (This may remind you of the unadorned symbols and ℚ which represent the ordinary integers and the ordinary rational numbers.)

Number-theorist Matt Baker writes: “To a number theorist, p-adic numbers are just as ‘real’ – and just as important – as real numbers. Both are ways of ‘filling in the gaps’ left by considering just rational numbers.”

What’s good about the p-adic numbers when p is prime is that they admit division as well as addition, subtraction, and multiplication. When n is a composite number, you can’t always divide one nonzero n-adic number by another, and relatedly, sometimes the product of two non-zero n-adics numbers gives zero (something that never happens for real numbers). We saw an example of this last anomaly at the start of the essay: the “marvelously strange” 10-adic numbers a and b are nonzero yet satisfy a × b = 0. But if we replace 10 by its two prime factors, 2 and 5, the anomaly goes away.

It’s now time to explain where a and b, those strange 10-adic numbers from the beginning of this essay, actually come from. In the 2-adic numbers, the only solutions to x2 = x are x=0 and x=1, because x2 = x can be rewritten as x(x−1) = 0, and we can use division to show that the only solutions are (2-adic) 0 and (2-adic) 1.13 Likewise, in the 5-adic numbers, the only solutions to x2 = x are (5-adic) 0 and (5-adic) 1. But when we “staple together” the 2-adic numbers and the 5-adic numbers to get the 10-adic numbers, we can mix and match those solutions to x2 = x to get not two but four solutions: the boring solutions ···000 and ···001 and two unholy Frankenstein hybrids of the numbers 0 and 1, the 10-adic numbers a and b. And our “stapler” is the Chinese Remainder Theorem (aka Sun Zi’s theorem) discussed in The Triumphs of Sisyphus.14

That explains why a and b are their own squares, and with a little more thought we can see why a+b must be 1 and a×b must be 0. Write (itwo, jfive) to signify the 10-adic integer that looks 2-adically like i but looks 5-adically like j, so that a is (1two, 0five) and b is (0two, 1five). When we add a and b, we get (1two + 0two, 0five + 1five) = (1two, 1five), which is 10-adic 1, whereas when we multiply a and b, we get (1two × 0two, 0five × 1five) = (0two, 0five), which is 10-adic 0. If you like the idea of sticking different p-adic number systems together, check out the profinite integers.

But there’s still the lingering mystery of the way repeated squarings, starting with any old decimal number n that ends in 5, brings us closer and closer (in the 10-adic sense) to a. Here again it’s helpful to look at the situation with both 2-adic and 5-adic spectacles. Since n is divisible by 5, n2 is divisible by 52, (n2)2 is divisible by 54, etc.; each time you square, the number of factors of 5 doubles. So 5-adically, the sequence n, n2, (n2)2, . . . is rapidly converging to 0. At the same time, the sequence n, n2, (n2)2, . . . is converging 2-adically to 1 (though not as quickly).15 Since the sequence n, n2, (n2)2, . . . is converging 5-adically to 0five and 2-adically to 1two, it’s converging 10-adically to (1two, 0five), which is a. (A similar analysis works for b, using the binomial expansion of (x+1)5.)

If you’ve ever learned about Newton’s method for approximating the roots of polynomials in a calculus class, and if you’re having a sense of deja vu, you’re right to be thinking “I’ve seen this before.” What we’re doing here is essentially applying Newton’s method simultaneously in 2 and 5, making use of the fact that the squaring map has 0 and 1 as attractive fixed points in both number systems. Has anyone ever written a short and sweet article for the American Mathematical Monthly called something like “Newton’s method, Hensel’s lemma, and arithmetic dynamics”? Until someone does, there’s Keith Conrad’s writeup (see the References).

A playful embodiment of the notion that different primes p shed different forms of light on the integers is Alex Wang’s game

https://mabotkin.github.io/zpordle/

(“p-ordle”). In it, you have to guess a secret-number-of-the-day between 0 and 1000 in ten tries, where each wrong answer causes the program to reveal to you the p-adic distance between your most recent guess and the correct answer, for ten pre-selected values of the prime p. For instance, if the first of the ten primes of the day is p = 3 and you guess “0” and the program replies

Prime: 3 Guess: 0 Norm: 1

then you learn that the 3-adic norm (i.e., size) of the difference between 0 and the secret number is 1; that is, the secret number is not a multiple of 3. If the second of the ten primes of the day is also 3 and you guess “1” and the program replies

Prime: 3 Guess: 1 Norm: 1/3

then you learn that the 3-adic norm of the difference between 1 and the secret number is 1/3; that is, the secret number is 1 more than a multiple of 3.

When Hensel developed the theory of p-adic numbers, he phrased things a bit differently than we do nowadays, and his approach (described in his 1913 book “Number Theory”) was hard to work with. Fortunately, the book caught the attention of young Helmut Hasse, who chanced upon it one day in 1920 while browsing through an antiquarian bookstore in Gottingen. Describing the fortuitous incident later, Hasse wrote “I found his completely new methods fascinating and worthy of thorough study.” Hasse went on to study with Hensel, and building on earlier work by Hermann Minkowski formulated and proved the first great theorem relating p-adic number theory to classical number theory: the global-local theorem for quadratic forms. It asserts that a multivariate quadratic form like 11x2 + 13y2 − 19z2 = 0 has a nonzero solution in the rational numbers if and only if has a nonzero solution in the real numbers and has a nonzero solution in the p-adic numbers for every prime p. One direction of the “if and only if” is easy: if the equation 11x2 + 13y2 − 19z2 = 0 has a solution in rational numbers, then those rational numbers have avatars in the p-adic numbers, so we get a p-adic solution for free, for each and every value of p. It’s the other direction that got number theorists excited. It says that the primes jointly “know” all the reasons why a quadratic equation might fail to have rational solutions.16

Or rather, the ordinary primes along with one extraordinary prime know all the reasons. This extra prime is sometimes called “the prime at infinity” or “the real prime”, but that’s just a figure of speech. In the imperfect pairing between primes and well-behaved extensions of the rational numbers (see Ostrowski’s Theorem), this notional prime gets paired with the real number system; see for instance the Math Stack Exchange question What is the Prime at Infinity?. You might say that the prime at infinity is a hole in the correspondence between primes and different ways of measuring bigness – a hole that mathematicians, those inveterate hole-fillers, can’t resist filling.

An even bigger win for p-adic numbers came at the end of the 20th century, when Andrew Wiles and Richard Taylor used 3-adic numbers and 5-adic numbers to give a proof of the Taniyama-Shimura Conjecture, which (thanks to work of Ken Ribet) was known to imply the truth of Fermat’s Last Theorem (discussed last month).

In their book “Number Theory I: Fermat’s Dream,” authors Kato, Kurokawa, and Saito write, “In the long history of mathematics a number meant a real number, and it is only relatively recently that we realized that there is a world of p-adic numbers. It is as if those who had seen the sky only during the day are marveling at the night sky. Just as we can see space objects better at night, we begin to see the profound mathematical universe through the p-adic numbers.”

Near the start of this article, I quoted Paul Garrett’s warning against ignoring the p-adics. But perhaps I should have mentioned the peril that awaits those who, far from ignoring p-adic numbers, become seduced by them. Mathematician Peter Scholze, whose work on p-adic numbers had much to do with his winning a Fields Medal, writes: “Now I find real numbers much, much more confusing than p-adic numbers. I’ve gotten so used to them that now real numbers feel very strange.”

Thanks to Matt Baker, Jeremy Cote, Dan Drake, Noam Elkies, Bill Propp, Paul van der Walt and Glen Whitney.

This essay is a draft of chapter 13 of a book I’m writing, tentatively called “What Can Numbers Be?: The Further, Stranger Adventures of Plus and Times”. If you think this sounds cool and want to help me make the book better, check out http://jamespropp.org/readers.pdf. And as always, feel free to submit comments on this essay at the Mathematical Enchantments WordPress site!

ENDNOTES

#1. If you have a calculator with limited precision, you can still play the squaring game, at least for a while; for instance, if your calculator has twelve digits, then once you get numbers with seven or more digits, throw out all but the last six digits of each number before you square it.

#2. They were brothers.

#3. You might guess that there’d be sixteen solutions in the next level, but the doubling actually stops; at each successive level, half of the solutions have two “children” but the other half have none at all. In fact, in many important applications of lifting, once you reach a certain point there’s no more branching: each mod mk solution gives rise to a single mod mk+1 solution.

#4. Some people wonder, “If we keep carrying the 1, doesn’t it have to go someplace and not just disappear? Shouldn’t it end up all the way at the left, at infinity?” I know four answers to this question. The first is, the decimal system doesn’t have “digits at infinity”. The second is, you’re free to try come up with a different way to add left-infinite numerals, and yours could be a self-consistent number-system, but that’s not how 10-adic addition is defined. The third answer is, we choose this way of adding infinite numerals because it agrees with what we get when we treat 10-adic integers the “mod 10, mod 100, mod 1000, et cetera” way; that is, 1+9 is 0 (mod 10), 01+99 is 00 (mod 100) 001 + 999 is 000 (mod 1000), et cetera. My fourth answer is, just as the place value of the “1” in the successive decimal representations .1, .01, .001, .0001, …goes to 0, the place value of the “1” in the successive 10-adic representations 1, 10, 100, 1000, . . . goes to 0, by virtue of our topsy-turvy redefinition of what “big” and “close” mean.

#5. That “7” at the end of the 10-adic representation of 1/3 feels spookily like the phantom 7 that would be the last digit of the decimal expansion of 2/3 if that expansion had a last digit, which it doesn’t. If despite what I wrote in the last footnote you still think that the 7 at the end of the successive approximations .67, .667, .6667, … has to go somewhere, now you’ve found a place for it to go: you can say that it jumped from (nonexistent) tail-end of the base-ten expansion of 2/3 to the tail-end of the ten-adic expansion of 1/3.

#6. What if we allow infinitely digits both to the left and to the right of the decimal point? Then you can get addition to work but not multiplication. See Donald Knuth’s preprint Ambidextrous Numbers.

#7. You can add two 2-adic numbers by adding their digital expansions with the carry rule “1 plus 1 equals 0-carry-the-1”. In particular you can add the infinite digital expansions ···110101 and ···001011 obtaining ···000000, which is indeed the digital expansion of 11 + (−11).

#8. Once upon a time, 1 wasn’t considered a number at all; it was considered the “unit” from which all the counting numbers were built. Later on −1 was accepted as the negative unit and i and −i were accepted as imaginary units. As new number systems proliferated, mathematicians needed a word for elements of a number system whose reciprocals also live inside the number system. They realized they were already calling these numbers “units” in the integers and in the Gaussian integers, so it seemed sensible to extend the term to numbers-with-reciprocals in general, even when numbers-with-reciprocals are no longer building blocks in any evident sense.

#9. It helps that at each stage, as we add 1/n to the n−1st harmonic number to obtain the nth harmonic number, the two numbers we’re adding are of different 2-adic size. And when we add two numbers of different 2-adic size, the 2-adic size of the sum is always equal to the 2-adic size of whichever of the two numbers being added is 2-adically larger. So for instance, the third harmonic number, 11/6, has 2-adic size 2, while 1/4 has 2-adic size 4, so when we add them, the sum has 2-adic size 4. This gives us an easy way to see that every harmonic number beyond the first, expressed as a reduced fraction, has an even denominator, and hence is not an integer. In fact, the denominators get “evener and evener” (that is, more and more divisible by 2) the further out we go. Putting it differently: the harmonic series 1/1 + 1/2 + 1/3 + 1/4 + . . . diverges to infinity 2-adically. It is believed, but not yet proved, that for every prime p, the harmonic numbers diverge to infinity p-adically.

#10. I’m cheating a little bit here. The triangle-areas in Monsky’s theorem are ordinary real numbers, not 2-adic numbers. So Monsky had to show that 2-adic ideas could be extended to real numbers as well. It turns out that there are multiple ways to do this extension – for instance, there are some that make π even and others that make π odd – but the fact that there’s at least one way to do it is all Monsky needed to get his proof to work.

#11. For instance, (1+3+9+27) − (−1/2) = 81/2 whose numerator is quadruply-divisible by 3, so the 3-adic distance between 1+3+9+7 and −1/2 is 1/81.

#12. Check: (−1/2)2 + (−1/2)4 + (−1/2)8 is equal to 81/256, which is the square of 9/16.

#13. If x(x−1) = 0, and x isn’t 0, then x has a reciprocal in the 2-adic numbers, so that when we multiply both sides of the equation x(x−1) = 0 by that reciprocal, it cancels the x and we get x−1 = 0.

#14. For instance, ···001two is 1 mod 23 (here I’m using subscripts so you’ll remember which number belongs to 2 and which number belongs to 5) while ···000five is 0 mod 53. Since 23 and 53 are relatively prime with product 103, Sun Zi’s theorem tells us that there’s a unique element in mod 1000 arithmetic that’s congruent to 1 mod 23 and 0 mod 53. And that element just happens to be 625, which gives us the last three digits of the strange number a. Likewise, if we look at the last three digits of b we get 376, the unique three-digit decimal number that’s congruent to 0 mod 23 and 1 mod 53.

#15. That’s because if you square a number n that’s 1 more than a multiple of 2k, where k is a positive integer, you always get a number that’s 1 more than a multiple of 2k+1. To see why, write n as 2kr + 1; then n2 = (2kr)2 + 2(2kr)(1) + (1)2, which simplifies to 22kr2 + 2k+1r + 1. Since k ≥ 1, we have 2kk+1, so both 22kr2 and 2k+1r are divisible by 2k+1, implying that n2 is 1 more than a multiple of 2k+1.

#16. In the example I gave, there are lots of nonzero rational solutions; two simple ones are (x,y,z) = (3,8,7) and (x,y,z) = (9,5,8).

REFERENCES

Matt Baker, p-adic numbers and dissections of squares into triangles

Keith Conrad, Hensel’s Lemma

Paul Garrett, Adele groups, p-adic groups, solenoids

M. J. Shai Haran, The Mysteries of the Real Prime, London Mathematical Society, 2001

Kelsey Houston-Edwards, An Infinite Universe of Number Systems

Evelyn Lamb, The Numbers behind a Fields Medalist’s Math

Derek Muller, Mathematicians Use Numbers Differently From The Rest of Us

Eric Rowland: 1 Billion is Tiny in an Alternate Universe: Introduction to p-adic Numbers

James Tanton, Some Unusual Mathematics for Unusual Numbers



5 thoughts on “Marvelous Arithmetics of Distance

  1. Antoine Chambert-Loir

    About footnote #10, this 2-adic idea was known before Monsky, when the vertices of all triangles were assumed to have rational coordinates. What we owe to him is the idea of using an extension of the 2-adic distance initially defined on the rationals to the real numbers.

    Liked by 1 person

    Reply
  2. Pingback: Apt Arithmetics of Distance – TOP Show HN

  3. Pingback: Expedient Arithmetics of Distance – TOP HACKER™

  4. Pingback: Plus and Times Set Free |

Leave a comment