question on the proof of uniqueness of completion In the book by Erwin Kreyszig, "Introductory Functional Analysis with Applications":
I don't understand something in proof of completion theorem.
In the fourth part of proof that about uniqueness of completion. 
 
The question is why the distances on $\tilde{X}$ and $\hat{X}$ must be the same? 
Can anyone explain that for me :)
 A: I’ll expand on Kreyszig’s argument. I don’t have the book, so it’s possible that some of what I’m about to do duplicates earlier parts of his proof.
We start with two completions of $\langle X,d\rangle$, $\langle\hat X,\hat d\rangle$ and $\langle\tilde X,\tilde d\rangle$. This means that there are $W\subseteq\hat X$ and $\tilde W\subseteq\tilde X$ such that

*

*$W$ is dense in $\hat X$,

*$\tilde W$ is dense in $\tilde X$,

*there is an isometry $T:X\to\hat X$ such that $T[X]=W$, and

*there is an isometry $\tilde T:X\to\tilde X$ such that $\tilde T[X]=\tilde W$.

We want to show that there is an isometry $h:\tilde X\to\hat X$ such that $h\upharpoonright\tilde W=T\circ\tilde T^{-1}:\tilde W\to W$.
Let $\tilde x\in\tilde X$. $\tilde W$ is dense in $\tilde X$, so for each $n\in\Bbb Z^+$ there is a point $\tilde x_n\in B_{\tilde d}\left(\tilde x,\frac1n\right)\cap\tilde W$. Clearly the sequence $\langle\tilde x_n:n\in\Bbb Z^+\rangle$ converges to $\tilde x$ in $\tilde X$. For each $n\in\Bbb Z^+$ let $x_n=\tilde T^{-1}(\tilde x_n)$ and $\hat x_n=T(x_n)\in\hat X$. $\tilde T$ and $T$ are isometries, so for all $m,n\in\Bbb Z^+$ we have
$$\hat d(\hat x_m,\hat x_n)=\tilde d(\tilde x_m,\tilde x_n)\;.\tag{1}$$
The sequence $\langle\tilde x_n:n\in\Bbb Z^+\rangle$ is convergent in $\tilde X$, so it’s Cauchy, and it follows immediately from $(1)$ that $\langle\hat x_n:n\in\Bbb Z^+\rangle$ is Cauchy in $\hat X$. And $\hat X$ is complete, so $\langle\hat x_n:n\in\Bbb Z^+\rangle$ must converge to some $\hat x\in\hat X$.
Suppose that $\langle\tilde x_n':n\in\Bbb Z^+\rangle$ is another sequence in $\tilde W$ converging to $\tilde x$. For each $\epsilon>0$ there is an $m_\epsilon\in\Bbb Z^+$ such that $\tilde d(\tilde x_n,\tilde x),\tilde d(\tilde x_n',\tilde x)<\frac{\epsilon}2$ whenever $n\ge m_\epsilon$, and hence
$$\tilde d(\tilde x_n,\tilde x_n')\le\tilde d(\tilde x_n,\tilde x)+\tilde d(\tilde x,\tilde x_n')<\frac{\epsilon}2+\frac{\epsilon}2=\epsilon$$
whenever $n\ge m_\epsilon$. For each $n\in\Bbb Z^+$ let $x_n'=\tilde T^{-1}(\tilde x_n')\in X$ and $\hat x_n'=T(x_n')\in\hat X$. Again using the fact that $\tilde T$ and $T$ are isometries, we have $\hat d(\hat x_n,\hat x_n')=\tilde d(\tilde x_n,\tilde x_n')$ for each $n\in\Bbb Z^+$, and hence $\hat d(\hat x_n,\hat x_n')<\epsilon$ whenever $n\ge m_\epsilon$.
Let $\epsilon>0$. Since $\langle\hat x_n:n\in\Bbb Z^+\rangle$ converges to $\hat x$ in $\hat X$, there is a $k_\epsilon$ such that $\hat d(\hat x_n,\hat x)<\frac{\epsilon}2$ whenever $n\ge k_\epsilon$. Thus,
$$\hat d(\hat x_n',\hat x)\le\hat d(\hat x_n',\hat x_n)+\hat d(\hat x_n,\hat x)<\frac{\epsilon}2+\frac{\epsilon}2=\epsilon$$
whenever $n\ge\max\{k_\epsilon,m_{\epsilon/2}\}$, and $\langle\hat x_n':n\in\Bbb Z^+\rangle$ also converges to $\hat x$.
This shows that the map $h:\tilde X\to\hat X$ defined by $h(\tilde x)=\hat x$ is well-defined: no matter which sequence in $\tilde W$ converging to $\tilde x$ I use to define $\hat x$, I get the same point of $hat X$. Moreover, if $\tilde x\in\tilde W$, then I can let $\tilde x_n=\tilde x$ for each $n\in\Bbb Z^+$ and see that $h(\tilde x)=T\left(\tilde T^{-1}(\tilde x)\right)$, so that $h\upharpoonright\tilde W=T\circ\tilde T^{-1}$, as desired.
Now we have to check that $h$ is an isometry.
Let $\tilde x$ and $\tilde y$ be any two points in $\tilde X$, and let $\langle\tilde x_n:n\in\Bbb Z^+\rangle$ and $\langle\tilde y_n:n\in\Bbb Z^+\rangle$ be sequences in $\tilde W$ converging to $\tilde x$ and $\tilde y$, respectively. Then the sequence $\big\langle\langle\tilde x_n,\tilde y_n\rangle:n\in\Bbb Z^+\big\rangle$ converges to $\langle\tilde x,\tilde y\rangle$ in the space $\tilde X\times\tilde X$. The metric $\tilde d$ is a continuous function from $\tilde X\times\tilde X$ to $\Bbb R$, so the sequence $\langle\tilde d(\tilde x_n,\tilde y_n):n\in\Bbb Z^+\rangle$ converges to $\tilde d(\tilde x,\tilde y)$ in $\Bbb R$.
As before, for each $n\in\Bbb Z^+$ let $x_n=\tilde T^{-1}(\tilde x_n)\in X$, and let $\hat x_n=T(x_n)\in W$, so that $\langle\hat x_n:n\in\Bbb Z^+\rangle$ converges to $h(\tilde x)$ in $\hat X$. Similarly, for each $n\in\Bbb Z^+$ let $y_n=\tilde T^{-1}(\tilde y_n)\in X$ and $\hat y_n=T(y_n)\in W$, so that $\langle\hat y_n:n\in\Bbb Z^+\rangle$ converges to $h(\tilde y)$.
The same argument that I used to show that $\langle\tilde d(\tilde x_n,\tilde y_n):n\in\Bbb Z^+\rangle$ converges to $\tilde d(\tilde x,\tilde y)$ in $\Bbb R$ can be used to show that $\langle\hat d(\hat x_n,\hat y_n):n\in\Bbb Z^+\rangle$ converges to $\hat d(\hat x,\hat y)$ in $\Bbb R$. But $\tilde d(\tilde x_n,\tilde y_n)=d(x_n,y_n)=\hat d(\hat x_n,\hat y_n)$ for each $n\in\Bbb Z^+$, so
$$\hat d\big(h(x),h(y)\big)=\lim_{n\to\infty}\hat d(\hat x_n,\hat y_n)=\lim_{n\to\infty}\tilde d(\tilde x_n,\tilde y_n)=\tilde d(\tilde x,\tilde y)\;,$$
and $h$ is indeed an isometry.
The last step is to show that $h$ maps $\tilde X$ onto $\hat X$. Let $\hat x\in\hat X$ be arbitrary. $W$ is dense in $\hat X$, so there is a sequence $\langle\hat x_n:n\in\Bbb Z^+\rangle$ in $W$ converging to $\hat x$. Use the ideas above to show that the sequence
$$\left\langle\tilde T\left(T^{-1}(\hat x_n)\right):n\in\Bbb Z^+\right\rangle$$
in $\tilde W$ is Cauchy and therefore converges to some $\tilde x\in\tilde X$; then show that $\hat x=h(\tilde x)$.
A: The important observation is that the completion of a metric space has a universal property.
Let $(\hat X,\hat d)$ be a complete metric space and $T\colon X\to \hat X$ isometric and such that $T(X)$ is dense in $\hat X$.
Then the following holds:
Claim. (universal property for completion) For any complete metric space $(Y,\delta)$ and isometric map $f\colon X\to Y$, there exists one and only one isometric map $h\colon \hat X\to Y$ with $h\circ T=f$.
Proof.
Start with uniqueness: If $h_1,h_2$ are two such maps, then clearly $h_1(x)=h_2(x)$ for all $x\in T(X)$. But since the set of points where $h_1$ and $h_2$ are equal is closed, and $T(X)$ is dense in $\hat X$, we conclude that $h_1=h_2$ on all of $\hat X$.
Now for existence: Given $x\in\hat X$ pick a seqeunce $x_n\to x$ with $x_n\in T(X)$ (this is possible because $T(X)$ is dense in $\hat X$). 
As a converging sequence, $(x_n)$ is Cauchy, hence $(f(x_n))$ is Cauchy because $f$ is isometric, hence $(f(x_n))$ is convergent because $Y$ is complete. Define $h(x):=\lim f(x_n)$ and verify that this is well-defined (does not depend on the choice of sequence converging to the given $x$). A straightforward verification shows that $h$ is isometric. $_\square$
In a way, the universal property formulated in the claim is the only important thing to know about completions. You may encounter similar universal properties in other contexts, for example, free groups, polynomial rings, ...
Now the general observation about universal properties is: 

Objects characterized by universal properties are always unique up to unique isomorphisms.

Here, let $T\colon(X,d)\to (\hat X,\hat d)$ and $T'\colon(X,d)\to(X',d')$ be two completions (i.e., $T,T'$ are isometric and the images are dense). Then by the claim, there exists a unique isometric map $h\colon \hat X\to X'$ with $h\circ T=T'$. By swapping roles, there exists a unique isometric $h'\colon X'\to \hat X$ with $h'\circ T'=T$. By considereing only one of the spaces, the claim states that there exists a unique isomtric map $h''\colon \hat X\to \hat X$ such that $h''\circ T=T$. But but the identity on $X$ and the composition $h'\circ h$ have thsi property. We conclude that $h'\circ h=h''=\operatorname{id}_{\hat X}$. Similarly we see that $h\circ h'$ is the identity on $X'$. Hence $h,h'$ show that $\hat X, X$ are isometric.
