Jump to content

Metric: Difference between revisions

From Mathepedia, the mathematical encyclopedia
Created page with "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 sp..."
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:


== Definitions ==
== Definitions ==
Let <math>X</math> be a given non-empty set. A metirx on <math>X</math> is a function <math display="block">d: X\times X\to \mathbb{R}</math>,
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>:


# '''Non-negativity:''' <math>d(x,y)\ge 0</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=Non-negativity is implied by the other three properties.}}{{Proof|proof=Let <math>x,y\in X</math>. By triangle inequality,
{{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 indisscernbles, <math>d(x,x)=0</math>. Thus
 
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>. Thus
 
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 d(x,y)+d(x,y)\
  0&\le 2d(x,y)\\
0&\le 2d(x,y)\
  0&\le d(x,y)
0&\le d(x,y).
\end{align}</math>}}
\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 LaTeX be a given nonempty set. A metric on LaTeX is a function

LaTeX

that satisfies the following four properties for all LaTeX:

  1. Nonnegativity: LaTeX
  1. Identity of indiscernibles: LaTeX
  1. Symmetry: LaTeX
  1. Triangle inequality: LaTeX.

The value LaTeX is called the distance between LaTeX and LaTeX.

Properties

Property.

Nonnegativity is implied by the other three properties.

Proof

Let LaTeX. By the triangle inequality,

LaTeX

By the identity of indiscernibles, LaTeX. Thus

LaTeX

By symmetry, LaTeX. Therefore,

Mathepedia render error: ! Package amsmath Error: \begin{align} allowed only in paragraph mode. See the amsmath package documentation for explanation. Type H <return> for immediate help. ... l.9 \begin{align} No pages of output.

Hence LaTeX.

Reverse triangle inequality.

Suppose that LaTeX is a metric space and LaTeX. Then

LaTeX

Proof

By the triangle inequality,

LaTeX

By symmetry, LaTeX. Therefore,

LaTeX

Using the triangle inequality again,

LaTeX

Rearranging gives

LaTeX

Thus both

LaTeX

and

LaTeX

hold. Hence

LaTeX

Distance from a fixed point is continuous.

Let LaTeX be a metric space and let LaTeX. The function LaTeX defined by

LaTeX

is continuous.

Proof

For any LaTeX, the reverse triangle inequality gives

LaTeX

Let LaTeX. If LaTeX, then

LaTeX

Therefore LaTeX is continuous.

Open balls

Let LaTeX be a metric space. For LaTeX and LaTeX, the open ball with centre LaTeX and radius LaTeX is the set

LaTeX

Similarly, the closed ball with centre LaTeX and radius LaTeX is the set

LaTeX

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 LaTeX is called open if for every LaTeX, there exists some LaTeX such that

LaTeX

A subset LaTeX is called closed if its complement LaTeX is open.

This topology is called the metric topology induced by LaTeX. Thus metrics allow concepts from analysis and topology to be studied in a common framework.

Convergence

Let LaTeX be a metric space, and let LaTeX be a sequence in LaTeX. The sequence LaTeX is said to converge to LaTeX if

LaTeX

Equivalently, for every LaTeX, there exists LaTeX such that whenever LaTeX,

LaTeX

In this case, one writes

LaTeX

Uniqueness of limits.

In a metric space, a convergent sequence has at most one limit.

Proof

Suppose that LaTeX and LaTeX. By the triangle inequality,

LaTeX

Taking the limit as LaTeX, both terms on the right tend to LaTeX. Hence

LaTeX

By the identity of indiscernibles, LaTeX. Therefore the limit is unique.

Continuity

Let LaTeX and LaTeX be metric spaces. A function LaTeX is continuous at LaTeX if for every LaTeX, there exists LaTeX such that whenever

LaTeX

one has

LaTeX

The function LaTeX is called continuous if it is continuous at every point of LaTeX.

This definition generalizes the usual epsilon delta definition of continuity from real analysis.

Examples

Standard metric on the real line

On LaTeX, the usual metric is

LaTeX

This metric agrees with the ordinary notion of distance between real numbers.

Euclidean metric

On LaTeX, the Euclidean metric is

LaTeX

where LaTeX and LaTeX.

Discrete metric

On any nonempty set LaTeX, the discrete metric is defined by

Mathepedia render error: ! Extra alignment tab has been changed to \cr. <template> $\hfil $$\endtemplate l.12 1, & x\ne y. No pages of output. Transcript written on /var/lib/mathepedia-renderer/cache/mathepedia-a7a7ae7eddc 206e45e014d983ab3fa45e39a2c907aae6cfdff0757b8e205229b-hvot_7za/diagram.log.

This metric treats every two distinct points as being exactly distance LaTeX apart.

Taxicab metric

On LaTeX, the taxicab metric is

LaTeX

In LaTeX, this measures distance by moving only in coordinate directions, like travelling along the streets of a rectangular city grid.

Supremum metric

On LaTeX, the supremum metric is

LaTeX

This metric measures the largest coordinate difference between two points.

A pseudometric is similar to a metric, but it does not require that LaTeX implies LaTeX. Thus two distinct points may have distance LaTeX.

A norm on a vector space gives rise to a metric by defining

LaTeX

For example, the usual absolute value on LaTeX gives the standard metric

LaTeX

See also