[step:Show that every basic open set in the product topology meets the candidate set]We verify that $E$ is [dense](/page/Dense%20Subset) in $\prod_{k=1}^\infty X_k$ by showing $E$ intersects every nonempty basic [open set](/page/Open%20Set). A basic open set in the product [topology](/page/Topology) has the form
\begin{align*}
\mathcal{U} = \prod_{k=1}^\infty G_k,
\end{align*}
where each $G_k \in \tau_k$ is open in $X_k$, and $G_k = X_k$ for all but finitely many indices $k$. Let $\{k_1, \ldots, k_m\} \subset \mathbb{N}$ be the (finite) set of indices for which $G_{k_j} \neq X_{k_j}$, and set $N := \max(k_1, \ldots, k_m)$.
**Constrained coordinates.** For each $j \in \{1, \ldots, m\}$, the set $G_{k_j}$ is a nonempty open subset of $X_{k_j}$, and $D_{k_j}$ is dense in $X_{k_j}$. By the definition of density, $D_{k_j} \cap G_{k_j} \neq \varnothing$. Choose $d_{k_j} \in D_{k_j} \cap G_{k_j}$.
**Unconstrained coordinates.** For every index $k \notin \{k_1, \ldots, k_m\}$, we have $G_k = X_k$, so the base point $p_k \in D_k \subset X_k = G_k$ satisfies the constraint.
**Assembling the element.** Define $y = (y_1, y_2, \ldots) \in \prod_{k=1}^\infty X_k$ by
\begin{align*}
y_k :=
\begin{cases}
d_{k} & \text{if } k \in \{k_1, \ldots, k_m\}, \\
p_k & \text{if } k \notin \{k_1, \ldots, k_m\}.
\end{cases}
\end{align*}
Then $y_k \in D_k$ for every $k$ (since $d_{k_j} \in D_{k_j}$ and $p_k \in D_k$), and $y_k = p_k$ for all $k > N$ (since all constrained indices satisfy $k_j \le N$). Therefore $y \in E_N \subset E$.
Moreover, $y_k \in G_k$ for every $k$: for constrained indices, $y_{k_j} = d_{k_j} \in G_{k_j}$; for unconstrained indices, $y_k = p_k \in X_k = G_k$. Therefore $y \in \mathcal{U}$.
Since $y \in E \cap \mathcal{U}$, the set $E$ meets every nonempty basic open set. Because basic open sets form a base for the product topology, every nonempty open set contains a nonempty basic open set, and hence meets $E$. Therefore $\overline{E} = \prod_{k=1}^\infty X_k$, so $E$ is a [countable](/page/Countable%20Set) dense subset, and the product space is separable.[/step]