Metric

A distance function on a set satisfying positivity, symmetry, and the triangle inequality.
Metric

A metric on a XX is a d ⁣:X×X[0,)d\colon X\times X\to[0,\infty) such that for all x,y,zXx,y,z\in X:

  1. (Identity of indiscernibles) d(x,y)=0d(x,y)=0 if and only if x=yx=y.
  2. (Symmetry) d(x,y)=d(y,x)d(x,y)=d(y,x).
  3. (Triangle inequality) d(x,z)d(x,y)+d(y,z)d(x,z)\le d(x,y)+d(y,z).

A metric is the basic structure underlying a ; it determines and hence the .

Examples:

  • On Rn\mathbb{R}^n, the Euclidean metric d(x,y)=xy2d(x,y)=\|x-y\|_2.
  • On any set XX, the discrete metric d(x,y)=0d(x,y)=0 if x=yx=y and d(x,y)=1d(x,y)=1 otherwise.