# Extension of a Uniformly Continuous Function between Metric Spaces

Let $(X,d)$ and $(Y,d')$ be metric spaces with $(Y,d')$ complete. Let $A\subseteq X$. I need to show that if $f:A\to Y$ is uniformly continuous, then $f$ can be uniquely extended to $\bar{A}$ maintaining the uniform continuity.

My attempt at this has involved taking each point $a\in \bar{A}-A$ and forming a Cauchy sequence to it by considering open balls $B_{\frac{1}{n}}(a)-B_{\frac{1}{n+1}}(a)$ beginning with $n$ large enough so there is such a sequence, and defining $g(a)$ to be the limit in $Y$. The uniqueness seems to be obvious just by thinking about the uniqueness of limits (referring to the sequence in $Y$), but I have to admit I don't know how to rigorously show it. The uniform continuity seems natural, but I don't know how to show it, either.

This seems to be correct, but I'm not entirely sure... Any help would be very appreciated!

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.
• When proving that $\lim f(x_n)$ exists, you need a sequence $(x_n)$ converging to $a$. AFAIK, constructing it requires $a\in\overline{S}$ and $d$. May 13, 2016 at 14:53

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 the definition of uniform continuity it is clear that the extension of $$f$$ is 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}$$

[This is, except for a few details, same as Carlos Pinzon's answer above]

Let $${ X,Y }$$ be metric spaces and $${ A (\subseteq X ) \overset{f}{\to} Y }$$ a continuous map. Both $${ d _X, d _Y }$$ will be denoted by $${ d }$$ for brevity.

The following question arises. Can we impose a "general enough" constraint such that : There is a unique continuous map $${ \overline{A} \overset{\overline{f}}{\to} Y }$$ with the property $${ \overline{f} \vert _{A} = f }$$ ?

Turns out imposing that $${ f }$$ is uniformly continuous and $${ Y }$$ is complete will do. Further, in this case $${ \overline{f} }$$ is uniformly continuous.

$${ \underline{ \textbf{Defining} \text{ } \overline{f} } }$$

For every $${ p \in \overline{A}, }$$ there exists a seq $${ (x _n) \subseteq A }$$ with $${ d(x _n, p) \to 0 }.$$

Let $${ p \in \overline{A} }.$$ For every $${ n \in \mathbb{Z} _{\gt 0} },$$ pick an $${ x _n \in A }$$ with $${ d(x _n, p) \lt \frac{1}{n} }.$$

So if we ensure that

$${ {\color{purple}{(1)}} }$$ If $${ (x _n) \subseteq A }$$ and $${ d(x _n, p) \to 0 }$$ for some $${ p \in X }$$ then $${ \lim _{n \to \infty} f(x _n) }$$ exists
$${ {\color{purple}{(2)} } }$$ If $${ \lbrace (x _n) \subseteq A; d(x _n, p) \to 0 \rbrace }$$ and $${ \lbrace (y _n) \subseteq A; d(y _n, p) \to 0 \rbrace }$$ for some $${ p \in X }$$ then $${ \lim _{n \to \infty} f(x _n) = \lim _{n \to \infty} f(y _n) }$$

then we can define a map $${ \overline{A} \overset{\overline{f}}{\to} Y }$$ naturally by : Let $${ p \in \overline{A} }.$$ Pick an $${ (x _n) \subseteq A }$$ with $${ d(x _n, p) \to 0 },$$ and set $${ \overline{f}(p) := \lim _{n \to \infty} f(x _n) }.$$

Ensuring $${ {\color{purple}{(1)} } }$$: Let $${ (x _n) \subseteq A }$$ and $${ d(x _n, p) \to 0 }$$ for some $${ p \in X }.$$ So $${ (x _n) }$$ is Cauchy. So imposing that $${ f }$$ is uniformly continuous ensures $${ (f(x _n)) }$$ is Cauchy.

Let $${ \epsilon \gt 0 }.$$ Pick $${ \delta \gt 0 }$$ such that $${ x,y \in A },$$ $${ d(x,y) \lt \delta }$$ implies $${ d(f(x), f(y)) \lt \epsilon }.$$ Pick $${ N }$$ such that $${ d(x _m, x _n) \lt \delta }$$ whenever $${ m, n \geq N }.$$ Now $${ d(f(x _m), f(x _n)) \lt \epsilon }$$ whenever $${ m, n \geq N }.$$

Further imposing that $${ Y }$$ is complete ensures $${ (f (x _n)) }$$ is convergent.

Ensuring $${ {\color{purple}{(2)} } }$$: Say $${ f }$$ is uniformly continuous and $${ Y }$$ is complete, which ensures $${ {\color{purple}{(1)} } }.$$ Let $${ (x _n), (y _n) \subseteq A }$$ with $${ d(x _n, p) \to 0 },$$ $${ d(y _n, p) \to 0 }$$ for some $${ p \in X }.$$ So $${ \lim _{n \to \infty} f(x _n) = \ell _1 }$$ and $${ \lim _{n \to \infty} f(y _n) = \ell _2 }$$ exist. We'll show $${ \ell _1 = \ell _2 }.$$
As $${ d(\ell _1, \ell _2) }$$ $${ \leq \underbrace{ d(\ell _1, f(x _n)) } _{\to 0} }$$ $${ + d(f (x _n), f(y _n)) }$$ $${ + \underbrace{ d(f(y _n), \ell _2) } _{\to 0} },$$ it suffices to show $${ d(f(x _n), f(y _n)) \to 0 }.$$

Let $${ \epsilon \gt 0 }.$$ Pick $${ \delta \gt 0 }$$ such that $${ x,y \in A, }$$ $${ d(x,y) \lt \delta }$$ implies $${ d(f(x), f(y)) \lt \epsilon }.$$
From $${ d(x _n, y _n) }$$ $${ \leq d(x _n, p) + d(p, y _n) \to 0 },$$ we have $${ d(x _n, y _n) \to 0 }.$$ So pick $${ N }$$ such that $${ d(x _n, y _n ) \lt \delta }$$ for all $${ n \geq N }.$$ Now $${ d(f(x _n), f(y _n)) \lt \epsilon }$$ for all $${ n \geq N },$$ as needed.

$${ \underline{ \textbf{Properties of} \text{ } \overline{f} } }$$

From now, $${ A \overset{f}{\to} Y }$$ is uniformly continuous and $${ Y }$$ is complete, and $${ \overline{A} \overset{\overline{f}}{\to} Y }$$ is as defined above.

Note $${ \overline{f} \vert _{A} = f }.$$ We'll show $${ \overline{f} }$$ is uniformly continuous.
Let $${ \epsilon \gt 0 },$$ and $${ p, q \in \overline{A} }.$$ We want a $${ \delta \gt 0 }$$ independent of $${ p,q },$$ such that $${ d(p,q) \lt \delta }$$ implies $${ d(\overline{f}(p), \overline{f}(q) ) \lt \epsilon }.$$

Pick $${ \eta \gt 0 }$$ such that $${ x,y \in A, d(x,y) \lt \eta }$$ implies $${ d(f(x), f(y)) \lt \frac{\epsilon}{10} }.$$
We'll show $${ \delta := \frac{1}{10} \min\lbrace \epsilon, \eta \rbrace }$$ will work.

Suppose $${ {\color{green}{d(p,q) \lt \delta}} }.$$
Pick seqs $${ (x _n), (y _n) \subseteq A }$$ with $${ d(x _n, p) \to 0 },$$ $${ d(y _n, q) \to 0 }.$$ Now $${ d(f(x _n), \overline{f}(p)) \to 0 }$$ and $${ d(f(y _n), \overline{f}(q)) \to 0 }$$ too.
So pick an $${ m }$$ such that $${ {\color{green}{d(x _m, p)}} },$$ $${ {\color{green}{d(y _m, q)}} },$$ $${ {\color{green}{d(f(x _m), \overline{f}(p))}} }$$ and $${ {\color{green}{d(f(y _m), \overline{f}(q))}} }$$ are all $${ {\color{green}{\lt \delta}} }.$$
Now $${ d(\overline{f}(p), \overline{f}(q)) }$$ $${ \leq d(\overline{f}(p), f(x _m)) }$$ $${ + d(f(x _m), f(y _m)) }$$ $${ + d(f (y _m), \overline{f}(q)) }$$ $${ \leq 2\delta + {\color{red}{d(f(x _m), f(y _m))}} . }$$
But as $${ d(x _m, y _m) }$$ $${ \leq d(x _m, p) }$$ $${ + d(p,q) }$$ $${ + d(q, y _m) }$$ $${ \lt 3 \delta \lt \eta },$$ we have $${ {\color{red}{d(f (x _m), f(y _m)) \lt \frac{\epsilon}{10}}} }.$$ This gives $${ d(\overline{f}(p), \overline{f}(q)) }$$ $${ \leq 2\delta + \frac{\epsilon}{10} }$$ $${ \lt \epsilon }.$$
Finally $${ d(\overline{f}(p), \overline{f}(q)) \lt \epsilon },$$ as needed.

[This shows we could've set $${ \delta := \frac{1}{3} \min \lbrace \epsilon, \eta \rbrace }$$ to begin with. But $${ \frac{1}{10} }$$ was a "safer factor" to carry out the estimates]

[Uniqueness] Suppose $${ \overline{A} \overset{g}{\to} Y }$$ is continuous and $${ g \vert _{A} = f }.$$ We see $${ g = \overline{f} }$$ :
Let $${ p \in \overline{A}. }$$ Pick a seq $${ (x _n) \subseteq A }$$ with $${ d(x _n, p) \to 0 }.$$ As $${ g }$$ is continuous, $${ g(p) = \lim _{n \to \infty} g(x _n) }.$$ But $${ g(x _n) = f(x _n) }$$ and $${ \overline{f}(p) = \lim _{n \to \infty} f(x _n). }$$ So $${ \overline{f}(p) = g(p) },$$ as needed.