Let $X$ be any nonempty set.For any $x,y\in X$,define
$d(x,y)=1$ if $x\neq y$
$d(x,y)=0$ if $x=y$.
Then $(X,d)$ is a metric space.The metric $d$ is called discret metric and the space $(X,d)$ is called discret metric space.
Proof:
(1)For any given $x\in X$,$d(x,x)=0$.
(2)For any $x,y\in X$,$d(x,y)=0$,or $d(x,y)=1$.So $d(x,y)\geq 0$.
(3)If $x=y$,then $y=x$.And if $x\neq y$,$y\neq x$.So $d(x,y)=d(y,x)$
(4)If $x=y$,then it is easy to verify that $d(x,y)\leq d(x,z)+d(z,y)$.If $x\neq y$,then $x=z$ and $y=z$ can not be hold at the same time.So $d(x,y)\leq d(x,z)+d(z,y)$.
注:這個例子無非就是:一個非空集合里的元素到自身的距離都是0,而不同元素之間的距離都是1.這個例子告訴我們,可以在任意非空集合上定義一個度量.