Characterization of P-adic Valuation on Integers

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

Let $\nu_p^\Z: \Z \to \N \cup \set {+\infty}$ be the $p$-adic valuation on $\Z$.

Let $n \in \Z_{\ne 0}$.

Then $\map {\nu_p^\Z} n$ is the unique $r \in \N$ such that:
 * $\exists k \in \Z: n = p^r k : p \nmid k$

Uniqueness of $r$
Let $r, r'$ be such that:
 * $\exists k \in \Z: n = p^r k : p \nmid k$

and:
 * $\exists k' \in \Z: n = p^{r'} k' : p \nmid k'$

, suppose $r \ge r'$.

By subtracting the above equations:
 * $0 = p^r k - p^{r'} k' = p^{r'} \paren {p^{r - r'} k - k'} = 0$

Therefore:
 * $p ^{r - r'} k = k'$

Thus because $p \nmid k'$:
 * $r - r' = 0$