p-adic absolute value (source code)

= p-adic absolute value
{c}
{title2=$|\cdot|_p$}

Fix a <prime number> $p$. Write a nonzero <rational number> as $x=p^k a/b$, where $k\in\mathbb Z$ and the nonzero <integers> $a,b$ are not divisible by $p$. The exponent $k$ is uniquely determined. Its <P-adic valuation> is this signed exponent $v_p(x)=k$: equivalently, for any nonzero integer <numerator> $A$ and <denominator> $B$,
$$
v_p(A/B)=v_p(A)-v_p(B),\qquad |x|_p=p^{-v_p(x)},\qquad |0|_p=0.
$$
Factors of $p$ in the <numerator> decrease the <p-adic absolute value>; factors in the <denominator> increase it. For $p=2$ the computations are:

|| <Rational number> $x$
|| Factorization
|| <P-adic valuation> $v_2(x)$
|| <2-adic absolute value> $|x|_2$

| $8$
| $2^3$
| $3$
| $1/8$

| $12$
| $2^2\cdot3$
| $2$
| $1/4$

| $3/8$
| $2^{-3}\cdot3$
| $-3$
| $8$

| $-7$
| $2^0\cdot(-7)$
| $0$
| $1$

| $0$
| Not applicable
| $+\infty$ by convention
| $0$

This is an <absolute value on a field> measuring <divisibility>, rather than the magnitude on a <real number> <number line>. It satisfies
$$
|xy|_p=|x|_p|y|_p,\qquad |x+y|_p\leq\max\{|x|_p,|y|_p\}.
$$
The proof comes directly from <P-adic valuations>: exponents add in a <product of numbers>, and extracting a common power of $p$ from a <sum> gives $v_p(x+y)\geq\min\{v_p(x),v_p(y)\}$. If the two <P-adic valuations> differ, the remaining term with smaller exponent cannot cancel modulo $p$, so equality holds. Thus the <p-adic absolute value> is a <Non-Archimedean absolute value>. https://arxiv.org/pdf/math/0502560[Stephen William Semmes, Notes on p-adic numbers, page 1]{ref}

The <metric> $d_p(x,y)=|x-y|_p$ makes two <rational numbers> close when their difference contains a high power of $p$. This packages successive <modular congruences> into a numerical error estimate, allowing <convergence in a metric space> and <convergent series> to encode exact <arithmetic> information.