This question is (1-21)(b) from M. Spivak's Calculus on Manifolds.
Question: If $A$ is closed, $B$ is compact, and $A \cap B = \emptyset$, prove that there is $d > 0$ such that $||y - x|| \geq d$ for all $y \in A$ and $x \in B$.
Now, I interpret this as an instruction to find a single $d$ that works for all $y \in A$ and $x \in B$. However, I can't see why the following is not a counter-example:
Consider the set $$A_0 = (-\infty, 0) \cup \left[\bigcup_{n=1}^{\infty} \left(\frac{1}{n + 1}, \frac{1}{n}\right)\right] \cup (1, \infty)$$ where $(a,b)$ denotes the open interval as usual. Since $A_0$ is a union of open sets, it too is open. Thus $$A = \mathbb{R} - A_0 = \left\{ \frac{1}{n} \quad \colon \quad n \in \mathbb{N}\right\}$$ is closed. The set $$B = [-1, 0]$$ is certainly compact. Moreover, $A \cap B = \emptyset$. However, for all $d > 0$, there exists a $y \in A$ such that $$||0 - y|| = ||y|| < d$$
I must be overlooking something somewhere. Any help spotting where will be appreciated.