A metric space is a set whose elements have a specified distance from one another. Its distance function, called a metric, obeys rules abstracted from ordinary geometric distance. The elements may be numbers, vectors, functions, or other objects rather than physical locations. Metric spaces provide a common framework for studying convergence and continuity in mathematical analysis, while connecting these ideas with geometry and topology. (ocw.mit.edu)
Definition
Formally, a metric space is a pair ((X,d)), where (X) is a set and [ d:X\times X\longrightarrow[0,\infty) ] is a function satisfying the following axioms for all (x,y,z\in X):
- Identity of indiscernibles: (d(x,y)=0) if and only if (x=y).
- Symmetry: (d(x,y)=d(y,x)).
- Triangle inequality: (d(x,z)\leq d(x,y)+d(y,z)).
Nonnegativity is included in the specified range of (d). Distances are finite real numbers under this definition. The points of (X) need not have coordinates, and the definition requires neither addition nor scalar multiplication. Any subset (A\subseteq X) becomes a metric space by restricting (d) to (A\times A); this is its subspace metric. (math.cmu.edu)
Examples
On the real line, the standard metric is (d(x,y)=|x-y|). On (\mathbb R^n), Euclidean distance is [ d_2(x,y)=\left(\sum_{i=1}^{n}|x_i-y_i|^2\right)^{1/2}. ] Other metrics on the same set include [ d_1(x,y)=\sum_{i=1}^{n}|x_i-y_i|, \qquad d_\infty(x,y)=\max_{1\leq i\leq n}|x_i-y_i|. ] These assign different numerical distances but induce the same open sets on finite-dimensional Euclidean space. (ocw.mit.edu)
Every set admits the discrete metric, which assigns distance (0) to identical points and (1) to distinct points. A normed vector space has the metric (d(x,y)=|x-y|). For the space (C([a,b],\mathbb R)) of continuous functions on a closed bounded interval, another example is [ d(f,g)=\sup_{t\in[a,b]}|f(t)-g(t)|. ] Convergence in this metric is precisely uniform convergence. Thus, a point in a metric space can itself be an entire function. (jirka.org)
Balls and induced topology
For (r>0), the open ball centered at (x) is [ B(x,r)={y\in X:d(x,y)<r}. ] A subset (U\subseteq X) is an open set when every (x\in U) has some ball (B(x,r)) contained in (U). A set is closed when its complement is open. These open sets make (X) a topological space: arbitrary unions and finite intersections of open sets are open. Open balls form a basis for this topology. (math.cmu.edu)
Different metrics may generate the same topology. For example, (d) and (\min{1,d}) have identical balls of sufficiently small radius and therefore identical open sets. The topology records local proximity but does not retain every quantitative feature of distance; in particular, it need not determine completeness. (jirka.org)
Convergence and continuity
A sequence ((x_n)) converges to (x\in X) when [ d(x_n,x)\longrightarrow0. ] Equivalently, for every (\varepsilon>0), all sufficiently late terms belong to (B(x,\varepsilon)). A limit, when it exists, is unique: the triangle inequality prevents one sequence from approaching two points separated by a positive distance. A subset is closed exactly when it contains the limits of all convergent sequences drawn from it. (ocw.mit.edu)
A map (f:(X,d_X)\to(Y,d_Y)) is a continuous function at (x) if, for every (\varepsilon>0), some (\delta>0) satisfies [ d_X(x,y)<\delta \quad\Longrightarrow\quad d_Y(f(x),f(y))<\varepsilon. ] In metric spaces, continuity is equivalent to preservation of convergent sequences and also to the requirement that inverse images of open sets be open. These formulations connect distance-based analysis with topological definitions. (ocw.mit.edu)
Completeness and completion
A Cauchy sequence has terms that eventually become arbitrarily close to one another:
[
\forall\varepsilon>0\ \exists N
\forall m,n\geq N,\quad d(x_m,x_n)<\varepsilon.
]
A complete metric space is one in which every Cauchy sequence converges to a point of the space. The real numbers are complete under their standard metric; the rational numbers are not, because rational Cauchy sequences can approach irrational real numbers. (ocw.mit.edu)
Every metric space has a completion: a complete space containing an isometric copy of the original as a dense subset. The completion is unique up to an isometry that respects this copy. A complete normed vector space is a Banach space; a Hilbert space is complete under the metric induced by its inner product. (ocw.mit.edu)
Compactness
A metric space is a compact space if every open cover has a finite subcover. In metric spaces, this is equivalent to every sequence having a subsequence converging within the space. It is also equivalent to completeness together with total boundedness, meaning that, for every (\varepsilon>0), finitely many balls of radius (\varepsilon) cover the space. (ocw.mit.edu)
Compact subsets of metric spaces are closed and bounded, but the converse fails in general. An infinite set with the discrete metric is complete and bounded, yet not compact: its singleton open sets form a cover with no finite subcover. In (\mathbb R^n) with the standard metric, by contrast, the Heine–Borel theorem states that a subset is compact exactly when it is closed and bounded. (jirka.org)