Showing infimum of distance between sets is positive I am trying to understand the proof of Lemma 45.1 in Bartle, The Elements of Real Analysis.  The lemma is used to prove that diffeomorphisms map sets with zero content into sets with zero content.  Bartle leaves to reader (with hint that is $\bar{A}$ is compact):

If $\bar{A} \subset \Omega \subset \mathbb{R}^p$ where $\Omega$ is an
open set and $\bar{A}$ is closed and bounded, then $\inf \{ \|a-x\|:
 a\in \bar{A}, x \notin \Omega\}> 0$.

My attempt:  I know $\{ \|a-x\|: a\in \bar{A}, x \notin \Omega\} = \{ \|a-x\|: (a,x) \in \bar{A} \times \Omega^c\}$ where $\Omega^c = \mathbb{R}^p - \Omega$, and the Euclidean norm $\|a-x\|$ is a continuous function of its arguments.  If I knew that $\bar{A} \times \Omega^c$ was compact then I would have the infimum equal to $\|a'-x'\|$ for some point $(a',x')$.  But since $\bar{A} \cap \Omega^c = \emptyset$ we must have $\|a'-x'\| > 0$.
But I am stuck when $\Omega^c$ is not compact.

To solve it your way, choose $M$ such that $\Omega_M = \{ y \in \Omega^c \mid d(X, y) \leq M \} \neq \varnothing.$  Then $\Omega_M$ is compact (because it's closed and bounded) and $\inf \{d(x, y) \mid x \in X, y \in \Omega_M \} =  \inf \{ d(x, y) \mid x \in X, y \in \Omega^c \}$, so consider $X \times \Omega_M$.
