[ *This article was updated on 8 Mar 13; the universal property is now in terms of Cauchy-continuous maps.* ]

On an intuitive level, a complete metric space is one where there are “no gaps”. Formally, we have:

Definition. A metric space (X, d) is said to becompleteif every Cauchy sequence in X converges.

Completeness is not a topological property, i.e. one can’t infer whether a metric space is complete just by looking at the underlying topological space. For example, (0, 1) and **R** are homeomorphic as topological spaces, but the former is not complete (since the sequence (1/*n*) is Cauchy but doesn’t converge) and the latter is. Clearly, not every subspace of a complete metric space is complete. E.g. **R** – {0} is not complete since the sequence (1/*n*) doesn’t converge. However, we have:

Proposition 1. A subset of a complete metric space X is complete if and only if it’s closed in X.

**Proof**.

Both directions use theorem 1 here. If *Y* is closed in *X*, then any Cauchy sequence in *Y* is also Cauchy in *X* and hence must converge to some *a* in *X*; then *a* must lie in *Y* by the theorem.

Conversely, if *Y* is a non-closed subset of *X*, then there is a sequence in *Y* converging to *a* in *X*, outside *Y*. This sequence is Cauchy since it’s convergent in *X*, but it doesn’t converge in *Y*; thus *Y* is not complete. ♦

Proposition 2. If and are complete metric spaces, then so is where d can be any one of the following metrics:

- ;
- ;
- .

**Proof**.

We know (from proposition 3 here) that if a sequence in *X* × *Y* is Cauchy, then are Cauchy in *X* and *Y* respectively. Hence, they’re both convergent, say, to Thus, is convergent. ♦

**Exercise**

Suppose is a countably infinite collection of complete metric spaces. Construct a metric on as before. Is the resulting metric space complete?

**Answer (highlight to read)** :

Yes, each projection map π_{n} : *X* → *X _{n}* is uniformly continuous. So a Cauchy sequence (

*x*)

_{n}_{1}, (

*x*)

_{n}_{2}, (

*x*)

_{n}_{3}, … gives rise to a Cauchy sequence in each

*X*. Each of these converges, to say,

_{n}*a*in

_{n}*X*. Then by proposition 4 here, we see that (

_{n}*x*)

_{n}_{1}, (

*x*)

_{n}_{2}, (

*x*)

_{n}_{3}, … converges to (

*a*). ♦

_{n}## Completion of Metric Space

It turns out there’s a unique way of embedding any metric space into a “smallest” complete metric space.

Definition. A metric space Y is acompletionof metric space X if:

- X is a metric subspace of Y;
- Y is complete; and
- X is dense in Y.

Suppose satisfies the first two conditions. Then we take Now *Z* is closed in *Y* so it is complete by proposition 1 above. Furthermore, *X* is dense in *Z* by definition. So is now a completion. In other words, the third condition enforces a minimality condition on *Y*. One can visualise *Y* as filling up the gaps of *X*.

Classical example: the completion of **Q**, under the Euclidean metric, is **R**.

The key property of the completion is the following.

Universal Property of Completion. Suppose is a completion. Then:

- for any Cauchy-continuous map to a complete metric space Z, there is a unique continuous such that

**Minor Note**.

Since *g* is continuous, it’s automatically Cauchy-continuous here since *Y* is complete: indeed, if is a Cauchy sequence in *Y*, then it converges to some *y*, so is convergent and must also be Cauchy.

**Proof**.

Uniqueness: if *g*, *g’* satisfy then since *X* is dense in *Y* and *Z* is Hausdorff, we have *g* = *g’*.

Only existence remains: we denote the metric of *X* and *Y* by *d* and that of *Z* by *d’*.

Suppose since *X* is dense in *Y*, *y* is a limit of a sequence (*x _{n}*) in

*X*. Then (

*x*) is Cauchy and since

_{n}*f*is Cauchy-continuous, (

*f*(

*x*)) is Cauchy in

_{n}*Z*. So (

*f*(

*x*)) converges to some

_{n}*z*and we let

*g*(

*y*) =

*z*.

To show *g* is well-defined: suppose We need to show have the same limit. It suffices to show as *n* → ∞.

- For each ε>0, pick δ>0 such that whenever
*d*(*x*,*y*) < δ, we have*d’*(*f*(*x*),*f*(*y*)) < ε. - Given this δ, pick
*N*such that when*n*>*N*, we have and - Then when
*n*>*N*,

Clearly since if we can pick the constant sequence (*y*, *y*, …) in *X*.

Finally, we need to show *g* is continuous. By theorem 6 here, it suffices to show that if then Now since *X* is dense in *Y*, we can pick a sequence such that This gives also. From our definition of *g*, we must have so we’re done. ♦

## Exercise

Prove that if *f* had been uniformly continuous, so is the induced *g*.

**Answer (highlight to read)**.

The following replaces the last paragraph in the proof of universal property.

Let ε>0. There exists δ>0 such that whenever *x*, *x’* in *X* satisfies *d*(*x*, *x’*) < δ, we have *d’*(*f*(*x*), *f*(*x’*)) < ε/2. Now suppose *y*, *y’* in *Y* satisfy *d*(*y*, *y’*) < δ/2.

- Pick sequences (
*x*), (_{n}*x*‘) in_{n}*X*such that (*x*) →_{n}*y*and (*x*‘) →_{n}*y’*. - For large enough
*n*,*d*(*x*,_{n}*y*) < δ/4 and*d*(*x*‘,_{n}*y’*) < δ/4 so we get*d*(*x*,_{n}*x*‘) ≤_{n}*d*(*x*,_{n}*y*) +*d*(*y*,*y’*) +*d*(*y’*,*x*‘) < δ._{n} - Thus, for
*n*big,*d’*(*f*(*x*),_{n}*f*(*x*‘)) < ε/2._{n} - Since
*f**(x*(_{n}) → g*y*) and*f*(*x*‘) →_{n}*g*(*y’*) by definition, we can pick a large*n*such that*d’*(*f**(x*(_{n}), g*y*)) < ε/4 and*d’*(*f*(*x*‘),_{n}*g*(*y’*)) < ε/4. - This gives
*d’*(*g*(*y*),*g*(*y’*)) ≤*d’*(*g*(*y*),*f*(*x*)) +_{n}*d*(*f*(*x*),_{n}*f*(*x*‘)) +_{n}*d*(*f*(*x*‘),_{n}*g*(*y’*)) < ε. ♦

## Properties of the Completion

With the universal property, there’re a couple of properties we can prove rather easily.

Proposition 3. The completion is unique up to homeomorphism, i.e. if and are both completions, then there is a unique homeomorphism f : Y → Y’ which restricts to the identity map on X.

**Proof**.

Let and be the injections. Since *i* and *j* are uniformly continuous, by the universal property (U.P.) on *Y*, there exists a unique uniformly continuous which extends the identity map id_{X} on *X*. Likewise, by the U.P. on *Y’*, there is a unique uniformly continuous extending id_{X}. Composing gives uniformly continuous maps and extending id_{X}. By uniqueness in U.P., both and must be identity maps. ♦

Thus, we can call *Y* **the** completion of *X* without any ambiguity.

If two metrics are topologically equivalent, the resulting completions can be very different. E.g. (0, 1) and **R** (under the Euclidean metric) are homeomorphic topological spaces, but the former’s completion is [0, 1] while the latter is already complete. *In short, completion is not a topological construction*.

Proposition 4. If Y is the completion of X and , then the completion of X’ is its closure in Y.

**Proof**.

Let *Y’* = cl_{Y}(*X’*). Since *Y’* is a closed subset of complete metric space *Y*, it is complete too. Also, *X’* is dense in *Y’* by definition, so we’re done. ♦

Proposition 5. If Y_{1}is the completion of X_{1}and Y_{2}is the completion of X_{2}, then Y_{1}× Y_{2}is the completion of X_{1}× X_{2}, if we let the metric take on any one of the three possibilities in proposition 2.

**Proof**.

We already know *Y*_{1} × *Y*_{2} is complete by proposition 2. Also, so *X*_{1} × *X*_{2} is dense in *Y*_{1} × *Y*_{2}. ♦

Proposition 6. If Y_{1}is the completion of X_{1}and Y_{2}is the completion of X_{2}, then any uniformly continuous map extends to a uniformly continuous

**Proof**.

Compose *f* with to obtain a uniformly continuous map to a complete space. By universal property of *Y*_{2}, this extends to a uniformly continuous such that ♦

If *f* is injective or surjective, the induced *g* may not be so. For example, consider the map which takes *t* to exp(2π*it*). We leave it to the reader to prove its uniform continuity. The induced map on the completion is which takes *t* to exp(2π*it*) as well, and this is not injective.

For another example, consider the map [1, ∞) → (0, 1] which takes *x* to 1/*x*. This is uniformly continuous and induces [1, ∞) → [0, 1], again taking *x* to 1/*x*. This map is not surjective. Observe that in both examples, the initial map is a homeomorphism but the inverse, though continuous, is not uniformly continuous.

## Existence of Completion

Although we’ve proved many properties of the completion of a metric space, we’ve yet to demonstrate its existence.

Big Theorem.Every metric space (X, d) has a completion (Y, d’).

Let’s prove this step-by-step.

**Step 1 : Define Y.**

Let Σ be the set of all Cauchy sequences in *X*. Define a relation on Σ:

- For write if

It’s not hard to prove that this gives an equivalence relation on Σ (the proof’s left as an exercise, e.g. transitivity follows from the triangular inequality). We define *Y* to be the set of equivalence classes.

**Step 2 : Define d’**

If two element are represented by Cauchy sequences we define the distance function to be:

First we show that the limit exists; since **R** is complete it suffices to show is Cauchy. To do that, note that for all *m*, *n*:

By symmetry, we also have which gives:

Since are Cauchy, for any ε>0, we can find *N* such that whenever *m*, *n* > *N*, we have Thus is Cauchy.

**Step 3 : Prove that d’ is well-defined.**

Let’s show that *d’*(*y*, *y’*) is independent of our choice of Cauchy sequences. Suppose and Arguing as in step 2, we obtain:

By definition of ~, the two terms and on the RHS tends to 0. Hence *d’* is well-defined.

**Step 4 : Prove that d’ is a metric.**

Clearly *d’*(*y*, *y’*) ≥ 0. Suppose *d’*(*y*, *y’*) = 0, and are represented by Then , so and *y* = *y’*. This proves reflexivity. Obviously *d’*(*y*, *y’*) = *d’*(*y’*, *y*).

This leaves the triangular inequality. Suppose Then we have for each *n*. Taking the limit of each term, we get the triangular inequality for *d’*.

**Step 5 : Define an embedding of X as a metric subspace of Y.**

Define the map *i* : *X* → *Y* which takes *x* to the element of *Y* representing the Cauchy sequence (*x*, *x*, *x*, … ). Clearly *d’*(*i*(*x*), *i*(*x’*)) = *d*(*x*, *x’*).

**Step 6 : Prove that X is dense in Y.**

Let be represented by We claim that (*x _{n}*), as a sequence in

*Y*, converges to

*y*; i.e.

For each ε>0, pick *N* such that when *m*, *n* > *N*, we have Fixing *n*, and taking the limit as *m*→∞, we get Thus, we’re done.

**Step 7 : Prove that Y is complete**.

Let be a Cauchy sequence in *Y*. Since *X* is dense in *Y*, for each *n*, pick such that We claim that is Cauchy: for

Hence for any ε>0, just pick *N* such that (i) *N* > 3/ε and (ii) for any *m*, *n *> *N*, we get Thus, when *m*, *n* > *N*, we have and is a Cauchy sequence in *X*, which must correspond to some

It remains to show Indeed, we have:

Step 6 then tells us that since And we’re done. ♦

Thanks for the article – I just have a few questions regarding the universal property of completion. Firstly, we have that if f was uniformly continuous, then g is uniformly continuous. If f was a homeomorphism – would this also mean g is a homeomorphism? How would we go about proving this? Lastly, in your proof of g being uniformly continuous, why do you have d'(y,y’)? Isn’t y and y’ elements of Y? To show g is uniformly continuous, don’t we need to show that for d(y,y’) < delta, then d'(g(y),g(y')) < epsilon?

Thanks for any feedback you can provide.

For your first question, I believe the answer is yes, but for a rather trivial reason. The resulting X must be complete, so the completion Y is X. In other words, we’re given such that

(i) f is Cauchy-continuous;

(ii) f is a homeomorphism

(iii) Z is complete.

Now if is Cauchy, then so is by (i), and this converges to some By (iii), we have z=f(x) for some Since and is continuous by (ii), we have .

For your second question, that was a bug, which I’ve now fixed. Thanks! 🙂

Regarding the first part, I’m a bit confused, if you wouldn’t mind explaining. For example, if we had the situation in Proposition 6 above: If $f$ is uniformly continuous, then we can construct a uniformly continuous map $X_{1} \rightarrow Y_{2}$ which would result in a uniformly continuous map in $g$. Suppose $f$ is a homeomorphism between $X_{1}$ and $X_{2}$ – are you saying this must mean that $X_{1}$ and $X_{2}$ are complete? If so – why, I’m struggling to see why this might be the case?

And to follow up with the proof of $g$ being uniformly continuous, I’ve realised I’m still a bit confused when reading through the proof. My understanding is that we need to show that when $d(y,y’) < \delta \implies d'(g(y),g(y')) < \epsilon$, but you seem to have $d(\overline{x_{n}},\overline{x'_{n}}) < \delta \implies d'(g(y),g(y')) < \epsilon$ – could you explain this?

Thanks for your help!

Apologies for the formatting, I thought latex could be used by your reply earlier.

No why must and be complete? If is a homeomorphism, then it just extends to a homeomorphism . The composed map is not a homeomorphism then. Just take and for instance.

For your second question, I proved that .

[ Latex tip for wordpress: use '$' together with latex, e.g. https://en.support.wordpress.com/latex/ ]

Sorry, I think I need to clarify my above comment what I am trying to ask is – if f is a homeomorphism – does this mean than g would be a homeomorphism? Thanks.

I understood your question and answered it: in my comment I proved that under your assumptions, X has to be complete. Since X is complete, we have Y=X and so if f is a homeomorphism, so is g because g=f.

Thanks for the help on the latex.

So to clarify my understanding, what you’re saying is:

If and are the completions of and respectively, then if is a homeomorphism, then $g$ is a homeomorphism. But the composed map say is not a homeomorphism. (I suppose because then is not surjective – but the image of would be a homeomorphism right?)

How could we prove that the homeomorphism of $f$ just extends to $g$?

Thanks for your patience.

Oops, I made a mistake in the reply timed (April 20, 2015 at 1:01 am). It’s not true that if f is a homeomorphism, so is g. In fact, I had explicitly listed some counterexamples above after proposition 6. >_<

Hi, in your examples above proposition 6, it seems to say that if is a homeomorphism, then this does not necessarily mean that is uniformly continuous. But strictly speaking, homeomorphism doesn’t require uniform continuous does it? It just requires a bijective continuous function, with inverse continuous as well right? If is a homeomorphism and uniformly continuous, wouldn’t that mean is also a homeomorphism? With extending where latex Y$? In this case, wouldn’t be uniformly continuous, and it would also be bijective?

One can, and should prove that the completion is unique up to isometries. The reason why one “should” is that homeomorphisms don’t preserve completeness, so it’s meaningless to consider this property “up to homeomorphism”. Take for instance $\arctan: \mathbb R \to (-\pi/2,\pi/2)$: it’s bijective, continuous and strictly increasing, thus a homeomorphism, and yet the reals are complete while the open interval is not.