Let XX be a set. A metric on XX is a function d:X×X→Rd:X\times X\rightarrow\mathbb{R} that satisfies the metric axioms for all x,y,z∈X:x,y,z\in X:

d(x,y)≥0,  with  d(x,y)=0  if and only if  x=yd(x,y)\geq 0,\,\,\mathrm{with}\,\,d(x,y)=0\,\,\mathrm{if}\,\mathrm{and}\,\mathrm{only}\,\mathrm{if}\,\,x=y d(x,y)=d(y,x)d(x,y)=d(y,x) d(x,z)≤d(x,y)+d(y,z)d(x,z)\leq d(x,y)+d(y,z)

The third axiom is the triangle inequality.

Let XX be a set and dd be a metric on X.X. The pair (X,d)(X,d) is a metric space, and is written XX when the metric is understood. The real numbers with d(x,y)=∣x−y∣d(x,y)=\lvert x-y\rvert form a metric space, and Rn\mathbb{R}^n with the Euclidean distance is the metric space called Euclidean space.

Let (X,d)(X,d) be a metric space and A⊆X.A\subseteq X. The metric subspace AA is the metric space (A,dA)(A,d_A) where dAd_A is the restriction of dd to A×A.A\times A.

Let XX be a set. The discrete metric on XX is the metric that is 00 when x=yx=y and 11 otherwise. Any set is a metric space under the discrete metric.

Let V\mathcal{V} be a vector space over R\mathbb{R} or C.\mathbb{C}. A norm on V\mathcal{V} is a function ∥⋅∥:V→R\lVert\cdot\rVert:\mathcal{V}\rightarrow\mathbb{R} that satisfies the norm axioms for all u‾,v‾∈V\underline{u},\underline{v}\in\mathcal{V} and all scalars λ:\lambda:

∥v‾∥≥0,  with  ∥v‾∥=0  if and only if  v‾=0‾\lVert\underline{v}\rVert\geq 0,\,\,\mathrm{with}\,\,\lVert\underline{v}\rVert=0\,\,\mathrm{if}\,\mathrm{and}\,\mathrm{only}\,\mathrm{if}\,\,\underline{v}=\underline{0} ∥λ v‾∥=∣λ∣∥v‾∥\lVert\lambda\,\underline{v}\rVert=\lvert\lambda\rvert\lVert\underline{v}\rVert ∥u‾+v‾∥≤∥u‾∥+∥v‾∥\lVert\underline{u}+\underline{v}\rVert\leq\lVert\underline{u}\rVert+\lVert\underline{v}\rVert

Let V\mathcal{V} be a vector space over R\mathbb{R} or C\mathbb{C} and ∥⋅∥\lVert\cdot\rVert be a norm on V.\mathcal{V}. The pair (V,∥⋅∥)(\mathcal{V},\lVert\cdot\rVert) is a normed vector space. The norm of an inner product space satisfies the norm axioms by the Cauchy-Schwarz inequality, so every inner product space is a normed vector space.

Let V\mathcal{V} be a normed vector space. The induced metric on V\mathcal{V} is the metric given by the norm of the difference of two vectors.

d(u‾,v‾):=∥u‾−v‾∥d(\underline{u},\underline{v}):=\lVert\underline{u}-\underline{v}\rVert

Every normed vector space is a metric space with its induced metric.

Let x‾∈Rn\underline{x}\in\mathbb{R}^n and p≥1.p\geq 1. The pp-norm of x‾\underline{x} is the pp-th root of the sum of the pp-th powers of the absolute values of its coordinates, and the maximum norm of x‾\underline{x} is the largest absolute value of its coordinates.

∥x‾∥p:=(∑i=1n∣xi∣p)1p,∥x‾∥∞:=max⁡1≤i≤n∣xi∣\lVert\underline{x}\rVert_p:=\left(\sum_{i=1}^{n}\lvert x_i\rvert^p\right)^{\frac{1}{p}},\qquad\lVert\underline{x}\rVert_\infty:=\max_{1\leq i\leq n}\lvert x_i\rvert

The 22-norm is the Euclidean norm, the 11-norm is the Manhattan norm and ∥x‾∥p→∥x‾∥∞\lVert\underline{x}\rVert_p\rightarrow\lVert\underline{x}\rVert_\infty as p→∞.p\rightarrow\infty. The triangle inequality for the pp-norm is the Minkowski inequality.

Let (X,d)(X,d) be a metric space, x∈Xx\in X and r>0.r>0. The open ball of radius rr centred at xx is the set of points at distance less than rr from x.x. The closed ball of radius rr centred at xx is the set of points at distance at most rr from x.x. The sphere of radius rr centred at xx is the set of points at distance exactly rr from x.x.

B(x,r):={y∈X:d(x,y)<r},B‾(x,r):={y∈X:d(x,y)≤r},S(x,r):={y∈X:d(x,y)=r}B(x,r):=\left\{y\in X:d(x,y)<r\right\},\qquad\overline{B}(x,r):=\left\{y\in X:d(x,y)\leq r\right\},\qquad S(x,r):=\left\{y\in X:d(x,y)=r\right\}

Let (X,d)(X,d) be a metric space and U⊆X.U\subseteq X. The set UU is open if and only if every point of UU is the centre of some open ball contained in U.U.

∀ x∈U ∃ r>0:B(x,r)⊆U\forall\,x\in U\,\exists\,r>0:B(x,r)\subseteq U

Let (X,d)(X,d) be a metric space and F⊆X.F\subseteq X. The set FF is closed if and only if its complement X∖FX\setminus F is open.

In Rn\mathbb{R}^n with the Euclidean distance this is the earlier definition of an open set. Open and closed sets have the following properties:

  • open balls are open, and closed balls, spheres and finite sets are closed;
  • open intervals are open in R\mathbb{R} and closed intervals are closed in R;\mathbb{R};
  • a set can be both open and closed, as ∅\varnothing and XX are, or neither, as [0,1)\left[0,1\right) is in R;\mathbb{R};
  • under the discrete metric every set is open;
  • the union of any collection of open sets is open and the intersection of finitely many open sets is open;
  • the intersection of any collection of closed sets is closed and the union of finitely many closed sets is closed.

The finiteness conditions cannot be dropped: ⋂n=1∞(−1n,1n)={0}\bigcap_{n=1}^{\infty}\left(-\frac{1}{n},\frac{1}{n}\right)=\left\{0\right\} is an intersection of open sets that is not open.

Let (X,d)(X,d) be a metric space, A⊆XA\subseteq X and x∈X.x\in X. The point xx is an interior point of AA if and only if some open ball centred at xx is contained in A.A. The point xx is a limit point of AA if and only if every open ball centred at xx contains a point of AA other than x.x. The point xx is an isolated point of AA if and only if x∈Ax\in A and some open ball centred at xx contains no other point of A.A.

Let (X,d)(X,d) be a metric space and A⊆X.A\subseteq X. The interior of A,A, written int A,\mathrm{int}\,A, is the set of interior points of A.A. The closure of A,A, written A‾,\overline{A}, is the union of AA and its limit points. The boundary of A,A, written ∂A,\partial A, is the closure of AA without the interior of A.A.

int A⊆A⊆A‾,∂A:=A‾∖int A\mathrm{int}\,A\subseteq A\subseteq\overline{A},\qquad\partial A:=\overline{A}\setminus\mathrm{int}\,A

The interior, closure and boundary have the following properties:

  • the interior is the largest open set contained in A,A, so AA is open if and only if A=int A;A=\mathrm{int}\,A;
  • the closure is the smallest closed set containing A,A, so AA is closed if and only if A=A‾,A=\overline{A}, which holds if and only if AA contains all of its limit points;
  • the boundary is closed, and x∈∂Ax\in\partial A if and only if every open ball centred at xx meets both AA and X∖A.X\setminus A.

For example, in R\mathbb{R} the interval [0,1)\left[0,1\right) has interior (0,1),\left(0,1\right), closure [0,1]\left[0,1\right] and boundary {0,1},\left\{0,1\right\}, whereas the rational numbers Q\mathbb{Q} have empty interior and closure R.\mathbb{R}.

Let (X,d)(X,d) be a metric space and A⊆X.A\subseteq X. The set AA is dense in XX if and only if A‾=X.\overline{A}=X. The rational numbers are dense in R.\mathbb{R}.

Let (X,d)(X,d) be a metric space and A⊆X.A\subseteq X. The set AA is bounded if and only if it is contained in some ball. The diameter of AA is the supremum of the distances between its points.

diam A:=sup⁡{d(x,y):x,y∈A}\mathrm{diam}\,A:=\sup\left\{d(x,y):x,y\in A\right\}

Let (X,d)(X,d) be a metric space, (xn)\left(x_n\right) be a sequence of points of XX and x∈X.x\in X. The sequence (xn)\left(x_n\right) converges to x,x, written xn→x,x_n\rightarrow x, if and only if the distances d(xn,x)d\left(x_n,x\right) converge to 00 as a sequence of real numbers.

∀ε>0 ∃N∈N:d(xn,x)≤ε  ∀ n≥N\forall\varepsilon>0\,\exists N\in\mathbb{N}:d\left(x_n,x\right)\leq\varepsilon\,\,\forall\,n\geq N

Equivalently, every open ball centred at xx contains all but finitely many terms of the sequence. Convergent sequences in a metric space have the following properties:

  • a convergent sequence has exactly one limit and is bounded;
  • in Rn\mathbb{R}^n a sequence converges if and only if each of its coordinates converges;
  • in a metric subspace a sequence converges if and only if it converges in the whole space with the limit lying in the subspace;
  • every subsequence of a convergent sequence converges to the same limit;
  • x∈A‾x\in\overline{A} if and only if xx is the limit of a sequence of points of A,A, so AA is closed if and only if it contains the limit of every convergent sequence of its points.

Let (X,dX)\left(X,d_X\right) and (Y,dY)\left(Y,d_Y\right) be metric spaces, f:X→Yf:X\rightarrow Y be a function and x0∈X.x_0\in X. The function ff is continuous at x0x_0 if and only if for every ε>0\varepsilon>0 there exists δ>0\delta>0 such that points within δ\delta of x0x_0 are mapped to points within ε\varepsilon of f(x0).f\left(x_0\right).

∀ε>0 ∃δ>0:dY(f(x),f(x0))≤ε  ∀ x∈X, dX(x,x0)<δ\forall\varepsilon>0\,\exists\delta>0:d_Y\left(f(x),f\left(x_0\right)\right)\leq\varepsilon\,\,\forall\,x\in X,\,d_X\left(x,x_0\right)<\delta

Let (X,dX)\left(X,d_X\right) and (Y,dY)\left(Y,d_Y\right) be metric spaces and f:X→Yf:X\rightarrow Y be a function. The function ff is continuous on XX if and only if it is continuous at every point of X.X. For real functions of one or several real variables this is the earlier definition of continuity. The following are equivalent:

  • ff is continuous on X;X;
  • f(xn)→f(x)f\left(x_n\right)\rightarrow f(x) whenever xn→xx_n\rightarrow x in X;X;
  • the inverse image f−1(V)f^{-1}(V) of every open set V⊆YV\subseteq Y is open in X;X;
  • the inverse image of every closed set in YY is closed in X.X.

Continuous functions on metric spaces have the following properties:

  • a composition of continuous functions is continuous;
  • the metric d:X×X→Rd:X\times X\rightarrow\mathbb{R} is continuous in each argument, since ∣d(x,z)−d(y,z)∣≤d(x,y);\lvert d(x,z)-d(y,z)\rvert\leq d(x,y);
  • in a normed vector space the norm, addition and scalar multiplication are continuous.

Let (X,dX)\left(X,d_X\right) and (Y,dY)\left(Y,d_Y\right) be metric spaces and f:X→Yf:X\rightarrow Y be a function. The function ff is uniformly continuous if and only if for every ε>0\varepsilon>0 there exists δ>0,\delta>0, depending on ε\varepsilon alone, such that dY(f(x),f(y))≤εd_Y\left(f(x),f(y)\right)\leq\varepsilon for all x,y∈Xx,y\in X with dX(x,y)<δ.d_X(x,y)<\delta.

Let (X,dX)\left(X,d_X\right) and (Y,dY)\left(Y,d_Y\right) be metric spaces and f:X→Yf:X\rightarrow Y be a function. The function ff is Lipschitz continuous with constant L≥0L\geq 0 if and only if dY(f(x),f(y))≤L dX(x,y)d_Y\left(f(x),f(y)\right)\leq L\,d_X(x,y) for all x,y∈X.x,y\in X.

Let (X,dX)\left(X,d_X\right) and (Y,dY)\left(Y,d_Y\right) be metric spaces and f:X→Yf:X\rightarrow Y be a function. The function ff is an isometry if and only if it preserves distances.

dY(f(x),f(y))=dX(x,y)  ∀ x,y∈Xd_Y\left(f(x),f(y)\right)=d_X(x,y)\,\,\forall\,x,y\in X

An isometry is injective and Lipschitz continuous with constant 1.1. Lipschitz continuity implies uniform continuity, which implies continuity.

Let XX be a set and dd and d′d' be metrics on X.X. The metrics dd and d′d' are equivalent if and only if they have the same open sets. Two metrics are equivalent if and only if they have the same convergent sequences with the same limits.

Let XX be a set and dd and d′d' be metrics on X.X. The metrics dd and d′d' are strongly equivalent if and only if there are constants 0<c≤C0<c\leq C such that each metric is bounded above and below by constant multiples of the other.

c d(x,y)≤d′(x,y)≤C d(x,y)  ∀ x,y∈Xc\,d(x,y)\leq d'(x,y)\leq C\,d(x,y)\,\,\forall\,x,y\in X

Strongly equivalent metrics are equivalent, and have the same bounded sets, Cauchy sequences and uniformly continuous functions. Equivalent metrics need not: d′(x,y)=min⁡{1,∣x−y∣}d'(x,y)=\min\left\{1,\lvert x-y\rvert\right\} is equivalent to the usual metric on R\mathbb{R} but makes R\mathbb{R} bounded.

Let V\mathcal{V} be a vector space and ∥⋅∥\lVert\cdot\rVert and ∥⋅∥′\lVert\cdot\rVert' be norms on V.\mathcal{V}. The norms are equivalent if and only if their induced metrics are strongly equivalent. Any two norms on Rn\mathbb{R}^n are equivalent, since

∥x‾∥∞≤∥x‾∥2≤∥x‾∥1≤n∥x‾∥∞,\lVert\underline{x}\rVert_\infty\leq\lVert\underline{x}\rVert_2\leq\lVert\underline{x}\rVert_1\leq n\lVert\underline{x}\rVert_\infty,

so open sets, convergence and continuity in Rn\mathbb{R}^n do not depend on which norm is used.