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?

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)$.
