User:Dragons flight/math2

In mathematics, a metric space is a set where a notion of distance (called a metric) between elements of the set is defined.

The metric space which most closely corresponds to our intuitive understanding of space is the 3-dimensional Euclidean space. In fact, the notion of "metric" is a generalization of the Euclidean metric 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 straight line segment connecting them. Other metric spaces occur for example in elliptic geometry and hyperbolic geometry, where distance on a sphere measured by angle is a metric, and the hyperboloid model of hyperbolic geometry is used by special relativity as a metric space of velocities.

A metric space also induces topological properties like open and closed sets which leads to the study of even more abstract topological spaces.

History
Maurice Fréchet introduced metric spaces in his work Sur quelques points du calcul fonctionnel, Rendic. Circ. Mat. Palermo 22 (1906) 1–74.

Definition
A metric space is an ordered pair $$(M,d)=2$$ where $$M=2$$ is a set and $$d=2$$ is a metric on $$M=2$$, i.e., a function


 * $$d \colon M \times M \rightarrow \mathbb{R}=2$$

such that for any $$x, y, z \in M=2$$, the following holds:


 * 1) $$d(x,y) \ge 0=2$$     (non-negative),
 * 2) $$d(x,y) = 0\,=2$$ iff $$x = y\,=2$$     (identity of indiscernibles),
 * 3) $$d(x,y) = d(y,x)\,=2$$     (symmetry) and
 * 4) $$d(x,z) \le d(x,y) + d(y,z)=2$$     (triangle inequality).

The first condition follows from the other three, since:
 * $$2d(x,y) = d(x,y) + d(y,x) \ge d(x,x) = 0.=2$$

The function $$d=2$$ is also called distance function or simply distance. Often, $$d=2$$ is omitted and one just writes $$M=2$$ for a metric space if it is clear from the context what metric is used.

Examples of metric spaces

 * 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. Many of the examples below can be seen as concrete versions of this general idea.
 * The real numbers with the distance function $$d(x,y) = \vert y - x \vert=2$$ given by the absolute difference, and more generally Euclidean $n=2$-space with the Euclidean distance, are complete metric spaces. The rational numbers with the same distance also form a metric space, but are not complete.
 * The positive real numbers with distance function $$d(x,y) =\vert \log(y/x) \vert=2$$ is a complete metric space.
 * Any normed vector space is a metric space by defining $$d(x,y) = \lVert y - x \rVert=2$$, see also metrics on vector spaces. (If such a space is complete, we call it a Banach space.) Examples:
 * The Manhattan norm gives rise to the Manhattan distance, where the distance between any two points, or vectors, is the sum of the differences between corresponding coordinates.
 * The maximum norm gives rise to the Chebyshev distance or chessboard distance, the minimal number of moves a chess king would take to travel from $$x=2$$ to $$y=2$$.
 * The British Rail metric (also called the Post Office metric or the SNCF metric) on a normed vector space is given by $$d(x,y) = \lVert x \rVert + \lVert y \rVert=2$$ for distinct points $$x=2$$ and $$y=2$$, and $$d(x,x) = 0=2$$. More generally $$\lVert . \rVert=2$$ can be replaced with a function $$f=2$$ taking an arbitrary set $$S=2$$ to non-negative reals and taking the value $$0=2$$ at most once: then the metric is defined on $$S=2$$ by $$d(x,y) = f(x) + f(y)=2$$ for distinct points $$x=2$$ and $$y=2$$, and $$d(x,x) = 0=2$$.  The name alludes to the tendency of railway journeys (or letters) to proceed via London (or Paris) irrespective of their final destination.
 * If $$(M,d)=2$$ is a metric space and $$X=2$$ is a subset of $$M=2$$, then $$(X,d)=2$$ becomes a metric space by restricting the domain of $$d=2$$ to $$X \times X=2$$.
 * The discrete metric, where $$d(x,y) = 0=2$$ if $$x=y=2$$ and $$d(x,y) = 1=2$$ otherwise, is a simple but important example, and can be applied to all non-empty sets. This, in particular, shows that for any non-empty set, there is always a metric space associated to it. Using this metric, any point is an open ball, and therefore every subset is open and the space has the discrete topology.
 * A finite metric space is a metric space having a finite number of points. Not every finite metric space can be isometrically embedded in a Euclidean space.
 * The hyperbolic plane is a metric space. More generally:
 * If $$M=2$$ is any connected Riemannian manifold, then we can turn $$M=2$$ into a metric space by defining the distance of two points as the infimum of the lengths of the paths (continuously differentiable curves) connecting them.
 * If $$X=2$$ is some set and $$M=2$$ is a metric space, then, the set of all bounded functions $$f \colon X \rightarrow M=2$$ (i.e. those functions whose image is a bounded subset of $$M=2$$) can be turned into a metric space by defining $$d(f,g) = \sup_{x \in X} d(f(x),g(x))=2$$ for any two bounded functions $$f=2$$ and $$g=2$$ (where $$\sup=2$$ is supremum. This metric is called the uniform metric or supremum metric, and If $$M=2$$ is complete, then this function space is complete as well. If X is also a topological space, then the set of all bounded continuous functions from $$X=2$$ to $$M=2$$ (endowed with the uniform metric), will also be a complete metric if M is.
 * If $$G=2$$ is an undirected connected graph, then the set $$V=2$$ of vertices of $$G=2$$ can be turned into a metric space by defining $$d(x,y)=2$$ to be the length of the shortest path connecting the vertices $$x=2$$ and $$y=2$$. In geometric group theory this is applied to the Cayley graph of a group, yielding the word metric.
 * The Levenshtein distance is a measure of the dissimilarity between two strings $$u=2$$ and $$v=2$$, defined as the minimal number of character deletions, insertions, or substitutions required to transform $$u=2$$ into $$v=2$$. 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.
 * Given a metric space $$(X,d)=2$$ and an increasing concave function $$f \colon [0,\infty) \rightarrow [0,\infty)=2$$ such that $$f(x) = 0=2$$ if and only if $$x=0=2$$, then $$f \circ d=2$$ is also a metric on $$X=2$$.
 * Given an injective function $$f=2$$ from any set $$A=2$$ to a metric space $$(X,d)=2$$, $$d(f(x), f(y))=2$$ defines a metric on $$A=2$$.
 * 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=2$$ by $$n=2$$ matrices over some field is a metric space with respect to the rank distance $$d(X,Y) = \mathrm{rank}(Y - X)=2$$.
 * The Helly metric is used in game theory.

Open and closed sets, topology and convergence
Every metric space is a topological space in a natural manner, and therefore all definitions and theorems about general topological spaces also apply to all metric spaces.

About any point $$x=2$$ in a metric space $$M=2$$ we define the open ball of radius $$r > 0=2$$ about $$x=2$$  as the set
 * $$B(x;r) = \{y \in M : d(x,y) < r\}.=2$$

These open balls form the base for a topology on M, making it a topological space.

Explicitly, a subset $$U=2$$ of $$M=2$$ is called open if for every $$x=2$$ in $$U=2$$ there exists an $$r > 0=2$$ such that $$B(x;r)=2$$ is contained in $$U=2$$. The complement of an open set is called closed. A neighborhood of the point $$x=2$$ is any subset of $$M=2$$ that contains an open ball about $$x=2$$ as a subset.

A topological space which can arise in this way from a metric space is called a metrizable space; see the article on metrization theorems for further details.

A sequence ($$x_n=2$$) in a metric space $$M=2$$ is said to converge to the limit $$x \in M=2$$ iff for every $$\epsilon>0=2$$, there exists a natural number N such that $$d(x_n,x) < \epsilon =2$$ for all $$n > N=2$$. Equivalently, one can use the general definition of convergence available in all topological spaces.

A subset $$A=2$$ of the metric space $$M=2$$ is closed iff every sequence in $$A=2$$ that converges to a limit in $$M=2$$ has its limit in $$A=2$$.

Complete spaces
A metric space $$M=2$$ is said to be complete if every Cauchy sequence converges in $$M=2$$. That is to say: if $$d(x_n, x_m) \to 0=2$$ as both $$n=2$$ and $$m=2$$ independently go to infinity, then there is some $$y\in M=2$$ with $$d(x_n, y) \to 0=2$$.

Every Euclidean space 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=2$$, are not complete.

Every metric space has a unique (up to isometry) completion, which is a complete space that contains the given space as a dense subset. For example, the real numbers are the completion of the rationals.

If $$X=2$$ is a complete subset of the metric space $$M=2$$, then $$X=2$$ is closed in $$M=2$$. Indeed, a space is complete iff it is closed in any containing metric space.

Every complete metric space is a Baire space.

Bounded and totally bounded spaces
A metric space M is called bounded if there exists some number r, such that d(x,y) ≤ r for all x and y in M. The smallest possible such r is called the diameter of M. The space M is called precompact or totally bounded 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 numbers and occasionally regions in a Euclidean space Rn 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.

Compact spaces
A metric space M is compact if every sequence in M has a subsequence 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 defined via open covers.

Examples of compact metric spaces include the closed interval [0,1] with the absolute value metric, all metric spaces with finitely many points, and the Cantor set. Every closed subset of a compact space is itself compact.

A metric space is compact iff it is complete and totally bounded. This is known as the Heine–Borel theorem. 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" δ such that every subset of M of diameter < δ is contained in some member of the cover.

Every compact metric space is second countable, and is a continuous image of the Cantor set. (The latter result is due to Pavel Alexandrov and Urysohn.)

Locally compact and proper spaces
A metric space is said to be locally compact 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 {y : d(x,y) ≤ r} is compact. Proper spaces are locally compact, but the converse is not true in general.

Connectedness
A metric space $$M=2$$ is connected if the only subsets that are both open and closed are the empty set and $$M=2$$ itself.

A metric space $$M=2$$ is path connected if for any two points $$x, y \in M=2$$ there exists a continuous map $$f\colon [0,1] \to M=2$$ with $$f(0)=x=2$$ and $$f(1)=y=2$$. Every path connected space is connected, but the converse is not true in general.

There are also local versions of these definitions: locally connected spaces and locally path connected spaces.

Simply connected spaces are those that, in a certain sense, do not have "holes".