[proofplan]
We first establish the tube lemma as a standalone claim: if $Y$ is compact and $W$ is an open set in $X \times Y$ containing the slice $\{x_0\} \times Y$, then some open tube $U \times Y$ around the slice is contained in $W$. We then prove the main theorem: given an open cover of $X \times Y$, we cover each slice by finitely many members, apply the tube lemma to fatten each slice into a tube, and use compactness of $X$ to select finitely many tubes.
[/proofplan]
[step:Establish the tube lemma: open sets containing a compact slice contain a tube]
[claim:Tube Lemma]
Let $X$ be a [topological](/page/Topology) space, $Y$ compact, and $x_0 \in X$. If $W$ is an open set in $X \times Y$ containing $\{x_0\} \times Y$, then there exists an open neighbourhood $U$ of $x_0$ in $X$ with $U \times Y \subseteq W$.
[/claim]
[proof]
For each $y \in Y$, the point $(x_0, y) \in W$. By definition of the product topology, there exist [open sets](/page/Open%20Set) $U_y \subseteq X$ and $V_y \subseteq Y$ with $(x_0, y) \in U_y \times V_y \subseteq W$. The collection $\{V_y\}_{y \in Y}$ is an open cover of $Y$. By compactness of $Y$, finitely many suffice: there exist $y_1, \ldots, y_n \in Y$ with $Y = V_{y_1} \cup \cdots \cup V_{y_n}$.
Define $U = U_{y_1} \cap \cdots \cap U_{y_n}$, which is open (finite intersection) and contains $x_0$. For any $(x, y) \in U \times Y$: since $y \in V_{y_j}$ for some $j$, and $x \in U \subseteq U_{y_j}$, we have $(x, y) \in U_{y_j} \times V_{y_j} \subseteq W$. Therefore $U \times Y \subseteq W$.
[/proof]
[guided]
The tube lemma says that an open set $W$ containing a "vertical slice" $\{x_0\} \times Y$ must contain an entire "tube" $U \times Y$ around it, provided $Y$ is compact.
**Why compactness is needed:** For each $y \in Y$, we find a basic open rectangle $U_y \times V_y$ with $(x_0, y) \in U_y \times V_y \subseteq W$. The sets $\{V_y\}_{y \in Y}$ cover $Y$, and the $U_y$ are open neighbourhoods of $x_0$ --- but they vary with $y$.
**The intersection step:** To get a single neighbourhood $U$ of $x_0$ that works for all $y$ simultaneously, we need $U \subseteq U_y$ for every relevant $y$. This means intersecting the $U_y$'s. An arbitrary intersection of open sets need not be open, but a finite intersection is. Compactness of $Y$ reduces to finitely many $V_{y_1}, \ldots, V_{y_n}$ covering $Y$, and then $U = U_{y_1} \cap \cdots \cap U_{y_n}$ is open.
**Verification:** For any $(x, y) \in U \times Y$, some $j$ has $y \in V_{y_j}$, and $x \in U \subseteq U_{y_j}$, so $(x, y) \in U_{y_j} \times V_{y_j} \subseteq W$. Therefore $U \times Y \subseteq W$.
**Counterexample without compactness:** In $\mathbb{R} \times \mathbb{R}$, the set $W = \{(x, y) : |x| < 1/(1 + |y|)\}$ is open and contains $\{0\} \times \mathbb{R}$, but no tube $(-\varepsilon, \varepsilon) \times \mathbb{R}$ fits inside $W$ (for any $\varepsilon > 0$, the point $(\varepsilon/2, \, 2/\varepsilon)$ lies in the tube but not in $W$).
[/guided]
[/step]
[step:Cover each slice by finitely many sets and apply the tube lemma]
Let $\{W_i\}_{i \in I}$ be an open cover of $X \times Y$. For each $x \in X$, the slice $\{x\} \times Y$ is homeomorphic to $Y$ via $y \mapsto (x, y)$, hence compact. The sets $\{W_i \cap (\{x\} \times Y)\}_{i \in I}$ form an open cover of $\{x\} \times Y$, so finitely many suffice: there exist $i_1(x), \ldots, i_{k(x)}(x) \in I$ with
\begin{align*}
\{x\} \times Y \subseteq W_{i_1(x)} \cup \cdots \cup W_{i_{k(x)}(x)}.
\end{align*}
Let $N_x = W_{i_1(x)} \cup \cdots \cup W_{i_{k(x)}(x)}$. This is open in $X \times Y$ (a finite union of open sets) and contains $\{x\} \times Y$. By the tube lemma, there exists an open neighbourhood $U_x$ of $x$ in $X$ with $U_x \times Y \subseteq N_x$.
[/step]
[step:Extract a finite subcover of $X \times Y$ using compactness of $X$]
The collection $\{U_x\}_{x \in X}$ is an open cover of $X$. By compactness of $X$, there exist $x_1, \ldots, x_m$ with $X = U_{x_1} \cup \cdots \cup U_{x_m}$. Then
\begin{align*}
X \times Y = \bigcup_{j=1}^{m} (U_{x_j} \times Y) \subseteq \bigcup_{j=1}^{m} N_{x_j} = \bigcup_{j=1}^{m} \bigcup_{\ell=1}^{k(x_j)} W_{i_\ell(x_j)}.
\end{align*}
Each $N_{x_j}$ is a finite union of members of the original cover, and there are finitely many tubes. The total collection is a finite subcover of $\{W_i\}_{i \in I}$.
[/step]