Solution (source code)

= Solution

A subset $S\subseteq G$ <topologically generates> $G$ exactly when
$$
\langle p_j(S)\rangle=p_j(G)
$$
for every $j$. In the usual presentation by surjective finite quotients this reads $\langle p_j(S)\rangle=G_j$. Indeed, a subgroup is dense exactly when its image in every finite discrete quotient is the whole quotient. This is the <finite-quotient criterion for topological generation>.