Standard Discrete Metric is Metric

Theorem
The discrete metric is a metric.

Proof
M0, M1 and M2 clearly hold, so we just need to check M3:


 * $$x = z \Longrightarrow d \left({x, z}\right) = 0 \Longrightarrow 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 M3 holds.