linguistic:voice_change, structural:scholar_edition
p -adic expansion of rational numbers

The decimal expansion of a positive rational number r {\displaystyle r} is its representation as a series

where k {\displaystyle k} is an integer and each a i {\displaystyle a_{i}} is also an integer such that 0 ≤ a i < 10. {\displaystyle 0\leq a_{i}<10.} This expansion can be computed by long division of the numerator by the denominator, which is itself based on the following theorem: If r = n d {\displaystyle r={\tfrac {n}{d}}} is a rational number such that 10 k ≤ r < 10 k + 1, {\displaystyle 10^{k}\leq r<10^{k+1},} there is an integer a {\displaystyle a} such that 0 < a < 10, {\displaystyle 0<a<10,} and r = a 10 k + r ′, {\displaystyle r=a\,10^{k}+r',} with r ′ < 10 k. {\displaystyle r'<10^{k}.} The decimal expansion is obtained by repeatedly applying this result to the remainder r ′ {\displaystyle r'} which in the iteration assumes the role of the original rational number r {\displaystyle r}.

The p - adic expansion of a rational number is defined similarly, but with a different division step. More precisely, given a fixed prime number p {\displaystyle p}, every nonzero rational number r {\displaystyle r} can be uniquely written as r = p k n d, {\displaystyle r=p^{k}{\tfrac {n}{d}},} where k {\displaystyle k} is a (possibly negative) integer, n {\displaystyle n} and d {\displaystyle d} are coprime integers both coprime with p {\displaystyle p}, and d {\displaystyle d} is positive. The integer k {\displaystyle k} is the p -adic valuation of r {\displaystyle r}, denoted v p (r), {\displaystyle v_{p}(r),} and p − k {\displaystyle p^{-k}} is its p -adic absolute value, denoted | r | p {\displaystyle |r|_{p}} (the absolute value is small when the valuation is large). The division step consists of writing

where a {\displaystyle a} is an integer such that 0 ≤ a < p, {\displaystyle 0\leq a<p,} and r ′ {\displaystyle r'} is either zero, or a rational number such that | r ′ | p < p − k {\displaystyle |r'|_{p}<p^{-k}} (that is, v p (r ′) > k {\displaystyle v_{p}(r')>k}).

The p {\displaystyle p} - adic expansion of r {\displaystyle r} is the formal power series

obtained by repeating indefinitely the above division step on successive remainders. In a p -adic expansion, all a i {\displaystyle a_{i}} are integers such that 0 ≤ a i < p. {\displaystyle 0\leq a_{i}<p.}

If r = p k n 1 {\displaystyle r=p^{k}{\tfrac {n}{1}}} with n > 0 {\displaystyle n>0}, the process stops eventually with a zero remainder; in this case, the series is completed by trailing terms with a zero coefficient, and is the representation of r {\displaystyle r} in base- p.

The existence and the computation of the p -adic expansion of a rational number results from Bézout's identity in the following way. If, as above, r = p k n d, {\displaystyle r=p^{k}{\tfrac {n}{d}},} and d {\displaystyle d} and p {\displaystyle p} are coprime, there exist integers t {\displaystyle t} and u {\displaystyle u} such that t d + u p = 1. {\displaystyle td+up=1.} So

Then, the Euclidean division of n t {\displaystyle nt} by p {\displaystyle p} gives

with 0 ≤ a < p. {\displaystyle 0\leq a<p.} This gives the division step as

so that in the iteration

is the new rational number.

The uniqueness of the division step and of the whole p -adic expansion is easy: if p k a 1 + p k + 1 s 1 = p k a 2 + p k + 1 s 2, {\displaystyle p^{k}a_{1}+p^{k+1}s_{1}=p^{k}a_{2}+p^{k+1}s_{2},} one has a 1 − a 2 = p (s 2 − s 1). {\displaystyle a_{1}-a_{2}=p(s_{2}-s_{1}).} This means p {\displaystyle p} divides a 1 − a 2. {\displaystyle a_{1}-a_{2}.} Since 0 ≤ a 1 < p {\displaystyle 0\leq a_{1}<p} and 0 ≤ a 2 < p, {\displaystyle 0\leq a_{2}<p,} the following must be true: 0 ≤ a 1 {\displaystyle 0\leq a_{1}} and a 2 < p. {\displaystyle a_{2}<p.} Thus, one gets − p < a 1 − a 2 < p, {\displaystyle -p<a_{1}-a_{2}<p,} and since p {\displaystyle p} divides a 1 − a 2 {\displaystyle a_{1}-a_{2}} it must be that a 1 = a 2. {\displaystyle a_{1}=a_{2}.}

The p -adic expansion of a rational number is a series that converges to the rational number, if one applies the definition of a convergent series with the p -adic absolute value.In the standard p -adic notation, the digits are written in the same order as in a standard base- p system, namely with the powers of the base increasing to the left. This means that the production of the digits is reversed and the limit happens on the left hand side.

The p -adic expansion of a rational number is eventually periodic. Conversely, a series ∑ i = k ∞ a i p i, {\textstyle \sum _{i=k}^{\infty }a_{i}p^{i},} with 0 ≤ a i < p {\displaystyle 0\leq a_{i}<p} converges (for the p -adic absolute value) to a rational number if and only if it is eventually periodic; in this case, the series is the p -adic expansion of that rational number. The proof is similar to that of the similar result for repeating decimals.