Metric: Difference between revisions
No edit summary |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
== Definitions == | == Definitions == | ||
Let <math>X</math> be a given | Let <math>X</math> be a given nonempty set. A metric on <math>X</math> is a function | ||
<math display="block">d: X\times X\to \mathbb{R},</math> | |||
that satisfies the following four properties for all <math>x,y,z\in X</math>: | that satisfies the following four properties for all <math>x,y,z\in X</math>: | ||
# ''' | # '''Nonnegativity:''' <math>d(x,y)\ge 0</math> | ||
# '''Identity of indiscernibles:''' <math>d(x,y) = 0 \Longleftrightarrow x=y</math> | # '''Identity of indiscernibles:''' <math>d(x,y) = 0 \Longleftrightarrow x=y</math> | ||
# '''Symmetry:''' <math>d(x,y)=d(y,x)</math> | # '''Symmetry:''' <math>d(x,y)=d(y,x)</math> | ||
# '''Triangle inequality:''' <math>d(x,z)\le d(x,y)+d(y,z)</math>. | # '''Triangle inequality:''' <math>d(x,z)\le d(x,y)+d(y,z)</math>. | ||
The value <math>d(x,y)</math> is called the distance between <math>x</math> and <math>y</math>. | |||
== Properties == | == Properties == | ||
{{Property|property= | {{Property|property=Nonnegativity is implied by the other three properties.}} | ||
{{Proof|proof=Let <math>x,y\in X</math>. By the triangle inequality, | |||
<math display="block">d(x,x)\le d(x,y)+d(y,x).</math> | <math display="block">d(x,x)\le d(x,y)+d(y,x).</math> | ||
By the identity of | |||
By the identity of indiscernibles, <math>d(x,x)=0</math>. Thus | |||
<math display="block">0\le d(x,y)+d(y,x).</math> | <math display="block">0\le d(x,y)+d(y,x).</math> | ||
By symmetry, <math>d(x,y)=d(y,x)</math>. | |||
By symmetry, <math>d(x,y)=d(y,x)</math>. Therefore, | |||
<math display="block">\begin{align} | <math display="block">\begin{align} | ||
0&\le d(x,y)+d(x,y)\ | |||
0&\le 2d(x,y)\ | |||
0&\le d(x,y). | |||
\end{ | \end{align}</math> | ||
Hence <math>d(x,y)\ge 0</math>.}} | |||
{{Property|title=Reverse triangle inequality|property=Suppose that <math>(X,d)</math> is a metric space and <math>x,y,z\in X</math>. Then | |||
<math display="block">|d(x,y)-d(x,z)|\le d(y,z).</math>}} | |||
{{Proof|proof=By the triangle inequality, | |||
<math display="block">d(x,y)\le d(x,z)+d(z,y).</math> | |||
By symmetry, <math>d(z,y)=d(y,z)</math>. Therefore, | |||
<math display="block">d(x,y)-d(x,z)\le d(y,z).</math> | |||
Using the triangle inequality again, | |||
<math display="block">d(x,z)\le d(x,y)+d(y,z).</math> | |||
Rearranging gives | |||
<math display="block">d(x,z)-d(x,y)\le d(y,z).</math> | |||
Thus both | |||
<math display="block">d(x,y)-d(x,z)\le d(y,z)</math> | |||
and | |||
<math display="block">d(x,z)-d(x,y)\le d(y,z)</math> | |||
hold. Hence | |||
<math display="block">|d(x,y)-d(x,z)|\le d(y,z).</math>}} | |||
{{Property|title=Distance from a fixed point is continuous|property=Let <math>(X,d)</math> be a metric space and let <math>a\in X</math>. The function <math>f:X\to\mathbb{R}</math> defined by | |||
<math display="block">f(x)=d(x,a)</math> | |||
is continuous.}} | |||
{{Proof|proof=For any <math>x,y\in X</math>, the reverse triangle inequality gives | |||
<math display="block">|d(x,a)-d(y,a)|\le d(x,y).</math> | |||
Let <math>\varepsilon>0</math>. If <math>d(x,y)<\varepsilon</math>, then | |||
<math display="block">|f(x)-f(y)|=|d(x,a)-d(y,a)|<\varepsilon.</math> | |||
Therefore <math>f</math> is continuous.}} | |||
== Open balls == | |||
Let <math>(X,d)</math> be a metric space. For <math>a\in X</math> and <math>r>0</math>, the '''open ball''' with centre <math>a</math> and radius <math>r</math> is the set | |||
<math display="block">B_r(a)={x\in X:d(x,a)<r}.</math> | |||
Similarly, the '''closed ball''' with centre <math>a</math> and radius <math>r</math> is the set | |||
<math display="block">\overline{B}_r(a)={x\in X:d(x,a)\le r}.</math> | |||
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 <math>U\subseteq X</math> is called '''open''' if for every <math>x\in U</math>, there exists some <math>r>0</math> such that | |||
<math display="block">B_r(x)\subseteq U.</math> | |||
A subset <math>C\subseteq X</math> is called '''closed''' if its complement <math>X\setminus C</math> is open. | |||
This topology is called the '''metric topology''' induced by <math>d</math>. Thus metrics allow concepts from analysis and topology to be studied in a common framework. | |||
== Convergence == | |||
Let <math>(X,d)</math> be a metric space, and let <math>(x_n)</math> be a sequence in <math>X</math>. The sequence <math>(x_n)</math> is said to '''converge''' to <math>x\in X</math> if | |||
<math display="block">\lim_{n\to\infty} d(x_n,x)=0.</math> | |||
Equivalently, for every <math>\varepsilon>0</math>, there exists <math>N\in\mathbb{N}</math> such that whenever <math>n\ge N</math>, | |||
<math display="block">d(x_n,x)<\varepsilon.</math> | |||
In this case, one writes | |||
<math display="block">x_n\to x.</math> | |||
{{Property|title=Uniqueness of limits|property=In a metric space, a convergent sequence has at most one limit.}} | |||
{{Proof|proof=Suppose that <math>x_n\to x</math> and <math>x_n\to y</math>. By the triangle inequality, | |||
<math display="block">d(x,y)\le d(x,x_n)+d(x_n,y).</math> | |||
Taking the limit as <math>n\to\infty</math>, both terms on the right tend to <math>0</math>. Hence | |||
<math display="block">d(x,y)=0.</math> | |||
By the identity of indiscernibles, <math>x=y</math>. Therefore the limit is unique.}} | |||
== Continuity == | |||
Let <math>(X,d_X)</math> and <math>(Y,d_Y)</math> be metric spaces. A function <math>f:X\to Y</math> is '''continuous at''' <math>a\in X</math> if for every <math>\varepsilon>0</math>, there exists <math>\delta>0</math> such that whenever | |||
<math display="block">d_X(x,a)<\delta,</math> | |||
one has | |||
<math display="block">d_Y(f(x),f(a))<\varepsilon.</math> | |||
The function <math>f</math> is called '''continuous''' if it is continuous at every point of <math>X</math>. | |||
This definition generalizes the usual epsilon delta definition of continuity from real analysis. | |||
== Examples == | |||
=== Standard metric on the real line === | |||
On <math>\mathbb{R}</math>, the usual metric is | |||
<math display="block">d(x,y)=|x-y|.</math> | |||
This metric agrees with the ordinary notion of distance between real numbers. | |||
=== Euclidean metric === | |||
On <math>\mathbb{R}^n</math>, the Euclidean metric is | |||
<math display="block">d(x,y)=\sqrt{\sum_{i=1}^{n}(x_i-y_i)^2},</math> | |||
where <math>x=(x_1,\ldots,x_n)</math> and <math>y=(y_1,\ldots,y_n)</math>. | |||
=== Discrete metric === | |||
On any nonempty set <math>X</math>, the discrete metric is defined by | |||
<math display="block">d(x,y)= | |||
\begin{cases} | |||
0, & x=y,\ | |||
1, & x\ne y. | |||
\end{cases}</math> | |||
This metric treats every two distinct points as being exactly distance <math>1</math> apart. | |||
=== Taxicab metric === | |||
On <math>\mathbb{R}^n</math>, the taxicab metric is | |||
<math display="block">d(x,y)=\sum_{i=1}^{n}|x_i-y_i|.</math> | |||
In <math>\mathbb{R}^2</math>, this measures distance by moving only in coordinate directions, like travelling along the streets of a rectangular city grid. | |||
=== Supremum metric === | |||
On <math>\mathbb{R}^n</math>, the supremum metric is | |||
<math display="block">d(x,y)=\max_{1\le i\le n}|x_i-y_i|.</math> | |||
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 <math>d(x,y)=0</math> implies <math>x=y</math>. Thus two distinct points may have distance <math>0</math>. | |||
A '''norm''' on a vector space gives rise to a metric by defining | |||
<math display="block">d(x,y)=|x-y|.</math> | |||
For example, the usual absolute value on <math>\mathbb{R}</math> gives the standard metric | |||
<math display="block">d(x,y)=|x-y|.</math> | |||
== See also == | |||
* [[Metric space]] | |||
* [[Topology]] | |||
* [[Open set]] | |||
* [[Closed set]] | |||
* [[Continuity]] | |||
* [[Convergence]] | |||
* [[Normed vector space]] | |||
[[Category:Metric spaces]] | |||
[[Category:Topology]] | |||
[[Category:Mathematical analysis]] | |||
Latest revision as of 22:01, 29 June 2026
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