# Finite generation and profinite completion

Let $G$ be a (countable) residually finite group whose profinite completion is topologically finitely generated. Must $G$ be finitely generated?

• Wouldn't $\hat{\mathbb{Z}}$ be a counterexample? Or am I missing something? – Donu Arapura May 10 '15 at 16:58
• @DonuArapura my fault. Edited. – Pablo May 10 '15 at 17:01
• Isn't $\mathbb{Z}_{(p)}$ still a counterexample? – Johannes Hahn May 10 '15 at 17:39
• @DonuArapura: yes it works (that subgroups of finite index in $\hat{\mathbf{Z}}$ can be checked by hand without any fancy theorem. By Nikolov-Segal (and Serre in the pro-$p$-case), any infinite topologically finitely generated profinite group also works. Of course it provides no countable example, but very simple countable examples have been pointed out as well. – YCor May 10 '15 at 20:55

No. Take $G=\oplus_{p} C_p$, where the sum is over all primes $p$ and $C_p$ is the cyclic groups of order $p$. Then $G$ is clearly locally finite and infinite and therefore not finitely generated. However, it is easy to see that the profinite completion of $G$ is $\Pi_p C_p$ which is a cyclic profinite group.