[proofplan]
We prove both directions. For the forward direction, we show that if $\prod_\alpha X_\alpha$ is locally compact, then each $X_\alpha$ is locally compact (via continuous projections) and all but finitely many $X_\alpha$ are compact (by analysing the structure of a basic open neighbourhood and its compact closure). For the reverse direction, when all but finitely many factors are compact, we write the product as a finite product of locally compact spaces times a product of compact spaces: the finite product is locally compact by the [Finite Products of Locally Compact Spaces](/theorems/1064) theorem, and the infinite product of compact spaces is compact by [Tychonoff's Theorem](/theorems/953).
[/proofplan]
[step:Show that local compactness of the product forces each factor to be locally compact]
Assume $\prod_{\alpha \in A} X_\alpha$ is locally compact. Fix $\beta \in A$ and a point $x_\beta \in X_\beta$. Choose a point $x = (x_\alpha)_{\alpha \in A} \in \prod_\alpha X_\alpha$ with $x_\beta = x_\beta$.
Since $\prod_\alpha X_\alpha$ is locally compact, there exists an open set $U$ and a compact set $K$ in $\prod_\alpha X_\alpha$ with $x \in U \subset K$. The projection map $\pi_\beta: \prod_\alpha X_\alpha \to X_\beta$ is continuous and surjective. By the [Continuous Image of a Compact Space is Compact](/theorems/305) theorem, $\pi_\beta(K)$ is compact. The set $\pi_\beta(U)$ is open in $X_\beta$ (the projection of a basic open set $\prod_\alpha U_\alpha$, where $U_\alpha = X_\alpha$ for all but finitely many $\alpha$, onto the $\beta$-th coordinate is $U_\beta$; and $\pi_\beta$ is an open map).
We have $x_\beta \in \pi_\beta(U) \subset \pi_\beta(K)$, where $\pi_\beta(U)$ is open and $\pi_\beta(K)$ is compact. Since $x_\beta$ was arbitrary, $X_\beta$ is locally compact.
[/step]
[step:Show that all but finitely many factors must be compact]
Assume $\prod_{\alpha \in A} X_\alpha$ is locally compact. Fix a point $x \in \prod_\alpha X_\alpha$ and let $U$ be an open set and $K$ a compact set with $x \in U \subset K$.
Since $U$ is open in the product topology, there exists a basic open set $\prod_{\alpha \in A} U_\alpha$ with $x \in \prod_\alpha U_\alpha \subset U$, where $U_\alpha$ is open in $X_\alpha$ for each $\alpha$ and $U_\alpha = X_\alpha$ for all $\alpha$ outside a finite set $F \subset A$.
For each $\alpha \in A \setminus F$, we have $U_\alpha = X_\alpha$, so $\pi_\alpha(\prod_\beta U_\beta) = X_\alpha$. Since $\prod_\beta U_\beta \subset K$ and $\pi_\alpha$ is continuous, we get $X_\alpha = \pi_\alpha(\prod_\beta U_\beta) \subset \pi_\alpha(K)$. By the [Continuous Image of a Compact Space is Compact](/theorems/305) theorem, $\pi_\alpha(K)$ is compact. Since $X_\alpha \subset \pi_\alpha(K)$ and $\pi_\alpha(K) \subset X_\alpha$ (as $\pi_\alpha$ maps into $X_\alpha$), we conclude $X_\alpha = \pi_\alpha(K)$, which is compact.
Therefore $X_\alpha$ is compact for all $\alpha \in A \setminus F$, i.e., all but finitely many factors are compact.
[guided]
This is the critical step. The product topology has the special property that basic open sets restrict only finitely many coordinates — all others are the full space $X_\alpha$. When such a basic open set sits inside a compact set $K$, projecting onto any "unrestricted" coordinate $\alpha \notin F$ gives $\pi_\alpha(\prod_\beta U_\beta) = X_\alpha \subset \pi_\alpha(K)$. Since the continuous image of a compact set is compact (by [Continuous Image of a Compact Space is Compact](/theorems/305)), we get $X_\alpha$ is compact.
This is why the product topology (as opposed to the box topology) is the correct choice: in the box topology, basic open sets can restrict all coordinates, and the argument would fail — indeed, the statement itself is false for the box topology.
[/guided]
[/step]
[step:Prove the converse — finitely many non-compact factors implies local compactness]
Assume each $X_\alpha$ is locally compact and $X_\alpha$ is compact for all $\alpha \in A \setminus F$ where $F \subset A$ is finite. Write the product as
\begin{align*}
\prod_{\alpha \in A} X_\alpha = \left(\prod_{\alpha \in F} X_\alpha\right) \times \left(\prod_{\alpha \in A \setminus F} X_\alpha\right).
\end{align*}
The product topology on $\prod_\alpha X_\alpha$ agrees with the product topology on this two-fold product.
The finite product $\prod_{\alpha \in F} X_\alpha$ is locally compact Hausdorff by the [Finite Products of Locally Compact Spaces](/theorems/1064) theorem (each $X_\alpha$ for $\alpha \in F$ is locally compact Hausdorff by hypothesis).
The infinite product $\prod_{\alpha \in A \setminus F} X_\alpha$ is compact by [Tychonoff's Theorem](/theorems/953) (each $X_\alpha$ for $\alpha \in A \setminus F$ is compact by hypothesis). A compact space is locally compact (every point has the entire space as a compact neighbourhood).
Therefore $\prod_\alpha X_\alpha$ is the product of a locally compact Hausdorff space and a compact (hence locally compact Hausdorff) space. By the [Finite Products of Locally Compact Spaces](/theorems/1064) theorem (with $N = 2$), the product is locally compact Hausdorff.
Alternatively: fix $x = (x_\alpha) \in \prod_\alpha X_\alpha$. For each $\alpha \in F$, local compactness of $X_\alpha$ provides an open $U_\alpha$ and compact $K_\alpha$ with $x_\alpha \in U_\alpha \subset K_\alpha$. For each $\alpha \in A \setminus F$, set $U_\alpha := X_\alpha$ and $K_\alpha := X_\alpha$ (which is compact). The set $\prod_\alpha U_\alpha$ is a basic open set in the product topology (since $U_\alpha = X_\alpha$ for all $\alpha \notin F$, which is cofinitely many). The set $\prod_\alpha K_\alpha$ is compact by [Tychonoff's Theorem](/theorems/953). We have $x \in \prod_\alpha U_\alpha \subset \prod_\alpha K_\alpha$, giving a compact neighbourhood of $x$.
[guided]
The reverse direction decomposes the product into a finite product of locally compact spaces (handled by [Finite Products of Locally Compact Spaces](/theorems/1064)) and an infinite product of compact spaces (handled by [Tychonoff's Theorem](/theorems/953)).
The direct construction is illuminating: at each coordinate $\alpha \in F$, we choose a compact neighbourhood $K_\alpha$ of $x_\alpha$. At each coordinate $\alpha \notin F$, we simply take $K_\alpha = X_\alpha$, which is already compact. The product $\prod_\alpha K_\alpha$ is compact by Tychonoff, and $\prod_\alpha U_\alpha$ is a basic open neighbourhood of $x$ contained in it.
This construction reveals why we need all but finitely many factors to be compact: in a basic open set, we can only "control" finitely many coordinates (those where $U_\alpha \neq X_\alpha$). For the remaining coordinates, $U_\alpha = X_\alpha$, and we need $K_\alpha = X_\alpha$ to be compact so that the product $\prod_\alpha K_\alpha$ is compact by Tychonoff. If infinitely many $X_\alpha$ were non-compact, we could not form a compact product $\prod_\alpha K_\alpha$ because Tychonoff requires all factors to be compact.
[/guided]
[/step]