P-adic Integers is Metric Completion of Integers

Theorem
Let $p$ be a prime number.

Let $\struct {\Q_p, \norm {\,\cdot\,}_p}$ be the $p$-adic numbers.

Then the $p$-adic integers $\Z_p$ with the $p$-adic metric is the metric completion of the integers $\Z$.

Proof
By the definition of the $p$-adic norm on $\Q_p$, it extends the $p$-adic norm on $\Q$.

By definition of the $p$-adic norm on $\Q$:
 * $\forall q \in \Q: \norm q_p := \begin{cases}

0 & : q = 0 \\ p^{-\map {\nu_p} q} & : q \ne 0 \end{cases}$ where $\nu_p: \Q \to \Z \cup \set {+\infty}$ is the $p$-adic valuation on $\Q$.

By definition of the $p$-adic valuation on $\Z$:
 * $\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}$

It follows that:
 * $\forall n \in \Z : \norm {n}_p \le 1$

Hence $\Z \subseteq \Z_p$

By definition, the $p$-adic integers is the valuation ring induced by $\norm {\,\cdot\,}_p$.

By the definition of the valuation ring induced by $\norm {\,\cdot\,}_p$ then the $p$-adic integers are the closed ball ${B_1}^- \paren {0}$.

By Closed Balls are Clopen then the $p$-adic integers are both open and closed in the $p$-adic metric.