1

There are some p-adic integers definitions, all vague (for non-mathematicians), as this Wikipedia's definition:

  $x = (x_1 \operatorname{mod} p, ~ x_2 \operatorname{mod} p^2, ~ x_3 \operatorname{mod} p^3, ~ \ldots)$

How to calculate $x_i$? Can I use the the standard positional notation?

I need some basic examples with the answer, using small integers.
Let p=2 and $x \in \mathbb{N}$, starting with small x:

  • 0 = (0,0,0,0,...)2 ? $~~=? \infty$
  • 1 = (1,0,0,0,...)2 ?
  • 2 = (0,1,0,0,...)2 ?
  • ... ? ...

... Or, better, a Python/Javascript/Any script that generates correct examples.


Note

There is not yet an "ISO standard" for expressing p-adics, sometimes it is confusing.

This question is not a duplicate:

Peter Krauss
  • 163
  • 8
  • 1
    Have you consulted any books, for instance some of those listed in the references of that Wikipedia page? There you may also find the excellent introduction by Gouvêa, aptly named "p-adic Numbers: An Introduction". It does presuppose a first-year level of understanding of basic algebra, including modular arithmetic and vector spaces, as well as some elementary calculus. – Servaes Jul 23 '23 at 15:15
  • 2
    The positional notation construction seems pretty elementary to me. What else are you looking for? – Ted Jul 23 '23 at 16:32
  • @Ted, sorry, we can delete my Note section, it is not the list that I need, it is only a illustration because no one illustrated it at Wikipedia... I need a list a 2-adic integer numbers... I can also build one, but I need to calculate $x_i$... "how to?" is also the question. – Peter Krauss Jul 23 '23 at 18:41
  • @Servaes, sorry, the it is not an open document, https://doi.org/10.2307/2975598 – Peter Krauss Jul 23 '23 at 18:46
  • 4
    Take any sequence of 0's and 1's and you have a 2-adic number. That's what the positional notation construction says. It's impossible to literally build a "list", if you mean a sequence listing them all, because there are uncountably many 2-adic numbers. – Ted Jul 23 '23 at 19:00
  • 2
    I think you're asking how to calculate the $x_i$s for a given "standard integer" $x\in\mathbb{Z}$ (to see how $\mathbb{Z}$ sits inside the $p$-adic integers), is that right? If so, it's just $x_i=x$ mod $p^i$. Think of $x$ mod $p^i$ as being the "$i$th approximation" to the integer $x$, as far as $p$ is concerned. If $x$ is an actual nonnegative integer this will eventually "stabilize" at $x$ itself, and if $x$ is an actual negative integer this will eventually behave as $x_i=p^i-\vert x\vert$. The clause in the wikipedia page is telling you the general form of a $p$-adic integer. – Noah Schweber Jul 23 '23 at 19:05
  • @Ted, thanks, it is a good clue, but please show some examples, $2 = (0,1,0, 0, 0,...)$ is valid as 2-adic integer? and $55 = (1,1,1, 0, 1,1,0,0,0,...)$ is? – Peter Krauss Jul 23 '23 at 19:10
  • 2
    @PeterKrauss Indeed in your second representation, the positional notation as a power series in $p$, you indeed have $$55=(1,1,1,0,1,1,0,0,0,\ldots).$$ In your first representation, as an inverse limit over $\Bbb{Z}/p^k\Bbb{Z}$, you have $$55=(1,3,7,7,23,55,55,55,\ldots).$$ – Servaes Jul 23 '23 at 19:30
  • 1
    @PeterKrauss You keep asking for examples, but you have listed so many examples already in your post. So I'm not sure what you are looking for. – Ted Jul 23 '23 at 22:09
  • @Servaes, thanks. I found an "example generator" at https://siefkenj.github.io/jspadic/ and a good open document for step-by-step computer/mathematics formalization, https://hal.science/hal-01444183/document – Peter Krauss Jul 24 '23 at 04:16
  • I think that a really illuminating thing here would be to figure out how you write $-1$ in either notation. Have you done that already? If so, the next exercise would be to work out the five first bits in a 2-adic representation of $\sqrt{-7}$ (there are two solutions). – Jyrki Lahtonen Jul 24 '23 at 05:21
  • Possibly helpful are some of the references in my answer to p adic introduction without algebra prerequisite? In my answer, I just added 4 more references to the 2 previously existing references, in case it helps. – Dave L. Renfro Jul 24 '23 at 07:21
  • You may find OEIS sequence A318960 of interest. It is "One of the two successive approximations up to 2^n for 2-adic integer sqrt(-7). This is the 1 (mod 4) case." The sequence begins: $1, 5, 5, 21, 53, 53, 181, 181, 181, 181, 181, 181, 181,... $ – Somos Jul 24 '23 at 19:08

2 Answers2

2

Adding the following examples, because in my opinion these are more illuminating about what the $2$-adics are:

  • $-1=\ldots1111$ in the 2-adic notation, or $-1=(1,3,7,15,31,63,127,\ldots)$ in the inverse limit notation. This goes well together with the geometric series sum formula $$a+aq+aq^2+aq^3+\cdots=\frac a{1-q}$$ with $a=1$, $q=2$, and could be read as $$1+2+4+8+16+32+\cdots=\frac1{1-2}=-1.$$ If you ever advance to $2$-adic metrics and convergence in your studies, then all this will make perfect sense.
  • If we look at the inverse limit sequence $x=(1,1,5,5,21,53,53,\ldots)$ we see that $$x^2+7=(8,8,32,32,448,2816,2816,\ldots)=(0,0,0,\ldots),$$ because the entries are all divisible by the prescribed powers of two. It is not immediately obvious that we can continue this sequence, but it is not exceedingly difficult to show that either. Anyway, this 2-adic number can somewhat justifiably claim to be $\sqrt{-7}$.

In some sense you are starting this look into 2-adics at the wrong end by only looking at natural numbers – something you (and your computer) can handle comfortably already. Looking at the negative integers reveals that this is the twos complements notation taken to the infinity. But there are more 2-adics than just the integers, which is what the example with $\sqrt{-7}$ seeks to convey.

Jyrki Lahtonen
  • 133,153
  • Thanks Jyrki, good point to show importancy of p-adics (!). About my question, where I use $x_i$ you use $a_i$, is it? But you use $a_i>p$ and "reverse order", it not seems the "standard notation"... Would you have a reference (open document) for your notation? Or maybe you can point out where your notation is used by Caruso (that I adopted as main reference), for natural numbers. – Peter Krauss Jul 24 '23 at 06:18
  • 1
    @PeterKrauss This answer only uses the inverse limit notation $$(x_1\pmod{p},x_2\pmod{p^2},x_3\pmod{p^3},\ldots).$$ In this notation addition and multiplication are pointwise, so the claim that $$x=(1,1,5,5,21,53,53,\ldots),$$ is a square root of $-7$ can be checked pointwise, by computing $$x^2+7=(8,8,32,32,448,2816,2816,\ldots).$$ Then reducing each coordinate mod $p^k$ you see that $x^2+7=0$. – Servaes Jul 24 '23 at 08:50
  • 1
    Of course the question remains how to continue the sequence for $x=\sqrt{-7}$. A good exercise is to do this by Hensel's lemma, a result that is absolutely central in $p$-adic theory. This will give you the coordinates of $x$ one at a time, precisely in the format of this inverse limit notation. That's another big reason this notation is used. – Servaes Jul 24 '23 at 08:51
  • 1
    +1 of course, but "this justifies the claim that $\sqrt{-7}$ is a 2-adic integer" -- you know how pedantic I am about these matters, but for reasons, so I would rather have that rephrased as: "this justifies the claim that there is a $2$-adic integer which is a square root of $-7$" (which has little to do with e.g. the complex number(s) $ (\pm) 2.645751311... i$ that one would usually mean when writing $\sqrt{-7}$). – Torsten Schoeneberg Jul 24 '23 at 16:44
  • 1
    Point taken, @Torsten. I overstated my case. – Jyrki Lahtonen Jul 24 '23 at 18:44
0

The short answer is in my last comment, a Github resource:

I found an "example generator" at https://siefkenj.github.io/jspadic/ (...)

And, copying the examples generated by the link, the detailed answer is:

  • Yes, the standard "base p" notation is the p-adic notation for small integers of $\mathbb{N}$
  • 0 = (0,0,0,...)2 = $0_2 ~~=? \infty$
  • 1 = (1,0,0,...)2 = $1_2$
  • 2 = (0,1,0,0,...)2 = $01_2$
  • 3 = (1,1,0,0,...)2 = $11_2$
  • ...
  • 13 = (1,1,0,1,0,0,...)2 = $1101_2$
  • ...
  • 12345 = (1,1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,...)2 = $11000000111001_2$
  • ...
  • 123456789 = $\dots 10111100110100010101_2$
  • 1234567891234567 = $\dots 10111010111100000111_2$

You can check the case of 13 by this illustration
 enter image description here

PS: inductive reasoning is very important for non-mathematicians, to confirm that the interpretation of mathematician notation is correct.
Abstract mathematical notation is very abstract for normal humans, and sometimes ambiguous and confusing. The concrete examples are didactic, eliminating doubts and ambiguities.

How to build same $x_i$ from mod operator

The didactic challenge is to start from the classic positional notation and express an algorithm to build the same digits (all digits d with values d<p).

The positional notation (for natural numbers) say that:

$x = x_0 + x_{1} p + x_{2} p^2 + x_{3} p^3 + \dots + x_{n} p^n$
where p is a prime and the $x_i$ are integers from {0, 1, . . . , p− 1}.

So, for $p=2$ we have:
    $x = x_0 + 2x_{1} + 4x_{2} + 8x_{3} + \dots + 2^{n}x_{n} $
where the $x_i$ are integers from {0, 1}.

A non-expert reader see that $x_0 = x \operatorname{mod} p$, but is not so easy to see how to build the $x_i$ factors of the next powers, $2^i$, using the $\operatorname{mod}$ operator.

So the 2-adic number, when $x \in \mathbb{N}$, at this step, is something as:
  $(x_0, x_1, x_2, x_3, \dots, x_n) = (\dots, x_{n-3}, x_{n-2}, x_{n-1}, x_n)$

Using the results of the "inverse limit notation" (section below),
$x_n = x\operatorname{mod}2 \\ x_{n-1}=(x\operatorname{mod}4 - x\operatorname{mod}2)/2 \\ x_{n-2} = (x\operatorname{mod}8 - x\operatorname{mod}4)/4 \\ x_{n-3} = (x\operatorname{mod}16 - x\operatorname{mod}8)/8 \\ \dots$

Checking with 13: $((13\operatorname{mod}16 - 13\operatorname{mod}8)/8, (13\operatorname{mod}8 - 13\operatorname{mod}4)/4, (13\operatorname{mod}4 - 13\operatorname{mod}2)/2, 13\operatorname{mod}2) ~=~ (~(13 - 5)/8, ~(5 - 1)/4, ~(1 - 1 )/2, ~1) ~=~ (8/8, 4/4, 0, 1) = (1, 1, 0, 1)$

PS: using here the [Caruso2017,page 4]'s definition of p-adic number, with classic positional notation. It is also used by Siefkenj at examples generator.

To avoid "notation conflicts" we need to show another mathematician notation, that is not the positional notation.

How to build the inverse limit notation from positional

A 2-adic number, even the simplest (small numbers of $\mathbb{N}$), can be expressed by other notation, of expansion factors $a_i$ that are outside the previous constraint $x_i<2$, we can use any $0 \leq a_i$

$x = (a_0, a_1, a_2, \dots, a_n)_2$

Starting with the positional notation,

$x = x_0 + x_{1} 2 + x_{2} 4 + x_{3} 8 + \dots + x_{n} 2^n \\ = x_{n} 2^n + x_{n-1}2^{n-1} + x_{n-2}2^{n-2} + \dots + x_0 $

To express the number by mod operator:
  $x = (x \operatorname{mod} 2, ~x \operatorname{mod} 4, ~x \operatorname{mod} 8, \dots)\\ = (x_{n},~~ x_{n} + 2x_{n-1},~~ x_{n} + 2x_{n-1} + 4x_{n-2},~~ \dots)_2$

Now we obtain different results in the concrete examples:

  • 1 = (1,1,1,...)2
  • 2 = (0,2,2,2,...)2
  • 3 = (1,3,3,3,...)2
  • ...
  • 13 = (1,1,5,13,13,...)2
  • ...

Check, with 13, the use of positional notation factors: $x_0=1; ~x_1=1; ~x_2=0; ~x_3=1$.
Using them we have:
  $a_0=x_3=1;\\a_1= x_3 + 2x_{2}=1+0=1;\\ a_2=x_3 + 2x_2 + 4x_1=1+0+4=5;\\ a_3=x_3 + 2x_2 + 4x_1 + 8x_0=1+0+4+8=13.$
So, by these results we have 13 = (1,1,5,13,...)2.


References

Peter Krauss
  • 163
  • 8
  • 3
    I still think that $2=10_2$ in binary (with the least significant bit at the right end). In other words, the order of the bits is inverted. – Jyrki Lahtonen Jul 24 '23 at 05:41
  • Hi @JyrkiLahtonen, the answer text is not mine, is an open Wiki, you can edit (!). As I say in the question "There is not yet an 'ISO standard' for expressing p-adics", you can add other references showing "notation conflicts". We can use also the example of $13 = 1101_2$. PS: I am using the Siefkenj's link to generate examples. – Peter Krauss Jul 24 '23 at 05:56
  • 1
    The last equality you write is wrong. Given a $p$-adic number in positional notation $$x=x_0+x_1p+x_2p^2+x_3p^3+\ldots,$$ its conversion to the inverse limit notation is: \begin{eqnarray} x&=&(x\mod{p},\ x\mod{p^2},\ x\mod{p^3},\ x\mod{p^4},\ \ldots)\ &=&(x_0,x_0+x_1p,x_0+x_1p+x_2p^2,x_0+x_1p+x_2p^2+x_3p^3,\ldots). \end{eqnarray} – Servaes Jul 24 '23 at 08:34
  • 1
    @JyrkiLahtonen The conventional notation for $p$-adic numbers is in the same direction as binary (or decimal) notation. It is just that proximity between numbers is checked in the opposite direction. – Servaes Jul 24 '23 at 08:43
  • 2
    @Servaes Sure, but I think using $2$ as a subscript is limited to writing natural numbers in base two as opposed to the 2-adic notation. I have been wrong about such things before, and may well be here as well :-) Your explanation of how to convert the bit-by-bit notation into the inverse limit notation is, of course, on the money. – Jyrki Lahtonen Jul 24 '23 at 09:40
  • @JyrkiLahtonen I haven't seen the subscript for $p$-adics before either. It may help to give some clarity when first encountering them, but in my experience (too) it is not common in the literature. – Servaes Jul 24 '23 at 10:50
  • @Servaes, thanks the correction, I created a new section, "How to build the inverse limit notation" (this is the notation name?) with your correct explanation. You can edit. – Peter Krauss Jul 24 '23 at 13:04
  • 1
    @PeterKrauss I think you got the representation for $13$ wrong. I just picked these names based on the constructions they stem from, to distinguish the two notations. I'm not sure whether they have any specific (commonly understood) names. I do find it a bit confusing that you use the same subscript notation $x=(x_1,x_2,x_3,\ldots)_2$ for these two different notations. The same sequence does not represent the same number in these two different representations! – Servaes Jul 24 '23 at 13:17
  • 2
    *To expand a bit, the two notations also have different restrictions on the sequences that are allowed. In the power-series representation you must have $0\leq x_i<p$ for all $i$, whereas in the inverse limit representation you must have $x_i\equiv x_j\pmod{p^i}$ for all $j>i$. – Servaes Jul 24 '23 at 13:20
  • Hi @JyrkiLahtonen, I edited: splitted into 2 "How To" sections and changed the formulas... Now it seems correct, please check. – Peter Krauss Jul 25 '23 at 01:23