Metric
In mathematics, a metric or distance function is a function that defines a rigorous concept of distance between each pair of elements in a given set. By generalizing the physical concept of distance, metrics allow mathematicians to define topological concepts such as open and closed sets, continuity, convergence, and limits in highly abstract spaces. A set equipped with a metric is called a metric space.
Definitions
Let be a given nonempty set. A metric on
is a function
that satisfies the following four properties for all :
- Nonnegativity:
- Identity of indiscernibles:
- Symmetry:
- Triangle inequality:
.
The value is called the distance between
and
.
Properties
Nonnegativity is implied by the other three properties.
Let . By the triangle inequality,
By the identity of indiscernibles, . Thus
By symmetry, . Therefore,
Hence .
Suppose that is a metric space and
. Then
By the triangle inequality,
By symmetry, . Therefore,
Using the triangle inequality again,
Rearranging gives
Thus both
and
hold. Hence
Let be a metric space and let
. The function
defined by
is continuous.
For any , the reverse triangle inequality gives
Let . If
, then
Therefore is continuous.
Open balls
Let be a metric space. For
and
, the open ball with centre
and radius
is the set
Similarly, the closed ball with centre and radius
is the set
Open balls are fundamental because they describe the local structure of a metric space.
Metric topology
Every metric space naturally gives rise to a topology. A subset is called open if for every
, there exists some
such that
A subset is called closed if its complement
is open.
This topology is called the metric topology induced by . Thus metrics allow concepts from analysis and topology to be studied in a common framework.
Convergence
Let be a metric space, and let
be a sequence in
. The sequence
is said to converge to
if
Equivalently, for every , there exists
such that whenever
,
In this case, one writes
In a metric space, a convergent sequence has at most one limit.
Suppose that and
. By the triangle inequality,
Taking the limit as , both terms on the right tend to
. Hence
By the identity of indiscernibles, . Therefore the limit is unique.
Continuity
Let and
be metric spaces. A function
is continuous at
if for every
, there exists
such that whenever
one has
The function is called continuous if it is continuous at every point of
.
This definition generalizes the usual epsilon delta definition of continuity from real analysis.
Examples
Standard metric on the real line
On , the usual metric is
This metric agrees with the ordinary notion of distance between real numbers.
Euclidean metric
On , the Euclidean metric is
where and
.
Discrete metric
On any nonempty set , the discrete metric is defined by
This metric treats every two distinct points as being exactly distance apart.
Taxicab metric
On , the taxicab metric is
In , this measures distance by moving only in coordinate directions, like travelling along the streets of a rectangular city grid.
Supremum metric
On , the supremum metric is
This metric measures the largest coordinate difference between two points.
Related notions
A pseudometric is similar to a metric, but it does not require that implies
. Thus two distinct points may have distance
.
A norm on a vector space gives rise to a metric by defining
For example, the usual absolute value on gives the standard metric