Find a product of open set covering the compact set

Let $A$, $B$ be compact subsets of the topological spaces $X$ and $Y$, respectively. If $N$ is an open subset of the product space $X\times Y$ containing $A\times B$, prove that there exist open sets $U \subset X$ and $V \subset Y$ such that $A\times B\subset U\times V\subset N$.

My attempt: For every $c=(a, b)\in A\times B$, there exist open sets $U_a, V_b$ s.t. $a\in U_a \subset X$ and $b\in V_b \subset Y$, $W_c=U_a \times V_b \subset N$. Since $A\times B$ is compact, there are finitely many points $c_1, ..., c_n \in A \times B$ such that $$A\times B\subset\bigcup_{i=1}^{n}W_{c_i}$$

Now let $c_i = (a_i, b_i)$(Here $a_i$ and $a_j$ might be the same even if $i\neq j$.) Then let $U=\bigcup _{i=1}^{n}U_{a_i}$ and $V=\bigcup_{i=1}^{n}V_{b_i}$, but I am not sure that $U\times V \subset N$, since $U\times V \neq \bigcup_i W_i$ in general. How should I proceed?

Any advice or hint would be helpful!

• My proof below does not use compactness of $A \times B$, and allows us the control we need to get $U$ and $V$. – Henno Brandsma Aug 2 '17 at 17:27

Re-using an old answer:

It's cleaner to split the proof into a new tube lemma and the actual proof, where both re-use the same proof idea as Munkres' Tube lemma formulation.

Extend the tube lemma first: Let $X,Y$ be any spaces. If $x \in X$ and $B \subseteq Y$ is compact and $\{x\} \times B \subseteq N$, where $N$ is open in $X \times Y$, then there are open sets $O_x \subseteq X$ containing $x$ and $O_B \subseteq Y$ open with $B \subseteq O_B$, such that $O_x \times O_B \subseteq N$. I'll call this the "real" tube lemma. If you study the proof in Munkres, this is what he actually showed there. (Note that it's a bit stronger as we can take $B= Y$ if $Y$ is compact, to get his version.)

Proof: just follow the proof in Munkres: For every $b \in B$ pick $U_b \subseteq X$ open containing $x$ and $V_b \subseteq Y$ containing $b$ such that $U_b \times V_b \subseteq N$. Finitely many $V_{b_1}, \ldots V_{b_m}$ also cover $B$ by compactness, and then define $O_B = \cup_{i=1}^n V_{b_i}$ and $O_x = \cap_{i=1}^n$. Then just as in Munkres proof $O_x \times O_B \subseteq N$ ($(p,q) \in O_x \times O_B$ implies $q \in V_{b_j}$ for some $j$ and then $p \in U_{b_j}$ as well, and $(p,q) \in U_{b_j} \times V_{b_j} \subseteq N$ by their definition.)

Now to prove the original statement:

So we have $A \times B \subseteq N$. For every $a \in A$ we apply the "real" tube lemma above to $\{a\}$ and $B$, to find $O_a$ open containing $a$ and $O_B(a)$ containing $B$ such that $O_a \times O_B(a) \subseteq N$. Then again, finitely many $O_a$ cover $A$ by compactness of $A$, say $O_{a_1}, \ldots O_{a_n}$, and then define (following the same idea again) $U := \cup_{i=1}^n O_{a_i}$ which is open and contains $A$ (as they form a subcover) and $V = \cap_{i=1}^n O_B(a_i)$ which is an open neighbourhood of $B$ by finiteness. Now $U \times V \subseteq N$: if $(p,q) \in U \times V$, then $p \in O_{a_j}$ for some $j \in \{1,\ldots n$ and then $q \in V \subseteq O_B(a_j)$ and again $(p,q) \in O_{a_j} \times O_B(a_j) \subseteq N$ as required.

This proof set-up is exactly like the proof that in Hausdorff spaces are we can separate two disjoint compact sets by open sets, where we use a lemma to separate $x$ and a disjoint compact set $B$ first, and then prove the full result using the same idea. It's slightly easier on the notation I think.