Muhammad Haris Rao
Lemma: Let $X, Y$ be topological spaces with $B \subseteq Y$ compact. Then if $x \in X$, the set $\{ x \} \times B \subseteq X \times Y$ is a compact subset of $X \times Y$.
Proof. Let $\{ U_i \}_{i \in I}$ be a cover of $\{ x \} \times B$. For each $y \in B$, choose $i_y \in I$ such that $(x, y) \in U_{i_y}$. By definition of the product topology, there exist $V_y^X \subseteq X$ and $V_y^Y \subseteq Y$ open such that $V_y^X \times V_y^Y \subseteq U_{i_y}$ and $(x, y) \in V_y^X \times V_y^Y$. It follows that if $y \in B$ then $y \in V_y^Y$, so $\{ V_y^Y \}_{y \in B}$ is an open cover of $B$. Hence, there is a finite $C \subseteq B$ such that $\{ V_y^Y \}_{y \in C}$ covers all of $B$ as well. Then we claim that $\{ U_{i_y} \}_{y \in C}$ is a finite subcollection of $\{ U_i \}_{i \in I}$ which covers $\{ x \} \times B$. Indeed, if $(x, y_0) \in \{ x \} \times B$ then there exists $y^* \in C$ such that $y \in V_{y^*}^Y$. Then we have $$ (x, y_0) \in V_{y^*}^X \times V_{y^*}^Y \subseteq \bigcup_{y \in C} V_y^X \times V_y^X \subseteq \bigcup_{y \in C} U_{i_y} $$ Thus, $\{ U_{i_y} \}_{y \in C}$ does cover $A \times B$ and we have found our desired finite subcover. $\blacksquare$
Lemma (Tube Lemma): Let $X, Y$ be topological spaces, and $B \subseteq Y$ compact, and $x \in X$. If $N \subseteq X \times Y$ is an open set containing the slice $\{ x \} \times B$ then there is open neighborhood $U \subseteq X$ of $x$ such that $U \times B \subseteq N$.
Proof. By definition of the product topology, for each $y \in B$ there exist open neighborhoods $U_y \subseteq X$, $V_y \subseteq Y$ of $x \in X$, $y \in Y$ respectively such that $U_y \times V_y \subseteq N$. Then we have the an open covering $\{ x \} \times B \subseteq \bigcup_{y \in B} (U_y \times V_y)$. By compactness of $\{ x \} \times B$, there exists a finite subset $C \subseteq B$ such that $\{ x \} \times B \subseteq \bigcup_{y \in C} (U_y \times V_y )$. Now take $U = \bigcap_{y \in C} U_y \subseteq X$ as an open neighborhood of $x$. Then we have $$ \{ x \} \times B \subseteq U \times B \subseteq \bigcup_{y \in C} (U_y \times V_y) \subseteq N $$ So the tube $U \times B$ satisfies the desired properties. $\blacksquare$
Theorem: Let $X, Y$ be topological spaces, and $A \subseteq X$, $B \subseteq Y$ compact subsets. Then $A \times B$ is compact in $X \times Y$ endowed with the product topology.
Proof. Let $\{ U_i \}_{i \in I}$ be a collection of open subsets of $X \times Y$ covering all of $A \times B$. For each $x \in A$, consider the slice $\{ x \} \times B \subseteq A \times B$. This slice is a compact subset of $X \times Y$, and is covered by $\{ U_i \}_{i \in I}$ so there exists a finite subset $I_x \subseteq I$ such that $\{ U_i \}_{i \in I_x}$ covers $\{ x \} \times B$. By the tube lemma, there is an open neighborhood $U_x \subseteq X$ of $x$ such that $U_x \times B \subseteq \bigcup_{i \in I_x} U_i$. Now $\{ U_x \}_{x \in A}$ is an open cover of $A$ so there exists a finite subset $C \subseteq A$ such that $\{ U_x \}_{x \in C}$ is an open cover of $A$. Finally, let $$ J = \bigcup_{x \in C} I_x \subseteq I $$ Clearly, $J$ is finite. We claim that $\{ U_i \}_{i \in J}$ is a cover of $A \times B$. Indeed, if $(x_0, y_0) \in A \times B$, then there is $x^* \in C$ such that $x_0 \in U_{x^*}$. Then $$ (x_0, y_0) \in U_{x^*} \times B \subseteq \bigcup_{i \in I_{x^*}} U_i \subseteq \bigcup_{i \in J} U_i $$ which completes the proof. $\blacksquare$
Corollary: Finite products of compact topological spaces are compact.
In this section, we will prove the following generalisation:
Theorem (Tychonoff): Lef $\{ X_i \}_{i \in I}$ be a collection of topological spaces indexed by $I$. Then the proeduct space $$ X = \prod_{i \in I} X_i $$ endowed with the product topology is compact.