Solution (source code)

= Solution

A <topological group module> $A$ is a topological <abelian group> with a jointly continuous action of $G$ by <group automorphisms>. Its <continuous cochains with topological coefficients> are
$$
C^0(G,A)=A,\qquad C^n(G,A)=\operatorname{Cont}(G^n,A)\quad(n\geq1),
$$
with pointwise addition. The inhomogeneous differential is
$$
\begin{aligned}
(dc)(g_1,\ldots,g_{n+1})={}&g_1c(g_2,\ldots,g_{n+1})\\
&+\sum_{i=1}^n(-1)^ic(g_1,\ldots,g_ig_{i+1},\ldots,g_{n+1})\\
&+(-1)^{n+1}c(g_1,\ldots,g_n).
\end{aligned}
$$
For $n=0$, this means $(da)(g)=ga-a$. Continuity of multiplication and of the action ensures that $d$ preserves continuous cochains. Expanding $d(dc)$ gives cancellation in pairs: the two orders of multiplying neighbouring arguments agree by associativity, and the two ways of applying the action agree by its action law. Thus $d^2=0$. The <cocycles> are $Z^n=\ker(d:C^n\to C^{n+1})$ and the <coboundaries> are $B^n=\operatorname{im}(d:C^{n-1}\to C^n)$, with $B^0=0$. Define
$$
\boxed{H^n(G,A)=Z^n(G,A)/B^n(G,A).}
$$
For general topological coefficients this is an algebraic quotient of the continuous cochains; its optional quotient <topology> need not be Hausdorff. For discrete coefficients it is the usual <continuous cohomology of a profinite group>. In degree zero it is the subgroup of invariant elements.

Give the discrete <prime field> $\mathbb F_p$ its trivial $G$-action. The one-cocycle condition becomes $c(gh)=c(g)+c(h)$ and every one-coboundary is zero. Hence
$$
H^1(G,\mathbb F_p)=\operatorname{Hom}_{\mathrm{cont}}(G,\mathbb F_p)
=\operatorname{Hom}_{\mathrm{cont}}(G/\Phi(G),\mathbb F_p).
$$
Every such <group homomorphism> kills powers and <group commutators>, hence their <closure> $\Phi(G)$, and every continuous functional on the quotient pulls back. If $G$ is topologically finitely generated, $V=G/\Phi(G)$ is a finite <elementary abelian group>. To verify finiteness without assuming it, the <closure> of a subgroup generated by $r$ elements of this abelian exponent-$p$ quotient has at most $p^r$ elements; a finite subgroup is already closed. Thus $V$ is a finite-dimensional <vector space>. Question 2 says that a generating family of $G$ is minimal precisely when its images give a basis of $V$. The <dual space> has the same finite dimension. This proves
$$
\boxed{d(G)=\dim_{\mathbb F_p}H^1(G,\mathbb F_p)\quad\text{for finitely generated }G.}
$$

There is a genuine missing hypothesis if the printed assertion is read for arbitrary <pro-p groups> and $d(G)$ means the least cardinality of any dense generating family. Here is an explicit <infinite-rank failure of the first-cohomology generator formula>. Let $I=\{0,1\}^{\mathbb N}$ and $G=\prod_{r\in I}\mathbb F_p$. Enumerate the finite binary strings as $s_1,s_2,\ldots$ and define $g_n(r)=1$ if $s_n$ is a prefix of $r$, and $0$ otherwise. For finitely many distinct sequences $r_1,\ldots,r_k$, choose long enough prefixes to distinguish each individually. The corresponding $g_n$ project onto the coordinate unit vectors of $\mathbb F_p^k$, so $\langle g_n:n\geq1\rangle$ surjects onto every finite coordinate projection and is dense in the <product topology>. No finite family can generate densely, since a finitely generated abelian exponent-$p$ subgroup is finite and closed. Thus $d(G)=\aleph_0$. On the other hand, continuity of a linear functional to $\mathbb F_p$ means its kernel contains a basic neighbourhood, so it depends on finitely many coordinates. The coordinate projections are consequently a basis of the continuous <dual space>, giving
$$
\dim_{\mathbb F_p}H^1(G,\mathbb F_p)=|I|=2^{\aleph_0}>\aleph_0.
$$
\b[The unrestricted infinite-rank formula is false.] A convention requiring a generating basis tending to the identity is different from the printed unrestricted topological generator count; the finite-rank identity proved above has no such ambiguity.

For finite $X$, a <free pro-p group> $F_p(X)$ is characterized by the <universal property> that every map $X\to P$ to a <pro-p group> extends uniquely to a continuous <group homomorphism> $F_p(X)\to P$. It is the <pro-p completion> of the abstract <free group> on $X$: each map to a finite $p$-group factors through one of the defining finite quotients, and passing to the <inverse limit> gives the extension to any <pro-p group>; uniqueness follows from density. This unrestricted universal property can also define the completion on an arbitrary set $X$. When using an infinite basis required to tend to the identity, one instead imposes the universal property only for maps tending to the identity. Only the finite-rank version is needed for the following argument.

A <finite pro-p presentation> is an isomorphism
$$
G\cong F_p(x_1,\ldots,x_a)/\overline{\langle R_1,\ldots,R_t\rangle^{F_p}}.
$$
There are finitely many generators and finitely many relators, and the denominator is their closed <normal closure>. The relators are elements of the <free pro-p group>; they may be limits of ordinary words. That distinction is important when writing conjugation relations below.

Now suppose $K\trianglelefteq_oG$ has a <finite pro-p presentation> with generators $k_1,\ldots,k_a$ and relators $R_1,\ldots,R_t$. The quotient $Q=G/K$ is a <finite p-group>. Choose a finite <finite pro-p presentation> $Q=\langle\bar y_1,\ldots,\bar y_b\mid S_1,\ldots,S_c\rangle$. Such a presentation exists, for example by using its entire finite multiplication table. Lift the quotient generators to $y_j\in G$. For every $i,j$, choose elements $W_{ij},V_{ij}$ of the <free pro-p group> on the $x_i$ that map respectively to $y_j^{-1}k_iy_j$ and $y_jk_iy_j^{-1}$ in $K$. Choose $U_\ell(x)$ mapping to $S_\ell(y)$, which lies in $K$. Form the finite <finite pro-p presentation>
$$
\begin{aligned}
P=\langle x_1,\ldots,x_a,y_1,\ldots,y_b\mid{}&R_h(x)=1,\\
&y_j^{-1}x_iy_j=W_{ij}(x),\quad y_jx_iy_j^{-1}=V_{ij}(x),\\
&S_\ell(y)=U_\ell(x)\rangle_{\mathrm{pro}\text{-}p}.
\end{aligned}
$$
All listed relations hold in $G$, giving a continuous surjective <group homomorphism> $P\to G$: its compact image contains $K$ and maps onto $Q$.

Let $X$ be the closed <subgroup> of $P$ topologically generated by the $x_i$. Both conjugation directions were included, so each $y_j$ normalizes $X$. The $x_i$ also normalize it, and its closed normalizer contains the generators of $P$. Thus $X\trianglelefteq P$. The relations $R_h$ give a continuous surjection $K\to X$. Its composite with $X\to K$ induced by $P\to G$ fixes every $k_i$, and hence is the identity. Therefore the surjection $K\to X$ is injective as well, so $X\cong K$. On quotienting by $X$, the conjugation and kernel relations disappear, and the remaining presentation is exactly $\langle y_1,\ldots,y_b\mid S_1,\ldots,S_c\rangle_{\mathrm{pro}\text{-}p}=Q$. Thus $P/X\to G/K$ is an isomorphism. The kernel of $P\to G$ lies in $X$ and meets $X$ trivially, so is trivial. Consequently $P\cong G$, proving
$$
\boxed{K\trianglelefteq_oG\text{ finitely presented}\quad\Longrightarrow\quad G\text{ finitely presented}.}
$$