Standard Discrete Metric is Metric

Theorem
The discrete metric is a metric.

Proof
The metric space axioms M1, M3 and M4 clearly hold, so we just need to check M2:


 * $x = z \implies d \left({x, z}\right) = 0 \implies d \left({x, y}\right) + d \left({y, z}\right) \ge d \left({x, z}\right)$.
 * $x \ne z$: Either $x \ne y$ or $y \ne z$, so $d \left({x, y}\right) + d \left({y, z}\right) \ge 1$, but $d \left({x, z}\right) = 1$, so $d \left({x, y}\right) + d \left({y, z}\right) \ge d \left({x, z}\right)$.

Either way, $d \left({x, y}\right) + d \left({y, z}\right) \ge d \left({x, z}\right)$ and M2 holds.