Where is compactness used? Suppose $K$ is a compact subset and $F$ a closed subset of a metric space $X$ such that $K \cap F = \varnothing$. The question I am working on wants me to show that $0 < \inf\{d(x, y) : x \in K, y \in F\}$.
Below is my proof:
Let $f(x) := \inf\{d(x, y) : y \in F\}$. Then $f$ is a function on $K$. We want to show that $f(x) > 0$ for $x \in K$. Suppose there was an $x_{0} \in K$ such that $f(x_{0}) = 0$. Then there would exists a sequence $\{y_{n}\}_{n = 1}^{\infty}$ of elements of $F$ such that $d(x_{0}, y_{n}) < 1/n$. This implies that $x_{0}$ is a limit point of $F$ and hence $x_{0} \in F$ since $F$ is closed. This contradicts the fact that $F \cap K = \varnothing$.
My question is: Where is compactness of $K$ used?
 A: Your argument is not quite complete. You have shown that $f(K)\subseteq(0,\infty)$, but this does not imply that $\displaystyle\inf_{x\in K}f(x)\neq 0$. To argue this, you have to note that by compactness of $K$, $f(K)$ is compact as well and that hence $\displaystyle\inf_{x\in K} f(x) \in f(K) \subseteq(0,\infty)$.
A: You used compactness when you started your contradiction argument.
"Suppose there was an $x_0 \in K$ such that $f(x_0) = 0$."
If $K$ were not compact, then this would not be the only case to consider for the assumption $\textrm{inf } f(x) = 0$. For example, what if $f$ attained every positive value, but just not zero?
Since $K$ is compact, you know that $f$ has a minimum value, i.e. there is some $x_0$ such that $f(x_0)$ actually equals $\textrm{inf } f(x)$.
A: I dont think your argument is correct.
I would have proved it in this way going along your lines.
Let if possible $\inf \{d(x,y)|x\in K,y\in F\}=0$
Then $\forall n\in N,\exists x_n\in K,y_n\in F$ such that $d(x_n,y_n)<1/n$
So we get a sequence $\{x_n\}$ in $K$. Now as $K$ is compact so $\exists \{x_{n_k}\}\subseteq \{x_n\}\text{ and } x\in K$ such that $x_{n_k}\to x$ as $k\to \infty$
So for some large enough $N_1\in N$ we must have $d(y_{n_k},x)\le d(y_n,x_{n_k})+d(x_{n_k},x)\le \epsilon /2+\epsilon /2=\epsilon$ for  all $k\ge N_1$
So we have ,
$y_{n_k}\to x$ as $k\to \infty$ and as $F$ is closed so $x\in F$
So we have $x\in F\cap K$ which is a contradiction.
Hence $\inf \{d(x,y)|x\in K,y\in F\}\ne 0$
