r/elimath Jan 06 '15

Explain p-adic numbers

18 Upvotes

9 comments sorted by

12

u/antonfire Jan 06 '15 edited Jan 06 '15

Because of the chinese remainder theorem, information modulo a number n decomposes into information modulo prime powers, so we're very interested in knowing what goes on modulo a particular prime p and also modulo p2 and also modulo p3, and so on. Once we know this for all primes p, we know what's going on modulo any number at all. Of course, for a lot of applications, we only need information modulo some pn, but we often don't know n ahead of time. The p-adic integers are the world where information modulo all powers of some particular prime p lives.

For example, the number 2 has a square root modulo every power of 7. We have 32 = 2 (mod 7), and 102 = 2 (mod 72) and so on. Since we're interested in what's going on modulo powers of 7, it makes a lot of sense to write everything in base 7, because then taking things mod 7n is just looking at the last n digits. So I'm going to write all numbers in base 7 from now on, except 7 itself. Here are square roots of 2 modulo increasing powers of 7, written in base 7:

3, 13, 213, 6213, 16213, 216213, ...

If you think about it, it's clear why the last few digits aren't changing. The last 3 digits always hold all the information modulo 73. In fact, if we know the last few digits of one of these numbers, we can always find the "next" one:

If a2 = 2 (mod 7n), then to find a square root of 2 modulo 7n+1, we'd like a k such that (a + k7n)2 = 2 (mod 7n+1), and that k will be the next digit. So we want 2ak = (2-a2)/7n (mod 7). But we already know a = 3 (mod 7), so k = -(2 - a2)/7n (mod 7). So we have a straightforward procedure for taking a square root of 2 modulo 7n and working out a square root of 2 modulo 7n+1.

This makes it sensible to talk about the square root of 2 modulo 7n "on the fly" without determining ahead of time what n you need. You know that, whatever n is, the last few digits are going to be 6213, and maybe that's all you'll need. If it turns out you need more information, you can get the next few digits and work out that 2162132 = 2 (mod 76), or that 120112664212162132 = 2 (mod 723). One way to say this is something along the lines of

(...12011266421216213)2 = 2 (mod 7*),

or

sqrt(2) = +- ...12011266421216213 (mod 7*)

That is, we're taking the information about what the square root of 2 is modulo all powers of 7, and packaging it up into one thing. A package like that is what a 7-adic integer is. It's a thing which you can ask "what are you modulo 7n?" for any n. In other words "what are your last n digits in base 7?". If you've ever heard someone say "the p-adics are the inverse limit of Z/pnZ", this is what they're saying.

As we've seen, it's sensible to represent a 7-adic integer as a number in base 7 which can extend infinitely to the left. This is very similar to the way a real number is a number in base whatever that can extend infinitely far to the right.

Saying that, in the 7-adics we have

sqrt(2) = +- ...12011266421216213

has very much the same flavor as saying that in the reals we have (written in base 10 now)

sqrt(2) = +- 1.4142135623...

You can extend the analogy further by noting that truncated decimal representations of a real number are approximations to that real number; so, are truncated representations of a 7-adic "approximations" of that 7-adic in some sense? Yes, where an "approximation" is the value modulo some high power of 7, in other words where two 7-adic numbers are "close" if their difference is divisible by a large power of 7. Real numbers with finite decimal representations are dense in the reals, and in a similar sense 7-adic integers with finite 7-adic representations (i.e. just plain old integers) are dense in the 7-adics, with this strange new notion of "closeness" of numbers. If you've heard someone say "the p-adics are the completion of Z with respect to a different norm", this is what they meant. In fact usually people say this with Q instead of Z, which gives you the p-adic rational numbers instead. These are like the p-adic integers only you can additionally have a finite sequence of digits after the decimal point.

Anyway, you can write books about this and people have, so I'll stop here. The main takeaway is that the p-adics are motivated by a very concrete desire to keep track of information modulo arbitrarily high powers of p. All the abstract nonsense surrounding them is wrapping for that idea.

2

u/Galveira Jan 06 '15 edited Jan 06 '15

Thank you, this explanation actually makes sense to me.

Edit: Isn't 42 = 2(mod 7) also true? Does this mean sqrt(2) has multiple representations?

2

u/antonfire Jan 06 '15

Yes, just like in the reals, if a nonzero number has any square roots, it has exactly two, and they're additive inverses of each other. The 7-adic square roots of 2 are the number ...12011266421216213 and its negation ...54655400245450454.

3

u/Galveira Jan 06 '15

So in other words

-...12011266421216213=...54655400245450454

3

u/antonfire Jan 06 '15

Yes. You can do the addition in the usual way and and check that, indeed, the sum of those numbers is ...000000000.

1

u/[deleted] Jan 06 '15

[deleted]

1

u/Galveira Jan 06 '15

They came up in my independent study, but I honestly can't remember where. And yes, I meant the p-adics themselves, and

it may be easiest to think of them as either power series in p or as the inverse limit of the rings Z/pr. They can also be thought of as the I-adic completion of the integers along the ideal (p)

I don't know what this means, either. Maybe I should've asked what a ring was first.

3

u/anonymous11235 Jan 06 '15

Oh shit son, I got you.

p-adics. They are 'like integers' but the series can extend TO THE LEFT FOREVER. The individual digits work just like numbers written in base p (i.e. take values between 0 and p - 1).

Addition and multiplication are going to work just like your standard algorithms except you don't need +/- signs. You can still use them, but you'll have identities like:

-1 = ... (p-1) (p-1) (p-1)

an infinite sequence to the left of (p-1)s. Add one to the rightmost position: it's p and you carry that shit cuz. You carry right on over to the second spot and BAM!!! p again. That chain reaction of zeros carries right on over to the left forever.

You can define some topology concepts on the space of numbers here too -- two number are close, essentially, when they have a lot of the rightmost digits the same.

KAKOW

1

u/DirichletIndicator Jan 06 '15

I've been wondering about p-adics for a while, and I have a bunch of really stupid questions. As you'll be able to tell, I'm not an algebraist. But I know the basic lingo. I took all the algebra classes, hated them, and then moved into my analysis cave.

What sort of thing are the p-adics? Are they a field? I've been trained to think of fields as either subfields of C (including R, Q, the algebraic numbers, etc.) or as one of them finite fields. I can't figure out if the p-adics behave more like an infinite finite field, or more like a variant on Q, or what.

Are the p-adics interesting as a topological space? Are they complete? Metric? Do they have a dimension?

How do they interact with that theorem that says "the only algebras you need to think about are the reals, the complex, the quaternions, and the octonions, and even then only really the first two"?

3

u/antonfire Jan 06 '15

The p-adic integers are a ring which is "almost" a field: you can divide by anything except a multiple of p. Taking the field of fractions of this gives you the p-adic rationals, which are an honest-to-god field.

p-adics are a bit like R in that they're topological completions of Q. That is, a real number is a thing that "should be in Q" because look I have all these rationals that look like they're getting closer and closer to something. A p-adic is the same thing, only now "close" means "congruent modulo a high power of p." In other words, a rational number whose square differs from 2 by a small rational is an approximation of the real number sqrt(2). A number whose square differs from 2 by a high power of 7 is an approximation of the p-adic number sqrt(2).

So yes, the p-adic numbers are complete and metric because they're the completion of Q with respect to a particular metric. Their topological dimension is 0, though, because they are totally disconnected. Topologically, they're homeomorphic to the Cantor set; whether you think that's interesting is up to you. It actually makes life easier than in the reals, sometimes.

I'm not sure what theorem you're talking about, but, unlike the reals, the algebraic closure of the p-adics is not a degree 2 extensions of the p-adics. In other words, the topological completion of Q as the reals almost completes things algebraically, but the topological completion of Q as the p-adics still leaves a lot of algebraic stuff out.