What even is distance? p-adic numbers and completion of the set of real numbers

I chose this topic for a blog post based on a tangent mentioned in class: p-adic numbers. I was intrigued that there was a different way to complete the rational numbers since it took me long enough to accept that irrational numbers got to be on the number line at all. If it weren’t for 45-45-90 triangles with rational side lengths that needed hypotenuses, I honestly don’t think I would have ever accepted irrationals as more than some theoretical, mathematical construct, that while consistent, had no value to me personally beyond computation. So I was really excited to see if p-adic numbers would make more intuitive sense to me. Sadly, after some initial research it just wasn’t clicking. But after a bit more digging, I found this video:

The direct comparison of the completion of the real numbers using irrational numbers and p-adic numbers was really helpful to ground my understanding of the p-adic numbers. Hopefully this video and my discussion below will also help some of you get a feel for p-adic numbers.

Before we jump into the p-adic completion of the rationals, I’d like to discuss how we can complete the set of rational numbers in general. When we talk about completing the rational numbers, we’re really talking about completing a metric space. A metric space is defined as a set, X, with a metric, or global distance function, g(x,y), such that for every two points x and y in X, the distance between them is a non-negative, real number. A metric space must also satisfy three other properties:

• g(x,y) = 0 iff x=y
• g(x,y) = g(y,x)
• g(x,y) + g(y,z) ≥ g(x,z) (The Triangle Inequality)

This results in a metric space (X,g). (For our familiar completion of the rational numbers, we will use the absolute value function as our global distance function so d(x,y) = |x-y|.)

Now, a metric space (X,g) is called complete if every Cauchy sequence in (X,g) converges in (X,g). This means (spoilers) that if a Cauchy sequence converges to a value not in the metric space, the metric space is not complete. A Cauchy sequence is a sequence whose element become closer to one another as the sequence is extended. Luckily, we already have our metric, g(x,y) which determines the positive distance between any two points in X that we will use to calculate “closeness.” Thus, we call a sequence {x1,x2,x3,…} Cauchy if for every positive, real number E, there is some positive integer N such that all natural numbers m and n greater than N, g(xm,xn) < E.

Because of this, the set of rational numbers is not a complete metric space. Take for example the sequence {2, 2.2, 2.23, 2.236, 2.2360, 2.23606, …}. We will use d(x,y) as our global distance function. By definition, this is a Cauchy sequence of rational numbers, but its limit is √5. Because this is not an element of the rational numbers, the sequence does not converge in (Q,d). Therefore the set of rational numbers cannot be a complete metric space.

To complete this metric space, we simply add the limits of all the Cauchy sequences that can be constructed from the rationals to the rationals to form what we know as the reals. This fills in all the gaps in the metric space so every Cauchy sequence in (R,d) converges in (R,d).

Now for the formation of p-adic numbers. The primary change when working with p-adic numbers is the definition of distance. Before, we used the positive distance between two numbers on a number line, d(x,y) = |x-y|, as the metric for distance. The p-adic numbers are formed using a fundamentally different conception of distance that is still consistent with all the requirements of a metric needed to define a metric space.

We start with the formation of a p-adic number by choosing and fixing a prime, p. Every non-zero, rational number x can be written in the form x=(pn)*(r/s) where p is the fixed prime, r and s are integers, and p, r, and s are all coprime. Using this formation, we can represent all the rationals as p-adic numbers in terms of the fixed prime, p. We can then define the p-adic absolute value to create a different definition of distance to be used as a metric later on. This absolute value is defined as:

|x|p = |(pn)*(r/s)| = p-n

We also define |0|p = 0 for consistency. Notice that this definition of distance means the p-adic absolute values can only take the form of whole numbers, unit fractions, and zero. As a result, when taking the differences between two rational number x and y, this results in a very different formation of distance. The video posted above gives a great example:

When p = 7, 28814 and 2 are ‘closer together’ than 3 and 2.

This works because |28814 – 2|7 = |28812|7 = |74*(12/1)|7 = 7-4 = 1/2401 and
|3 – 2|7 = |1|7 = |04*(1/1)|7 = 70 = 1. Since 1/2401 < 1, the distance between 28814 and 2 is less than the distance between 3 and 2. Because of this, as the distance between two numbers contains factors of larger and larger powers of p, the distance decreases.

So to see if the rationals are complete using this new metric, we must check to see if every Cauchy sequence of rational numbers has a limit that is itself a rational number. Because each p-adic formation of the rationals is unique based on the initial choice of p (written Qp) and because there are infinitely many primes, it is impossible to check every p-adic formation of the rationals. But we can write a general case using p to show one example where the rationals are incomplete which is sufficient to show that the rationals are not complete using any p-adic metric.

{p0, p0+p1, p0+p1+p2, p0+p1+p2+p3, p0+p1+p2+p3+p4, …}

Because each successive term in the sequence adds a higher power of p to the previous term, we are adding smaller and smaller pieces to each term under the p-adic metric. This is because the distance between successive terms is pn and as n increases, p-n decreases. Thus, this is a Cauchy sequence. But the limit of this sequence is infinite, so it is not a term in the set of rational numbers. So again, we find ourselves in a situation where we must add the limit of each Cauchy sequences of rational numbers that can be formed using the p-adic metric to complete the rationals.

The hardest thing for me to wrap my head around while studying the p-adic completion of the rationals is that this completion does not result in the set of real numbers that result from adding the limits of the Cauchy sequences using d(x,y) to the rationals. Unlike infinite decimals that we represent as irrational constants or roots, p-adic numbers have a finite decimal component and can expand indefinitely to the left. So any p-adic number can be represented as a power series such as:

x-mp-m + x-m+1p-m+1 + … + x0 + x1p1 + x2p2 + …

Which can be written in decimal form as:


This idea was so foreign to me that I needed it to be explicitly spelled out in the video before I could even consider it a valid way to describe a number. I’m still trying to decide if I like it. It’s definitely cool, but it’s also scary – like nuclear fission. I’m still wary of the repercussions of the p-adic definition of absolute value, but I’m glad to have explored the Wonderland like world that it creates.


Click to access 0001_0006.pdf


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s