If a compact set and a closed set have no intersection, is it true that the distance between the two set always positive? Let $A \subseteq \mathbb{R}^n$ be compact, and $B \subseteq \mathbb{R}^n$ be closed. Assume $A \cap B=\emptyset$.Prove that there is a M>0 such that $||\vec{a}-\vec{b}|| \geq c \quad \forall \vec{a} \in A,\vec{b} \in B$.
My solution is as follows: Suppose to the contrary that there exist $\vec{c} \in A,\vec{d} \in B$ such that for all c>0 we have $||\vec{c}-\vec{d}||<M$. But this would imply that $\vec{c}=\vec{d}$ which contradicts the fact that  $A \cap B=\emptyset$.
I think my proof is wrong because i did not use the fact that A is compact and B is closed. Which step is wrong?
 A: You have used the letter $c$ in two different ways!
I presume what you actually want to prove is that there is
$\epsilon>0$ such that $\|\vec c-\vec d\|\ge\epsilon$
for all $\vec c\in A$ and $\vec d\in B$. This is a useful
standard result.
The negation of the statement isn't that there are points $\vec c$
and $\vec d$
with $\|\vec c-\vec d\|<\epsilon$ for all $\epsilon >0$. Rather it is that for
each $\epsilon>0$ there are $\vec c\in A$ and $\vec d\in B$
with $\|\vec c-\vec d\|<\epsilon$, i.e., the $\vec c$ and $\vec d$
can depend on $\epsilon$.
Anyway here are my hints:


*

*For each $a\in A$ show that $f(a)$ defined by $f(a)=\inf_{b\in B}\|a-b\|$ satisfies $f(a)>0$ 

*Prove that $f$ is continuous on $A$.

*Prove that $f$ has a minimum on $A$.

A: You have misplaced a quantifier in your translation of the statement that the distance between the two sets is positive. And you're right that the fact your proof doesn't use closedness is a bad sign since the (correct version of the) statement is false for arbitrary sets. 
The two sets having distance zero means that for all $\epsilon > 0$ there is an $a\in A$ and a $b\in B$ such that $d(a,b) <\epsilon.$ By picking $\epsilon = 1,$ $\epsilon = 1/2,$ $\epsilon = 1/4\ldots$ you can get sequences $a_n\in A$ and $b_n\in B$ such that $d(a_n,b_n) \to 0.$ Since $A$ is compact, there is a subsequence $a_{n_k}$ that converges to $a\in A.$ We still have $d(a_{n_k},b_{n_k})\to 0$ so $b_{n_k}$ also converges to $a.$ Since $B$ is closed and $b_{n_k}$ is a sequence in $B$ that converges to $a,$ we have $a\in B.$ So $a\in A$ and $a\in B,$ contradicting $A\cap B = \emptyset.$
More on the assumptions: it's relatively easy to think of an example with distance $0$ where either $A$ or $B$ is not closed. Can you think of an example where $A$ and $B$ are both closed but $A$ is not compact?
