Discrete metric (source code)

= Discrete metric
{title2=$d(x,y)=\boldsymbol1_{\{x\ne y\}}$}
{wiki}

The <discrete metric> sets $d(x,x)=0$ and $d(x,y)=1$ for distinct points. It induces the <discrete topology>, and its <Cauchy sequences> are exactly the eventually constant <sequences>.

Every nonempty <set> equipped with the <discrete metric> is a <bounded set>, even if it is an <infinite set>. For $0<r<1$, both the <open ball> and <closed ball> about $a$ are the <singleton> $\{a\}$. At $r=1$, the <open ball> is still $\{a\}$, but the <closed ball> is the whole space; for $r>1$, both are the whole space. Every <subset> is both an <open set> and a <closed set>. Consequently the <boundary> of the radius-one <closed ball> is empty, even though every point other than $a$ is at distance exactly one. Also, the <closure> of $B_d(a,1)$ is $\{a\}$, rather than the radius-one <closed ball>.