Inner product spaces as well as normed spaces have a distance function, namely the norm of the difference,
between two vectors
i.e.,
The importance of a distance function and the triangle inequality is that it can also be applied to certain nonlinear spaces, which have no zero element (``origin''). Such spaces are called metric spaces. More precisely we have the following definition.
By a metric space is meant a
pair
consisting of set
and a distance function
, i.e., a
single-valued, nonnegative, real function
defined for
which has the following three properties.
The distance function
is called
the metric of the
metric space. All inner product spaces are metric spaces with
All normed linear spaces are metric spaces with
However not all metric spaces are normed linear spaces.
Example 1: The two dimensional surface of a sphere
is not a vector space. It is, however, a metric space whose distance function is the (shortest) length of the great circle passing between a pair of points.
Show that (a) the Hamming distance, (b) the Pythagorean distance, and (c) the Chebyshev distance each satisfy the triangle inequality.