Integers with Metric Induced by P-adic Valuation

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

Let $d: \Z^2 \to \R_{\ge 0}$ be the mapping defined as:


 * $\forall x, y \in \Z: \map d {x, y} = \begin {cases} 0 & : x = y \\ \dfrac 1 r & : x - y = p^{r - 1} k: r \in \N_{>0}, k \in \Z, p \nmid k \end {cases}$

Then $d$ is a metric on $\Z$.

Proof
From Characterization of P-adic Valuation on Integers:


 * $d$ is well-defined.

We prove the metric space axioms.

This follows immediately from the definition of $d$.

Let $x, y, z \in \Z$.

From Characterization of P-adic Valuation on Integers:
 * $\exists r, s, t \in \N_{>0}, k, l, m \in \Z, p \nmid k, l, m:$
 * $x - y = p^{r - 1} k$
 * $y - z = p^{s - 1} l$
 * $x - z = p^{t - 1} m$

Let $t' = \min \set{r, s}$.

Then:

Hence:
 * $p^{t' - 1} \divides p^{t - 1} m$

Then:
 * $t' \le t$

Hence:

Let $x, y \in \Z$.

Case 1: $x = y$
Let $x = y$.

By definition of $d$:
 * $\map d {x, y} = 0 = \map d {y, x}$

Case: $x \ne y$
Let $x \neq y$.

Then

Hence:
 * $\map d {x, y} = \dfrac 1 r = \map d {y, x}$

Let $x, y \in \Z$ such that:


 * $x \ne y$

Let $x - y = p^{r - 1} k: r \in \N_{>0}, k \in \Z, p \nmid k$.

We have: