Suppose $X$ is a set. The discrete metric on $X$ is the function $d: X \times X \to \R _+$ defined by \[ d(x, y) = \begin{cases} 1 & \text{ if } x = y \\ 0 & \text{ otherwise } \end{cases} \] In this case, $(X, d)$ is called a discrete metric space.
\[ d(x, y) = \begin{cases} 1 & \text{ if } x = y \\ 0 & \text{ otherwise } \end{cases} \]