Closeness in the 2-Adic Metric

When is 144 closer to 8 than to 143?

The usual definition of the norm of a real number {x} is its modulus or absolute value {|x|}. We measure the “distance” between two real numbers by means of the absolute value of their difference. This gives the Euclidean metric {\rho(x,y) = |x-y|} and, using it, we can define the usual topology on the real numbers {\mathbb{R}}.

The standard arrangement of the real numbers on a line automatically ensures that numbers with small Euclidean difference between them are geometrically close to each other. It may come as a surprise that there are other ways to define norms and distances, which provide other topologies, leading us to a radically different concept of closeness, and to completely new number systems, the p-adic numbers.

The 2-adic valuation

The {p}-adic valuation — or {p}-adic order (Katok, 2007) — of an integer {n} is the function

\displaystyle \nu_p(n) = \begin{cases} \max\{k\in\mathbb{N} : p^k \mid n \} & \mbox{for\ } n \neq 0 \\ \infty & \mbox{for\ } n = 0 \end{cases}

In words, the {p}-adic valuation of {n} is the index of the largest power of {p} that divides {n}.

We shall be concerned exclusively with the case {p = 2}. The “degree of evenness” of a number can be expressed in terms of the 2-adic valuation. For an integer {n}, the 2-adic valuation is the largest natural number {k} such that {2^k} divides {n}. It is normally written {\nu_2(n)}.  For even integers, {\nu_2(n)>0}; for odd integers, {\nu_2(n)=0}. By convention, {\nu_2(0)=\infty} (since zero is divisible by every power of {2}).

The valuation can be extended to the rational numbers {m/n}:

\displaystyle \nu_2\left(\frac{m}{n}\right) = \nu_p(m) - \nu_p(n) \,.

It is easily proved that, for any two rational numbers, {q_1} and {q_2}, {\nu_2(q_1+q_2) \ge \min\{\nu_2(q_1),\nu_2(q_2)\}}, so that

\displaystyle || q_1+q_2 ||_2 \le \max( ||q_1||_2, ||q_2||_2 ) \,,

with equality holding if {\nu_2(q_1) \neq \nu_2(q_2)}. This is known as the strong triangle inequality. It has some surprising consequences, one of which is that, in this geometry, all triangles are isosceles!

We note that the concept of “closeness” under the 2-adic norm is completely different to the usual notion of nearness. For example, the Euclidean difference between the two numbers 3 and 8 is 5, since {| 3 - 8 | = 5}. But we have {|| 3 - 8 ||_2 = || 5 ||_2 = 1}. Indeed, all the odd numbers are at unit distance from 8. Stranger still, we have

\displaystyle || 8 - 143 ||_2 = 1 \,, \qquad\mbox{while}\qquad || 8 - 144 ||_2 = || 2^3 - 9\times2^4 ||_2 = 2^{-3} \,,

so that 144 is much closer to 8 than is 143. It takes some time to build intuition about these matters, but p-adic evaluations are powerful allies in number theory.

The 2-adic distance between numbers

We can use the 2-adic norm to define the distance between any two rational numbers. For simplicity we will confine attention below to the integers, although the ideas are more general.

The 2-adic distance between any two natural numbers {k} and {\ell}, written {|| k-\ell ||_2}, is defined as {2^{-\nu_2(k-\ell)}}, where {{\nu_2(k-\ell)}} is the 2-adic valuation of the difference between the numbers. It is the inverse of the largest power of 2 that divides the difference. It always takes one of the values {\{1, 2^{-1}, 2^{-2}, 2^{-3}, \dots \}}.

In the Figure here, we show the first 32 natural numbers. Considering the entire set of integers {\mathbb{Z}}, we can guarantee only that two arbitrary integers differ by a multiple of {2^0 = 1}, so the maximal distance is {1}. Thus, all the numbers shown in the figure — and indeed all the integers — have distance of at most {1} from each other.

In the figure below (left panel) we separate the numbers into those with even parity and those with odd parity. Within each of these two sets, any two numbers always differ by an even number, so the 2-adic distance is always at most {\textstyle{\frac{1}{2}}}. Thus, the numbers in either magenta region are closer to each other than are two numbers with one in each region.

Left: numbers within any magenta region differ by a multiple of 2. Right: numbers within any green region differ by a multiple of 4.

In the figure (right panel), we separate the numbers into four sets, in which all numbers differ by a multiple of 4. Thus, two numbers within a single green region differ by at most {\textstyle{\frac{1}{4}}}. The distance between numbers in different green regions is at least {\textstyle{\frac{1}{2}}}.

Continuing the process, all numbers within a single red region in the figure below (left panel) differ by a multiple of 8 and so are distant from each other by at most {\textstyle{\frac{1}{8}}}.

Finally, all numbers within a blue region in the figure (right panel) differ by a multiple of 16 and so are distant from each other by at most {\textstyle{\frac{1}{16}}}.

Left: numbers within a red region differ by a multiple of 8. Right: numbers within a blue region differ by a multiple of 16.

Clopen Balls

The p-adic numbers are defined by forming the closure of the field of rational numbers {\mathbb{Q}} in the topology arising from the p-adic metric. We will not discuss this (see Katok, 2007) but we will consider the open-and-closed balls defined for this metric. The open ball {B(a,r)} is the set of points whose p-adic distance from {a} is less than {r}:

\displaystyle B(a,r) := \{ x\in\mathbb{Q} : || x-a ||_2 < r \} \,.

It turns out that {B(a,r)} is both open and closed: it is a clopen set. Even more intriguing is that every point of a ball is its centre:

\displaystyle b \in B(a,r) \implies a \in B(b,r) \qquad\mbox{so that}\qquad B(b,r) = B(a,r) \,.

The coloured regions we have shown in the figures above are open balls (of course, we have only included a small number of elements). For example, the grey area is {B(0,2)}; the top right red area is {B(5,1/4)} and the bottom right blue region is {B(15,1/8)}.

More Visualisations

There are many other ways to depict the rational numbers so as to emphasise properties such as distance apart (Lynch and Mackey, 2022). With some graphical expertise, we could stack the figures above in a vertical tower, with the vertical coordinate being the 2-adic valuation for the innermost regions.

The illustration below, showing a fractal tower of 3-adic numbers, is from a recent article in Quanta Magazine (Houston-Edwards, 2020). Similar diagrams can be constructed for p-adic numbers with other primes {p} (see Katok, 2007).

Visualization of the 3-adic numbers [Image: Samuel Velasco/Quanta Magazine].


{\bullet} Katok, Svetlana, 2007: p-adic Analysis Compared with Real. Student Math. Lib., Vol. 37. Amer. Math. Soc., ISBN: 978-0-8218-4220-1.

{\bullet} Kelsey Houston-Edwards, 2020: An Infinite Universe of Number Systems. Quanta Magazine, October 19, 2020. LINK.

{\bullet} Lynch, Peter & Michael Mackey, 2022: Parity and Partition of the Rational Numbers. arXiv.

{\bullet} Wikipedia article: p-adic Number.


Last 50 Posts