Let \(X\) be a non-empty set. A function \(d\colon X\times X\to \mathbb{R}\) is called metric on \(X\) if it satisfies for all \(x,y,z\in X\)

  1. \(d(x,x)=0\),
  2. positivity, i.e. \(d(x,y)> 0\) if \(x\neq y\),
  3. symmetry, i.e. \(d(x,y)=d(y,x)\),
  4. triangle inequality, i.e. \(d(x,y)\le d(x,z)+d(z,y)\).

The metric is a notion of a distance.

Remarks

Examples Link to heading