# compact subset of product topology is nowhere dense

Let $$\{X_i\}$$ be a family of non-empty, Hausdorff spaces. Prove that if infinitely many of them are non-compact then every compact subset of the topological product $$\prod X_i$$ is nowhere dense.

In order to show that some compact $$K\subset \prod_i X_i$$ is nowhere dense, we need to show first that $$\text{int}(\overline{K})=\emptyset$$. Now since $$\prod X_i$$ is Hausdorff, we can say that $$\overline{K}=K$$. So the problem reduces to show that $$\text{int}(K)=\emptyset$$. Now one information that we still didn't use is $$\color{red}{\text{infinitely many of them (i.e. \ X_i for infinitely many i) are non-compact}}$$. But how to conclude the result from there is not clear to me. Any help is appreciated.

If $$K \subseteq \prod_i X_i$$ is compact, it's already closed (as all $$X_i$$, and thus the product, is Hausdorff) so we only need to check it has empty interior.
To this end it suffices that any non-empty basic open subset $$\prod_i O_i$$ of the product (so all $$\emptyset \neq O_i$$ are open in $$X_i$$ and almost all $$O_i$$ are the whole space, or $$F:=\{i \in I: X_i \neq O_i \}$$ is finite; this is the standard product base) cannot be a subset of $$K$$.
So suppose (for a contradiction) that $$\prod_i O_i \subseteq K$$. By assumption $$J:=\{ i \in I: X_i \text{ not compact }\}$$ is infinite. So we have some $$i_0 \in J\setminus F$$ ($$F$$ defined above for this basic open set). So we have from the inclusion that $$X_{i_0} = O_{i_0} = \pi_{i_0}[\prod_i O_i] \subseteq \pi_{i_0}[K] \subseteq X_{i_0}$$
That $$X_{i_0}=O_{i_0}$$ follows from $$i_0 \notin F$$, the rest is obvious. But then $$X_{i_0} = \pi_{i_0}[K]$$ which is compact as a continuous image of a compact set, contradicting $$i_0 \in J$$.
This contradiction shows that $$\operatorname{int}(K)=\emptyset$$ for any compact $$K \subseteq \prod_i X_i$$ and we're done.