In
mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and their changes (cal ...
, a metric space is a non empty
set together with a
metric
METRIC (Mapping EvapoTranspiration at high Resolution with Internalized Calibration) is a computer model
Computer simulation is the process of mathematical modelling, performed on a computer, which is designed to predict the behaviour of or th ...

on the set. The metric is a
function
Function or functionality may refer to:
Computing
* Function key
A function key is a key on a computer
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern comp ...
that defines a concept of ''distance'' between any two
members
Member may refer to:
* Military jury, referred to as "Members" in military jargon
* Element (mathematics), an object that belongs to a mathematical set
* In object-oriented programming, a member of a class
** Field (computer science), entries in ...
of the set, which are usually called
points
Point or points may refer to:
Places
* Point, Lewis, a peninsula in the Outer Hebrides, Scotland
* Point, Texas, a city in Rains County, Texas, United States
* Point, the NE tip and a ferry terminal of Lismore, Scotland, Lismore, Inner Hebrides, ...
. The metric satisfies a few simple properties:
* the distance from
to
is zero if and only if
and
are the same point,
* the distance between two distinct points is positive,
* the distance from
to
is the same as the distance from
to
, and
* the distance from
to
is less than or equal to the distance from
to
via any third point
.
A metric on a space induces
topological propertiesIn topology
s, which have only one surface and one edge, are a kind of object studied in topology.
In mathematics, topology (from the Greek language, Greek words , and ) is concerned with the properties of a mathematical object, geometric object ...
like
open
Open or OPEN may refer to:
Music
* Open (band)
Open is a band.
Background
Drummer Pete Neville has been involved in the Sydney/Australian music scene for a number of years. He has recently completed a Masters in screen music at the Australia ...
and
closed set
In geometry
Geometry (from the grc, γεωμετρία; ' "earth", ' "measurement") is, with , one of the oldest branches of . It is concerned with properties of space that are related with distance, shape, size, and relative position of ...
s, which lead to the study of more abstract
topological space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no gener ...
s.
The most familiar metric space is
3-dimensional Euclidean space
Three-dimensional space (also: 3-space or, rarely, tri-dimensional space) is a geometric setting in which three values (called parameter
A parameter (from the Ancient Greek language, Ancient Greek wikt:παρά#Ancient Greek, παρά, ''par ...
. In fact, a "metric" is the generalization of the
Euclidean metric
In mathematics, the Euclidean distance between two points in Euclidean space is the length of a line segment between the two points.
It can be calculated from the Cartesian coordinates of the points using the Pythagorean theorem, therefore occas ...
arising from the four long-known properties of the Euclidean distance. The Euclidean metric defines the distance between two points as the length of the
line segment
In geometry
Geometry (from the grc, γεωμετρία; ' "earth", ' "measurement") is, with , one of the oldest branches of . It is concerned with properties of space that are related with distance, shape, size, and relative position ...

connecting them. Other metric spaces occur for example in
elliptic geometry
Elliptic geometry is an example of a geometry
Geometry (from the grc, γεωμετρία; ''wikt:γῆ, geo-'' "earth", ''wikt:μέτρον, -metron'' "measurement") is, with arithmetic, one of the oldest branches of mathematics. It is conc ...
and
hyperbolic geometry
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no g ...
, where distance on a
sphere
A sphere (from Greek#REDIRECT Greek
Greek may refer to:
Greece
Anything of, from, or related to Greece
Greece ( el, Ελλάδα, , ), officially the Hellenic Republic, is a country located in Southeast Europe. Its population is appr ...

measured by angle is a metric, and the
hyperboloid model
In geometry
Geometry (from the grc, γεωμετρία; ''wikt:γῆ, geo-'' "earth", ''wikt:μέτρον, -metron'' "measurement") is, with arithmetic, one of the oldest branches of mathematics. It is concerned with properties of space th ...
of hyperbolic geometry is used by
special relativity
In physics
Physics is the natural science that studies matter, its Elementary particle, fundamental constituents, its Motion (physics), motion and behavior through Spacetime, space and time, and the related entities of energy and force ...
as a metric space of
velocities
The velocity of an object is the Time derivative, rate of change of its Position (vector), position with respect to a frame of reference, and is a function of time. Velocity is equivalent to a specification of an object's speed and direction o ...

. Some of non-geometric metric spaces include spaces of finite strings (
finite sequence
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
s of symbols from a predefined alphabet) equipped with e.g. a
Hamming Hamming may refer to:
* Richard Hamming
Richard Wesley Hamming (February 11, 1915 – January 7, 1998) was an American mathematician whose work had many implications for computer engineering
Computer engineering (CoE or CpE) is a branch o ...
's or
Levenshtein distance
In information theory
Information theory is the scientific study of the quantification, storage, and communication
Communication (from Latin ''communicare'', meaning "to share") is the act of developing Semantics, meaning among Subject (phi ...
, a space of subsets of any metric space equipped with
Hausdorff distanceIn mathematics, the Hausdorff distance, or Hausdorff metric, also called Pompeiu–Hausdorff distance, measures how far two subsets of a metric space are from each other. It turns the set of non-empty set, non-empty compact space, compact subsets of ...
, a space of
real functions integrableIn mathematics, integrability is a property of certain dynamical system
In mathematics, a dynamical system is a system in which a Function (mathematics), function describes the time dependence of a Point (geometry), point in a Manifold, geometric ...

on a unit
interval with an integral metric
or probabilistic spaces on any chosen metric space equipped with
Wasserstein metric
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It h ...
. See also the section .
History
In 1906
Maurice FréchetMaurice may refer to:
People
*Saint Maurice
Saint Maurice (also Moritz, Morris, or Mauritius; ) was the leader of the legendary Roman Theban Legion in the 3rd century, and one of the favorite and most widely venerated saints of that group. He w ...
introduced metric spaces in his work ''Sur quelques points du calcul fonctionnel''. However the name is due to
Felix Hausdorff
Felix Hausdorff (November 8, 1868 – January 26, 1942) was a German mathematician
A mathematician is someone who uses an extensive knowledge of mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as q ...
.
Definition
A metric space is an
ordered pair
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It h ...

where
is a set and
is a
metric
METRIC (Mapping EvapoTranspiration at high Resolution with Internalized Calibration) is a computer model
Computer simulation is the process of mathematical modelling, performed on a computer, which is designed to predict the behaviour of or th ...
on
, i.e., a
function
Function or functionality may refer to:
Computing
* Function key
A function key is a key on a computer
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern comp ...
:
such that for any
, the following holds:
:
Given the above three axioms, we also have that
for any
. This is deduced as follows (from the top to the bottom):
:
The function
is also called ''distance function'' or simply ''distance''. Often,
is omitted and one just writes
for a metric space if it is clear from the context what metric is used.
Ignoring mathematical details, for any system of roads and terrains the distance between two locations can be defined as the length of the shortest route connecting those locations. To be a metric there shouldn't be any one-way roads. The triangle inequality expresses the fact that detours aren't shortcuts. If the distance between two points is zero, the two points are indistinguishable from one-another. Many of the examples below can be seen as concrete versions of this general idea.
Examples of metric spaces
* The
real number
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no g ...
s with the distance function
given by the
absolute difference
The absolute difference of two real number
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus ...

, and, more generally,
Euclidean -space with the
Euclidean distance
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...
, are
complete metric spaces. The
rational number
In mathematics, a rational number is a number that can be expressed as the quotient or fraction (mathematics), fraction of two integers, a numerator and a non-zero denominator . For example, is a rational number, as is every integer (e.g. ) ...
s with the same distance function also form a metric space, but not a complete one.
* The
positive real numbersIn mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ha ...
with distance function
is a complete metric space.
* Any
normed vector space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no g ...
is a metric space by defining
, see also
metrics on vector spaces. (If such a space is
complete, we call it a
Banach space
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It h ...
.) Examples:
** The
Manhattan norm gives rise to the
Manhattan distance
A taxicab geometry is a form of geometry in which the usual distance function or Metric (mathematics), metric of Euclidean geometry is replaced by a new metric in which the distance between two points is the sum of the absolute differences of thei ...

, where the distance between any two points, or vectors, is the sum of the differences between corresponding coordinates.
** The cyclic Mannheim metric or Mannheim distance is a modulo variant of the Manhattan metric.
** The
maximum norm
frame, The perimeter of the square is the set of points in R2 where the sup norm equals a fixed positive constant.
In mathematical analysis, the uniform norm (or sup norm) assigns to real- or complex-valued bounded functions ''f'' defined on ...
gives rise to the
Chebyshev distance
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...
or chessboard distance, the minimal number of moves a
chess king would take to travel from
to
.
* The
British Rail
British Railways (BR), which from 1965 traded as British Rail, was the state-owned company that operated the national rail system rail transport in Great Britain
The railway system in Great Britain is the oldest railway system in the world. ...
metric (also called the "post office metric" or the "
SNCF
The Société nationale des chemins de fer français (; abbreviated as SNCF ; French for "French National Railway Company") is France
France (), officially the French Republic (french: link=no, République française), is a List of tr ...

metric") on a
normed vector space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no g ...
is given by
for distinct points
and
, and
. More generally
can be replaced with a function
taking an arbitrary set
to non-negative reals and taking the value
at most once: then the metric is defined on
by
for distinct points
and
, and The name alludes to the tendency of railway journeys to proceed via London (or Paris) irrespective of their final destination.
* If
is a metric space and
is a
subset
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...

of then
becomes a metric space by restricting the domain of
to
* The
discrete metric
Discrete in science is the opposite of continuous
Continuity or continuous may refer to:
Mathematics
* Continuity (mathematics), the opposing concept to discreteness; common examples include
** Continuous probability distribution or random vari ...
, where
if
and
otherwise, is a simple but important example, and can be applied to all sets. This, in particular, shows that for any set, there is always a metric space associated to it. Using this metric, the singleton of any point is an
open ball
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
, therefore every subset is open and the space has the
discrete topology
In topology
s, which have only one surface and one edge, are a kind of object studied in topology.
In mathematics, topology (from the Greek language, Greek words , and ) is concerned with the properties of a mathematical object, geometric objec ...
.
* A finite metric space is a metric space having a
finite
Finite is the opposite of Infinity, infinite. It may refer to:
* Finite number (disambiguation)
* Finite set, a set whose cardinality (number of elements) is some natural number
* Finite verb, a verb form that has a subject, usually being inflected ...
number of points. Not every finite metric space can be
isometrically embedded in a
Euclidean space
Euclidean space is the fundamental space of classical geometry. Originally, it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean spaces of any nonnegative integer dimension (mathematics), dimens ...
.
* The
hyperbolic plane
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...
is a metric space. More generally:
** If
is any
connected Riemannian manifold
In differential geometry
Differential geometry is a mathematical
Mathematics (from Greek
Greek may refer to:
Greece
Anything of, from, or related to Greece
Greece ( el, Ελλάδα, , ), officially the Hellenic Republic, is a c ...
, then we can turn
into a metric space by defining the distance of two points as the
infimum
In mathematics, the infimum (abbreviated inf; plural infima) of a subset S of a partially ordered set P is a greatest element in P that is less than or equal to all elements of S, if such an element exists. Consequently, the term ''greatest low ...
of the lengths of the paths (continuously differentiable
curve
In mathematics, a curve (also called a curved line in older texts) is an object similar to a line (geometry), line, but that does not have to be Linearity, straight.
Intuitively, a curve may be thought of as the trace left by a moving point (geo ...

s) connecting them.
* If
is some set and
is a metric space, then, the set of all
bounded function
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...
s
(i.e. those functions whose image is a
bounded subset of
) can be turned into a metric space by defining
for any two bounded functions
and
(where
is
supremum
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no ge ...

). This metric is called the
or supremum metric, and If
is complete, then this
function space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and th ...
is complete as well. If ''X'' is also a topological space, then the set of all bounded
continuous
Continuity or continuous may refer to:
Mathematics
* Continuity (mathematics), the opposing concept to discreteness; common examples include
** Continuous probability distribution or random variable in probability and statistics
** Continuous ga ...
functions from
to
(endowed with the uniform metric), will also be a complete metric if ''M'' is.
* If
is an
undirected connected graph, then the set
of vertices of
can be turned into a metric space by defining
to be the length of the shortest path connecting the vertices
and In
geometric group theory
Geometric group theory is an area in mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mat ...
this is applied to the
Cayley graph on two generators ''a'' and ''b''
In mathematics, a Cayley graph, also known as a Cayley colour graph, Cayley diagram, group diagram, or colour group is a Graph (discrete mathematics), graph that encodes the abstract structure of a group (mathemati ...

of a group, yielding the
word metricIn group theory
The popular puzzle Rubik's cube invented in 1974 by Ernő Rubik has been used as an illustration of permutation group">Ernő_Rubik.html" ;"title="Rubik's cube invented in 1974 by Ernő Rubik">Rubik's cube invented in 1974 by Ern ...
.
*
Graph edit distanceIn mathematics and computer science, graph edit distance (GED) is a Similarity measure, measure of similarity (or dissimilarity) between two Graph (discrete mathematics), graphs.
The concept of graph edit distance was first formalized mathematically ...
is a measure of dissimilarity between two
graphs
Graph may refer to:
Mathematics
*Graph (discrete mathematics)
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes an ...
, defined as the minimal number of
graph edit operations required to transform one graph into another.
* The
Levenshtein distance
In information theory
Information theory is the scientific study of the quantification, storage, and communication
Communication (from Latin ''communicare'', meaning "to share") is the act of developing Semantics, meaning among Subject (phi ...
is a measure of the dissimilarity between two
strings
String or strings may refer to:
*String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects
Arts, entertainment, and media Films
* Strings (1991 film), ''Strings'' (1991 fil ...
and
, defined as the minimal number of character deletions, insertions, or substitutions required to transform
into
. This can be thought of as a special case of the shortest path metric in a graph and is one example of an
edit distance
In computational linguistics and computer science, edit distance is a way of quantifying how dissimilar two String (computing), strings (e.g., words) are to one another by counting the minimum number of operations required to transform one string in ...
.
* Given a metric space
and an increasing
concave function
In , a concave function is the of a . A concave function is also ously called concave downwards, concave down, convex upwards, convex cap, or upper convex.
Definition
A real-valued f on an (or, more generally, a in ) is said to be ''concave' ...

such that
f(x) = 0 if and only if
x=0, then
f \circ d is also a metric on
X.
* Given an injective function
f from any set
A to a metric space
(X,d),
d(f(x), f(y)) defines a metric on
A.
* Using T-theory, the tight span of a metric space is also a metric space. The tight span is useful in several types of analysis.
* The set of all
m by
n matrix (mathematics), matrices over some
field (mathematics), field is a metric space with respect to the
rank
Rank is the relative position, value, worth, complexity, power, importance, authority, level, etc. of a person or object within a ranking
A ranking is a relationship between a set of items such that, for any two items, the first is either "rank ...
distance
d(X,Y) = \mathrm(Y - X).
* The
Helly metric
In game theory
Game theory is the study of mathematical model
A mathematical model is a description of a system
A system is a group of Interaction, interacting or interrelated elements that act according to a set of rules to form a u ...
is used in
game theory
Game theory is the study of mathematical model
A mathematical model is a description of a system
A system is a group of Interaction, interacting or interrelated elements that act according to a set of rules to form a unified whole.
...
.
Open and closed sets, topology and convergence
Every metric space is a
topological space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no gener ...
in a natural manner, and therefore all definitions and theorems about general topological spaces also apply to all metric spaces.
About any point
x in a metric space
M we define the
open ball
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
of radius
r > 0 (where
r is a real number) about
x as the set
:
B(x;r) = \.
These open balls form the
base
Base or BASE may refer to:
Brands and enterprises
* Base (mobile telephony provider), a Belgian mobile telecommunications operator
*Base CRM
Base CRM (originally Future Simple or PipeJump) is an enterprise software company based in Mountain Vie ...
for a topology on ''M'', making it a
topological space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no gener ...
.
Explicitly, a subset
U of
M is called
open
Open or OPEN may refer to:
Music
* Open (band)
Open is a band.
Background
Drummer Pete Neville has been involved in the Sydney/Australian music scene for a number of years. He has recently completed a Masters in screen music at the Australia ...
if for every
x in
U there exists an
r > 0 such that
B(x;r) is contained in
U. The
complement
A complement is often something that completes something else, or at least adds to it in some useful way. Thus it may be:
* Complement (linguistics), a word or phrase having a particular syntactic role
** Subject complement, a word or phrase addi ...
of an open set is called
closed. A
neighborhood
A neighbourhood (British English
British English (BrE) is the standard dialect
A standard language (also standard variety, standard dialect, and standard) is a language variety that has undergone substantial codification of grammar ...
of the point
x is any subset of
M that contains an open ball about
x as a subset.
A topological space which can arise in this way from a metric space is called a
metrizable space
In topology and related areas of mathematics, a metrizable space is a topological space that is Homeomorphism, homeomorphic to a metric space. That is, a topological space (X, \mathcal) is said to be metrizable if there is a Metric (mathematics), m ...
.
A
sequence
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

(
x_n) in a metric space
M is said to
converge
Converge may refer to:
* Converge (band), American hardcore punk band
* Converge (Baptist denomination), American national evangelical Baptist body
* Limit (mathematics)
* Converge ICT, internet service provider in the Philippines
See also
...
to the limit
x \in M if and only if
In logic
Logic is an interdisciplinary field which studies truth and reasoning. Informal logic seeks to characterize Validity (logic), valid arguments informally, for instance by listing varieties of fallacies. Formal logic represents st ...
for every
\varepsilon>0, there exists a natural number ''N'' such that
d(x_n,x) < \varepsilon for all
n > N. Equivalently, one can use the general definition of convergence available in all topological spaces.
A subset
A of the metric space
M is closed if and only if every sequence in
A that converges to a limit in
M has its limit in
A.
Types of metric spaces
Complete spaces
A metric space
M is said to be complete if every
Cauchy sequence
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...
converges in
M. That is to say: if
d(x_n, x_m) \to 0 as both
n and
m independently go to infinity, then there is some
y\in M with
d(x_n, y) \to 0.
Every
Euclidean space
Euclidean space is the fundamental space of classical geometry. Originally, it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean spaces of any nonnegative integer dimension (mathematics), dimens ...
is complete, as is every closed subset of a complete space. The rational numbers, using the absolute value metric
d(x,y) = \vert x - y \vert, are not complete.
Every metric space has a unique (up to
isometry
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...
)
completion, which is a complete space that contains the given space as a
dense
The density (more precisely, the volumetric mass density; also known as specific mass), of a substance is its mass
Mass is both a property
Property (''latin: Res Privata'') in the Abstract and concrete, abstract is what belongs to or ...
subset. For example, the real numbers are the completion of the rationals.
If
X is a complete subset of the metric space
M, then
X is closed in
M. Indeed, a space is complete if and only if it is closed in any containing metric space.
Every complete metric space is a
Baire space
In mathematics, a Baire space is a topological space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and ...
.
Bounded and totally bounded spaces

A metric space
M is called if there exists some number
r, such that
d(x, y) \leq r for all
x, y \in M. The smallest possible such
r is called the of
M. The space
M is called precompact or
totally boundedIn topology
s, which have only one surface and one edge, are a kind of object studied in topology.
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structu ...
if for every
r>0 there exist finitely many open balls of radius
r whose union covers
M. Since the set of the centres of these balls is finite, it has finite diameter, from which it follows (using the triangle inequality) that every totally bounded space is bounded. The converse does not hold, since any infinite set can be given the discrete metric (one of the examples above) under which it is bounded and yet not totally bounded.
Note that in the context of
intervals in the space of
real number
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no g ...
s and occasionally regions in a Euclidean space
\R^n a bounded set is referred to as "a finite interval" or "finite region". However boundedness should not in general be confused with "finite", which refers to the number of elements, not to how far the set extends; finiteness implies boundedness, but not conversely. Also note that an unbounded subset of
\R^n may have a finite
volume
Volume is a scalar quantity expressing the amount
Quantity or amount is a property that can exist as a multitude
Multitude is a term for a group of people who cannot be classed under any other distinct category, except for their shared fact ...
.
Compact spaces
A metric space
M is compact if every sequence in
M has a
subsequence
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
that converges to a point in
M. This is known as
sequential compactness and, in metric spaces (but not in general topological spaces), is equivalent to the topological notions of
countable compactness and
compactness
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
defined via
open cover
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It h ...
s.
Examples of compact metric spaces include the closed interval
,1/math> with the absolute value metric, all metric spaces with finitely many points, and the Cantor set
In mathematics, the Cantor set is a set of points lying on a single line segment that has a number of remarkable and deep properties. It was discovered in 1874 by Henry John Stephen Smith and introduced by German mathematician Georg Cantor in 188 ...

. Every closed subset of a compact space is itself compact.
A metric space is compact if and only if it is complete and totally bounded. This is known as the Heine–Borel theorem
In real analysis the Heine–Borel theorem, named after Eduard Heine and Émile Borel, states:
For a subset ''S'' of Euclidean space R''n'', the following two statements are equivalent:
*''S'' is closed set, closed and bounded set, bounded
*''S'' i ...
. Note that compactness depends only on the topology, while boundedness depends on the metric.
Lebesgue's number lemma states that for every open cover of a compact metric space M, there exists a "Lebesgue number" \delta such that every subset of M of diameter
In geometry
Geometry (from the grc, γεωμετρία; ' "earth", ' "measurement") is, with , one of the oldest branches of . It is concerned with properties of space that are related with distance, shape, size, and relative position ...

r<\delta is contained in some member of the cover.
Every compact metric space is second countable
In topology
s, which have only one surface and one edge, are a kind of object studied in topology.
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical struc ...
, and is a continuous image of the Cantor set
In mathematics, the Cantor set is a set of points lying on a single line segment that has a number of remarkable and deep properties. It was discovered in 1874 by Henry John Stephen Smith and introduced by German mathematician Georg Cantor in 188 ...

. (The latter result is due to Pavel Alexandrov
Pavel Sergeyevich Alexandrov (russian: Па́вел Серге́евич Алекса́ндров), sometimes romanized ''Paul Alexandroff'' (7 May 1896 – 16 November 1982), was a Soviet
The Soviet Union,. officially the Union of Soviet ...
and Urysohn
Pavel Samuilovich Urysohn () (February 3, 1898 – August 17, 1924) was a Soviet Union, Soviet mathematician who is best known for his contributions in dimension theory, and for developing Urysohn's metrization theorem and Urysohn's lemma, both of ...
.)
Locally compact and proper spaces
A metric space is said to be locally compact In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and the ...
if every point has a compact neighborhood. Euclidean spaces are locally compact, but infinite-dimensional Banach spaces are not.
A space is proper if every closed ball \ is compact. Proper spaces are locally compact, but the converse is not true in general.
Connectedness
A metric space M is connected if the only subsets that are both open and closed are the empty set and M itself.
A metric space M is path connected
In topology and related branches of mathematics, a connected space is a topological space that cannot be represented as the union (set theory), union of two or more disjoint set, disjoint Empty set, non-empty open (topology), open subsets. Conne ...
if for any two points x, y \in M there exists a continuous map f\colon ,1\to M with f(0)=x and f(1)=y.
Every path connected space is connected, but the converse is not true in general.
There are also local versions of these definitions: locally connected spaceImage:Neighborhood illust1.svg, In this topological space, ''V'' is a neighbourhood of ''p'' and it contains a connected open set (the dark green disk) that contains ''p''.
In topology and other branches of mathematics, a topological space ''X'' is ...
s and locally path connected spaces.
Simply connected space
In topology, a topological space is called simply connected (or 1-connected, or 1-simply connected) if it is path-connected and every Path (topology), path between two points can be continuously transformed (intuitively for embedded spaces, staying ...
s are those that, in a certain sense, do not have "holes".
Separable spaces
A metric space is separable space
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
if it has a countable
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...
dense
The density (more precisely, the volumetric mass density; also known as specific mass), of a substance is its mass
Mass is both a property
Property (''latin: Res Privata'') in the Abstract and concrete, abstract is what belongs to or ...
subset. Typical examples are the real numbers or any Euclidean space. For metric spaces (but not for general topological spaces) separability is equivalent to second-countability
In topology, a second-countable space, also called a completely separable space, is a topological space whose topology has a countable base (topology), base. More explicitly, a topological space T is second-countable if there exists some countable ...
and also to the Lindelöf property.
Pointed metric spaces
If X is a metric space and x_0\in X then (X,x_0) is called a ''pointed metric space'', and x_0 is called a ''distinguished point''. Note that a pointed metric space is just a nonempty metric space with attention drawn to its distinguished point, and that any nonempty metric space can be viewed as a pointed metric space. The distinguished point is sometimes denoted 0 due to its similar behavior to zero in certain contexts.
Types of maps between metric spaces
Suppose (M_1,d_1) and (M_2,d_2) are two metric spaces.
Continuous maps
The map f\,\colon M_1\to M_2 is continuous
Continuity or continuous may refer to:
Mathematics
* Continuity (mathematics), the opposing concept to discreteness; common examples include
** Continuous probability distribution or random variable in probability and statistics
** Continuous ga ...
if it has one (and therefore all) of the following equivalent properties:
;General topological continuity: for every open set U in M_2, the preimage
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...
f^ /math> is open in M_1
:This is the general definition of continuity in topology.
;Sequential continuity: if (x_n) is a sequence in M_1 that converges to x, then the sequence (f(x_n)) converges to f(x) in M_2.
:This is sequential continuity, due to Eduard Heine
Heinrich Eduard Heine (16 March 1821 – October 1881) was a German
German(s) may refer to:
Common uses
* of or related to Germany
* Germans, Germanic ethnic group, citizens of Germany or people of German ancestry
* For citizens of German ...
.
;ε-δ definition: for every x\in M_1 and every \varepsilon>0 there exists \delta>0 such that for all y in M_1 we have
::d_1(x,y)<\delta \implies d_2(f(x),f(y))< \varepsilon.
:This uses the (ε, δ)-definition of limit, and is due to Augustin Louis Cauchy.
Moreover, f is continuous if and only if it is continuous on every compact subset of M_1.
The image (mathematics), image of every compact set under a continuous function is compact, and the image of every connected set under a continuous function is connected.
Uniformly continuous maps
The map f\,\colon M_1\to M_2 is uniform continuity, uniformly continuous if for every \varepsilon>0 there exists \delta>0 such that
:d_1(x,y)<\delta \implies d_2(f(x),f(y))< \varepsilon \quad\mbox\quad x,y\in M_1.
Every uniformly continuous map f\,\colon M_1\to M_2 is continuous. The converse is true if M_1 is compact (Heine–Cantor theorem).
Uniformly continuous maps turn Cauchy sequences in M_1 into Cauchy sequences in M_2. For continuous maps this is generally wrong; for example, a continuous map
from the open interval (0,1) ''onto'' the real line turns some Cauchy sequences into unbounded sequences.
Lipschitz-continuous maps and contractions
Given a real number K>0, the map f\,\colon M_1\to M_2 is Lipschitz continuity, ''K''-Lipschitz continuous if
:d_2(f(x),f(y))\leq K d_1(x,y)\quad\mbox\quad x,y\in M_1.
Every Lipschitz-continuous map is uniformly continuous, but the converse is not true in general.
If K<1, then f is called a contraction mapping, contraction. Suppose M_2=M_1 and M_1 is complete. If f is a contraction, then f admits a unique fixed point (Banach fixed-point theorem). If M_1 is compact, the condition can be weakened a bit: f admits a unique fixed point if
: d(f(x), f(y)) < d(x, y) \quad \mbox \quad x \ne y \in M_1.
Isometries
The map f\,\colon M_1\to M_2 is an isometry
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...
if
:d_2(f(x),f(y))=d_1(x,y)\quad\mbox\quad x,y\in M_1
Isometries are always injective; the image of a compact or complete set under an isometry is compact or complete, respectively. However, if the isometry is not surjective, then the image of a closed (or open) set need not be closed (or open).
Quasi-isometries
The map f\,\colon M_1\to M_2 is a quasi-isometry if there exist constants A\geq1 and B\geq0 such that
:\frac d_2(f(x),f(y))-B\leq d_1(x,y)\leq A d_2(f(x),f(y))+B \quad\text\quad x,y\in M_1
and a constant C\geq0 such that every point in M_2 has a distance at most C from some point in the image f(M_1).
Note that a quasi-isometry is not required to be continuous. Quasi-isometries compare the "large-scale structure" of metric spaces; they find use in geometric group theory
Geometric group theory is an area in mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mat ...
in relation to the word metricIn group theory
The popular puzzle Rubik's cube invented in 1974 by Ernő Rubik has been used as an illustration of permutation group">Ernő_Rubik.html" ;"title="Rubik's cube invented in 1974 by Ernő Rubik">Rubik's cube invented in 1974 by Ern ...
.
Notions of metric space equivalence
Given two metric spaces (M_1, d_1) and (M_2, d_2):
*They are called homeomorphic (topologically isomorphic) if there exists a homeomorphism between them (i.e., a bijection continuous in both directions).
*They are called uniformic (uniformly isomorphic) if there exists a uniform isomorphism between them (i.e., a bijection uniformly continuous in both directions).
*They are called isometric if there exists a bijective isometry
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...
between them. In this case, the two metric spaces are essentially identical.
*They are called quasi-isometric if there exists a quasi-isometry between them.
Topological properties
Metric spaces are paracompact Hausdorff spaces and hence normal space, normal (indeed they are perfectly normal). An important consequence is that every metric space admits partitions of unity and that every continuous real-valued function defined on a closed subset of a metric space can be extended to a continuous map on the whole space (Tietze extension theorem). It is also true that every real-valued Lipschitz maps, Lipschitz-continuous map defined on a subset of a metric space can be extended to a Lipschitz-continuous map on the whole space.
Metric spaces are first countable since one can use balls with rational radius as a neighborhood base.
The metric topology on a metric space M is the coarsest topology on M relative to which the metric d is a continuous map from the product of M with itself to the non-negative real numbers.
Distance between points and sets; Hausdorff distance and Gromov metric
A simple way to construct a function separating a point from a closed set (as required for a completely regular space) is to consider the Distance#Distances between sets and between a point and a set, distance between the point and the set. If (M,d) is a metric space, S is a subset
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...

of M and x is a point of M, we define the distance from x to S as
:d(x,S) = \inf\ where \inf represents the infimum
In mathematics, the infimum (abbreviated inf; plural infima) of a subset S of a partially ordered set P is a greatest element in P that is less than or equal to all elements of S, if such an element exists. Consequently, the term ''greatest low ...
.
Then d(x, S)=0 if and only if x belongs to the closure (topology), closure of S. Furthermore, we have the following generalization of the triangle inequality:
:d(x,S) \leq d(x,y) + d(y,S),
which in particular shows that the map x\mapsto d(x,S) is continuous.
Given two subsets S and T of M, we define their Hausdorff distanceIn mathematics, the Hausdorff distance, or Hausdorff metric, also called Pompeiu–Hausdorff distance, measures how far two subsets of a metric space are from each other. It turns the set of non-empty set, non-empty compact space, compact subsets of ...
to be
:d_H(S,T) = \max \ where \sup represents the supremum
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no ge ...

.
In general, the Hausdorff distance d_H(S,T) can be infinite. Two sets are close to each other in the Hausdorff distance if every element of either set is close to some element of the other set.
The Hausdorff distance d_H turns the set K(M) of all non-empty compact subsets of M into a metric space. One can show that K(M) is complete if M is complete.
(A different notion of convergence of compact subsets is given by the Kuratowski convergence.)
One can then define the Gromov–Hausdorff convergence, Gromov–Hausdorff distance between any two metric spaces by considering the minimal Hausdorff distance of isometrically embedded versions of the two spaces. Using this distance, the class of all (isometry classes of) compact metric spaces becomes a metric space in its own right.
Product metric spaces
If (M_1,d_1),\ldots,(M_n,d_n) are metric spaces, and N is the Euclidean norm on \mathbb R^n, then \Bigl(M_1 \times \cdots \times M_n, N(d_1,\ldots,d_n)\Bigr) is a metric space, where the product metric is defined by
:N(d_1,\ldots,d_n)\Big((x_1,\ldots,x_n),(y_1,\ldots,y_n)\Big) = N\Big(d_1(x_1,y_1),\ldots,d_n(x_n,y_n)\Big),
and the induced topology agrees with the product topology. By the equivalence of norms in finite dimensions, an equivalent metric is obtained if N is the Norm (mathematics)#Taxicab norm or Manhattan norm, taxicab norm, a Norm (mathematics)#p-norm, p-norm, the maximum norm, or any other norm which is non-decreasing as the coordinates of a positive n-tuple increase (yielding the triangle inequality).
Similarly, a countable product of metric spaces can be obtained using the following metric
:d(x,y)=\sum_^\infty \frac1\frac.
An uncountable product of metric spaces need not be metrizable. For example, \mathbb^\mathbb is not first-countable space, first-countable and thus isn't metrizable.
Continuity of distance
In the case of a single space (M,d), the distance map d\colon M\times M \to R^+ (from the Metric space#Definition, definition) is uniformly continuous with respect to any of the above product metrics N(d,d), and in particular is continuous with respect to the product topology of M\times M.
Quotient metric spaces
If ''M'' is a metric space with metric d, and \sim is an equivalence relation on M, then we can endow the quotient set M/\!\sim with a pseudometric. Given two equivalence classes [x] and [y], we define
:d'([x],[y]) = \inf\
where the infimum
In mathematics, the infimum (abbreviated inf; plural infima) of a subset S of a partially ordered set P is a greatest element in P that is less than or equal to all elements of S, if such an element exists. Consequently, the term ''greatest low ...
is taken over all finite sequences (p_1, p_2, \dots, p_n) and (q_1, q_2, \dots, q_n) with [p_1]=[x], [q_n]=[y], [q_i]=[p_], i=1,2,\dots, n-1. In general this will only define a pseudometric space, pseudometric, i.e. d'([x],[y])=0 does not necessarily imply that [x]=[y]. However, for some equivalence relations (e.g., those given by gluing together polyhedra along faces), d' is a metric.
The quotient metric d is characterized by the following universal property. If f\,\colon(M,d)\to(X,\delta) is a metric map between metric spaces (that is, \delta(f(x),f(y))\le d(x,y) for all x, y) satisfying f(x)=f(y) whenever x\sim y, then the induced function \overline\,\colon M/\!\sim\to X, given by \overline([x])=f(x), is a metric map \overline\,\colon (M/\!\sim,d')\to (X,\delta).
A topological space is sequential space, sequential if and only if it is a quotient of a metric space.
Generalizations of metric spaces
* Every metric space is a uniform space in a natural manner, and every uniform space is naturally a topological space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no gener ...
. Uniform and topological spaces can therefore be regarded as generalizations of metric spaces.
* Relaxing the requirement that the distance between two distinct points be non-zero leads to the concepts of a pseudometric space or a dislocated metric space. Removing the requirement of symmetry, we arrive at a quasimetric space. Replacing the triangle inequality with a weaker form leads to semimetric spaces.
* If the distance function takes values in the extended real number line \mathbb R\cup\, but otherwise satisfies the conditions of a metric, then it is called an ''extended metric'' and the corresponding space is called an ''\infty-metric space''. If the distance function takes values in some (suitable) ordered set (and the triangle inequality is adjusted accordingly), then we arrive at the notion of ''generalized ultrametric''.
* Approach spaces are a generalization of metric spaces, based on point-to-set distances, instead of point-to-point distances.
* A continuity space is a generalization of metric spaces and posets, that can be used to unify the notions of metric spaces and Domain theory, domains.
* A partial metric space is intended to be the least generalisation of the notion of a metric space, such that the distance of each point from itself is no longer necessarily zero.
Metric spaces as enriched categories
The ordered set (\mathbb,\geq) can be seen as a Category (mathematics), category by requesting exactly one morphism a\to b if a\geq b and none otherwise. By using + as the tensor product and 0 as the Identity element, identity, it becomes a monoidal category R^*.
Every metric space (M,d) can now be viewed as a category M^* enriched category, enriched over R^*:
* Set \operatorname(M^*):=M
* For each X,Y\in M set \operatorname(X,Y):=d(X,Y)\in \operatorname(R^*)
* The composition morphism \operatorname(Y,Z)\otimes \operatorname(X,Y)\to \operatorname(X,Z) will be the unique morphism in R^* given from the triangle inequality d(y,z)+d(x,y)\geq d(x,z)
* The identity morphism 0\to \operatorname(X,X) will be the unique morphism given from the fact that 0\geq d(X,X).
* Since R^* is a poset, all Diagram (category theory), diagrams that are required for an enriched category commute automatically.
See the paper by F.W. Lawvere listed below.
See also
* Assouad-Nagata dimension
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
References
Further reading
* Victor Bryant, ''Metric Spaces: Iteration and Application'', Cambridge University Press, 1985, .
* Dmitri Burago, Yuri Dmitrievich Burago, Yu D Burago, Sergei Ivanov, ''A Course in Metric Geometry'', American Mathematical Society, 2001, .
* Athanase Papadopoulos, ''Metric Spaces, Convexity and Nonpositive Curvature'', European Mathematical Society, First edition 2004, . Second edition 2014, .
Mícheál Ó Searcóid
''Metric Spaces''
Springer Undergraduate Mathematics Series
2006, .
* Lawvere, F. William, "Metric spaces, generalized logic, and closed categories", [Rend. Sem. Mat. Fis. Milano 43 (1973), 135—166 (1974); (Italian summary)
This is reprinted (with author commentary) a
Also (with an author commentary) in Enriched categories in the logic of geometry and analysis. Repr. Theory Appl. Categ. No. 1 (2002), 1–37.
*
External links
*
Far and near — several examples of distance functions
at cut-the-knot.
{{Authority control
Metric spaces,
Mathematical analysis
Mathematical structures
Topology
Topological spaces