# Metric space  Main Article Discussion Related Articles  [?] Bibliography  [?] External Links  [?] Citable Version  [?] This editable Main Article is under development and subject to a disclaimer. [edit intro]

In mathematics, a metric space is, roughly speaking, an abstract mathematical structure that generalizes the notion of a Euclidean space $\mathbb {R} ^{n}$ which has been equipped with the Euclidean distance, to more general classes of sets such as a set of functions. The notion of a metric space consists of two components, a set and a metric in that set. In a metric space, the metric replaces the Euclidean distance as a notion of "distance" between any pair of elements in its associated set (for example, as an abstract distance between two functions in a set of functions) and induces a topology in the set called the metric topology.

The theory of metric spaces includes the following topics: isometric embeddings and universal metric spaces (in the sense of isometric embeddings); metric maps (which do not increase distances); the category of metric spaces and metric maps, and its subcategories; injective metric spaces and related notions; special classes of metric spaces like strongly convex spaces; metric generalizations of the notions of differential geometry; metric properties of the metric spaces which appear in other branches of mathematics (e.g. Banach spaces, in particular Hilbert spaces).

The topic of metric spaces can be attractive both to children and to research mathematicians. Certain deeper directions in the theory of metric spaces are closely related to the approximation theory.

Every simple graph can be viewed as a metric space (in more than one way). Thus formally the theory of simple graphs can be considered as a special chapter of the theory of metric spaces. Indeed, as a rule, the notions of the theory of simple graphs can be rephrased in the language of metric spaces (possibly in more than one way).

## Metric in a set

Let $X\,$ be an arbitrary set. A metric $d\,$ on $X\,$ is a function $d:X\times X\rightarrow \mathbb {R}$ with the following properties:

1. $d(x_{2},x_{1})=d(x_{1},x_{2})\quad \forall x_{1},x_{2}\in X$ (symmetry)
2. $d(x_{1},x_{2})\leq d(x_{1},x_{3})+d(x_{3},x_{2})\quad \forall x_{1},x_{2},x_{3}\in X$ (triangular inequality)
3. $d(x_{1},x_{2})=0\ \Leftrightarrow \ x_{1}=x_{2}\,$ It follows from the above three axioms of a metric (also called distance function) that:

$d(x_{1},x_{2})\geq 0\quad \forall x_{1},x_{2}\in X$ (non-negativity)

## Definition of metric space

A metric space is an ordered pair $(X,d)\,$ where $X\,$ is a set and $d\,$ is a metric on $X\,$ .

For shorthand, a metric space $(X,d)\,$ is usually written simply as $X\,$ once the metric $d\,$ has been defined or is understood.

## Metric topology

A metric on a set $X\,$ induces a particular topology on $X\,$ called the metric topology. For any $x\in X$ , let the open ball $B_{r}(x)\,$ of radius $r>0\,$ around the point $x\,$ be defined as $B_{r}(x)=\{y\in X\mid d(y,x) . Define the collection ${\mathcal {O}}$ of subsets of $X\,$ (meaning that $A\in {\mathcal {O}}\Rightarrow A\subset X$ ) consisting of the empty set $\emptyset$ and all sets of the form:

$\cup _{\gamma \in \Gamma }B_{r_{\gamma }}(x_{\gamma }),$ where $\Gamma \,$ is an arbitrary index set (can be uncountable) and $r_{\gamma }>0\,$ and $x_{\gamma }\in X$ for all $\gamma \in \Gamma$ . Then the set ${\mathcal {O}}$ satisfies all the requirements to be a topology on $X\,$ and is said to be the topology induced by the metric $d\,$ . Any topology induced by a metric is said to be a metric topology.

## Examples

1. The "canonical" example of a metric space, and indeed what motivated the general definition of such a space, is the Euclidean space $\mathbb {R} ^{n}$ endowed with the Euclidean distance $d_{E}\,$ defined by $d_{E}(x,y)={\sqrt {\sum _{k=1}^{n}|x_{k}-y_{k}|^{2}}}$ for all $x,y\in \mathbb {R} ^{n}$ .
2. Consider the set $C[a,b]\,$ of all real valued continuous functions on the interval $[a,b]\subset \mathbb {R}$ with $a . Define the function $d:C[a,b]\times C[a,b]\rightarrow \mathbb {R}$ by $d(f,g)=\max _{x\in [a,b]}|f(x)-g(x)|$ for all $f,g\in C[a,b]$ . This function $d\,$ is a metric on $C[a,b]\,$ and induces a topology on $C[a,b]\,$ often known as the norm topology or uniform topology.
3. Let $X\,$ be any nonempty set. The discrete metric on $X\,$ is defined as $d(x,y)=1\,$ if $x\neq y$ and $d(x,y)=0\,$ otherwise. In this case the induced topology is the discrete topology, in which every set is open.

## Mappings

A mapping f from a metric space (X,d) to another (Y,e) is an isometry if it is distance-preserving: that is

$e(f(x_{1}),f(x_{2}))=d(x_{1},x_{2}).\,$ A mapping f from a metric space (X,d) to another (Y,e) is continuous at x in X if for all real ε > 0 there exists δ > 0 such that

$d(x',x)<\delta \Rightarrow e(f(x'),f(x)<\varepsilon \,$ and continuous if it is continuous at every point of X.

If we let $B_{d}(x,r)$ denote the open ball of radius r round x in X, and similarly $B_{e}(y,r)$ denote the open ball of radius r round y in Y, we can express these conditions in terms of the pull-back $f^{\dashv }$ $f^{\dashv }[B_{e}(f(x),\varepsilon )]\supseteq B_{d}(x,\delta ).\,$ 