Is my proof for this correct? I've seen the proof by contradiction that uses the triangle inequality, but this was the first proof that I came up with, and I'd like to test my understanding by asking if my proof is also correct. I'm uncertain of whether or not my claim that $\inf d(M_x, y) >0, \inf d(m_x,y) >0 $ is correct, or if my claim that $\inf d(x, y) = \inf\{ \inf d(M_x, y), \inf d(m_x, y) \}$ is correct.
My Proof:
This is for a metric space $(X, d)$ with $A, B \subset X$ subsets of $X$, and $x \in A$, $y \in B$
$$A \mbox{ compact } \Rightarrow A \mbox{ bounded } \Rightarrow ^\exists M_x, m_x \: | \: M_x = \sup A, \: m_x = \inf A$$ Since $M_x$ and $m_x$ are upper and lower bounds, for some sequences $(x_n)_n \in A$, it is true that $$(x_n)_i \rightarrow M_x, (x_n)_i \rightarrow m_x$$ $$A \mbox{ compact } \Rightarrow A \mbox{ closed } \Rightarrow A \mbox{ contains its accumulation pts } \Rightarrow M_x, m_x \in A$$ $$A \cap B = \emptyset \Rightarrow M_x, m_x \notin B$$ Since $M_x$ and $m_x$ are not in $B$, we have $$\{\inf d(M_x, y) \: | \: y \in B\} > 0, \mbox{ and }\{\inf d(m_x, y) \: | \: y \in B\} > 0 $$By definition of $M_x$ and $m_x$, they are the closest possible points to any points in another set $S$ where $A \cap S = \emptyset$, so $$ \{ \inf d(x, y) \: | \: x \in A, \: y \in B \} = \inf \{ \inf d (M_x, y) \: | \: y \in B, \: \inf d(m_x, y) \: | \: y\in B\} > 0$$
So $$ d(A, B) = \{ \inf d(x, y) \: | \: x \in A, \: y \in B \} > 0$$