Let $X$ be a complete metric space. Let us say that given a subset $A\subseteq X$, a point $a\in X$ is a limit point of $A$ if for every $r>0, A \cap B(a,r)\setminus \{a\} \ne \phi$. Now let $A,B$ be disjoint closed subsets of a complete metric space $X$ such that $A,B$ has no limit point in $X$ and also assume that $A,B$ are infinite. Then, does there necessarily exist a uniformly continuous function $f: X \to \mathbb R$ such that $d(f(A),f(B)):=\inf \{|f(a)-f(b)| : a\in A, b\in B\}>0$ ?
On a version of Urysohn lemma for complete metric spaces, involving uniform continuous functions
complete-spacesgeneral-topologymetric-spacesuniform-continuity
Related Solutions
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.
That the intersection of the $G_n$ is dense, is a small modification of the above argument: let $O$ be any non-empty open set in $X$, and start with an open ball $N_0 \subseteq O$ and stay inside $N_0$ with all subsequent steps. This hardly takes any effort at all, but does show that the $x \in \cap G_n$ is also in $N_0$ hence in $O$. So the intersection of the $G_n$ intersects every non-empty open set, hence is dense.
The construction of the $N_n$ can be a bit simplified:
- Start with $p_0 \in O$ and $N_0 := B(p, r_0) \subseteq O$.
- $N_0$ is open, so $G_1 \cap N_0$ is non-empty (as $G_1$ is dense) and open (as $G_1$ is open). So pick $p_1 \in G_1 \cap N_0$ and let $0< r_1 < 1$ be small enough that $\overline{B(p_1, r_1)} \subseteq G_1 \cap N_0$. Define $N_1 = B(p_1, r_1)$.
- $N_1$ is open and again we have that $p_2 \in N_1 \cap G_0 \cap G_1$ exists by denseness and this set is open so there exists $0<r_2 < \frac12$ such that $\overline{B(p_2, r_2}) \subseteq (N_1 \cap G_0 \cap G_1)$. Define $N_2 = B(p_2, r_2)$.
- continue this process recursively.
No distinguishing limit points etc. Just go straight to the goal.
Then the $\overline{N_n}$ $n \ge 1$ form the required nested family that the Cantor intersection theorem can be applied to. The promised $p \in \bigcap_{n \ge 1} \overline{N_n} \subseteq O \cap \bigcap_{n \ge 1}O_n$ witnesses the denseness of $\bigcap_{n \ge 1} G_n$.
Best Answer
No. Take $X$ to be the real line, take $A$to be the set of positive integers, and take $B$ to be the set of numbers of the form $n+2^{-n}$ for positive integers $n$. If $f$ is uniformly continuous, then, for any $\varepsilon>0$, we'll have $|f(n)-f(n+2^{-n})|<\varepsilon$ for all sufficiently large $n$. So the infimum in your question will be zero.