Distance between closed and compact set

functional-analysismetric-spaces

my professor gave us this excercise:

The distance of two subsets $S_{1}$ and $S_{2}$ of a given complete metric space $(X, d)$ :
$$ d\left(S_{1}, S_{2}\right)=\inf \left\{d(x, y): x \in S_{1}, y \in S_{2}\right\}.$$

a) Suppose $S_{1}$ contains only one point $x$ and $S_{2}$ is closed. Prove $d\left(S_{1}, S_{2}\right)=d(x, y)$ for some $y \in S_{2}$.

b) Suppose $S_{1}$ is compact and $S_{2}$ is closed. Prove $d\left(S_{1}, S_{2}\right)=d(x, y)$ for some $x \in S_{1}$ $y \in S_{2}$.

I managed to do the first item (using a Cauchy sequence and the fact that X is a metric space), but the second one is giving me some problems, first I tried to use sequences but I did't go anywhere, I also though about seeing $d$ as a continous function in the product space, but a compact x closed is not compact, so I can't ensure that I get the minimum. Any idea would help. Thanks.

EDIT: My proof of a) If $S_1 \cap S_2 \neq \varnothing$ there is nothing to prove. If $S_1=\{x\}$, let us suppose that $S_1 \cap S_2 = \varnothing$, then we can consider $(y_n)_{n\in \mathbb{N}}$ a sequence such that $y_n \in S_2$ for any $n \in \mathbb{N}$ and such that $d(x,y_j)\leq d(x,y_i)$ if $i<j$. Clearly $(y_n)_{n\in \mathbb{N}}$ is a Cauchy sequence, therefore it converges to a $y \in S_2$ (due to the fact that $S_2$ is closed and therefore it contains all its accumulation points).

Best Answer

Here is a counterexample to (a) and therefore also to (b).

Let $X$ be the set of all nonnegative integers. Define a metric $d$ on $X$ by setting $d(x,x)=0$, $d(0,x)=d(x,0)=1+\frac1x$ for $x\gt0$, and $d(x,y)=2$ for $x,y\gt0$.

The metric space $(X,d)$ is complete (every Cauchy sequence is eventually constant) and locally compact (the induced topology is discrete).

Let $S_1=\{0\}$ and $S_2=X\setminus\{0\}$. Then $d(S_1,S_2)=d(0,S_2)=1$ but $d(0,y)\gt1$ for every $y\in S_2$.

Related Question