Metric space consisting two elements. Suppose that $S$ be a set consisting exactly $2$ elements. Suppose we define a function $\displaystyle d:S \times S \to [0,\infty)$ by $\displaystyle d(x,y)=\begin{cases}1 &\text{ , if }x\not=y\\0 &\text{ , if} x=y\end{cases}$
How I can show that $d$ defines a metric on $S$ ?
Problem is on triangular inequality..To prove triangular inequality we need at least three points. How I can show the triangular inequality ?
Same problem for a set consisting only $1$-element or empty set.
What's the idea behind these ?
 A: The triangle inequality says:
$$
\text{For all } x, y, z, \;\; d(x,y) + d(y,z) \ge d(x,z).
$$
It may seem like it to you (thinking of it as a triangle), but $x,y,z$ do not have to be distinct. Two of them can be the same point.
However, triangle inequality with two or one point(s) is trivial. For instance, suppose $x = y$. Then the triangle inequality says
$$
d(x,x) + d(x,z) \ge d(x,z)
$$
which is true merely relying on the fact that $d(x,x) \ge 0$.
The same thing happens if $y = z$. Finally if $x = z$, we get
$$
d(x,y) + d(y,x) \ge d(x,x),
$$
which follows from the other property of a metric space, that $d(x,x) = 0$, and the facts $d(x,y) \ge 0$ and $d(y,x) \ge 0$.
The bottom line: The triangle inequality only says something "interesting" (not implied by the other properties of a metric space) when the three points of the triangle are distinct.
A: You don't need three points. Here's the statment of the triangular inequality:
$$\forall x,y,z\in S,d(x,z)\le d(x,y)+d(y,z)$$
Remark: This metric is called the discrete metric, and it can be defined on any nonempty set.
