# Proof based on distance function continuity

I've proved the continuity of the distance function $d:X \times X\rightarrow \mathbb{R}$ in metric space $(X, d)$. Now I've to work on this:

Let $S \subseteq X$ be a dense set and $\{x_n\}$ a sequence included in $X$. Prove that if there exists $x \in X$ such that $\lim\limits_{n \to \infty} d(x_n, s) = d(x, s)$ for all $s \in S$, then $\lim \limits_{n \to \infty} x_n = x$.

My proof: We want to prove that $\lim \limits_{n \to \infty} d(x_n, x) = 0$. Since $S$ is dense, let $\{s_m \}$ be a sequence in $S$ such that $s_m \to x$.

\begin{align} \lim_{n \to \infty} d(x_n, x) &= \lim_{n \to \infty} d \left(x_n, \lim_{m \to \infty} s_m \right) \\ &= \lim_{n \to \infty} \ \lim_{m \to \infty} d(x_n, s_m) \\ &= \lim_{m \to \infty} \ \lim_{n \to \infty} \ d(x_n, s_m) & & (d \text{ is continuous)} \\ &= \lim_{m \to \infty} \ d(x, s_m) && \text{(by hypothesis)}\\ &= d(x, x) = 0. \end{align}

Do you think this proof is correct? It is heavily bases in the fact that $d$ is continuous.

Thanks!

-

Two remarks.

1) Your sequence $(s_m)$ is not a sequence. Because $S$ is dense you can pick some sequence such that $s_m \to x$.

2) You should explain why you can change order of limits.

However, proof can go like this.

Since $S$ is dense, for every $\epsilon > 0$ you can pick $s \in S$ such that $d(s,x) < \epsilon$. Then $$d(x_n,x) \leq d(x_n,s) + d(s,x) \leq \epsilon + \epsilon = 2\epsilon$$ for sufficiently large $n$ by assumption. Hence $x_n \to x$.

-
I'm not sure about this, but the order of the limits can be exchanged because $d(x, y)$ is continuous...is that right? – Federico Nov 15 '11 at 22:28
Yes, of course. – xen Nov 15 '11 at 22:45
You don't have that $d(x_n,s)\to 0$. You have only that $d(x_n,s)\to d(x,s)$. – leo Nov 16 '11 at 7:15
@leo, xen's answer does not rely on $d(x_n,s)\to0$ (which is false), but on the (true) statement that, if $d(x_n,s)\to d(x,s)$ and $d(x,s)<\epsilon$, then $d(x_n,s)<\epsilon$ for every $n$ large enough. – Did Nov 16 '11 at 7:53
yes, i see. thanks – leo Nov 16 '11 at 8:26

I think you don't need the continuity of $d$. You need to show that $d(x_n,x)\to 0$. So, let $\epsilon\gt 0$. Since $S$ is dense in $X$, exist $s\in S$ such that $d(s,x)\lt \epsilon/4$. Since $d(x_n,s)\to d(x,s)$, there exist a $N\in\mathbb{N}$ such that if $n\geq N$ then $|d(x_n,s)-d(x,s)|\lt \epsilon/2$. Now, if $n\geq N$ \begin{align*} d(x_n,x) &\leq d(x_n,s)+d(s,x)\\ &= |d(x_n,s)-d(x,s)+d(x,s)|+d(s,x)\\ &\leq |d(x_n,s)-d(x,s)|+|d(x,s)|+d(s,x)\\ &= |d(x_n,s)-d(x,s)|+ 2d(s,x)\\ &\lt \frac{\epsilon}{2}+2\cdot\frac{\epsilon}{4}=\epsilon. \end{align*} Since $\epsilon$ is arbitrary, this proves that $d(x_n,x)\to 0$.

-