Characterisation of uniformly continuous function
I have the following exercise: Let $(X,d)$, $(Y,e)$ be metric spaces.
This is the definition of distance of sets used in the exercise:
$d(A,B)=inf\{d(a,b)\colon a \in A, b \in B\}$
$d(f(A),f(B))=inf\{e(f(a),f(b))\colon f(a) \in A, f(b) \in B\}$
The exercise is:
Prove that $f\colon X \rightarrow Y$ is uniformly continuous if and only if, for all non empty sets $A$,$B$ in $X$ such that $d(A,B)=0$ we always have that $d(f(A),f(B))=0$.
If we suppose that $f$ is uniformly continuous, the implication is easy. But the converse is very hard for me. Let me show you what I have tried:
Suppose that for all non empty sets $A$,$B$ in $X$ such that $d(A,B)=0$ we always have that $d(f(A),f(B))=0$, and for the sake of a contradiction suppose also that $f$ is not uniformly continuous.
Then there exist $\epsilon_0>0$ such that for all $\delta>0$, exist $x_\delta$, $y_\delta$ in $X$ such that $d(x_\delta, y_\delta)<\delta$ but $e(f(x),f(y)) \geq \epsilon_0$.
In particular, for all $\delta=\frac{1}{n}>0$ there exist $x_n,y_n$ in $X$ such that $d(x_n,y_n)<\frac{1}{n}$ but $e(f(x_n),f(y_n)) \geq \epsilon_0$
Then $A=\{x_n \colon n \in \mathbb{N}\}$ and $B=\{y_n \colon n \in \mathbb{N}\}$ are such that $d(A,B)=0$.
Then by hypotheses, we have that $d(f(A),f(B))=0$. Then, in particular for $\epsilon_0>0$, there exist $x_n,y_m$ in $X$ such that $e(f(x_n),f(y_m))<\epsilon_0$.
But I get a contradiction if $n=m$ but I don't know how to proceed in case that $n\neq m$.
Any help would be appreciated.
Suppose $f$ is not uniformly continuous. Then there exists some $\varepsilon > 0$ and two sequences $(x_n),(y_n)$ of elements of $X$ such that $d(x_n, y_n) < \frac 1 n$ and $e(f(x_n),f(y_n)) > \varepsilon$.
We need to define two sets $A$ and $B$ such that $d(A,B)=0$ (this is easy because $d(x_n,y_n) \to 0$), but with $e(f(A),f(B)) > 0$ and this is hard because for now we can only control $e(f(x_n),f(y_n))$ and not $e(f(x_n),f(y_m))$.
So a bit more work is required.
Suppose there is an $x_n$ (or a $y_n$) such that there are infinitely many $m$ with $e(f(x_n),f(x_m)) < \varepsilon/3$ or $e(f(x_n),f(y_m)) < \varepsilon/3$.
Then we can pick $A = \bigcup \{x_m \mid e(f(x_n),f(x_m)) < \varepsilon/3 \} \cup \bigcup \{y_m \mid e(f(x_n),f(y_m)) < \varepsilon/3 \}$
and $B = \bigcup \{y_m \mid e(f(x_n),f(x_m)) < \varepsilon/3 \} \cup \bigcup \{x_m \mid e(f(x_n),f(y_m)) < \varepsilon/3 \}$.
Then $d(A,B) = 0$ because we pick infinitely many pairs, and $e(f(A),f(B)) \ge \varepsilon/3$ because for example if we have $x_m \in A$ and $y_p \in B$ then $x_p \in A$ and so
$\varepsilon < e(f(x_p),f(y_p)) \\
\le e(f(x_p),f(x_n)) + e(f(x_n),f(x_m)) + e(f(x_m),f(y_p)) \\
< 2\varepsilon/3 + e(f(x_m),f(y_p))$
which means $e(f(x_m),f(y_p)) > \varepsilon - 2\varepsilon/3 = \varepsilon/3$
Suppose that for every $x_n$ (and $y_n$), there is only finitely many $m$ with $e(f(x_n),f(x_m)) < \varepsilon/3$ and $e(f(x_n),f(y_m)) < \varepsilon/3$.
Then we can recursively select a subsequence $(x_{\phi(n)})$ of $(x_n)$ such that $e(f(x_{\phi(n)}),f(y_{\phi(m)})) \ge \varepsilon/3$ for all $n,m$. At each step there is only finitely many indices that get disqualified, and since you start with an infinite sequence, there is always a way to continue the sequence.
Letting $A = \{x_{\phi(n)}\}$ and $B = \{y_{\phi(n)}\}$ you get $d(A,B) = 0$ and $e(f(A),f(B)) \ge \varepsilon/3$
In both cases we have found subsets $A,B$ with $d(A,B) = 0$ and $e(f(A),f(B)) > 0$.