[proofplan]
For each factor $X_k$, fix a [countable](/page/Countable%20Set) [dense subset](/page/Dense%20Subset) $D_k$ and a base point $p_k \in D_k$. We construct a countable subset $E$ of the product $\prod_{k=1}^\infty X_k$ consisting of all sequences that agree with some element of $D_k$ in finitely many coordinates and equal $p_k$ in all remaining coordinates. The set $E$ is countable because it is a countable union of finite products of countable sets. To verify density, we use the defining property of the product [topology](/page/Topology): every basic [open set](/page/Open%20Set) constrains only finitely many coordinates. For each constrained coordinate $k$, the density of $D_k$ in $X_k$ provides an element of $D_k$ inside the constraint, while all unconstrained coordinates are filled by the base points. The resulting element of $E$ lies in the basic open set.
[/proofplan]
[step:Construct the candidate dense subset from finite modifications of a fixed base point]
For each $k \in \mathbb{N}$, let $D_k \subset X_k$ be a [countable](/page/Countable%20Set) [dense subset](/page/Dense%20Subset), which exists because $(X_k, \tau_k)$ is separable. Fix a base point $p_k \in D_k$ for each $k$. Define the set
\begin{align*}
E := \left\{(y_1, y_2, \ldots) \in \prod_{k=1}^\infty X_k : y_k \in D_k \text{ for all } k \in \mathbb{N}, \text{ and } y_k = p_k \text{ for all but finitely many } k\right\}.
\end{align*}
Equivalently, for each $N \in \mathbb{N}$, define
\begin{align*}
E_N := \left\{(y_1, y_2, \ldots) \in \prod_{k=1}^\infty X_k : y_k \in D_k \text{ for } 1 \le k \le N, \text{ and } y_k = p_k \text{ for } k > N\right\},
\end{align*}
so that $E = \bigcup_{N=1}^\infty E_N$.
[guided]
The construction of $E$ requires care. A first attempt might be to take the full Cartesian product $\prod_{k=1}^\infty D_k$ — the set of all sequences $(d_1, d_2, \ldots)$ with $d_k \in D_k$ for every $k$. This set is dense in the product (by the same argument we give below), but it is **not** countable: it has the cardinality of an infinite product of countably infinite sets, which is $|\mathbb{N}|^{|\mathbb{N}|} = 2^{\aleph_0}$ (the cardinality of the continuum). So the full product of dense subsets overshoots — it produces a dense subset, but not a *countable* one.
The remedy is to truncate: instead of allowing every coordinate to vary freely over $D_k$, we allow only *finitely many* coordinates to differ from a fixed base point. For each $k \in \mathbb{N}$, choose any element $p_k \in D_k$ as a "default value." The candidate set $E$ consists of all sequences that equal $p_k$ in all but finitely many coordinates, with the finitely many non-default coordinates drawn from $D_k$.
Formally, for each $N \in \mathbb{N}$, let $E_N$ be the set of sequences whose first $N$ entries are arbitrary elements of $D_1, \ldots, D_N$ (respectively) and whose remaining entries are the base points:
\begin{align*}
E_N := \left\{(y_1, \ldots, y_N, p_{N+1}, p_{N+2}, \ldots) : y_k \in D_k \text{ for } 1 \le k \le N\right\}.
\end{align*}
Then $E = \bigcup_{N=1}^\infty E_N$. The key point is that each $E_N$ is a *finite* product of countable sets (with the tail frozen), and a countable union of countable sets is countable.
Why does this truncation not destroy density? Because the product [topology](/page/Topology) only "looks at" finitely many coordinates at a time. A basic [open set](/page/Open%20Set) in the product topology constrains finitely many coordinates and imposes no restriction on the rest. So the base points $p_k$ in the unconstrained coordinates are harmless — they satisfy the vacuous constraint automatically. This is precisely where the argument would fail for the box topology, which can constrain *every* coordinate simultaneously.
[/guided]
[/step]
[step:Verify that the candidate set is countable]
Each set $E_N$ is in bijection with $D_1 \times D_2 \times \cdots \times D_N$, via the map $(y_1, \ldots, y_N, p_{N+1}, p_{N+2}, \ldots) \mapsto (y_1, \ldots, y_N)$. Since each $D_k$ is [countable](/page/Countable%20Set), the finite Cartesian product $D_1 \times \cdots \times D_N$ is countable (by induction on $N$: the product of two countable sets is countable by [Countability of Product of Natural Numbers](/theorems/754), and the inductive step follows). Therefore each $E_N$ is countable. The set $E = \bigcup_{N=1}^\infty E_N$ is a countable union of countable sets, hence countable by [Countable Union of Countable Sets](/theorems/755).
[/step]
[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.
[guided]
We must show that $E$ is dense, meaning $\overline{E} = \prod_{k=1}^\infty X_k$. Equivalently, every nonempty open set in the product topology meets $E$. Since every open set is a union of basic open sets, it suffices to show that $E$ intersects every nonempty basic open set.
What does a basic open set in the product topology look like? By definition, a basic open set is a product $\mathcal{U} = \prod_{k=1}^\infty G_k$ where each $G_k$ is open in $(X_k, \tau_k)$, and — crucially — $G_k = X_k$ for all but *finitely many* indices. This is the defining feature of the product topology: it constrains only finitely many coordinates. Let $\{k_1, \ldots, k_m\}$ be the finite set of indices where a genuine constraint is imposed (i.e., $G_{k_j} \subsetneq X_{k_j}$ or at least $G_{k_j} \neq X_{k_j}$), and let $N := \max(k_1, \ldots, k_m)$.
For each constrained index $k_j$, we need to find a point in $D_{k_j}$ that lies inside $G_{k_j}$. Since $G_{k_j}$ is a nonempty open subset of $X_{k_j}$ (it is nonempty because $\mathcal{U}$ is nonempty, so each factor must be nonempty) and $D_{k_j}$ is dense in $X_{k_j}$, the intersection $D_{k_j} \cap G_{k_j}$ is nonempty. Choose any $d_{k_j} \in D_{k_j} \cap G_{k_j}$.
For the unconstrained indices — every $k$ not in $\{k_1, \ldots, k_m\}$ — the constraint is $G_k = X_k$, which is satisfied by every element of $X_k$. In particular, the base point $p_k$ satisfies it.
We assemble the sequence $y = (y_1, y_2, \ldots)$ by setting $y_k = d_k$ at the constrained indices and $y_k = p_k$ everywhere else. By construction:
- $y_k \in D_k$ for all $k$ (at constrained indices we chose $d_{k_j} \in D_{k_j}$; at unconstrained indices $p_k \in D_k$).
- $y_k = p_k$ for all $k > N$ (all constrained indices are $\le N$).
Therefore $y \in E_N \subset E$. And $y \in \mathcal{U}$ because $y_k \in G_k$ for every $k$. So $E \cap \mathcal{U} \neq \varnothing$.
This argument would **fail** for the box topology. In the box topology, a basic open set can constrain *every* coordinate: $\mathcal{U} = \prod_{k=1}^\infty G_k$ with $G_k \neq X_k$ for infinitely many (or all) $k$. Our element $y$ sets $y_k = p_k$ for all but finitely many $k$, and the base point $p_k$ need not belong to $G_k$ when $G_k \neq X_k$. So $y$ would fail to lie in $\mathcal{U}$. The product topology's restriction to finitely many constraints is precisely what makes the "pad with base points" construction work.
Since $E$ meets every nonempty basic open set, and basic open sets form a base for the product topology (meaning every open set is a union of basic open sets), $E$ meets every nonempty open set. Therefore $\overline{E} = \prod_{k=1}^\infty X_k$. Combined with the countability of $E$ from the previous step, the product space is separable.
[/guided]
[/step]