Metric Spaces

metric

A metric is a rule that tells you how far apart any two points are. It is the mathematical distillation of our everyday notion of distance: it should never be negative, you should get the same answer whether you measure from A to B or from B to A, and a detour through a third point can never be a shortcut.

Formally, a metric on a set X is a function d: X x X -> R satisfying four conditions for all x, y, z in X. Non-negativity: d(x, y) >= 0. Identity of indiscernibles: d(x, y) = 0 if and only if x = y. Symmetry: d(x, y) = d(y, x). The triangle inequality: d(x, z) <= d(x, y) + d(y, z). The first condition is in fact implied by the other three, but it is usually stated for emphasis.

Many different metrics can live on the same set, and they need not agree on what looks like distance. On the plane you can use the straight-line distance, the taxicab distance |x1 - x2| + |y1 - y2|, or the maximum of the two coordinate differences; each is a genuine metric and each gives a different geometry, even though all three turn out to define the same open sets.

On any set X define d(x, y) = 0 if x = y and d(x, y) = 1 otherwise. This discrete metric satisfies all four axioms: every distinct pair is exactly one unit apart.

The discrete metric — the simplest metric that exists on every set.

If you drop the requirement that d(x, y) = 0 forces x = y (keeping only d(x, x) = 0), you get a pseudometric, where distinct points can sit at distance zero. The triangle inequality is the workhorse of analysis: nearly every estimate in this subject is, at heart, an application of it.

Also called
distance function距离函数距離函數