[Def]: Metric and Metric Space

Let $X$ be a nonempty set

A mapping

$d: X \times X \rightarrow \mathbb{R}$

is said to be a metric of $X$ if it satisfies:

  1. $d(x,y) \ge0$, $\forall x,y \in X$, $d(x,y)=0 \iff x=y$
  2. $d(x,y)=d(y,x)$, $\forall x,y \in X$
  3. for any $x,y,z\in X$, we have $d(x,z) \le d(x,y)+d(y,z)$

We denote $(X,d)$ as a metric space