Extension of a Uniformly Continuous Function between Metric Spaces

You may want to see the answers for this question, which answer yours, Extending a function by continuity from a dense subset of a space.

I built the proof myself based on Srivatsan's answer for that question. If anybody still needs it, here it goes:

Theorem

If $X$ and $Y$ are metric spaces and $f:S \to Y$ is uniformly continuous with $S$ dense in $X$, and $Y$ is complete, then there exists a unique continuous extension of $f$ in $\overline{S}$ which by the way is uniformly continuous.

Proof

Let $d$ and $D$ be the metrics of $X$ and $Y$ respectively.

Let $g:\overline{S} \to Y$ be given by $g(a) = \lim f(x_n)$, where $(x_n)$ is any sequence of points in $S$, with $x_n \to a$.

$g$ is well defined:

  • $\lim f(x_n)$ exists:

    Let $\varepsilon > 0$. Because of the uniform continuity of $f$, there exists $\delta>0$ such that for every $a,b \in S$, if $d(a,b) < \delta$, then $D(f(a),f(b)) < \varepsilon$.

    Since $x_n \to a$, $(x_n)$ is Cauchy, there exists $N \in \mathbb{Z}^{+}$ such that if $n,m \geq N$, $d(x_n,x_m)<\delta$.

    Hence, if $n,m \geq N$, $D(f(x_n),f(x_m))<\varepsilon$. Then $(f(x_n))$ is Cauchy, and since $Y$ is complete, $\lim f(x_n)$ exists.

  • If $x_n \to a$ and $y_n \to a$ then $\lim f(x_n) = \lim f(y_n)$:

    Let $(z_n) = (x_1,y_1,x_2,y_2,...)$. If $\varepsilon>0$, there exists $N \in \mathbb{Z}^{+}$ with $d(x_n,a) < \varepsilon$ and $d(y_n,a) < \varepsilon$ for each $n \geq N$.

    Consequently, if $n \geq 2N$, then $n/2,(n+1)/2 \geq N$ and so, if $n$ is even, $d(z_n,a) = d(y_{n/2},a) < \varepsilon$, and if $n$ is odd, $d(z_n,a) = d(y_{(n+1)/2},a) < \varepsilon$. Therefore $z_n \to a$.

    So, $\lim f(z_n)$ exists and since $(f(x_n))$ and $(f(y_n))$ are subsequences of $(f(z_n))$, $\lim f(x_n) = \lim f(z_n) = \lim f(y_n)$.

$g$ is an extension of $f$:

  • If $a \in S$, $a \to a$, therefore $g(a) = \lim f(a) = f(a)$.

$g$ is uniformly continuous:

  • Let $\varepsilon > 0$. Since $f$ is uniformly continuous, there exists $\delta > 0$ such that $D(f(a),f(b))<\varepsilon/3$ for every $a,b \in S$ with $d(a,b)<\delta$.

    Let $a,b \in \overline{S}$ with $d(a,b)<\delta/3$.

    There exist sequences in $S$, $(x_n)$ and $(y_n)$ with $x_n \to a$ and $y_n \to b$. Since $x_n \to a$ and $y_n \to b$, there exists $N_1 \in \mathbb{Z}^{+}$ with $d(x_n,a)<\delta/3$ and $d(y_n,b)<\delta/3$ for every $n\geq N_1$.

    If $n \geq N_1$, $d(x_n,y_n) \leq d(x_n,a) + d(a,b) + d(b,y_n) < \delta$ and so, $D(f(x_n),f(y_n)) < \varepsilon/3$.

    Also, since $f(x_n) \to g(a)$ and $f(y_n) \to g(b)$, there exists $N_2 \in \mathbb{Z}^{+}$ with $D(f(x_n),g(a))<\varepsilon/3$ and $D(f(y_n),g(b))<\varepsilon/3$ for every $n\geq N_2$.

    Then, if $N=max\{N_1,N_2\}$, $D(g(a),g(b)) \leq D(g(a),f(x_N)) + D(f(x_N),f(y_N)) + D(f(y_N),g(b)) < \varepsilon.$

$g$ is unique:

  • If $h$ is a continuous extension of $f$ in $\overline{S}$ and $a\in \overline{S}$, there exists a sequence $(x_n)$ in $S$ with $x_n \to a$. Since $h$ is continuous, $h(x_n) \to h(a)$. But $(h(x_n)) = (f(x_n))$ and $f(x_n) \to g(a)$, then $h(a) = g(a)$ must hold.

If $ a \in \overline{A} $ then $ a = \lim_n a_n $ where $ a _n \in A $. Then, $ a_n $ is Cauchy and as $ f $ is uniformily continuous n $ A $, $ f(a_n) $ is Cauchy and as $ (Y,d´) $ is complete you can define $ f(a) : = \lim_n f(a_n) $. For example, if $ b \in A $ you have that \begin{eqnarray} d(f(a),f(b)) &\le& d(f(a_n),f(b)) + d(f(a),f(a_n)) \end{eqnarray} and by definition of uniformily continuous you can see that $ c $ continue being uniformily continuous. Analogously, if $ b \in \overline{A}, b =\lim_n b_n $ where $ b_n \in \overline{A} $ and \begin{eqnarray} d(f(a),f(b)) &\le& d(f(a_n),f(a)) + d(f(b_n),f(a_n)) + d(f(b_n), f(b)) \end{eqnarray}