I have this problem:
If $X$ is a metric space, and if $A,B\subseteq X$ then the distance between $A$ to $B$ is $\mathtt d(A,B):=\inf \{d_X(x,y)| x\in A,y\in B\}$. Show that $\mathtt d(A,B)>0$ if $A\cap B=\varnothing$, $A$ is compact and $B$ is closed. What happen or if $B$ is open instead of closed? ans if $A$ is only closed instead of compact?
For the first claim, suppose that $\mathtt d(A,B)\not\gt 0\rightarrow\mathtt d(A,B)=0$, so $\inf \{d_X(x,y)| x\in A,y\in B\}=0$, then there's at least one $x\in A$ such that this happens, now we take the $\mathtt d(x,B):=\inf_{z\in B}d_X(x,z)=0$, I already proved that if that last distance is $0$ and the set is closed then $x\in B$, hence $x\in A\lor x\in B$ wich is a contradiction.
For the second claim, I'm not so sure, I think that in this case the $\inf$ doesn't exists, if we suppose that $\mathtt d(A,B)=\beta>0$ then doing something similar to the above, there's a $y_1\in B$ such that $\mathtt d(y_1,A)=\beta$, on the other hand since $B$ is open then $\exists\; \varepsilon_1>0$ such that $B_X(y_1,\varepsilon_1)\subseteq B$, so there's a $y_2\in B_X(y_1,\varepsilon_1)$ such that for some $0<\varepsilon_2<\varepsilon_1$ then $\mathtt d(y_2,A)+\varepsilon_2=\beta$, then $\mathtt d(y_2,A)<\mathtt d(y_1,A)$, so there is a smaller number than $\beta$. I think I'm taking to much liberty with the $y_2$.
For the third I belive that you just have to give a counterexample, however I'm having trouble finding it. I was thinking maybe something like a line in $\Bbb R^2$ that gets really close to another line, like asymptotically, but I don't know if it'll really work with any metric space.