Discrete

A root lifted one digit at a time

On a dial of seven, 3 × 3 is 2. On a dial of forty-nine the square root of 2 must reduce to 3, so there are only seven candidates, and exactly one of them works: 10. On a dial of 343 exactly one lift of 10 works: 108. Each step adds one digit on the left, found by solving a linear equation, and the digits go on for ever — a number …21216213 whose square is 2, in a world where closeness means divisibility by seven.

Worth reading first: Multiplying every number on the dial at once · Two dials at once.

Multiplying on a dial splits it into cycles whose lengths grow by a factor of the prime as the dial runs up the powers of that prime. Roots of equations behave the same way, and far more usefully. On a dial of seven, 3×3=93 \times 3 = 9, and nine leaves two on division by seven. So 33 is a square root of 22 on that dial, and so is 44, since 4×4=16=2+144 \times 4 = 16 = 2 + 14. Now ask the same question on a dial of forty-nine. There are forty-nine residues to try, and a search would try them all.

There is a better way, and it is the whole of this essay. Any square root of 22 on the dial of forty-nine is, in particular, a square root of 22 on the dial of seven — reducing both sides of x22(mod49)x^2 \equiv 2 \pmod{49} gives x22(mod7)x^2 \equiv 2 \pmod 7. So it must be 33 or 44 plus a multiple of seven, and only fourteen candidates remain. Of the seven lifts of 33, exactly one works, and it is 1010: 100=2+2×49100 = 2 + 2 \times 49. On the dial of 343343 exactly one of the seven lifts of 1010 works, and it is 108108. The roots do not have to be searched for at all. They are lifted, one power of seven at a time, and each lift is the solution of a linear equation.

Kurt Hensel made this into a theorem around 1900, and then into a number system. The lifts go on for ever, each one adding a digit on the left of the root’s base-seven expansion, and the infinite string of digits they build is a genuine square root of 22 — not among the real numbers, but among the seven-adic numbers, where two numbers are close when their difference is divisible by a high power of seven.

A tree that never branches

Search every residue on the dials of 77, 4949, 343343 and 24012401 and draw the square roots of 22 on each, joining each root to the root it reduces to on the dial one step smaller.

Square roots of 2, lifted from one power of 7 to the next. A tree whose rows are the square roots of 2 modulo 7 to the powers 1 to 4, each joined to the root it reduces to; counts 2, 2, 2, 2.
Fig. 1 The square roots of 2 modulo 7, 49, 343 and 2401, each found by checking every residue on its dial and joined to the root it reduces to one level up. Every level has exactly two roots, and each root has exactly one lift: 3, 10, 108, 2166 on one branch and 4, 39, 235, 235 on the other. Because 7 is odd and does not divide 2, the tree can never branch and never die.

The tree has two trunks and no branches. On every dial there are exactly two square roots of 22 — one reducing to 33, one to 44 — and the root on each dial determines the root on the next. The search checked every residue at every level; the regularity it found is what the theorem predicts. Notice also that the two trunks are negatives of each other on every dial: 3+4=73 + 4 = 7, 10+39=4910 + 39 = 49, 108+235=343108 + 235 = 343, 2166+235=24012166 + 235 = 2401. If xx squares to 22, so does x-x, and on a dial of odd size xx and x-x are never the same residue.

What the tree does not show is why each root has exactly one lift, and the reason is the most useful idea in the subject: to lift a root, solve the tangent-line equation.

The next digit is a tangent line

Suppose x0x_0 is a square root of 22 on the dial of 7k7^k. The candidates on the next dial are x0+t7kx_0 + t\cdot 7^k for t=0,1,,6t = 0, 1, \ldots, 6. Square one:

(x0+t7k)2=x02+2x0t7k+t272k.(x_0 + t\,7^k)^2 = x_0^2 + 2x_0\,t\,7^k + t^2\,7^{2k}.

The last term is a multiple of 7k+17^{k+1} and can be ignored. So the condition for a lift is

x022+2x0t7k0(mod7k+1),x_0^2 - 2 + 2x_0\,t\,7^k \equiv 0 \pmod{7^{k+1}},

and since x022x_0^2 - 2 is already a multiple of 7k7^k — that is what it means for x0x_0 to be a root on the smaller dial — everything can be divided by 7k7^k, leaving

x0227k+2x0t0(mod7).\frac{x_0^2 - 2}{7^k} + 2x_0\,t \equiv 0 \pmod 7.

That is a linear equation for the single digit tt, on the dial of seven. It has exactly one solution provided 2x02x_0 is not a multiple of seven, because then 2x02x_0 has an inverse on that dial and tt is determined. And 2x02x_0 is not a multiple of seven: seven is odd, and x0x_0 is not a multiple of seven because x022x_0^2 \equiv 2. So every root has exactly one lift, at every level. The figures confirm it by trying all seven candidate digits and finding exactly one that works, the one the formula gives.

The quantity 2x02x_0 is the derivative of x22x^2 - 2 at x0x_0, and the equation above is what Newton’s method does with it: replace the curve by its tangent line at the current guess, and solve the tangent line for the correction. The derivative was built to say how a function responds to a small change in its input. On a dial, “small” means “a multiple of a high power of seven”, and the derivative says how the function responds to that. Hensel’s lemma is Newton’s method in which nearness means divisibility. If the derivative at the root is not divisible by the prime, the root lifts uniquely; if it is, the lemma is silent and anything can happen.

The digits of a new number

Record the lifts in base seven and a pattern appears that is invisible in base ten. Each lift keeps every digit the previous root had and adds exactly one more, on the left.

A square root of 2, one 7-adic digit at a time. A table of the square root of 2 modulo 7 to the powers 1 to 8, with its base-7 digits; each row keeps the previous digits and adds one on the left.
Fig. 2 The root of 2 that reduces to 3, lifted from the dial of 7 to the dial of 787^8: 3, 10, 108, 2166, 4567, 38181, 155830, 1802916. In base seven each row keeps the digits of the row above and adds one on the left, highlighted. The digits so far are 21216213, and they continue to the left for ever.

In base ten the lifts 3,10,108,2166,4567,3, 10, 108, 2166, 4567, \ldots look unrelated. In base seven they are 33, 1313, 213213, 62136213, 1621316213, and so on: each is the previous one with a digit prepended. That is simply what “a lift” means — the new root agrees with the old one on the smaller dial, so its last kk base-seven digits are the old root’s, and the new information is one digit further left.

Carried on for ever, the process builds an infinite string of digits running to the left, 21216213\ldots 21216213, with the property that its last kk digits square to 22 on the dial of 7k7^k for every kk. Hensel’s idea was to take that string seriously as a number. Strings of base-pp digits running infinitely to the left can be added and multiplied digit by digit with carries, exactly as whole numbers are, and they form a number system, the pp-adic integers. In the seven-adic integers the string above is a square root of 22, in the same sense that the decimal 1.414211.41421\ldots, with digits running infinitely to the right, is a square root of 22 among the real numbers.

The two constructions are mirror images, and the mirror is the notion of distance. Among the real numbers, 1.414211.41421 is close to 2\sqrt 2 because their difference is small in size. Among the seven-adic numbers, 18029161802916 is close to the root because their difference is divisible by 787^8. Alexander Ostrowski proved in 1916 that these are the only two kinds of distance the rational numbers admit — size, and divisibility by one prime — so the real numbers and the pp-adic numbers, one system for each prime, are all the ways there are of filling in the gaps between fractions.

Newton’s method, doubling the digits

Newton’s method for a real square root doubles the number of correct decimal places at every step once it is close. The same happens seven-adically, and it is more dramatic, because each step is exact arithmetic on whole numbers.

Newton's method, where near means divisible by 7. Bars showing how many base-7 digits of x² agree with 2 after each Newton step from 3: 1, 2, 4, 8, 16, 32.
Fig. 3 Newton’s method for x2=2x^2 = 2 starting from 3, with the division by 2x done modulo a high power of 7. The number of trailing base-7 digits in which x2x^2 agrees with 2 goes 1, 2, 4, 8, 16, 32: it doubles at every step, exactly as the correct decimal places of a real square root double, because here “close” means differing by a multiple of a high power of 7.

The one-digit-at-a-time lifting of the previous figure is Newton’s method run with its correction truncated to a single digit. Run the full correction instead — xx(x22)/(2x)x \leftarrow x - (x^2 - 2)/(2x), with the division done on a dial of a large power of seven — and the agreement goes 1,2,4,8,16,321, 2, 4, 8, 16, 32 digits. The reason is the one that makes Newton’s method fast among the real numbers: the error after a step is proportional to the square of the error before it, and squaring a number divisible by 7k7^k gives one divisible by 72k7^{2k}. Quadratic convergence is a statement about how errors multiply, and it does not care whether error is measured by size or by divisibility.

Where the slope vanishes

The lemma needs the derivative not to be divisible by the prime. For square roots, the derivative is 2x2x, and there is exactly one prime that divides 2x2x for every xx: the prime two. On dials that are powers of two, the tree of square roots behaves quite differently.

Square roots of 17, lifted from one power of 2 to the next. A tree whose rows are the square roots of 17 modulo 2 to the powers 1 to 5, each joined to the root it reduces to; counts 1, 2, 4, 4, 4.
Fig. 4 The square roots of 17 modulo 2, 4, 8, 16 and 32. The tree branches and dies: one root mod 2, two mod 4, four mod 8, and then four at every level after, but not by one lift each — mod 16 the roots 1 and 7 each have two lifts while 5 and 3 have none. Because the slope 2x is even at every root, lifting stops being unique.

The square roots of 1717 show it. On the dial of two there is one, 11. On the dial of four there are two, 11 and 33. On the dial of eight there are four: every odd number squares to 11 on the dial of eight, and 17117 \equiv 1. Then the count stays at four, but the tree reshuffles at every level: on the dial of sixteen, the roots 11 and 77 each have two lifts and the roots 33 and 55 have none. The tangent-line equation has become 0t0 \cdot t \equiv something, which has either no solution or every solution, and the tree branches where it has every solution and dies where it has none.

There is a stronger form of the lemma that handles this. If the derivative at a root is divisible by exactly pep^e, the root lifts provided the function vanishes there to one more than twice that power, p2e+1p^{2e+1}. For square roots at the prime two, e=1e = 1, so a root on the dial of eight lifts all the way up, and the consequence is clean: an odd number is a square in the two-adic integers exactly when it leaves remainder 11 on division by 88. Seventeen does, so it has two-adic square roots; 33, 55 and 77 do not, and have no square roots on the dial of eight or any higher power of two.

A vanishing derivative, in both worlds

The failure at two has an exact counterpart among the real numbers, and seeing the two side by side is the clearest way to understand what the derivative is doing in each. Newton’s method for a real root converges quadratically — doubling the correct digits — only when the derivative is not zero at the root. At a double root, where the curve touches the axis instead of crossing it, the derivative vanishes, the tangent line is flat, and the method slows to halving the error at each step: one correct binary digit per step instead of twice as many.

On a dial the same vanishing has a different symptom. The tangent-line equation for the next digit is f(x0)tf(x0)/pk(modp)f'(x_0)\,t \equiv -f(x_0)/p^k \pmod p, and when pp divides f(x0)f'(x_0) the coefficient of tt is zero on the dial of pp. The equation stops determining tt: either every digit works or none does. So where the real method slows down, the pp-adic method loses uniqueness, and the tree branches or dies. In both worlds the cure is the same — look one order deeper, at how fast the function vanishes compared with its derivative — and in both worlds a root where the derivative vanishes is a root where the function is flatter than a line, so a small change in the input changes the output by much less than usual. Among the reals that makes the root hard to locate; on a dial it makes many residues equally good.

Which primes have a square root of two

The seven-adic square root of 22 exists because 22 is a square on the dial of seven, and the lifting does the rest. The same is true at every odd prime: 22 has a pp-adic square root exactly when it is a square modulo pp. Which primes those are is the second supplement to quadratic reciprocity: 22 is a square modulo an odd prime pp exactly when pp leaves 11 or 77 on division by 88 — so for 77, 1717, 2323, 3131, 4141 and half of all primes, and not for 33, 55, 1111, 1313, 1919 and the other half. At those, 2\sqrt 2 has no pp-adic existence at all.

So the real number 2\sqrt 2, which cannot be a fraction, has a pp-adic counterpart at half the primes and none at the other half. The number 1-1 behaves similarly, with a square root at the primes that leave 11 on division by 44. Every rational number’s squareness is decided prime by prime in this way, and the pp-adic numbers are the language in which “prime by prime” becomes a statement about a single object at each prime.

Counting roots on every dial

The two behaviours — unique lifting at odd primes, a mod-eight condition at two — are clearest side by side, in a count of square roots on every prime-power dial.

How many square roots a number has, modulo each prime power. A table of the number of solutions of x² ≡ a modulo powers of 2, 3, 5, 7 for a = 1, 2, 3, 5, 17.
Fig. 5 The number of square roots of 1, 2, 3, 5 and 17 modulo each power of 2, 3, 5 and 7 up to about three thousand, counted by trying every residue. For an odd prime not dividing the number, the count is 2 or 0 and never changes as the power grows. For powers of 2 from 8 on, an odd number has 4 square roots if it leaves 1 on division by 8, and none otherwise.

Read down any column at an odd prime and the count is constant: 22 if the number is a square on the dial of the prime itself, 00 if it is not, and the same at every power above. So for odd primes the question “is aa a square modulo pkp^k?” is decided entirely on the dial of pp — which is the question quadratic reciprocity answers. The column for 33 at the prime three shows the one exception, when the prime divides the number: 33 has the single root 00 modulo 33, and none modulo 99, because any multiple of three squares to a multiple of nine.

At the prime two the pattern is the mod-eight rule. Modulo 22 every odd number is a square; modulo 44 only those that leave 11 are; from eight on, it has four square roots or none, according as it is 1mod81 \bmod 8 or not. The four roots are ±x\pm x and ±x+2k1\pm x + 2^{k-1}, which is where the branching in the tree comes from: on a dial of a power of two, adding half the dial to a square root gives another square root, since (x+2k1)2=x2+2kx+22k2(x + 2^{k-1})^2 = x^2 + 2^k x + 2^{2k-2}.

From every dial to the rationals

The lifting argument has a consequence that runs the other way, and it is the reason the pp-adic numbers became central to number theory rather than a curiosity. If an equation with whole-number coefficients has a solution in rational numbers, then clearing denominators it has solutions on every dial, and it has a real solution. So an equation that fails on some dial has no rational solution — a cheap and powerful obstruction. Combined with solving on several dials at once, it is how most “no solution” proofs in elementary number theory work.

Hensel’s lemma makes the obstruction checkable: an equation is solvable on every power of pp as soon as it is solvable on one small dial with a nonvanishing derivative, so “solvable on every dial” is decided by finitely many checks. The deep question is the converse — whether solvability on every dial and among the reals forces a rational solution. For quadratic equations it does: that is the Hasse–Minkowski theorem, proved by Helmut Hasse in 1921 and 1923 from Minkowski’s earlier work on quadratic forms. For cubic equations it does not. Ernst Selmer showed in 1951 that

3x3+4y3+5z3=03x^3 + 4y^3 + 5z^3 = 0

has solutions with x,y,zx, y, z not all zero on every dial and among the reals, and none in whole numbers. The local–global principle holds for squares and fails for cubes, and measuring how it fails is one of the central problems of modern number theory.

What the dials cannot show

They cannot show the infinite number. Every figure stops at a finite power of the prime — the table at 787^8, the tree at 747^4, Newton’s method at thirty-two digits. The seven-adic square root of 22 is the limit of all of them, and the figures show its first digits and the rule that produces the rest, not the number itself.

They cannot show why only two distances exist. Ostrowski’s theorem, that size and divisibility by a prime are the only ways to measure distance between fractions, is quoted, not drawn; nothing in a picture of dials rules out a third.

And they cannot show Selmer’s cubic failing. That 3x3+4y3+5z3=03x^3 + 4y^3 + 5z^3 = 0 has no nontrivial whole-number solution is proved by an argument about the arithmetic of a cubic field, not by searching; a search, however long, would only fail to find one.

Still open: are the digits random

The seven-adic digits of 2\sqrt 2 begin 3,1,2,6,1,2,1,23, 1, 2, 6, 1, 2, 1, 2, and the decimal digits begin 1,4,1,4,2,1,3,51, 4, 1, 4, 2, 1, 3, 5. Both expansions are infinite and never repeat, since 2\sqrt 2 is irrational. Whether either is normal — whether each digit appears, in the long run, one time in seven or one time in ten, and each block of digits with its fair share — is not known for either. It is not known for any algebraic irrational number in any base, real or pp-adic. The digits are completely determined, each one computable by the lifting of this essay, and nobody can say whether they are evenly spread.

One digit, one linear equation

A root of a polynomial on a dial of pkp^k lifts to the dial of pk+1p^{k+1} by solving a linear equation for one digit, and when the derivative at the root is not divisible by pp the lift is unique. For x2=2x^2 = 2 and p=7p = 7 that makes a tree with two trunks and no branches, and the digits the lifts add build a seven-adic number, 21216213\ldots 21216213, whose square is 22. Newton’s method run in the same arithmetic doubles the digits at every step.

At the prime two the derivative 2x2x always vanishes, the tree branches and dies, and an odd number is a two-adic square exactly when it is 1mod81 \bmod 8. Across all prime powers, the count of square roots is fixed at the prime itself for every odd prime. Solvability on every dial is necessary for a rational solution; for squares it is also sufficient, and for cubes, as Selmer’s equation shows, it is not.

When a problem can be solved approximately, ask what “approximately” means — divisibility is an approximation too, and with it Newton’s method builds new numbers.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

DerivativeHensel lemmaLiftingLocal global principleModular arithmeticNewtons methodP adic numbersQuadratic residueSquare root