Closure of product equals product of closures

Theorem
Let $\{X_i\}_{i \in I}$ an arbitrary family of topological spaces and $A_i \subset X_i$ for each $i$. If $X = \prod_{i \in I}X_i$ has the product topology, $\prod_{i\in I} \overline{A_i} = \overline{\prod_{i\in I}A_i}$.

Proof
We proceed by double inclusion. Suppose $(x_i)_{i\in I}$ $\in \prod_{i\in I} \overline{A_i}$. This means $x_i \in \overline{A_i}$ for each $i$. Let $U$ be an open set containing $(x_i)_{i \in I}$. Since $x_i \in \overline{A_i}$, we can choose $y_i \in U_i \cap A_i$ and then $(y_i)_{i\in I} \in U \cap \prod_{i\in I} A_i$. But $U$ was arbitrary, hence $(x_i)_{i\in I} \in \overline{\prod_{i\in I}A_i}$.

Conversely, suppose $(x_i)_{i\in I} \in \overline{\prod_{i\in I}A_i}$. We want to show that $x_j \in \overline{A_j}$ for all $j$. Fixed $j$, we take $V_j$ an open set in $X_j$ such that $x_j \in V_j$. Since $\pi_{j}^{-1}(V_j)$ is open in $\prod_{i\in I} X_i$, we can pick $(y_i)_{i\in I} \in \prod_{i\in I} A_i$. Then $y_j \in V_j \cap A_j$, so it follows that $x_j \in \overline{A_j}$, namely $(x_i)_{i\in I} \in \prod_{i\in I} \overline{A_i}$. $\blacksquare$