## Definition

Let $p \in \N$ be a prime number.

### Integers

The $p$-adic valuation (on $\Z$) is the mapping $\nu_p^\Z: \Z \to \N \cup \left\{{+\infty}\right\}$ defined by:

$\nu_p^\Z \left({n}\right) := \begin{cases} +\infty & : n = 0 \\ \sup \left\{{v \in \N: p^v \mathbin \backslash n}\right\} & : n \ne 0 \end{cases}$

where:

$\sup$ denotes supremum
$p^v \mathbin \backslash n$ expresses that $p^v$ divides $n$.

### Rational Numbers

Let the $p$-adic valuation on the integers $\nu_p^\Z$ be extended to $\nu_p^\Q: \Q \to \Z \cup \left\{{+\infty}\right\}$ by:

$\nu_p^\Q \left({\dfrac a b}\right) := \nu_p^\Z \left({a}\right) - \nu_p^\Z \left({b}\right)$

This mapping $\nu_p^\Q$ is called the $p$-adic valuation (on $\Q$) and is usually denoted $\nu_p: \Q \to \Z \cup \left\{{+\infty}\right\}$.