Solution (source code)

= Solution

Choose a finite set $S$ of <topological generators> of $G$ and let $\Gamma=\langle S\rangle$ denote the abstract subgroup it generates. Then $\Gamma$ is dense in $G$. For an <open subgroup> $H$, the abstract subgroup $K=\Gamma\cap H$ is dense in $H$, since every nonempty open subset of $H$ is open in $G$. Every coset of $H$ meets $\Gamma$, so $[\Gamma:K]=[G:H]=m<\infty$.

Here is the needed <Schreier lemma> argument explicitly. Choose representatives $t$ in $\Gamma$ for the right <cosets> $K\backslash\Gamma$, including $1$ for $K$, and write $\overline\gamma$ for the representative of $K\gamma$. The finite set
$$
\{t s\,\overline{ts}^{-1}:t\text{ a representative},\ s\in S\cup S^{-1}\}
$$
is contained in $K$. For $k=s_1\cdots s_r\in K$, set $t_j=\overline{s_1\cdots s_j}$, with $t_0=t_r=1$. Then
$$
k=\prod_{j=1}^r(t_{j-1}s_jt_j^{-1}),
$$
and every factor belongs to the displayed finite set. Thus $K$ is finitely generated as an abstract <group>. Its finite generators topologically generate its closure $H$. \b[Every open subgroup of a finitely generated profinite group is finitely generated.]