MathLabs

Arithmetic and number theory

p-adic numbers and arithmetic

A prime pp gives Q\mathbb{Q} a second, non-Archimedean notion of distance: numbers become close when their difference is divisible by a high power of pp. Completing Q\mathbb{Q} under this metric produces Qp\mathbb{Q}_p, the field where Hensel's lemma, Ostrowski's theorem, and modern arithmetic geometry live.

IntuitionRedefining closeness by divisibility

Ordinarily, two numbers are close when their difference is small. Fix a prime pp instead, and declare two integers close when their difference is divisible by a **high power of pp. This is not a metaphor: it is a genuine, rigorous notion of distance, just built from a completely different rule. The key gadget is the pp-adic valuation** vp(n)v_p(n), the exponent of the highest power of pp that divides the integer nn (with vp(0)=∞v_p(0) = \infty). Large vp(n)v_p(n) means nn is 'small' in the pp-adic sense — the opposite of what nn looks like on the number line.

A concrete check with p=5p = 5: take the integers 22, 77, 1212, and 127127. We have 7−2=57 - 2 = 5, so v5(7−2)=1v_5(7-2) = 1; and 12−2=10=2⋅512 - 2 = 10 = 2 \cdot 5, also v5(12−2)=1v_5(12-2) = 1. But 127−2=125=53127 - 2 = 125 = 5^3, so v5(127−2)=3v_5(127-2) = 3. In the 55-adic sense, 127127 sits far closer to 22 than either 77 or 1212 does, even though 127127 looks enormous on the ordinary number line and 77, 1212 look nearby. Divisibility by 535^3, not ordinary size, decides closeness.

A circle with 9 evenly spaced points labeled 0 through 8; a chord is drawn from each point x to the point 2x mod 9, illustrating the doubling map on Z/9Z.
The clock face here is Z/9Z=Z/32Z\mathbb{Z}/9\mathbb{Z} = \mathbb{Z}/3^2\mathbb{Z}, one finite stage of the tower Z/3Z,Z/32Z,Z/33Z,…\mathbb{Z}/3\mathbb{Z}, \mathbb{Z}/3^2\mathbb{Z}, \mathbb{Z}/3^3\mathbb{Z}, \dots whose limit builds the 33-adic integers Z3\mathbb{Z}_3. Two integers land on the same point exactly when they are congruent modulo 99 — that is, when their 33-adic distance is at most 3−23^{-2}. Congruence modulo a higher power of pp always means the two numbers are closer in the pp-adic metric.

UndergraduateBuilding Zp\mathbb{Z}_p as a limit of finite rings

The valuation vpv_p turns into a genuine absolute value on Q\mathbb{Q} by setting ∣x∣p=p−vp(x)|x|_p = p^{-v_p(x)} for x≠0x \ne 0 and ∣0∣p=0|0|_p = 0: writing x=pvp(x)abx = p^{v_p(x)} \frac{a}{b} with p∤ap \nmid a, p∤bp \nmid b isolates exactly how divisible xx is by pp. This is multiplicative just like the usual absolute value, ∣xy∣p=∣x∣p∣y∣p|xy|_p = |x|_p |y|_p, so dp(x,y)=∣x−y∣pd_p(x, y) = |x-y|_p is a genuine metric on Q\mathbb{Q} — a rival to the familiar Euclidean one.

∣x∣p=p−vp(x)|x|_p = p^{-v_p(x)}

Two equivalent ways to build the completion Qp\mathbb{Q}_p of Q\mathbb{Q} under ∣⋅∣p|\cdot|_p: (1) formally complete Q\mathbb{Q} with respect to dpd_p, exactly as Cauchy sequences build R\mathbb{R} from Q\mathbb{Q} under the usual metric; or (2) first build the **pp-adic integers** as an inverse limit of finite rings, Zp=lim←⁡nZ/pnZ\mathbb{Z}_p = \varprojlim_n \mathbb{Z}/p^n\mathbb{Z} — a compatible sequence of residues modulo p,p2,p3,…p, p^2, p^3, \dots — and then form Qp\mathbb{Q}_p as its field of fractions. Both routes give the same field.

Zp=lim←⁡nZ/pnZ\mathbb{Z}_p = \varprojlim_n \mathbb{Z}/p^n\mathbb{Z}

Definition: pp-adic integers and pp-adic numbers

Every nonzero x∈Qpx \in \mathbb{Q}_p has a unique **pp-adic expansion** x=∑i=k∞aipix = \sum_{i=k}^{\infty} a_i p^i with k=vp(x)∈Zk = v_p(x) \in \mathbb{Z}, digits 0≤ai≤p−10 \le a_i \le p-1, and ak≠0a_k \ne 0; the series converges because ∣aipi∣p=p−i→0|a_i p^i|_p = p^{-i} \to 0. An element lies in Zp\mathbb{Z}_p exactly when k≥0k \ge 0, i.e. when it is an ordinary (possibly infinite) base-pp expansion with no negative powers of pp — the pp-adic analogue of a decimal with finitely many digits before the point but arbitrarily many after it, except the infinite tail runs toward higher, not lower, powers of pp.

x=∑i=k∞aipi,0≤ai≤p−1, k=vp(x)x = \sum_{i=k}^{\infty} a_i p^i,\quad 0 \le a_i \le p-1,\ k = v_p(x)

Topologically, Zp\mathbb{Z}_p (all digit sequences a0,a1,a2,…a_0, a_1, a_2, \dots) is compact: it is homeomorphic to a product ∏i≥0{0,…,p−1}\prod_{i \ge 0} \{0, \dots, p-1\} of finite discrete sets, so Tychonoff's theorem applies directly. Qp=⋃kp−kZp\mathbb{Q}_p = \bigcup_{k} p^{-k} \mathbb{Z}_p is then locally compact (every point has a compact neighborhood, namely a translate of Zp\mathbb{Z}_p), exactly as R\mathbb{R} is locally compact but not compact. This local compactness is what lets Qp\mathbb{Q}_p carry a Haar measure and support genuine pp-adic analysis and integration.

For all x,y∈Qpx, y \in \mathbb{Q}_p, ∣x+y∣p≤max⁡(∣x∣p,∣y∣p)|x+y|_p \le \max(|x|_p, |y|_p), and equality ∣x+y∣p=max⁡(∣x∣p,∣y∣p)|x+y|_p = \max(|x|_p, |y|_p) holds whenever ∣x∣p≠∣y∣p|x|_p \ne |y|_p.

Why is it true?

This is the defining feature separating the pp-adic world from ordinary geometry: it forces every triangle to be isosceles. If dp(x,z)=∣x−z∣pd_p(x,z) = |x-z|_p, dp(x,y)d_p(x,y), dp(y,z)d_p(y,z) are the three pairwise distances among three points, the two largest of them must be equal. There is no such thing as a pp-adic triangle with one side strictly longer than the other two — a picture that has no counterpart for the ordinary absolute value on R\mathbb{R}.

Proof

Write x=pvp(x)ux = p^{v_p(x)} u, y=pvp(y)wy = p^{v_p(y)} w with u,wu, w units in Zp\mathbb{Z}_p (i.e. ∣u∣p=∣w∣p=1|u|_p = |w|_p = 1), and suppose without loss of generality vp(x)≤vp(y)v_p(x) \le v_p(y), so ∣x∣p≥∣y∣p|x|_p \ge |y|_p. Factor out the smaller power: x+y=pvp(x)(u+pvp(y)−vp(x)w)x + y = p^{v_p(x)}(u + p^{v_p(y)-v_p(x)} w). The term in parentheses is a genuine element of Zp\mathbb{Z}_p (a sum of elements of Zp\mathbb{Z}_p), so its pp-adic absolute value is ≤1\le 1; hence ∣x+y∣p≤p−vp(x)=∣x∣p=max⁡(∣x∣p,∣y∣p)|x+y|_p \le p^{-v_p(x)} = |x|_p = \max(|x|_p, |y|_p), proving the inequality. If moreover vp(x)<vp(y)v_p(x) < v_p(y) strictly (i.e. ∣x∣p≠∣y∣p|x|_p \ne |y|_p), then pvp(y)−vp(x)w≡0(modp)p^{v_p(y)-v_p(x)} w \equiv 0 \pmod p while uu is a unit, so u+pvp(y)−vp(x)w≡u≢0(modp)u + p^{v_p(y)-v_p(x)} w \equiv u \not\equiv 0 \pmod p is again a unit; thus ∣x+y∣p=p−vp(x)|x+y|_p = p^{-v_p(x)} exactly, giving equality.

∣x+y∣p≤max⁡(∣x∣p,∣y∣p),equality if ∣x∣p≠∣y∣p|x+y|_p \le \max(|x|_p, |y|_p),\quad \text{equality if } |x|_p \ne |y|_p

Example: Checking the isosceles-triangle property with p=3p = 3

Take x=54x = 54 and y=24y = 24, and p=3p = 3. Compute ∣54∣3|54|_3 and ∣24∣3|24|_3 directly, then check the ultrametric prediction against 54+24=7854 + 24 = 78.

Solution

Factor: 54=2⋅3354 = 2 \cdot 3^3, so v3(54)=3v_3(54) = 3 and ∣54∣3=3−3=1/27|54|_3 = 3^{-3} = 1/27. Also 24=23⋅324 = 2^3 \cdot 3, so v3(24)=1v_3(24) = 1 and ∣24∣3=3−1=1/3|24|_3 = 3^{-1} = 1/3. Since ∣54∣3=1/27≠1/3=∣24∣3|54|_3 = 1/27 \ne 1/3 = |24|_3, the theorem's equality case applies, predicting ∣78∣3=max⁡(1/27,1/3)=1/3|78|_3 = \max(1/27, 1/3) = 1/3. Directly: 78=2⋅3⋅1378 = 2 \cdot 3 \cdot 13, so v3(78)=1v_3(78) = 1 and ∣78∣3=1/3|78|_3 = 1/3 — exactly as predicted. The triangle with vertices 00, 5454, 7878 (sides 5454, 2424, 7878 in 33-adic distance) has its two longest sides, 1/271/27-side and 1/31/3-side... more precisely its two largest distances equal to 1/31/3, confirming the isosceles shape.

Let f(X)∈Zp[X]f(X) \in \mathbb{Z}_p[X] and suppose a∈Zpa \in \mathbb{Z}_p satisfies f(a)≡0(modp)f(a) \equiv 0 \pmod p and f′(a)≢0(modp)f'(a) \not\equiv 0 \pmod p (a **simple root mod pp**). Then there exists a unique α∈Zp\alpha \in \mathbb{Z}_p with f(α)=0f(\alpha) = 0 exactly and α≡a(modp)\alpha \equiv a \pmod p.

Why is it true?

This is the pp-adic cousin of Newton's method, except it converges exactly rather than merely approximately: because Qp\mathbb{Q}_p is complete and ∣⋅∣p|\cdot|_p is ultrametric, the Newton iterates an+1=an−f(an)/f′(an)a_{n+1} = a_n - f(a_n)/f'(a_n) do not just approach a root, they stabilize digit by digit and land on one precisely after infinitely many corrections. A simple root mod pp is guaranteed to 'lift' uniquely all the way to an honest root in Zp\mathbb{Z}_p, turning a finite, checkable congruence condition into an existence proof for an exact pp-adic number.

Proof

Construct α\alpha as a limit of successive approximations a=a0,a1,a2,⋯∈Zpa = a_0, a_1, a_2, \dots \in \mathbb{Z}_p with an+1=an−f(an)/f′(an)a_{n+1} = a_n - f(a_n)/f'(a_n), showing by induction that vp(f(an))≥n+1v_p(f(a_n)) \ge n+1 and vp(f′(an))=vp(f′(a))=0v_p(f'(a_n)) = v_p(f'(a)) = 0 for all nn (the derivative stays a unit since an+1≡an(modp)a_{n+1} \equiv a_n \pmod p at every step, so f′(an)≡f′(a)≢0(modp)f'(a_n) \equiv f'(a) \not\equiv 0 \pmod p throughout). Then vp(an+1−an)=vp(f(an))−vp(f′(an))≥n+1v_p(a_{n+1}-a_n) = v_p(f(a_n)) - v_p(f'(a_n)) \ge n+1, so (an)(a_n) is Cauchy in the pp-adic metric; by completeness of Zp\mathbb{Z}_p it converges to some α≡a(modp)\alpha \equiv a \pmod p, and continuity of ff forces f(α)=lim⁡f(an)=0f(\alpha) = \lim f(a_n) = 0. Uniqueness: if β≠α\beta \ne \alpha were another root with β≡a(modp)\beta \equiv a \pmod p, the mean value / Taylor expansion f(β)−f(α)=(β−α)(f′(α)+p(⋯ ))f(\beta) - f(\alpha) = (\beta-\alpha)(f'(\alpha) + p(\cdots)) with f′(α)f'(\alpha) a unit would force β=α\beta = \alpha.

f(a)≡0(modp),f′(a)≢0(modp)   ⟹   ∃! α∈Zp: f(α)=0, α≡a(modp)f(a) \equiv 0 \pmod p,\qquad f'(a) \not\equiv 0 \pmod p \ \implies\ \exists!\, \alpha \in \mathbb{Z}_p:\ f(\alpha)=0,\ \alpha \equiv a \pmod p

Example: Lifting 2\sqrt{2} to Z7\mathbb{Z}_7

Let f(X)=X2−2f(X) = X^2 - 2 and p=7p = 7. Since 32=9≡2(mod7)3^2 = 9 \equiv 2 \pmod 7, a0=3a_0 = 3 is a root mod 77. Use Hensel's lemma to find the next 77-adic digit, i.e. determine α mod 49\alpha \bmod 49.

Solution

Check the hypotheses: f(3)=9−2=7≡0(mod7)f(3) = 9 - 2 = 7 \equiv 0 \pmod 7, and f′(3)=2⋅3=6≢0(mod7)f'(3) = 2 \cdot 3 = 6 \not\equiv 0 \pmod 7, so Hensel's lemma applies. Write the next approximation as a1=3+7ka_1 = 3 + 7k for k∈{0,…,6}k \in \{0, \dots, 6\} and expand modulo 4949: (3+7k)2=9+42k+49k2≡9+42k(mod49)(3+7k)^2 = 9 + 42k + 49k^2 \equiv 9 + 42k \pmod{49}. We need 9+42k≡2(mod49)9 + 42k \equiv 2 \pmod{49}, i.e. 42k≡−7≡42(mod49)42k \equiv -7 \equiv 42 \pmod{49}; dividing through by 77 gives 6k≡6(mod7)6k \equiv 6 \pmod 7, so k≡1(mod7)k \equiv 1 \pmod 7. Taking k=1k=1 gives a1=3+7=10a_1 = 3 + 7 = 10. Check: 102=100=2⋅49+2≡2(mod49)10^2 = 100 = 2 \cdot 49 + 2 \equiv 2 \pmod{49} — exactly right. So α≡10(mod49)\alpha \equiv 10 \pmod{49}, and the process continues to pin down α=…a2a1a0\alpha = \dots a_2 a_1 a_0 in base 77 digit by digit forever.

AdvancedOstrowski's theorem: pp-adic numbers are exactly as fundamental as the reals

Why single out R\mathbb{R} as the completion of Q\mathbb{Q}, when each prime pp produces its own Qp\mathbb{Q}_p? The honest answer is that there is no reason to: R\mathbb{R} has no special status among absolute values on Q\mathbb{Q} beyond being the 'infinite place'. This is made precise by Ostrowski's theorem, and it is the theorem that certifies pp-adic arithmetic is not a curiosity bolted onto number theory, but exactly as fundamental as the real numbers themselves.

Every nontrivial absolute value on Q\mathbb{Q} is equivalent either to the usual absolute value ∣⋅∣∞|\cdot|_\infty, or to ∣⋅∣p|\cdot|_p for exactly one prime pp.

Why is it true?

This says the 'places' of Q\mathbb{Q} — the essentially different ways to measure size and complete the field — are exactly the classical primes 2,3,5,7,…2, 3, 5, 7, \dots together with one extra 'infinite prime' ∞\infty standing for the usual absolute value. Nothing distinguishes ∞\infty structurally from any pp; it just happens to be the one Archimedean place. This single fact is the seed of the adeles and the entire local-global philosophy of modern number theory: to understand Q\mathbb{Q}, study it simultaneously at every place R,Q2,Q3,Q5,…\mathbb{R}, \mathbb{Q}_2, \mathbb{Q}_3, \mathbb{Q}_5, \dots.

Proof

Sketch. Let ∣⋅∣|\cdot| be a nontrivial absolute value on Q\mathbb{Q}. Case 1 (non-Archimedean): if ∣n∣≤1|n| \le 1 for every integer nn, the set p={n∈Z:∣n∣<1}\mathfrak{p} = \{n \in \mathbb{Z} : |n| < 1\} is a prime ideal of Z\mathbb{Z} (it is closed under addition by the ultrametric inequality, which any absolute value with ∣n∣≤1|n|\le1 on Z\mathbb{Z} automatically satisfies, and under multiplication by primality), hence p=(p)\mathfrak{p} = (p) for a unique prime pp; comparing ∣p∣|p| to p−1p^{-1} and using multiplicativity shows ∣⋅∣|\cdot| is equivalent to ∣⋅∣p|\cdot|_p. Case 2 (Archimedean): if ∣n0∣>1|n_0| > 1 for some integer n0n_0, write any integer n>1n > 1 in base n0n_0 and use the triangle inequality together with ∣n0k∣=∣n0∣k→∞|n_0^k| = |n_0|^k \to \infty to bound ∣n∣|n| above and below by powers of nn itself, forcing ∣n∣=nc|n| = n^c for a constant c∈(0,1]c \in (0,1] independent of nn; this makes ∣⋅∣|\cdot| equivalent to ∣⋅∣∞|\cdot|_\infty.

That local-global philosophy pays off spectacularly for quadratic forms. The Hasse–Minkowski theorem (Hasse, early 1920s, building on Minkowski) says a quadratic form ff in several variables over Q\mathbb{Q} represents 00 nontrivially over Q\mathbb{Q} if and only if it represents 00 nontrivially over every completion: over R\mathbb{R} and over Qp\mathbb{Q}_p for every prime pp. Checking solvability over R\mathbb{R} is just a sign condition, and checking solvability over Qp\mathbb{Q}_p reduces to a finite computation using Hensel's lemma — so an a priori infinite search over Qn\mathbb{Q}^n collapses to finitely many easy local checks. This is the archetype of a local-global (Hasse) principle; it is a genuine miracle special to quadratic forms; degree-33 forms can fail it (Selmer's curve 3x3+4y3+5z3=03x^3+4y^3+5z^3=0 has points everywhere locally but no rational point).

f represents 0 over Q  ⟺  f represents 0 over R and over Qp for every prime pf\ \text{represents}\ 0\ \text{over}\ \mathbb{Q} \iff f\ \text{represents}\ 0\ \text{over}\ \mathbb{R}\ \text{and over}\ \mathbb{Q}_p\ \text{for every prime}\ p
A finite rooted binary tree with three levels: the root splits into two children, each of which splits into two more, forming a small symmetric branching diagram. It is used purely as a generic branching-tree analogy, not an accurate rendering of the infinite (p+1)-regular Bruhat-Tits tree.
Honest disclaimer: this finite binary tree is only an illustrative stand-in, not a literal picture of the Bruhat–Tits tree attached to SL2(Qp)\mathrm{SL}_2(\mathbb{Q}_p). The real Bruhat–Tits tree is infinite and (p+1)(p+1)-regular — every vertex has p+1p+1 neighbors, not 22 — and its vertices are homothety classes of lattices in Qp2\mathbb{Q}_p^2. What this picture does convey honestly is the qualitative shape shared by all such trees: a branching, self-similar structure with no cycles, mirroring how nested pp-adic balls never partially overlap — they are always either disjoint or one contains the other, just like branches splitting apart and never rejoining.

Qp\mathbb{Q}_p is the prototype of a local field, and every number field KK has its own family of completions at its primes, generalizing Qp\mathbb{Q}_p — the basic objects of algebraic number theory's local-global machinery (class field theory, ramification, Galois representations). Fixing pp and letting the field vary in a tower Qp⊂K∞\mathbb{Q}_p \subset K_\infty is the setting of Iwasawa theory, whose pp-adic LL-functions pp-adically interpolate classical LL-values and encode deep arithmetic invariants (class numbers, Selmer groups) — one of the main engines of modern arithmetic geometry, feeding directly into the tools used to attack the Birch–Swinnerton-Dyer conjecture and beyond.

ResearchPerfectoid spaces and the living frontier

For most of the twentieth century pp-adic numbers stayed inside algebraic number theory. That changed in the 2010s with Peter Scholze's introduction of perfectoid spaces: highly ramified pp-adic geometric objects (built from towers like Qp(p1/p∞)\mathbb{Q}_p(p^{1/p^\infty})) whose geometry becomes, remarkably, equivalent to the geometry of certain spaces in positive characteristic via a 'tilting' correspondence. This lets deep theorems about characteristic-pp geometry (where Frobenius makes life easier) be transported back to prove new results in mixed and pp-adic characteristic, and vice versa.

If ∣x∣p=1/9|x|_p = 1/9 and ∣y∣p=1/27|y|_p = 1/27 with p=3p=3, what does the ultrametric inequality tell us about ∣x+y∣p|x+y|_p?

According to Ostrowski's theorem, what are the nontrivial absolute values on Q\mathbb{Q}, up to equivalence?

Hensel's lemma lets you lift a root aa of ff modulo pp to an exact root in Zp\mathbb{Z}_p provided which condition holds?

What does the pp-adic valuation vp(n)v_p(n) of a nonzero integer nn measure?

References

  1. Neal Koblitz (1984). p-adic Numbers, p-adic Analysis, and Zeta-Functions · DOI:10.1007/978-1-4612-1112-9
  2. Peter Scholze (2012). Perfectoid spaces · arXiv:1111.4914