##
Definition and properties

Let p be a prime number.

###
Integers

The **p-adic valuation** of an integer $n$ is defined to be

- $\nu _{p}(n)={\begin{cases}\mathrm {max} \{k\in \mathbb {N} :p^{k}\mid n\}&{\text{if ))n\neq 0\\\infty &{\text{if ))n=0,\end{cases))$

where $\mathbb {N}$ denotes the set of natural numbers and $m\mid n$ denotes divisibility of $n$ by $m$. In particular, $\nu _{p))$ is a function $\nu _{p}\colon \mathbb {Z} \to \mathbb {N} \cup \{\infty \))$.^{[2]}

For example, $\nu _{2}(-12)=2$, $\nu _{3}(-12)=1$, and $\nu _{5}(-12)=0$ since $|{-12}|=12=2^{2}\cdot 3^{1}\cdot 5^{0))$.

The notation $p^{k}\parallel n$ is sometimes used to mean $k=\nu _{p}(n)$.^{[3]}

If $n$ is a positive integer, then

- $\nu _{p}(n)\leq \log _{p}n$;

this follows directly from $n\geq p^{\nu _{p}(n)))$.

###
Rational numbers

The p-adic valuation can be extended to the rational numbers as the function

- $\nu _{p}:\mathbb {Q} \to \mathbb {Z} \cup \{\infty \))$
^{[4]}^{[5]}

defined by

- $\nu _{p}\left({\frac {r}{s))\right)=\nu _{p}(r)-\nu _{p}(s).$

For example, $\nu _{2}{\bigl (}{\tfrac {9}{8)){\bigr )}=-3$ and $\nu _{3}{\bigl (}{\tfrac {9}{8)){\bigr )}=2$ since ${\tfrac {9}{8))=2^{-3}\cdot 3^{2))$.

Some properties are:

- $\nu _{p}(r\cdot s)=\nu _{p}(r)+\nu _{p}(s)$
- $\nu _{p}(r+s)\geq \min {\bigl \{}\nu _{p}(r),\nu _{p}(s){\bigr \))$

Moreover, if $\nu _{p}(r)\neq \nu _{p}(s)$, then

- $\nu _{p}(r+s)=\min {\bigl \{}\nu _{p}(r),\nu _{p}(s){\bigr \))$

where $\min$ is the minimum (i.e. the smaller of the two).

##
p-adic absolute value

The p-adic absolute value on $\mathbb {Q}$ is the function

- $|\cdot |_{p}\colon \mathbb {Q} \to \mathbb {R} _{\geq 0))$

defined by

- $|r|_{p}=p^{-\nu _{p}(r)}.$

Thereby, $|0|_{p}=p^{-\infty }=0$ for all $p$ and
for example, $|{-12}|_{2}=2^{-2}={\tfrac {1}{4))$ and ${\bigl |}{\tfrac {9}{8)){\bigr |}_{2}=2^{-(-3)}=8.$

The p-adic absolute value satisfies the following properties.

From the multiplicativity $|rs|_{p}=|r|_{p}|s|_{p))$ it follows that $|1|_{p}=1=|-1|_{p))$ for the roots of unity $1$ and $-1$ and consequently also $|{-r}|_{p}=|r|_{p}.$
The subadditivity $|r+s|_{p}\leq |r|_{p}+|s|_{p))$ follows from the non-Archimedean triangle inequality $|r+s|_{p}\leq \max \left(|r|_{p},|s|_{p}\right)$.

The choice of base p in the exponentiation $p^{-\nu _{p}(r)))$ makes no difference for most of the properties, but supports the product formula:

- $\prod _{0,p}|r|_{p}=1$

where the product is taken over all primes p and the usual absolute value, denoted $|r|_{0))$. This follows from simply taking the prime factorization: each prime power factor $p^{k))$ contributes its reciprocal to its p-adic absolute value, and then the usual Archimedean absolute value cancels all of them.

The p-adic absolute value is sometimes referred to as the "p-adic norm",^{[citation needed]} although it is not actually a norm because it does not satisfy the requirement of homogeneity.

A metric space can be formed on the set $\mathbb {Q}$ with a (non-Archimedean, translation-invariant) metric

- $d\colon \mathbb {Q} \times \mathbb {Q} \to \mathbb {R} _{\geq 0))$

defined by

- $d(r,s)=|r-s|_{p}.$

The completion of $\mathbb {Q}$ with respect to this metric leads to the set $\mathbb {Q} _{p))$ of p-adic numbers.