\documentclass[a4paper]{article}

\def\npart{III}

\def\ntitle{Profinite Groups}
\def\nlecturer{G.\ R.\ Wilkes}

\def\nterm{Lent}
\def\nyear{2020}

\input{header}

\renewcommand{\c}[1]{\mathbf{#1}} % category
\DeclareMathOperator{\Mat}{Mat} % matrix group

\begin{document}

\input{titlepage}

\tableofcontents

\setcounter{section}{-1}

\section{Introduction}

Question: how can we tell when two objects are different? This is in general a difficult question and to answer it we need a variety of techniques.

\begin{itemize}
\item \(\N \cong \Q\) is easier thatn \(\Q \ncong \R\).
\item To show two finite dimensional vector spaces are not isomorphic we can compute their dimensions.
\item For simplicial complexes, we can compute that homology groups \(H_n(X)\). Note that this is a partial invariant, in contrast to dimensiona which is a complete invariant for finite dimensional spaces.
\item We can also consider \(\pi_1(X)\). However in contrast to \(H_1(X)\), \(\pi_1(X)\) is not necessarily abelian. The Adian-Rabin theorem says that there can be no algorithm which decides if a finitely presented group is trivial or not. Can we build algorithm which sometimes work? We can solve the problem for finite groups. For infinite groups we can build upon this idea. We can write out the lists of finite quotiesnts of two groups \(G_1\) and \(G_2\) and compare them. The question: when does this work?

  Before we answer this question, note that a list of quotient groups is a very unpleasant object. Instead, we can combine this list into a single ``limiting'' object, called the profinite completion. This technique works in other situations:
  \begin{itemize}
  \item \(p\)-adic integers \(\Z_p\) being the ``limit'' of \(\Z/p^n\Z\),
  \item Galois theory: let
    \begin{align*}
      K &= \Q(n\text{th root of unit for all } n) \\
      K_N &= \Q(n\text{th root of unit for } n \leq N)
    \end{align*}
    Then \(K = \bigcup K_N\) and is a Galois extension over \(\Q\) so we can consider \(\gal(K/\Q)\), which is the ``limit'' of \(\gal(K_n/\Q)\).
  \item étale fundamental groups in algebraic geometry.
  \end{itemize}
\end{itemize}

Aside from profinite groups, we will also study group cohomolgy in this course. It is another invariant of groups. This is related to the homology of a simplicial complex and gives abelian invariants. Among other things, it tells if a group is free. It answers the question: given a group \(G\) and an abelian group \(A\), how many groups \(E\) exists such that \(A \normal E\) and \(E/A \cong G\)?

\section{Inverse limits}

\subsection{Categories \& Limits}

Recap on categories and limits. Refer to III Category Theory.

\subsection{Inverse limits and profinite groups}

\begin{definition}[profinite completion]\index{profinite completion}
  Let \(G\) be a group. Let \(\c N\) be the category whose objects are finite index normal subgroups \(N \normal_f G\) and with an arrow \(N_1 \to N_2\) if and only if \(N_1 \subseteq N_2\). This is a poset category.

  The assignment
  \begin{align*}
    N &\mapsto G/N \\
    (N_1 \to N_2) &\mapsto (G/N_1 \to G/N_2)
  \end{align*}
  is a functor \(\c N \to \c{Grp}\).

  The limit of this diagram is a group called the \emph{profinite completion} \(\hat G\) of \(G\).
\end{definition}

\begin{notation}
  \(\hat G\) is equipped with homomorphisms making the following diagram commutes:
  \[
    \begin{tikzcd}
      \hat G \ar[d] \ar[dr] \\
      G/N_1 \ar[r] & G/N_2
    \end{tikzcd}
  \]
  In this course we refer to them as \emph{projection maps} and the horizontal map as \emph{transition map}. In addition, we have a \emph{canonical map} \(i: G \to \hat G\) which exists by the definition of limit.
\end{notation}

We haven't shown profinite completion exists. We will prove it shortly in a more general context, by showing that it is an exmaple of a particular kind of, in some sense well-behaved, limit.

\begin{definition}[inverse system]\index{inverse system}
  A poset \((J, \preceq)\) is called an \emph{inverse system} if for all \(i, j \in J\) exists \(k \in J\) such that \(k \preceq i\) and \(k \preceq j\).
\end{definition}

\begin{eg}
  In \(\c{N}\), \(N_1 \cap N_2\) is a subgroup of both \(N_1\) and \(N_2\).
\end{eg}

\begin{definition}[inverse system, inverse limit]\index{inverse system}\index{inverse limit}
  An \emph{inverse system} (of groups, sets etc) is a functor \(\c J \to \c C\) where \(\c J\) is the poset category corresponding to an inverse system.

  If \(F: \c J \to \c{Grp}\) is an inverse system, the limit of \(F\) is called the \emph{inverse limit} of the objects \(F(j)\).
\end{definition}

Since this is the central subject of this course, we spell out this definition explicitly

\begin{definition}
  An \emph{inverse system of groups}, indexed over an inverse system \((J, \preceq)\), consists of
  \begin{itemize}
  \item a group \(G_j\) for all \(j \in J\),
  \item for all \(i \preceq j\), a transition map \(\phi_{ij}: G_i \to G_j\) such that \(\phi_{ii} = \id_{G_i}, \phi_{jk} \compose \phi_{ij} = \phi_{ik}\).
  \end{itemize}
  The \emph{inverse limit of the system} \((G_j)_{j \in J}\) is a group \(\varprojlim_{j \in J} G_j\) with projection maps \(p_j: \varprojlim G_j \to G_j\) such that \(\phi_{ij} \compose p_i = p_j\) and such that for any \(Z\) with \(q_j: Z\to G_j\), a map \(q: Z \to \varprojlim G_j\) such that \(p_j \compose q = q_j\).
\end{definition}

\begin{definition}[profinite group]\index{profinite group}
  A \emph{profinite group} is the inverse limit of an inverse system of finite groups.
\end{definition}

\begin{eg}\leavevmode
  \begin{enumerate}
  \item The profinite completion of a group \(G\) is a profinite group.
  \item \(\Z_p\), the \(p\)-adic integers, is \(\varprojlim \Z/p^n\Z\).
  \end{enumerate}
\end{eg}

\begin{proposition}
  Let \((G_j)_{j \in J}\) be an inverse system of groups indexed by an inverse system \(J\). \(\varprojlim G_j\) exists and is equal to
  \[
    L = \{ (g_j)_{j \in J} \in \prod_{j \in J} G_j: \varphi_{ij} (g_i) = g_j \}.
  \]
\end{proposition}

\begin{proof}
  Let \(p_j: L \to G_j\) be the restriction of the projection \(\prod G_j \to G_j\). Then \(\varphi_{ij} \compose p_i = p_j\). Now let \(q_j: Z \to G_j\) be a cone. There is a unique map \(f: Z \to \prod G_j\) such that \(p_j \compose f = q_j\) and \(f(Z) \subseteq L\).
\end{proof}

Note that we do not use any properties of inverse system or posets. The construction works equally well for sets (except that the resulting inverse limit is not a group). We will see that the finiteness and inverse system requirement ensures that the construction gives a nonempty set. To do so we need to bring in topology.

\subsection{Topology on a profinite group/set}

Give each finite group \(G_j\) in an inverse system the discrete topology. Then give \(\prod G_j\) the product topology and \(\varprojlim G_j \subseteq \prod G_j\) the subspace topology. \(\prod G_j\) is Hausdorff and compact (Tychonoff). It follows that \(\varprojlim G_j\) is Hausdorff. Since the conditions defining the subgroup are closed conditions, it is also compact.

\begin{proposition}
  If \((X_j)_{j \in J}\) is an inverse system of nonempty finite sets then \(\varprojlim X_j \ne \emptyset\).
\end{proposition}

\begin{proof}
  Consider the set
  \[
    Y_I = \{(x_j) \in \prod X_J: \phi_{ij}(x_i) = x_j \text{ for all } i, j \in I\}
  \]
  where \(I \subseteq J\). The \(Y_I\)'s are closed and \(\bigcup_{I \text{ finite}} Y_I = \varprojlim X_j\).

  To show for \(I\) finite, \(Y_I \ne \emptyset\), by definition of inverse system exists \(k \in J\)  such that \(k \leq i\) for all \(i \in I\). Now \(X_k\) is nonempty so exists \(x_k \in X_K\). For \(i \in J\), set \(X = \varphi_{ki}(x_k)\). For \(j \notin I\), set \(x_j\) to be arbitrary. Then this gives a sequence \((x_i) \in Y_I\).

  Now use finite intersection property: suppose \(I_1, \dots, I_m\) are are finite, then
  \[
    Y_{I_1} \cap \cdots \cap Y_{I_m} \supseteq Y_{I_1 \cup \cdots \cup I_m} \ne \emptyset
  \]
  so \(\varprojlim X_j = \bigcup_{I \subseteq J \text{ finite}} Y_I \ne \emptyset\).
\end{proof}

It is perhaps psychologically comforting to point out that the topology on a profinite group is metrisable, thanks to

\begin{proposition}
  If \((X_i)\) is a countable family of metric spaces then \(\prod X_i\) is a metric space.
\end{proposition}

\begin{proof}
  IB Metric and Topological Spaces.
\end{proof}

In applications to profinite completions this is often implied by

\begin{proposition}
  If \(G\) is a finitely generated group then it has only countably many finite index normal subgroups.
\end{proposition}

\begin{proof}
  Every finite index normal subgroup arises as the kernel of some homomorphism \(G \to S_n\). For a fixed \(n\) the homomorphism is determined by the image of the generators of \(G\), so finitely many.
\end{proof}

\begin{proposition}
  Let \(G\) be a profinite group. Then multiplication \(\mu: G \times G \to G\) and inversion \(i: G \to G\) are continuous maps.
\end{proposition}

\begin{proof}
  Example sheet 1.
\end{proof}

Thus \(G\) is a \emph{topological group}\index{topological group}.

\begin{definition}
  An \emph{isomorphism of topological groups} is an isomorphism \(f: G \to H\) which is also a homeomorphism.
\end{definition}

From now on we only consider homomorphism between profinite groups which are continuous.

\begin{lemma}
  Let \(H\) be a topological group and let \(G = \varprojlim G_j\) be an inverse limit of finite groups with projections \(p_j: G \to G_j\). Then a homomorphism \(f: H \to G\) is continuous if and only if \(p_j \compose f: H \to G_j\) is continuous, if and only if \(\ker(p_j \compose f)\) is an open subgroups of \(H\).
\end{lemma}

\begin{proof}
  The first iff is by definition of the product topology on \(\prod G_j\). For the second, let \(f_j = p_j \compose f\). If \(f_j: H \to G_j\) is continuous then \(\ker f_j = f_j^{-1}(1)\) is open. Conversely, if \(\ker f_j\) is open then \(f_j^{-1}(g_j) = h \cdot \ker(f_j)\), where \(h \in f_j^{-1}(g_j)\) if nonempty, is open for all \(g_j \in G_j\). Thus \(f_j^{-1}(U)\) is open for all \(U \subseteq G_j\).
\end{proof}

\begin{proposition}
  Let \(G\) be a compact topological group. Then a subgroup \(U \subseteq G\) is open if and only if it is closed and has finite index.
\end{proposition}

\begin{proof}
  Example sheet 1.
\end{proof}

\begin{proposition}
  Let \(G = \varprojlim G_j\) be an inverse system of finite groups. Then the open subgroups \(U_j = \ker p_j\) form a basis of open neighbourhoods of the identity.
\end{proposition}

\begin{proof}
  Let \(V \ni 1\) be open. By definition of the product topology, \(V\) contains a basic open set of the form \(p_{j_1}^{-1}(X_{j_1}) \cap \cdots \cap p_{j_m}^{-1}(X_{j_m}) \ni 1\), where \(X_{j_i} \subseteq G_{j_i}\) open. Then \(1 \in X_{j_i} \subseteq G_{j_i}\) so by shrinking wlog \(X_{j_i} = \{1\}\). Thus \(1 \in \ker p_{j_1} \cap \cdots \cap \ker p_{j_m}\). Now can find \(k \in J\) such that \(k \leq j_i\) for all \(i\). Then \(1 \in U_k \subseteq \ker p_{j_1} \cap \cdots \cap \ker p_{j_m} \subseteq V\).
\end{proof}

\begin{corollary}
  A basis of open sets in \(G\) is \(\{p_j^{-1}(g_j): j \in J, g_j \in G_j\}\).
\end{corollary}

\begin{corollary}
  Let \(X \subseteq G = \varprojlim G_j\) be a subset. Then \(X\) is dense in \(G\) if and only if \(p_j(X) = p_j(X)\).
\end{corollary}

\begin{proof}
  If \(X\) is not dense then exist nonempty open set \(U\) such that \(U \cap X = \emptyset\). wlog \(U = p_j^{-1}(g_j)\). Then \(g_j \in p_j(G) \setminus p_j(X)\). Similarly if \(X\) is dense and \(U\) is nonempty open, wlog \(U = p_j^{-1}(g_j)\), then \(g_j \in p_j(G) = p_j(X)\) so \(X \cap U \ne \emptyset\).
\end{proof}

\begin{proposition}
  Let \((G_j)\) be an inverse system of finite groups and \(G = \varprojlim G_j\). Let \(X \subseteq G\) be a subset. Then \(\overline X = \varprojlim X_j\) where \(X_j = p_j(X)\).
\end{proposition}

\begin{proof}
  Let
  \begin{align*}
    X'
    &= \varprojlim X_j
    = \{(g_i) \in \prod G_j: g_j \in X_j \text{ for all } j, \phi_{ij}(g_i) = g_j\} \\
    &= \bigcap p_j^{-1}(X_j) \\
    &= \bigcap p_j^{-1}(p_j(X))
  \end{align*}
  which is closed. \(X \subseteq X'\) so \(\overline X \subseteq X'\). Let \(g \in G \setminus \overline X\). Then exists a basic open set \(p_j^{-1}(g_j) \subseteq G \setminus \overline X\). Hence \(\overline X \cap p_j^{-1}(g_j) = \emptyset\), so \(g_j \notin X_j\), so \(g \notin X'\).
\end{proof}

\begin{corollary}
  \(X\) is closed if and only if \(X = \varprojlim X_j\).
\end{corollary}

Along the same line

\begin{proposition}
  Let \(G\) be a profinite group. Then
  \[
    \overline X = \bigcap_{N \normal_o G} XN.
  \]
\end{proposition}

\begin{proof}
  Since \(\ker p_j\) form a neighbourhood basis of the identity,
  \[
    \overline X = \bigcap p_j^{-1}(p_j(X)) = \bigcap X \cdot \ker p_j \subseteq \bigcap_{N \normal_o G} XN.
  \]
  Conversely if \(g \notin \overline X\) then can find a neighbourhood \(p_j^{-1}(g_j)\) of \(g\) that is disjoint from \(X\). Then \(g \notin X \cdot \ker p_j\).
\end{proof}

\begin{eg}
  If \(\Gamma\) is an abstract group, \(\hat \Gamma\) its profinite completion with \(i: \Gamma \to \hat \Gamma\) then \(p_j(i(\Gamma)) = \Gamma/N_j = p_j(\hat \Gamma)\), so \(i(\Gamma)\) is dense in \(\hat \Gamma\).
\end{eg}

\subsection{Change of inverse system}

\subsubsection{Surjective inverse system}

Let \((G_j)_{j \in J}\) be an inverse system with transition funcitons \(\varphi_{ij}\) and projections \(p_j\).

\begin{definition}[surjective inverse system]\index{inverse system!surjective}
  An inverse system is \emph{surjective} if the transition maps \(\varphi_{ij}\) are all surjective.
\end{definition}

\begin{proposition}
  Let \((X_j)\) be a surjective inverse system of nonempty finite sets. Then all projections \(p_j: \varprojlim X_j \to X_j\) are surjective.
\end{proposition}

\begin{proof}
  Example sheet 1.
\end{proof}

\begin{proposition}
  Let \((X_j)\) be an inverse system of finite sets. Then there exists a surjective inverse system with the same inverse limit.
\end{proposition}

\begin{proof}
  Recall that
  \[
    \varprojlim X_j = \left\{ (x_j) \in \prod X_j: \varphi_{ij}(x_i) = x_j \right\}.
  \]
  Define \(Y_j = p_j(\varprojlim X_j)\). Then \(Y_j\) with transition maps \(\varphi_{ij}|_{Y_i}\) form an inverse system: if \(y_i \in Y_i\) then \(\varphi_{ij}(y_i) \in Y_J\). Then \(\varprojlim Y_j = \varprojlim X_j\), and this is a surjective inverse system.
\end{proof}

\subsubsection{Cofinal subsystems}

\begin{definition}[cofinal]\index{cofinal inverse system}\index{inverse system!cofinal}
  If \(J\) is an inverse system, \(I \subseteq J\) is \emph{cofinal} if for all \(j \in J\) exists \(i \in I\) such that \(i \leq j\).
\end{definition}
Therefore \(I\) is also an inverse system.

\begin{eg}\leavevmode
  \begin{enumerate}
  \item In the system of finite index subgroups of \(\Z\), one cofinal system is \(\{n! \Z\}\).
  \item If \(k \in J\), then \(J_{\leq k} = \{j \in J: j \leq k\}\) is a \emph{principal cofinal system}.
  \item A cofinal system of \(\N^{\text{op}}\) is the same as an increasing sequence of integers.
  \end{enumerate}
\end{eg}

\begin{definition}[linearly ordered inverse system]\index{inverse system!linearly ordered}
  An inverse system is \emph{linearly ordered} if it is isomorphic to a subset of \(\N^{\text{op}}\).
\end{definition}

\begin{proposition}
  Let \(J\) be a countable inverse system with no initial element. Then \(J\) has a linearly ordered cofinal system.
\end{proposition}

\begin{proof}
  Example sheet 1.
\end{proof}

\begin{proposition}
  Let \((X_j)\) be an inverse system of (finite) sets. Let \(I \subseteq J\) be a cofinal system. Then \(\varprojlim_{j \in J} X_j \cong \varprojlim_{i \in I} X_i\).
\end{proposition}

\begin{proof}
  We prove the proposition for profinite groups. Let \(G = \varprojlim_{j \in J} G_j, H = \varprojlim_{i \in I} G_i\). The map \(\prod G_j \to \prod G_i\) is a continuous homomorphism and restricts to a map \(f: G \to H\). Remains to check this is a bijection. Suppose \((g_j) \in \ker f\), then \(p_i(g) = g_i = 1\) for all \(i \in I\). For every \(j \in J\) exists \(i \in I\) such that \(i \leq j\) so \(g_j = \varphi_{ij}(g_i) = 1\). Thus \((g_j) = 1\). For surjectivity, let \((g_i) \in H\). For \(j \notin I\), let \(i \in I\) be such that \(i \leq j\) and set \(g_j = \varphi_{ij}(g_i)\). It is well-defined and \((g_j) \in G\).
\end{proof}

\section{Profinite groups}

\subsection{\(\Z_p\), the \(p\)-adic integers}

Let \(p\) be a prime. Consider the inverse system
\[
  \begin{tikzcd}
    \cdots \ar[r] & \Z/p^n \ar[r] & \cdots \ar[r] & \Z/p^2 \ar[r] & \Z/p \ar[r] & 1
  \end{tikzcd}
\]
of finite rings. The inverse limit is the profinite ring \emph{\(p\)-adic integers}\index{\(p\)-adic integer}
\[
  \Z_p = \varprojlim \Z/p^n.
\]
An element \(\alpha \in \Z_p\) is a sequence \((a_n)\) of elements of \(\Z/p^n\) such that \(a_n = a_m \bmod{p^n}\) if \(n \geq m\), where \(a_n = \alpha \pmod{p^n} = p_n(a)\).

Addition and multiplication are done component-wise. One way to get such \(\alpha\) is to take \(a \in \Z\) and let \(a_n\) be reductions mod \(p^n\) of \(a\). This gives \(\iota: \Z \to \Z_p\).

\begin{definition}[pro-\(p\) group, pro-\(p\) completion]\index{pro-\(p\) group}\index{pro-\(p\) completion}
  A \emph{pro-\(p\) group} is an inverse limit of \(p\)-groups.

  The \emph{pro-\(p\) completion} of \(\Gamma\) is
  \[
    \hat \Gamma_{(p)} = \varprojlim_{\substack{N \normal \Gamma \\ \Gamma/N \text{ a \(p\)-group}}} \Gamma/N.
  \]
\end{definition}

Therefore \(\Z_p = \hat \Z_{(p)}\). Usually we suppress \(\iota\) and regard \(\Z \subseteq \Z_p\).

There is a natural metric on \(\Z_p\): let \(\alpha = (a_n), \beta = (b_n)\). If \(\alpha = \beta\) then \(d(\alpha, \beta) = 0\). Otherwise let \(n\) be the smallest integer such that \(a_n \ne b_n\) and set \(d(\alpha, \beta) = p^{-n}\). The restriction of this metric to \(\Z\) is the ``\(p\)-adic metric'' on \(\Z\).

The open ball is
\begin{align*}
  B(0, r)
  &= \{(a_n): a_m = 0 \text{ for } p^{-m} \geq r\} \\
  &= \{(a_n): a_m = 0 \text{ for } m \leq -\log_p r\} \\
  &= \ker(\Z_p \to \Z/p^{\floor{-\log_p r}})
\end{align*}
which is an open subgroup of \(\Z_p\).

\begin{proposition}
  \(\Z_p\) is abelian and torsion-free.
\end{proposition}

\begin{proof}
  Abelian is obvious. For torsion-free, let \(\alpha = (a_n) \in \Z_p\) with \(\alpha \ne 0\) and \(m\alpha = 0\) for some \(m > 0\). Write \(m = p^rs\) where \(s\) is coprime to \(p\). As \(\alpha \ne 0\), exists \(n\) such that \(\alpha \ne 0 \pmod{p^n}\), i.e.\ \(a_n \ne 0 \in \Z/p^n\). As \(m \ne 0\), \(s \ne 0\). Now consider \(ma \pmod{p^{n + r}}\). Claim this is nonzero: if \(p^{n + r} \divides ma_{n + r}\) then \(p^n \divides  a_{n + r}\), hence \(a_{n + r} = 0 \pmod{p^n} = a_n \pmod{p^n}\).
\end{proof}

\begin{proposition}
  The ring \(\Z_p\) is an integral domain.
\end{proposition}

\begin{proof}
  Example sheet 1.
\end{proof}

\subsection{The profinite integers \(\hat \Z\)}

\begin{proposition}
  \(\hat \Z\) is abelian and torsion-free.
\end{proposition}

\begin{proposition}
  \(\hat \Z\) has zero divisors.
\end{proposition}

Both follow from

\begin{theorem}[Chinese remainder theorem]
  There is an isomorphism of topological rings
  \[
    \hat \Z \cong \prod_{p \textup{ prime}} \Z_p.
  \]
\end{theorem}

\begin{proof}
  There is a continuous homomorphism \(\hat \Z \to \Z_p\) for every \(p\) as
  \[
    \begin{tikzcd}
      \hat \Z \ar[d] \ar[dr] \\
      \Z/p^n \ar[r] & \Z/p^m
    \end{tikzcd}
  \]
  We thus have a continuous homomorphism \(f: \hat \Z \to \prod_{p \text{ prime}} \Z_p\).

  \(f\) is surjective if and only if \(\im f \subseteq \prod \Z_p\) is dense, if and only if \(\im f\) intersects all basic open sets of \(\prod \Z_p\) non-trivially. A basic open set has the form \(\phi^{-1}(x_1, \dots, x_r)\) where \(\phi: \prod \Z_p \to \Z/p_1^{n_1} \times \dots \times \Z/p_r^{n_r}\). Now invoke the classical Chinese remainder theorem: let \(m = p_1^{n_1} \cdots p_r^{n_r}\), then we have a commutative diagram
  \[
    \begin{tikzcd}
      \hat \Z \ar[r, "f"] \ar[d, two heads] & \prod \Z_p \ar[d, "\phi"] \\
      \Z/m \ar[r, "\cong"] & \Z/p_1^{n_1} \times \cdots \times \Z/p_r^{n_r}
    \end{tikzcd}
  \]
  As \((x_1, \dots, x_r) \in \im (\phi \compose f)\), have \(\im f \cap \phi^{-1}(x_1, \dots, x_r) \ne \emptyset\).

  Now suppose \(g \in \hat \Z \setminus \{0\}\). Then exists \(m\) such that the image of \(g\) in \(\hat \Z \to \Z/m\) is nonzero. Now use injectivity of the isomorphism to conclude \(f\) must be injective.
\end{proof}

\subsection{Profinite matrix group}

If \(R\) is a commutative ring with 1 then there is a matrix ring \(\Mat_n(R)\) of \(n \times n\) matrices whose entries are in \(R\). In particular
\begin{align*}
  \Mat_n(\Z_p) &\cong \varprojlim \Mat_n(\Z/p^m) \\
  \Mat_n(\hat \Z) &\cong \varprojlim \Mat_n(\Z/m)
\end{align*}
for similar argument as above.

Define
\begin{align*}
  \SL_n(R) &= \{A \in \Mat_n(R): \det A = 1\} \\
  \GL_n(R) &= \{A \in \Mat_n(R): \det A \in R^\times\}
\end{align*}
As \(\det: \Mat_n(\Z_p) \to \Z_p\) is a polynomial so continuous, \(\SL_n(\Z_p) \subseteq \Mat_n(\Z_p)\) is a closed subset and is a group under multiplication. We will show in example sheet that \(\Z_p^\times\) and \(\hat \Z^\times\) are closed subsets of \(\Z_p\) and \(\hat \Z\), and in fact they are isomorphic to \(\varprojlim (\Z/p^m)^\times\) and \(\varprojlim (\Z/m)^\times\). We have
\[
  \SL_n(\Z_p) = \varprojlim \SL_n(\Z/p^m)
\]
etc. A version of Chinese remainder theorem also holds.

Problem: consider the inclusion \(\SL_n(\Z) \subseteq \SL_n(\hat \Z)\). How does this inclusion look like? For example, is this inclusion dense? (the answer is yes, see example sheet 2). We know from general theory this holds if and only if \(\SL_n(\Z) \to \SL_n(\Z/m)\) is surjecitve. But this is not obvious at all. For example how can we find an element that is mapped to \(
\begin{psmallmatrix}
  7 & 9 \\
  4 & 9
\end{psmallmatrix}
\in \SL_2(\Z/13)\)?

Another question: do we have \(\SL_n(\hat \Z) = \widehat{\SL_n(\Z)}\), i.e.\ does \(\SL_n(\Z)\) have any other finite quotients other than \(\SL_n(\Z/m)\)? The answer is no for  \(n = 2\) (example sheet 2), and yes for \(n \geq 3\) (hard theorem of Bass-Lazard-Serre).

\subsection{Subgroups, quotients and homomorphisms}

A reminder that we are working in the category of topological groups so subgroups are closed and homomorphisms are continuous (non-closed subgroup can be pretty wild: \(\hat \Z \supseteq \prod \Z_p \supseteq \prod \Z\)).

\begin{proposition}
  A closed subgroup of a profinite group is a profinite group.
\end{proposition}

\begin{proposition}
  Let \(G = \varprojlim G_j\) be a profinite group of a surjective inverse system, \(H \leq G\) a closed subgroup. Let \(H_j = p_j(H)\). Then \(H\) has finite index (i.e.\ open) if and only if \([G_j: H_j]\) is constant for \(j \in I\) for some cofinal subsystem \(I \subseteq J\), in which case \([G: H] = [G_j: H_j]\) for \(j \in I\).
\end{proposition}

\begin{proof}
  Exercise.
\end{proof}

\begin{proposition}
  Let \(G\) be a profinite group and \(N \normal_c G\). Then \(G/N\) equipped with the quotient topology is a profinite group.
\end{proposition}

\begin{proof}
  Let \(G = \varprojlim G_j\) be a surjective inverse system. Define \(N_j = p_j(N)\). Then \(N_j \normal G_j\) and define \(Q_j = G_j/N_j\). Exists \(\psi_{ij}\) such that the following diagram commutes:
  \[
    \begin{tikzcd}
      G_i \ar[r, "\phi_{ij}"] \ar[d] & G_j \ar[d] \\
      G_i/N_i \ar[r, "\psi_{ij}"] & G_j/N_j
    \end{tikzcd}
  \]
  Check that \((Q_j, \psi_{ij})\) is an inverse system. Let \(Q = \varprojlim Q_j\). There exists a continuous map \(\prod G_j \to \prod Q_j\) restricting to \(f: G \to Q\). \((g_j) \in \ker f\) if and only if \(g_j \in \ker (G_j \to Q_j) = N_j\) for all \(j\), if and only if \(g \in N\). Thus \(\ker f = N\). By first isomorphism theorem for groups, exists group isomorphism \(\overline f: G/N \to Q\) making the diagram commute
  \[
    \begin{tikzcd}
      G \ar[r, "f"] \ar[d] & Q \\
      G/N \ar[ur, "\overline f"', dashed]
    \end{tikzcd}
  \]
  \(\overline f\) is continuous by definition of quotient topology. \(\overline f\) is a homeomorphism because \(G/N\) is compact and \(Q\) is Hausdorff.
\end{proof}

\begin{theorem}[first isomorphism theorem for profinite groups]
  If \(G\) and \(Q\) are profinite groups, \(f: G \to Q\) is a continuous surjective homomorphism, then exists an isomorphism of topological groups \(\overline f: G/\ker f \to Q\) making the following diagram commute
  \[
    \begin{tikzcd}
      G \ar[r, "f"] \ar[d] & Q \\
      G/\ker f \ar[ur, "\overline f"', dashed]
    \end{tikzcd}
  \]
\end{theorem}

\begin{corollary}
  A (closed) quotient of a profinite group is a profinite group when given the quotient topology.
\end{corollary}

\begin{definition}[morphism of inverse system]\index{inverse system!morphism}
  Let \((G_j)\) and \((H_j)\) be inverse system of finite groups, indexed over the same poset \(J\). A \emph{morphism of inverse system} is a family of group homomorphisms \(f_j: G_j \to H_j\) such that for all \(i \leq j\), the following diagram commutes
  \[
    \begin{tikzcd}
      G_i \ar[r, "f_i"] \ar[d, "\varphi_{ij}^G"] & H_j \ar[d, "\varphi_{ij}^H"] \\
      G_j \ar[r, "f_j"] & H_j
    \end{tikzcd}
  \]
\end{definition}

\begin{proposition}
  Given a morphism of inverse systems as above, exists a unique continuous homomorphism \(f: G \to H\) such that
  \[
    \begin{tikzcd}
      G \ar[r, "f"] \ar[d, "p_j^G"] & H \ar[d, "p_j^H"] \\
      G_j \ar[r, "f_j"] & H_j
    \end{tikzcd}
  \]
  commutes for all \(j\).
\end{proposition}

\begin{proof}
  Exercise.
\end{proof}

\begin{proposition}
  Let \((G_j)_{j \in J}, (H_i)_{i \in I}\) be inverse systems of finite groups, \(G = \varprojlim G_j, H = \varprojlim H_j\). Let \(f: G \to H\) be a continuous homomorphism. Assume \(J\) and \(I\) are countable. Then there are cofinal subsystems \(J' \subseteq J, I' \subseteq I\) with an isomorphism \(\alpha: J' \to I'\) and a morphism \(f_{j'}: G_{j'} \to H_{\alpha(j')}\) of inverse system which induces \(f\).
\end{proposition}

\begin{proof}
  We may assume \(J\) and \(I\) are linearly ordered, i.e.\ isomorphic to \(\N^{\text{op}}\). Also we may assume \((G_j)_{j \in J}\) is surjective. Set \(J' = J\). Construct an increasing sequence \(k_n\) of natural numbers inductively as follows: the composition \(G \to H \to H_n\) is continuous so the kernel is open, hence containing a basic open subgroup \(\ker p_{k_n}^G\) of \(G\). As \(\ker p_{k_n}^G \subseteq \ker p_n^H f\), exists a quotient map \(f_n: G_{k_n} \to H_n\). Increase \(k_n\) if necessary so \(k_n > k_{n - 1}\). Set \(I' = \{k_n\}\).
\end{proof}

\subsection{Generators of profinite groups}

\begin{definition}[topological generating set]\index{topological generating set}
  Let \(G\) be a topological group. A subset \(S \subseteq G\) is a \emph{(topological) generating set} for \(G\) if \(\langle S\rangle\) is dense in \(G\). \(G\) is \emph{(topologically) finitely generated} (tfg) if it has a finite topological generating set.
\end{definition}

\begin{definition}
  Let \(G\) be a topological group and \(S \subseteq G\). The \emph{closed subgroup generated by \(S\)} is the smallest closed subgroup of \(G\) which contains \(S\). Equivalently, it is the intersection of all closed subgroups which contain \(S\).
\end{definition}

\begin{ex}
  The closed subgroup generated by \(S\) is \(\overline{\langle S\rangle}\). More generally, the closure of a subgroup is a subgroup.
\end{ex}

\begin{proposition}
  If \(G\) is a profinite group, \(U \leq_o G\) then \(G\) is tfg if and only if \(U\) is tfg.
\end{proposition}

\begin{proof}
  If \(G = \overline{\langle S\rangle}\) for some finite \(S\) then \(U \cap \langle S\rangle\) is finitely generated. As \(U\) is open, \(U \cap \langle S\rangle\) is dense in \(U\).

  Conversely if \(U = \overline{\langle S\rangle}\) and \(T\) is a set of coset representatives for \(U\) in \(G\), then \(S \cup T\) is a finite generating set for \(G\).
\end{proof}

\begin{proposition}
  Let \(G = \varprojlim G_j\) be an inverse system of finite groups. Then \(S \subseteq G\) is a topological generating set if and only if \(p_j(S)\) generates \(p_j(G)\).
\end{proposition}

\begin{proof}
  \(\langle S\rangle\) is dense if and only if \(p_j(G) = p_j(\langle S\rangle) = \langle p_j(S)\rangle\) for all \(j\).
\end{proof}

\begin{proposition}
  \(\alpha \in \Z_p\) is a generator is and only if \(\alpha \ne 0 \pmod p\).
\end{proposition}

\begin{proof}
  Let \(\alpha = (a_n)\). \(\alpha\) is a generator if and only if \(a_n\) generates \(\Z/p^n\) for all \(n\), if and only if \(a_n\) is coprime to \(p^n\), if and only if \(a_n\) is coprime to \(p\).
\end{proof}

If \(\alpha\) is a generator then consider multiplication by \(\alpha\), \(f_\alpha: \Z_p \to \Z_p\). The image of \(f_\alpha\) contains \(\langle\alpha\rangle\) and hence \(\im f_\alpha \supseteq \overline{\langle \alpha\rangle} = \Z_p\) so exists \(\beta\) such that \(\alpha\beta = 1\). The converse is also true so we can identify the set of generators of \(\Z_p\) with \(\Z_p^\times\).

\(\Z_p^\times\) is an open subset of \(\Z_p\) and for all \(n\) the natural map \(\Z_p^\times \to (\Z/p^n)^\times\) is surjective. Thus many elements of \(\Z\) are invertible in \(\Z_p\). For example to compute the inverse of \(2 \in \Z_3^\times\), we can compute its inverse in \((\Z/3^n)^\times\) for increasingly large \(n\) to get
\[
  2^{-1} = (\dots, 41, 14, 5, 2) \in \prod \Z/3^n
\]
so \(2^{-1} = (\dots, 81, 27, 5, 2) \in \Z_3\).

\begin{proposition}
  \(\alpha \in \hat \Z\) is a generator if and only if \(\alpha \ne 0 \pmod p\) for all \(p\).
\end{proposition}

By Chinese remainder theorem this set is \(\prod \Z_p^\times\), and thus can be identified with \(\hat \Z^\times\). It is a closed subset of \(\hat \Z\) and just as in the \(p\)-adic integer case, \(\hat \Z^\times \to (\Z/n)^\times\) is surjective for all \(n\).

\begin{theorem}[Gaschütz's lemma for finite groups]\index{Gaschütz's lemma}
  Let \(f: G \to H\) be a surjective homomorphism of finite groups. Assume that \(G\) has a generating set of size \(d\). Then for any generating set \(\{z_1, \dots, z_d\}\) of \(H\), there exists a generating set \(\{x_1, \dots, x_n\}\) of \(G\) such that \(f(x_i) = z_i\).
\end{theorem}

\begin{proof}
  We formulate the theorem in terms of \emph{generating vectors}: \((x_1, \dots, x_d) \in G^d\) whose underlying set generates \(G\). \(f\) extends to \(f^d: G^d \to H^d\). Let \(y\) be a generating vector for \(H\) and let \(N_G(y)\) be the cardinality of the set of generating vectors \(x\) for \(G\) such that \(f^d(x) = y\). We show \(N_G(y)\) is independent of \(y\), and then the results follows.

  Induction on \(|G|\). Let \(y\) be a generating vector for \(H\). Let \(\mathcal C\) be the set of \(\leq d\)-generated proper subgroups of \(G\). Then for all \(x\) such that \(f^d(x) = y\), either \(\langle x \rangle = G\) or \(\langle x\rangle \in \mathcal C\). Therefore
  \[
    |\ker f^d| = |\{x \in G^d: f^d(x) = y\}| = N_G(y) + \sum_{C \in \mathcal C} N_C(y).
  \]
  As \(\ker f^d\) is manifestly independent of \(y\), by induction hypothesis \(N_G(y)\) is independent of \(y\).
\end{proof}

\begin{theorem}[Gaschütz's lemma for profinite groups]\index{Gaschütz's lemma}
  Let \(f: G \to H\) be a continuous surjective homomorphism of profinite groups. Assume \(G\) has a topological generating set of size \(d\). Then for every generating set \(\{z_1, \dots, z_d\}\) of \(H\), exists a generating set \(\{x_1, \dots, x_n\}\) of \(G\) such that \(f(x_i) = z_i\).
\end{theorem}

\begin{proof}
  wlog \(G = \varprojlim_{j \in J} G_j, H = \varprojlim_{j \in J} H_j\) and \(f\) is induced by a morphism of inverse systems \(f_j: G_j \to H_j\) (see lemma below) and the inverse systems are surjective. Let
  \[
    X_j = \{x_j \text{ generating vector for } G_j: f_j(x_j) = p_j^H(z)\}
  \]
  which is nonempty. \((X_j)_{j \in J}\) forms an inverse system so
  \[
    \varprojlim X_j = \{x \in G^d: x \text{ generator of } G: f(x) = z\}
  \]
  is nonempty.
\end{proof}

\begin{proposition}
  Let \(G\) be a profinite group and \(\mathcal U\) be a collection of open normal subgroups of \(G\) which form a neighbourhood basis at \(1\). Then \(G = \varprojlim_{U \in \mathcal U} G/U\).
\end{proposition}

\begin{proof}
  There exists a homomorphism \(f: G \to \varprojlim_{U \in \mathcal U} G/U\) which is surjective since \(G\) surjects \(G/U\), and injective because \(\mathcal U\) is a neighbourhood basis: for all \(g \in G \setminus \{1\}\) exists \(V \normal_o G\) such that \(g \notin V\) and exists \(U \in \mathcal U\) such that \(U \subseteq V\).
\end{proof}

\begin{eg}
  If \(G\) is tfg, take \(\mathcal U = \{U_n\}\) where
  \[
    U_n = \bigcap \{\text{normal subgroups of \(G\) of index \(\leq n\)}\}
  \]
  which is open since the collection is finite.
\end{eg}

As a corollary

\begin{lemma}
  If \(G\) is a tfg profinite group then \(G = \varprojlim_{j \in J} G_j\) where \(J\) is countable.
\end{lemma}

\section{Profinite completion}

\subsection{Residual finiteness}

Let \(\Gamma\) be an abstract group (usually finitely generated), \(\hat \Gamma = \varprojlim_{N \normal_f \Gamma} \Gamma/N\) its profinite completion, and a canonical map \(\iota = \iota_\Gamma: \Gamma \to \hat \Gamma\).

We have seen for \(\Gamma = \Z\) this canonical map is an injection. This injection is sufficiently important that it deserves its own name.

\begin{definition}[residually finite]\index{residually finite}
  Let \(\Gamma\) be an abstract group. \(\Gamma\) is called \emph{residually finite} if for every \(\gamma \in \Gamma \setminus \{1\}\) there exists \(N \normal_f \Gamma\) such that \(\gamma \notin N\). Equivalently, \(\gamma\) is not in the kernel of \(\Gamma \to \Gamma/N\).
\end{definition}

\begin{proposition}
  \(\Gamma\) is residually finite if and only if \(\iota_\Gamma: \Gamma \to \hat \Gamma\) is injective.
\end{proposition}

\begin{proposition}
  A subgroup of a residually finite group is residually finite.
\end{proposition}

\begin{proof}
  Suppose \(\Delta \leq \Gamma\). If \(\gamma \in \Delta \setminus \{1\}\), exists \(N \normal_f \Gamma\) such that \(\gamma \notin N\). Then \(N \cap \Delta \normal_f \Delta\) and \(\gamma \notin N \cap \Delta\).
\end{proof}

A partial converse holds, provided the subgroup has finite index:

\begin{proposition}
  Let \(\Gamma\) be an abstract group, \(\Delta \leq \Gamma\) of finite index. Then if \(\Delta\) is residually finite so is \(\Gamma\).
\end{proposition}

\begin{proof}
  Let \(\gamma \in \Gamma \setminus \{1\}\). If \(\gamma \notin \Delta\), take
  \[
    N = \mathrm{Core}_\Gamma(\Delta) = \bigcap_{g \in \Gamma} g\Delta g^{-1} \normal_f \Gamma
  \]
  and \(\gamma \notin N\). If \(\gamma \in \Delta\) then exists \(M \normal_f \Delta\) such that \(\gamma \notin M\). Then \(M \leq_f \Gamma\) so \(N = \mathrm{Core}_\Gamma(M) \normal_f \Gamma\) and \(\gamma \notin N\).
\end{proof}

\begin{proposition}
  Direct product of residually finite groups is residually finite.
\end{proposition}

\begin{proof}
  Example sheet 2.
\end{proof}

\begin{proposition}
  All finitely generated abelian groups are residually finite.
\end{proposition}

\begin{remark}
  Finite generation is necessary here. For example \(\Q\) has no nontrivial finite quotient.
\end{remark}

A source of residually finite groups is matrix group.

\begin{proposition}
  \(\SL_N(\Z)\) and \(\GL_N(\Z)\) are residually finite for all \(N\).
\end{proposition}

\begin{proof}
  If \(A \in \GL_N(\Z)\), take a prime \(p\) greater than an entry of \(A\). Then \(A\) is not in the kernel of \(\GL_N(\Z) \to \GL_N(\Z/p)\).
\end{proof}

\begin{proposition}[Non-examinable][Mal'cev's theorem]
  Let \(\Gamma\) be a finitely generated subgroup of \(\GL_N(K)\) (resp. \(\SL_N, \PSL_N\)) where \(K\) is a field. Then \(\Gamma\) is residually finite.
\end{proposition}

As a corollary, fundamental groups of surfaces are residually finite (as they are contained in \(\PSL_2(\R)\) by hyperbolic geometry).

\begin{theorem}
  Let \(G\) and \(H\) be tfg profinite groups. Then \(G \cong H\) if and only if the set of isomorphism types of continuous finite quotients of \(G\) and \(H\) are equal.
\end{theorem}

\begin{proof}
  Let \(G_n\) be the intersection of all open normal subgroups of \(G\) of index \(\leq n\). Then \(G_n \normal_o G\) and \(G = \varprojlim G/G_n\). Define \(H_n\) similarly. Now \(G/G_n\) is a continuous finite quotient of \(G\) so it is also a continuous finite quotient of \(H\). Thus exists \(V \normal_o H\) such that \(G/G_n \cong H/V\). By definition the intersection of all normal subgroups of \(G/G_n\) of index \(\leq n\) is trivial, so upon taking their preimages under \(H \to H/V\) we have \(H_n \subseteq V\). Then
  \[
    |G/G_n| = |H/V| \leq |H/H_n|.
  \]
  By symmetry we have equality so \(H_n = V\) and thus \(G/G_n \cong H/H_n\).

  To show there exists an isomorphism of inverse systems, let \(S_n\) be the set of isomorphisms \(G/G_n \to H/H_n\), which is nonempty. If \(f_n \in S_n\) then it takes normal subgroups of \(G/G_n\) of index \(\leq n - 1\) to those in \(H/H_n\), so defines an isomorphism \(G_{n - 1}/G_n \to H_{n - 1}/H_n\). Thus \(f_n\) descends to a map \(\phi_{n, n - 1}(f_n): G/G_{n - 1} \to H/H_{n - 1}\) which makes the following diagram commute
  \[
    \begin{tikzcd}
      G/G_n \ar[r, "f_n"] \ar[d] & H/H_n \ar[d] \\
      G/G_{n - 1} \ar[r, "\phi_{n, n - 1}(f_n)"] & H/H_{n - 1}
    \end{tikzcd}
  \]
  \((S_n, \phi_{n, n - 1})\) is an inverse system of nonempty sets so \(\varprojlim S_n\) is nonempty and its element defines an isomorphism of inverse systems.
\end{proof}

As a corollary

\begin{theorem}
  Let \(\Gamma, \Delta\) be finitely generated abstract groups. Then \(\hat \Gamma \cong \hat \Delta\) if and only if the set of isomorphism types of finite quotients of \(\Gamma\) and \(\Delta\) are the same.
\end{theorem}

The following lemma characterises open subgroups of profinite completion

% TODO: consider simplifying notations in the proof
% merge the proof with basic correspondence
% check if finitely generation is necessary

\begin{lemma}
  \label{lem:subgroup correspondence for profinite completion}
  Let \(\Gamma\) be a finitely generated abstract group. Then the open subgroups of \(\hat \Gamma\) are precisely the subgroups \(\overline{\iota_\Gamma(\Delta)}\) for \(\Delta \leq_f \Gamma\).
\end{lemma}

\begin{proof}
  If \(\Delta \leq_f \Gamma\) then \(\overline{\iota_\Gamma(\Delta)}\) is closed. It also has finite index so open: suppose \(\Gamma = \bigcup_{i = r}^r g_i \Delta\) is a finite (disjoint) union, then
  \[
    \hat \Gamma = \overline{\iota_\Gamma(\Gamma)}
    = \overline{\bigcup \iota_\Gamma(g_i \Delta)}
    = \bigcup \iota_\Gamma(g_i) \overline{\iota_\Gamma(\Delta)}
  \]

  Conversely, let \(U \leq_o \hat \Gamma\), then \(U \cap \iota_\Gamma(\Gamma)\) is dense in \(U\). Let \(\Delta = \iota_\Gamma^{-1}(U) = \iota_\Gamma^{-1}(U \cap \iota_\Gamma(\Gamma))\). Then \(\Delta \leq_f \Gamma\) and \(\iota_\Gamma(\Delta) = U \cap \iota_\Gamma(\Gamma)\).
\end{proof}

Question: how much can we learn about \(\Gamma\) from \(\hat \Gamma\), if \(\Gamma\) is residually finite?

\begin{proposition}
  If \(\hat \Gamma \cong \hat \Delta\), \(\Delta\) is abelian and \(\Gamma\) is residually finite then \(\Gamma\) is abelian.
\end{proposition}

\begin{proof}
  If \(\Delta\) is abelian, all its quotients are abelian, so \(\hat \Delta\) is abelian. Then \(\iota_\Gamma: \Gamma \to \hat \Gamma = \hat \Delta\) shows \(\Gamma\) is abelian.
\end{proof}

\begin{proposition}
  If \(G\) and \(H\) are finitely generated and \(\hat G \cong \hat H\) then \(G_{\mathrm{ab}} \cong H_{\mathrm{ab}}\). In particular if \(G\) is abelian and \(H\) is residually finite then \(G \cong H\).
\end{proposition}

\begin{proof}
  If \(G\) and \(H\) have the same finite quotients then they have the same finite abelian quotients, which are precisely the finite quotients of abelianisation. Thus suffices to show we can recover a finitely generated abelian group \(G \cong \Z^r \times T\) from its finite quotient. Have
  \[
    r = \max\{k: G \surj (\Z/n)^k \text{ for all } n\}
  \]
  and \(T\) the largest finite abelian group such that \(G \surj (\Z/n)^r \times T\).
\end{proof}

\begin{eg}[Baumslag]
  One does not have to go far from abelian groups to show this fails in general. Let \(\phi: C_{25} \to C_{25}\) be the automorphism \(t \mapsto t^6\) where \(t\) is a fixed generator. \(\phi\) has order \(5\). Form semidirect products \(G_1 = C_{25} \rtimes_\phi \Z, G_2 = C_{25} \rtimes_{\phi^2} \Z\). Write \(\Z = \langle s\rangle\) multiplicatively. Claim \(G_1 \ncong G_2\) but \(\hat G_1 \cong \hat G_2\).

  \begin{proof}
    Suppose \(\psi: G_2 \to G_1\) is an isomorphism. Then \(\psi(C_{25}) = C_{25}\) so \(\psi(t, 1) = (t^a, 1)\) where \(t^a\) generates \(C_{25}\). Let \(\psi(1, s) = (t^b, s^c)\). As \(s^c\) generates \(\Z\), \(c = \pm 1\). Now compute
    \[
      \psi((1, s) \bullet_2 (t, 1) \bullet_2 (1, s^{-1}))
      = \psi(\phi^2(t), 1)
      = (\phi^2(t^a), 1).
    \]
    On the other hand
    \begin{align*}
      (t^b, s^c) \bullet_1 (t^a, 1) \bullet_1 (\phi^{-c}(t^{-b}), s^{-c})
      &= (t^b \phi^c(t^a), s^c) \bullet_1 (\phi^{-c} (t^{-b}), s^{-c}) \\
      &= (t^b \phi^c(t^a) \phi^c \phi^{-c}(t^b), 1) \\
      &= (\phi^c(t^a), 1)
    \end{align*}
    so \(\phi^2(t^a) = \phi^c(t^a)\) so \(2 = c \pmod 5\), absurd.

    To show the profinite completions are isomorphic, note \(\hat G_1 = C_{25} \rtimes_\phi \hat \Z, \hat G_2 = C_{25} \rtimes_{\phi^2} \hat \Z\): let \(G_1 \to Q\) be a finite quotient. If the composition \(\Z \to G_1 \to Q\) has image of order \(m\), then \(f\) factors through the finite quotient \(C_{25} \rtimes_\phi (\Z/5m)\), so the quotients \(C_{25} \rtimes \Z/5m\) are cofinal in the finite quotients, so
    \[
      \hat G_1 = \varprojlim (C_{25} \rtimes \Z/5m) = C_{25} \rtimes \hat \Z.
    \]
    Same for \(G_2\).
  \end{proof}

  It is worth noting that if we try to compute the same expressions in the profinite completions, we can merely conclude \(c\) is a topological generator of \(\hat \Z\) --- but \(\hat \Z\) has many generators! In fact, for any \(c \in \hat \Z^\times\) such that \(c = 2 \pmod 5\) we can define \(\psi': \hat G_2 \to \hat G_1, (t^a, s^b) \mapsto (t^a, s^{bc})\) which is continuous and injective. As \(c\) is a generator, it is also surjective.
\end{eg}

Open problem: If \(G\) is finitely generated and residually finite and \(F\) is a finitely generated free group, does \(\hat F \cong \hat G\) imply \(F \cong G\)? Equivalently, does there exists a finitely generated residually finite group \(G\) and \(n \in \N\) such that a finite group \(Q\) is a quotient of \(G\) if and only if \(d(Q) \leq n\), where \(d\) is the minimum number of generators?

\begin{proposition}
  If \(F_1, F_2\) are both finitely generated free and \(\hat F_1 \cong \hat F_2\) then \(F_1 \cong F_2\).
\end{proposition}

\begin{proof}
  Immediate.
\end{proof}

What about surface groups? They are fundamental groups of genus \(g\) orientable surfaces and has presentation
\[
  S_g = \langle a_1, b_1, \dots, a_g, b_g| [a_1, b_1] \cdots [a_g, b_g]\rangle.
\]
Can we tell them apart from free groups? If \(\hat S_g = \hat F_r\) then \(\Z^{2g} \cong \Z^r\) so \(r = 2g\). What next?

\begin{proposition}[basic correspondence]
  Let \(G_1, G_2\) be finitely generated residually finite groups. Suppose \(\hat G_1 \cong \hat G_2\). Then there is a bijection
  \[
    \psi: \{H \leq_f G_1\} \to \{H \leq_f G_2\}
  \]
  such that if \(K \leq_f H \leq_f G_1\) then
  \begin{itemize}
  \item \([H: K] = [\psi(H): \psi(K)]\).
  \item \(K \normal H\) if and only if \(\psi(K) \normal \psi(H)\).
  \item If \(K \normal H\) then \(H/K \cong \psi(H)/\psi(K)\).
  \item \(\hat H \cong \widehat{\psi(H)}\).
  \end{itemize}
\end{proposition}

Every finite-sheeted cover of a surface is a surface, so every finite index subgroup of \(S_g\) is a surface group so has abelianisation \(\Z^{2g'}\). However \(F_r\) has an index \(2\) subgroup, which is free of rank \(2(r - 1) + 1\) by Nielsen-Schreier. Thus from the corrspondence we deduce \(S_g\) is not free.

The proposition itself follows from the correpondence between subgroups of \(G\) and \(\hat G\).

\begin{proposition}
  Let \(G\) be finitely generated residually finite and regard \(G\) as a subgroup of \(\hat G\). Then there is a bijection
  \begin{align*}
    \{H \leq_f G\} &\to \{U \leq_o \hat G\} \\
    H &\mapsto \overline H \\
    U \cap G &\mapsfrom U
  \end{align*}
  Furthermore if \(K \leq_f H \leq_f G\) then
  \begin{itemize}
  \item \([H : K] = [\overline H: \overline K]\),
  \item \(K \normal H\) if and only if \(\overline K \normal \overline H\),
  \item If \(K \normal H\) then \(H/K \cong \overline H/\overline K\),
  \item \(\overline H \cong \hat H\).
  \end{itemize}
\end{proposition}

\begin{proof}
  Surjectivity is done in \Cref{lem:subgroup correspondence for profinite completion}. To show injectivity enough to show \(\overline H \cap G = H\). Consider the action of \(G\) on \(G/H\), inducing a continuous \(\alpha: \hat G \to \mathrm{Sym}(G/H)\). Then \(g \in \mathrm{Stab}_{\hat G}(H)\), an open subgroup. If \(g \in G \setminus H\) then it is disjoint from \(H\), so \(g \notin \overline H\).

  Let \(\{g_i\}\) be a set of coset representatives of \(H\) in \(G\). Then \(\hat G = \bigcup g_i \overline H\). This is a disjoint union since \(\overline H \cap G = H\), so \(\{g_i\}\) is also a coset representative of \(\overline H\) in \(\hat G\), so there is a natural bijection \(G/H \to \hat G/\overline H\).

  If \(\overline K \normal \overline H\) then \(K = \overline K \cap G \normal \overline H \cap G = H\). \(H\) normalises \(K\) if and only if \(K\) lies in the kernel of the action \(H \to \mathrm{Sym}(H/K)\), so \(\overline K \subseteq \overline H\) so \(\overline K \normal \overline H\).

  Any finite quotient \(K\) of \(H\) is the quotient of \(\overline H\) by the open subgroup \(\overline K\). Thus by universal property there is a continuous homomorphism \(\overline H \to \hat H\). It is injective since for any \(1 \ne h \in \overline H\), exists \(U\) open in \(\hat G\) such that \(h \notin U\). Then \(h\) is not mapped to identity under the composition \(\overline H \to \hat H \to \overline H/\overline H \cap U\).
\end{proof}

\begin{definition}[Hopf property]\index{Hopf property}
  A (topological respectively) group \(G\) has the \emph{Hopf property} (or is Hopfian, or Hopf) if every (continuous respectively) surjective homomorphism \(G \to G\) is an isomorphism.
\end{definition}

Usually surjectivity is the easier condition to check --- if we know a set of generators then we only have to show that they lie in the image. On the other hand to show injectivity requires understanding the image of each element.

\begin{proposition}
  Let \(G\) be a tfg profinite group. Then \(G\) has the Hopf property.
\end{proposition}

\begin{proof}
  Let \(G_n\) be the intersection of all open normal subgroups of \(G\) of index \(\leq n\). \(G_n\) is open and \(G = \varprojlim G/G_n\). If \(U \leq_o G\) with \([G: U] \leq n\) then because \(f\) is surjective, \([G: U] = [G: f^{-1}(U)] \leq n\) so \(G_n \leq f^{-1}(U)\). Thus \(G_n \subseteq \bigcap f^{-1}(U) = f^{-1}(G_n)\) so \(f(G_n) \subseteq G_n\), inducing a surjective map \(f_n: G/G_n \to G/G_n\). Finite groups are Hopfian so \(f_n\) is an isomorphism. The result thus follows.
\end{proof}

\begin{corollary}
  If \(\Gamma\) is finitely generated and residually finite then \(\Gamma\) has the Hopf property.
\end{corollary}

\begin{proof}
  Let \(f: \Gamma \to \Gamma\) be a surjection. Then \(f\) induces a unique map \(\hat f: \hat \Gamma \to \hat \Gamma\). \(\hat \Gamma\) is tfg and \(\hat f\) is surjective because its image is compact and contains a dense subset. The result then follows from the Hopf property of \(\hat \Gamma\).
\end{proof}

\begin{proposition}
  Let \(G, H\) be (topological respectively) groups, \(G\) with Hopf property. If there exists (continuous respectively) surjections \(f: G \to H, f': H \to G\) then both \(f\) and \(f'\) are isomorphisms.
\end{proposition}

\begin{proof}
  \(f' \compose f: G \to G\) is an isomorphism by Hopf property so \(f\) is injective and an isomorphism. Then \(f' = (f'\compose f) \compose f^{-1}\) is also an isomorphism.
\end{proof}

\begin{proposition}
  Let \(\Gamma\) be a group and suppose exists a finite quotient \(Q\) of \(\Gamma\) such that \(d(\Gamma) = d(Q)\), where \(d\) is the minimum number of generators. Then for a free group \(F\), \(\hat F \ncong \hat \Gamma\) unless \(\Gamma\) is free, i.e.\ \(\Gamma \cong F\).
\end{proposition}

\begin{proof}
  Let \(F\) be a free group with \(\hat F \cong \hat \Gamma\). Then \(Q\) is also a quotient of \(F\) so \(d(F) \geq d(Q) = d(\Gamma)\) so exists a surjection \(f: F \to \Gamma\), which induces a continuous surjection \(\hat f: \hat F \to \hat \Gamma\). By Hopf property \(\hat f\) is an isomorphism so \(f\) is injective.
\end{proof}

\begin{eg}
  Non-Hopfian groups are not residually finite. For an example of non-Hopfian group, let
  \[
    \mathrm{BS}(n, m) = \langle a, t|a^nt^{-1} = a^m \rangle
  \]
  where \(n, m\) coprime. Define
  \begin{align*}
    f: \mathrm{BS}(n, m) &\to \mathrm{BS}(n, m) \\
    y &\mapsto t \\
    a &\mapsto a^n
  \end{align*}
  \(f\) is a surjection as it surjects the generators. But \(f\) is not injective: \(a\) does not commute with \(tat^{-1}\) (which we quote as a fact). But
  \[
    f([a, tat^{-1}]) = [a^n, ta^nt^{-1}] = [a^n, a^m] = 1
  \]
  so \(\mathrm{BS}(n, m)\) is not Hopfian. residually finite.
\end{eg}

\subsection{Finite quotients of free groups}

\begin{theorem}
  Free groups are residually finite.
\end{theorem}

There are two proofs. The first proof in online notes is non-examinable (and omitted). The proof actually shows that

\begin{corollary}
  For all \(p\), a free group \(F\) is residually \(p\)-finite. In particular \(F\) injects to its pro-\(p\) completion.
\end{corollary}

We record the second proof here, which is an algorithm to produce finite quotients.

\begin{proof}
  Let \(F\) be free on finite generating set \(S\) so \(F = \pi_1 \bigvee_S S^1\). Write \(g \in F \setminus \{1\}\) as a reduced word \(s_1 \cdots s_n\).  Write out \(g\) ``along a line'' to get a labelled graph \(Y\) and there is a continuous map \(Y \to X\). We seek to make \(Y\) a covering space of \(X\) by adding edges.

  For each \(s \in S\), the number of vertices having an outgoing \(s\) edge is the same as those having an incoming one. Thus we can add \(s\) edges so that every vertex has exactly one \(s\) edge entering and one leaving. This gives a finite covering \(\overline Y\) of \(X\) so corresponds to a finite index subgroup \(\pi_1\overline Y\) of \(F\). \(g \notin \pi_1 \overline Y\) since it is not a loop.

  For each \(s \in S\), following the edge \(s\) is a permutation of vertices to we have an action of \(F\) on vertices of \(Y\). \(g\) does not fix the initial vertex of \(Y\) as \(g\) is not contained in the finite index normal subgroup corresponding to the kernel of the action.
\end{proof}

\begin{theorem}[Marshall Hall's theorem]\index{Marshal Hall's theorem}
  Let \(S \subseteq F\) be a finite subset. If \(y \notin \langle S\rangle\) then exists a finite group \(Q\) and a homomorphism \(f: F \to Q\) such that \(f(y) \notin f(\langle S\rangle)\).
\end{theorem}

\begin{corollary}
  If \(S\) does not generate \(F\) then exists \(Q, f\) such that \(f(\langle S\rangle) \ne f(F)\).
\end{corollary}

\begin{remark}
  Marshall Hall's theorem actually says that exists \(H \leq_f F\) such that \(S \subseteq H\) and \(H = \langle S \rangle * H'\).
\end{remark}

\begin{corollary}
  \(S\) generates \(F\) if and only if \(S\) (topologically) generates \(\hat F\).
\end{corollary}

\begin{note}
  As a result \(\overline{\langle S\rangle} \cap F = \langle S\rangle\), which generalises the basic correspondence, which holds only for finite index subgroup.
\end{note}

The proof uses monodromy action of the fundamental group. Let \(X\) be a wedge of circles whose fundamental group is \(F\). If we can find a finite covering space \(Y\) of \(X\) such that \(S\) is contained in the image of \(\pi_1Y\) then \(\langle S\rangle\) is contained in the stabiliser of a vertex of the covering action. Similar to the proof of residually finiteness of free groups, if \(y \notin \langle S\rangle\) then we can construct \(Y\) so that \(g\) does not lie in the stabiliser.

To construct the covering space first let \(Y\) be the graph with a distinguished vertex and loops corresponding to words in \(S\) going around the vertex. We would like to add edges as before so that \(Y\) becomes a covering space. Here we encounter a problem as there might be more than one edge, say \(a\), coming from the distinguished vertex. We need to apply \emph{Stallings' fold}\index{Stalling' fold} to identify the repeated edges, and it is a fact that this procedure does not change the fundamental group.

The formal proof is non-examinable. A worked example can be found in the lecturer's online notes.

\section{Pro-\(p\) groups}

Recall that a \emph{pro-\(p\) group}\index{pro-\(p\) group} is an inverse limit of finite \(p\)-groups --- finite groups of order a power of \(p\). The \emph{pro-\(p\) completion}\index{pro-\(p\) completion} of \(\Gamma\) is
\[
  \hat \Gamma_{(p)} = \varprojlim_{\substack{N \normal \Gamma \\ \Gamma/N p\text{-group}}} \Gamma/N.
\]
For example \(\Z_p = \hat \Z_{(p)}\).

\subsection{Generators of pro-\(p\) groups}

\begin{definition}[Frattini subgroup]\index{Frattini subgroup}
  Let \(G\) be a finite group. The \emph{Frattini subgroup} of \(G\) is
  \[
    \Phi(G) = \bigcap \{M: M \text{ maximal proper subgroup of } G\}.
  \]
\end{definition}

\begin{proposition}
  If \(f: G \to H\) is a surjective group homomorphism then \(f(\Phi(G)) \subseteq \Phi(H)\). In particular \(\Phi(G)\) is a characteristic normal subgroup\index{characteristic subgroup}, i.e.\ if \(f: G \to G\) is an automorphism then \(f(\Phi(G)) = \Phi(G)\).
\end{proposition}

\begin{proof}
  Let \(M\) be a maximal proper subgroup of \(H\). Then \(f^{-1}(M)\) is a proper subgroup and it is maximal: if \(f^{-1}(M) \subseteq N \subseteq G\), assume \(f^{-1}(M) \ne N\). Then \(f(N) = H\) as \(M\) is maximal. Therefore \(G = N \cdot \ker f = N\) as \(N \supseteq \ker f\). Therefore \(\Phi(G) \subseteq f^{-1}(M)\), hence \(f(\Phi(G)) \subseteq M\). Taking intersection to get \(f(\Phi(G)) \subseteq \Phi(H)\).
\end{proof}

Note that we did not use finiteness anywhere.

\begin{proposition}
  Let \(G\) be a finite group. For \(S \subseteq G\) a subset, TFAE:
  \begin{enumerate}
  \item \(S\) generates \(G\).
  \item \(S \Phi(G)\) generates \(G\).
  \item \(S \Phi(G)/\Phi(G)\), the image of \(S\) in \(G/\Phi(G)\), generates \(G/\Phi(G)\).
  \end{enumerate}
\end{proposition}

In other words, the elements of \(\Phi(G)\) are precisely the non-generators.

\begin{proof}
  Only \(3 \implies 1\) is nonobvious. Suppose \(S\) does not generate \(G\). Then \(\langle S\rangle\) is contained in some maximal proper subgroup. Here we used the crucial fact that \(G\) is finite. Since \(\Phi(G) \subseteq M\), \(M/\Phi(G)\) is a proper subgroup of \(G/\Phi(G)\). Thus \(S \Phi(G)/\Phi(G) \subseteq M/\Phi(G) \subsetneq G/\Phi(G)\).
\end{proof}

\begin{definition}
  Let \(G\) be a group, \(H, K\) subgroups of \(G\) and \(m \in \Z\). Define
  \[
    HK = \{hk: h \in H, k \in K\}
  \]
  which is a priori a set, but is a subgroup if either \(H\) or \(K\) is normal, and is a normal subgroup if both \(H\) and \(G\) are.

  Define the commutator to be
  \[
    [H, K] = \langle [h, k] = h^{-1}k^{-1}hk: h \in H, k \in K \rangle
  \]
  which is a subgroup and is a normal subgroup if both \(H\) and \(K\) are normal.

  Finally define
  \[
    H^m = \langle h^m: h \in H\rangle.
  \]
  which is a subgroup.
\end{definition}

\begin{proposition}
  Let \(G\) be a \(p\)-group. Then
  \[
    \Phi(G)
    = [G, G] G^p
    = \ker (G \to G_{\mathrm{ab}} \to G_{\mathrm{ab}}/p G_{\mathrm{ab}})
    = \langle [g_1, g_2] g_3^p \rangle.
  \]
\end{proposition}

Note that \(G_{\mathrm{ab}}/p G_{\mathrm{ab}}\) is an \(\F_p\)-vector space, so is isomorphic to \((\Z/p)^d\) for some \(d\). Thus \(G/\Phi(G) \cong \F_p^d\) where \(d = d(G)\) is the minimum size of a generating set of \(G\).

\begin{proof}
  Example sheet 2.
\end{proof}

\begin{definition}
  Let \(G\) be a profinite group. Define
  \[
    \Phi(G) = \bigcap \{M: M \text{ maximal proper closed subgroups of } G\},
  \]
  where \(M\) maximal proper closed means that if \(N\) is a closed subgroup then \(M \subseteq N \subseteq G\) implies \(N = M\) or \(N = G\).
\end{definition}

\begin{proposition}
  Any proper closed subgroup of a profinite group \(G\) is contained in a proper open subgroup, and hence is contained in a maximal proper closed subgroup, and maximal proper closed subgroups are open.
\end{proposition}

\begin{proof}
  Suppose \(H \leq_c G\), \(G \ne H\) and \(G = \varprojlim G_j\). Since \(H\) is not dense, exists \(j\) such that \(p_j(H) \ne p_j(G)\). Then \(p_j^{-1}(p_j(H))\) is open proper and contains \(H\).
\end{proof}

Similar to the finite case we have

\begin{lemma}
  If \(f: G \to H\) is a surjective continuous homomorphism of profinite groups then \(f(\Phi(G)) \subseteq \Phi(H)\).
\end{lemma}

\begin{proposition}
  If \(S \subseteq G\) where \(G\) is a profinite group then TFAE
  \begin{enumerate}
  \item \(S\) is a tgs for \(G\).
  \item \(S \Phi(G)\) is a tgs for \(G\).
  \item \(S \Phi(G)/\Phi(G)\) is a tgs for \(G/\Phi(G)\).
  \end{enumerate}
\end{proposition}

\begin{proposition}
  Let \((G_j)_{j \in J}\) be a surjective inverse system of finite groups. Let \(G = \varprojlim G_j\). Then
  \[
    \Phi(G) = \varprojlim \Phi(G_j).
  \]
\end{proposition}

\begin{proof}
  Let \(p_j: G \to G_j\) be the projection. Then \(p_j(\Phi(G)) \subseteq \Phi(G_j)\) for all \(j\). Hence \(\Phi(G) \subseteq \varprojlim \Phi(G_j)\).

  Now let \(M\) be a maximal proper closed subgroup of \(G\). \(M\) is open so exists \(i\) such that \(\ker p_i \subseteq M\). Thus \(\ker p_j \subseteq M\) for all \(j \leq i\). Then \(p_j(M)\) is a maximal proper subgroup of \(G_j\) so \(p_j(M) \supseteq \Phi(G_j)\) for all \(j \leq i\). Thus
  \[
    M \supseteq \varprojlim_{j \leq i} \Phi(G_j) = \varprojlim \Phi(G_j).
  \]
\end{proof}

\begin{proposition}
  Let \(G\) be a tfg pro-\(p\) group. Then
  \[
    \Phi(G) = \overline{[G, G] G^p}
  \]
  and \(G/\Phi(G) \cong \F_p^d\) where \(d = d(G)\).
\end{proposition}

Later we will see that \([G, G] G^p\) is in fact closed.

\begin{note}
  \(G/\Phi(G)\) is also denoted \(H_1(G, \F_p)\).
\end{note}

\begin{proof}
  Write \(G = \varprojlim G_j\) as a surjective inverse limit of finite \(p\)-groups. Then \(\Phi(G) = \varprojlim [G_j, G_j] G_j^p\). If \(g_1, g_2, g_3 \in G\) then
  \[
    p_j([g_1, g_2]g_3^p) = [p_j(g_1), p_j(g_2)]p_j(g_3)^p \in [G_j, G_j] G_j^p
  \]
  so \(p_j(\overline{[G, G] G^p}) \subseteq [G_j, G_j] G_j^p\) for all \(j\) so \(\overline{[G, G] G^p} \subseteq \Phi(G)\). Now \(G/\overline{[G, G] G^p}\) is tfg abelian and every element has order \(p\). Therefore it is isomorphic to \(\F_p^d\) for some \(d\) (if \(a_1, \dots, a_d\) tgs of \(G/\overline{[G, G]G^p}\) then \(\{a_1^{n_1} \cdots a_d^{n_d}: n_1, \dots, n_d \in \{0, \dots, p - 1\}\}\) is a finite dense subgroup). Then since \(\Phi(\F_p^d) = \{0\}\), we find \(\Phi(G) \subseteq \overline{[G, G] G^p}\) as required.
\end{proof}

\begin{corollary}
  Let \(f: G \to H\) be a continuous homomorphism of tfg pro-\(p\) groups. Then \(f(\Phi(G)) \subseteq \Phi(H)\) and hence there is an induced map \(f_*: G/\Phi(G) \to H/\Phi(H)\), which is a map of vector spaces over \(\F_p\). \(f\) is surjective if and only if \(f_*\) is surjective.
\end{corollary}

\begin{proof}
  If \(g_1, g_2, g_3 \in G\) then
  \[
    f([g_1, g_2] g_3^p) = [f(g_1), f(g_2)] f(g_3)^p \in \Phi(H)
  \]
  so \(f(\Phi(G)) \subseteq \Phi(H)\).

  \(f(G)\) generates \(H\) if and only if \(f(G) \Phi(H)/\Phi(H) = f_*(G/\Phi(G))\) generates \(H/\Phi(H)\). As the image of both are compact so closed, the result follows.
\end{proof}

\begin{eg}
  Let \(F = \langle a, b\rangle\), the free group of rank 2 and \(G = \hat F_{(p)}\). Then \(G/\Phi(G) = \F_p^2\). Let \(S = \{a^4b^2a, ba^{-2}b\}\). Map \(S\) to \(G/\Phi(G)\) to test generation:
  \begin{align*}
    a^4b^2a &\mapsto
              \begin{psmallmatrix}
                5 \\
                2
              \end{psmallmatrix}
    \\
    ba^{-2}b &\mapsto
               \begin{psmallmatrix}
                 -2 \\
                 2
               \end{psmallmatrix}
  \end{align*}
  They generate \(\F_p^2\) if and only if \(\det
  \begin{psmallmatrix}
    5 & -2 \\
    2 & 2
  \end{psmallmatrix}
  = 14 \ne 0\), if and only if \(p \ne 2, 7\).
\end{eg}

\subsection{Nilpotent groups}

\begin{definition}
  A commutator of length 2 is a commutator
  \[
    [g_1, g_2] = g_1^{-1}g_2^{-1}g_1g_2 = g_1^{-1}g_1^{g_2}.
  \]
  Define iteratively a commutator of length \(n\)
  \[
    [g_1, g_2, \dots, g_n] = [g_1, [g_2, \dots, g_n]].
  \]
\end{definition}

\begin{definition}[lower central series]\index{lower central series}
  The \emph{lower central series} of \(G\) is the following sequence of subgroups:
  \begin{align*}
    G_1 &= G \\
    G_{n + 1} &= [G, G_n] = \langle [g, h]: g \in G, h \in G_n \rangle
  \end{align*}
  We sometimes denote \(G_n\) by \(\gamma_n(G)\).
\end{definition}

\begin{definition}[nilpotent group]\index{nilpotent group}
  A group \(G\) is \emph{nilpotent of class \(c\)} if \(\gamma_{c + 1}(G) = 1\) but \(\gamma_c(G) \ne 1\).
\end{definition}

For a nilpotent group we have
\[
  G = \gamma_1 \geq \gamma_2 \geq \dots \geq \gamma_{c + 1} = 1.
\]

\begin{note}
  \(\gamma_c(G)\) is central in \(G\) and nilpotent of class \(1\) is the same as abelian.
\end{note}

\begin{proposition}
  \(\gamma_n\) is \emph{fully characteristic}\index{fully characteristic subgroup} in the sense that if \(f: G \to H\) is a homomorphism then \(f(\gamma_n(G)) \subseteq \gamma_n(H)\).
\end{proposition}

\begin{proposition}
  Subgroups and quotients of nilpotent groups of class \(c\) are nilpotent of class \(\leq c\).
\end{proposition}

\begin{proposition}
  A finite \(p\)-group is nilpotent.
\end{proposition}

\begin{ex}
  If \(R\) is a ring, then the set of upper trianglular \(n \times n\) matrices with \(1\) on the diagonal is a nilpotent group.
\end{ex}

\begin{definition}
  For \(G\) is tfg pro-\(p\) group, the \emph{lower central \(p\)-series} is defined by
  \begin{align*}
    G_1 &= G \\
    G_{n + 1} &= \overline{[G, G_n] G_n^p}
  \end{align*}
  \(\gamma_n(G) \subseteq G_n = \gamma_n^{(p)}(G)\).
\end{definition}

Why are we doing this?
\begin{enumerate}
\item \(G_n/G_{n + 1}\) are vector spaces over \(\F_p\).
\item \(\gamma_n^{(p)}(G)\) is open in \(G\): inductively \(\Phi(G) = \gamma_2^{(p)}(G)\) and \(\Phi(G_{n - 1}) \leq \gamma_n^{(p)}(G)\), and Frattini subgroup of a tfg pro-\(p\) group is open.
\item \(\{\gamma_n^{(p)}(G)\}\) forms a neighbourhood basis for the identity: if \(N \normal_o G\), \(G/N\) is a finite \(p\)-group so \(\gamma_n^{(p)}(G/N)\) vanish for some \(n\). Therefore \(\gamma_n^{(p)}(G) \subseteq N\).
\end{enumerate}

\subsection{Invariance of topology}

\begin{theorem}
  \label{thm:homomorphism from pro-p group is continuous}
  Let \(G\) be a tfg pro-\(p\) group, \(H\) a profinite group and \(f: G \to H\) a homomorphism. Then \(f\) is continuous.
\end{theorem}

\begin{corollary}
  Let \(G\) be a tfg pro-\(p\) group. There is no other topology on \(G\) making it into a profinite group.
\end{corollary}

\begin{proof}
  If \(\tau_1\) is our given topology and \(\tau_2\) is another topology such that \((G, \tau_2)\) is profinite, then the identity homomorphism from \(\tau_1\) to \(\tau_2\) is continuous so a homeomorphism.
\end{proof}

``The group structure determines the topology''.

\Cref{thm:homomorphism from pro-p group is continuous} follows from

\begin{theorem}
  \label{thm:finite index subgroup of pro-p group is open}
  Let \(G\) be a tfg pro-\(p\) group. Then any finite index subgroup of \(G\) is open.
\end{theorem}

\begin{proof}[Proof of \Cref{thm:homomorphism from pro-p group is continuous}]
  Suppose \(f: G \to H\) is a homomorphism. Then for all \(U \normal_o H\), \(U\) has finite index so \(f^{-1}(H)\) has finite index and hence open in \(G\). Thus \(f\) is continuous.
\end{proof}

\begin{lemma}
  Let \(G\) be a nilpotent group generated by \(a_1, \dots, a_d\). Then every \(g \in [G, G]\) can be written as
  \[
    g = [a_1, x_1] \cdots [a_d, x_d]
  \]
  for some \(x_1, \dots, x_d \in G\).
\end{lemma}

\begin{proof}
  Induction on nilpotency class. \(c = 1\) is trivial. Assume true for nilpotency class \(c - 1\). In particular it is true for \(G/\gamma_c(G)\) so
  \[
    g = [a_1, x_1] \cdots [a_d, x_d] \cdot u
  \]
  for some \(u \in \gamma_c(G)\). We can write \(u\) as a product
  \[
    u = \prod_{i = 1}^N [g_i, v_i]
  \]
  where \(g_i \in G, v_i \in \gamma_{c - 1}(G)\). Recall the commutator relations
  \begin{align*}
    [xy, z] &= [x, z]^y [y, z] \\
    [x, yz] &= [x, z] [x, y]^z
  \end{align*}
  which imply, for \(v \in \gamma_{c - 1}(G)\)
  \begin{align*}
    [a_ia_j, v] &= [a_i, v] [a_j v] \\
    [a_i^{-1}, v] &= [a_i, v^{-1}] = [a_i, v]^{-1} \\
    [a_i, v] [a_i, v] &= [a_i, v^2] \\
    [a_i, w] [a_i, v] &= [a_i, vw]
  \end{align*}
  Now we can rewrite \(u\) in the form \([a_1, v_1'] \cdots [a_d, v_d']\) so
  \[
    g = [a_1, x_1] \cdots [a_d, x_d] [a_1, v_1'] \cdots [a_d, v_d']
    = [a_1, x_1v_1'] \cdots [a_d, x_d v_d'].
  \]
\end{proof}

\begin{proposition}
  Let \(G\) be a tfg pro-\(p\) group. Then \([G, G]\) is closed in \(G\).
\end{proposition}

\begin{proof}
  Let \(a_1, \dots, a_d\) be a tgs for \(G\). Let
  \[
    X = \{[a_1, x_1] \cdots [a_d, x_d]: x_i \in G\}.
  \]
  \(X\) is the image of the map
  \begin{align*}
    G^d &\to G \\
    (x_1, \dots x_d) &\mapsto [a_1, x_1] \cdots [a_d, x_d]
  \end{align*}
  so is compact so closed. Obviously \(X \subseteq [G, G]\). Let \(g \in [G, G]\). Let \(G = \varprojlim G_j\) where \(p_j: G \to G_j\). Then \(p_j(g) \in [G_j, G_j]\). \(G_j\) is nilpotent as it is a \(p\)-group. By the previous lemma
  \[
    p_j(g) = [p_j(a_1), x_1] \cdots [p_j(a_d), x_d]
  \]
  for some \(x_1, \dots, x_d \in G_j\). Hence \(p_j(g) \in p_j(X)\) for all \(j\) so \(g \in \overline X = X\).
\end{proof}

\begin{proposition}
  Let \(G\) be a pro-\(p\) group and let \(K\) be a finite index subgroup. Then \([G: K]\) is a power of \(p\).
\end{proposition}

\begin{proof}
  wlog assume \(K\) is normal (otherwise replace \(K\) by its core). Let \([G: K] = m = p^r m'\) where \(m'\) is coprime to \(p\). Consider \(X = \{g^m:g \in G\}\). Then \(X \subseteq K\) by Lagrange. \(X\) is closed so
  \[
    X = \overline X = \bigcap_{N \normal_o G} XN.
  \]
  We will show that \(g^{p^r} \in X \subseteq K\) for all \(g \in G\), and this shows \([G: K]\) divides \(p^r\) (?). Let \(N \normal_o G\) be open normal. Let \([G: N] = p^s\) for some \(s\). Let \(t = \max(r, s)\). Then \(g^{p^s} \in N\) for all \(g \in G\). But \((m, p^t) = p^r\) so exists \(a, b \in \Z\)  such that \(am + bp^t = p^r\). Then
  \[
    g^{p^r} = (g^a)^m \cdot (g^b)^{p^t} \in XN.
  \]
  This holds for all \(N \normal_o G\) so the result follows.
\end{proof}

\begin{proposition}
  If \(G\) is a tfg pro-\(p\) group then \([G, G]G^p\) is closed in \(G\), hence equal to \(\Phi(G)\).
\end{proposition}

\begin{proof}
  Let \(G^{\{p\}} = \{g^p: g \in G\}, G^p = \langle G^{\{p\}} \rangle\). As \(G/[G, G]\) is abelian,
  \[
    [G, G]G^p = [G, G]G^{\{p\}}
  \]
  and \([G, G]G^{\{p\}}\) is closed as it is the image of the map
  \begin{align*}
    [G, G] \times G &\to G \\
    (x, g) &\mapsto xg^p
  \end{align*}
\end{proof}

\begin{proof}[Proof of \Cref{thm:finite index subgroup of pro-p group is open}]
  Again wlog look at normal subgroups only. Suppose \(K \normal_f G\) is a counterexample with \([G: K]\) is minimal. Consider
  \[
    M = [G, G]G^p K \normal_f G
  \]
  which contains \(K\) as a finite index subgroup.

  Now \(G/K\) is a non-trivial \(p\)-group so
  \[
    \Phi(G/K) = [G/K, G/K](G/K)^p,
  \]
  which is the image of \(M\) in \(G/K\). Hence \(M\) is a proper subgroup of \(G\) so either \(M = K\), so \(K \geq [G, G] G^p = \Phi(G)\) open, so \(K\) open, or \(M \ne K\), therefore by minimality \(K\) is open in \(M\) and \(M\) is open in \(G\) so \(K\) is open in \(G\).
\end{proof}

\subsection{Hensel's lemma \& \(p\)-adic arithmetic}

We saw earlier that solving the equation \(ax = 1\) in \(\Z_p\) just depends on the image of \(a\) in \(\Z/p\). Hensel's lemma allows us to do so for all polynomials, and gives an algorithm for finding the root.

\begin{lemma}
  Let \(f(x)\) be a polynomial with \(\Z_p\) coefficients. Then \(f\) has a root in \(\Z_p\) if and only if it has a root modulo \(\Z/p^k\) for all \(k\).
\end{lemma}

The aim is to reduce just to mod \(p\). To do so we use the method of \emph{Hensel lifting}\index{Hensel lifting}. As an example let \(p = 7\) and \(f(x) = x^2 - 2\). \(f(3) = 0 \pmod 7\) so to find a solution mod \(49\), consider the element \(3 + 7a\), \(0 \leq a \leq 6\). Then
\[
  (3 + 7a)^2 = 9 + 7 \cdot 6a + 49 a^2 = 2 + 7 (1 + 6a) \pmod{49}
\]
so we only have to solve a linear equation since the square term vanishes. \(a = 1\), for example, gives a solution so \((3 + 7 \cdot 1)^2 = 100 = 2 \pmod{49}\). Next we can consider \(10 + 7^2 \cdot a \in \Z/343\) etc.

\begin{proposition}[Hensel's lemma for square roots]
  Let \(p \ne 2\) be prime. Suppose \(\lambda \in \Z_p\) is congruent to a nonzero square \(r_1^2 \pmod p\). Then exists a unique \(\rho \in \Z_p\) such that \(\rho^2 = \lambda\) and \(\rho = r_1 \pmod p\).
\end{proposition}

\begin{proof}
  We construct a sequence \(r_k \in \Z\), unique modulo \(p^k\), such that
  \begin{itemize}
  \item \(r_{k + 1} = r_k \pmod{p^k}\),
  \item \(r_k^2 = \lambda \pmod{p^k}\).
  \end{itemize}
  The first condition can be either interpreted as \((z_k)\) forming a Cauchy sequence in \(\Z_p\), or as \((r_k) \in \prod \Z/p^k\) compatible with transition functions. In either case it gives an elemnt \(\rho \in \Z_p\). The second condition then says \(\rho^2 = \lambda\).

  Suppose we have constructed \(r_k\). Consider the elements \(r_k + ap^k\), \(0 \leq a < p\). Since \(r_k^2 = \lambda \pmod{p^k}\), we can write \(r_k^2 = \lambda + b_k p^k\) for some \(b_k \in \Z_p\). Then
  \[
    (r_k + p^ka)^2 = \lambda + p^kb_k + 2p^ka r_k + p^{2k} a^2
    = \lambda + p^k(b_k + 2a r_k) \pmod{p^{k + 1}}
  \]
  Now modulo \(p\),
  \[
    b_k + 2ar_k = b_k + 2ar_1 \pmod p
  \]
  has a unique root for \(a \pmod p\), since \(2r_1 \ne 0 \pmod p\). Set \(r_{k + 1} = r_k + p^k a\).
\end{proof}

\begin{proposition}[Hensel's lemma]\index{Hensel's lemma}
  Let \(f(x)\) be a polynomial with \(\Z_p\) coefficients and let \(K \in \N\). Let \(r \in \Z_p\) be such that \(f(r) = 0 \pmod{p^K}, f'(r) \ne 0 \pmod p\). Then exist a unique \(\rho \in \Z_p\) such that \(f(\rho) = 0\) and \(\rho = r \pmod{p^K}\).
\end{proposition}

This follows immediately from

\begin{lemma}
  For \(r, a \in \Z_p\) and \(k \geq 1\),
  \[
    f(r + p^ka) = f(r) + p^k af'(r) \pmod{p^{k + 1}}.
  \]
\end{lemma}

\begin{proof}
  The statement is linear in \(f\) so enough to show for \(f(x) = x^n\). By binomial formula,
  \begin{align*}
    (r + p^ka)^n
    &= r^n + np^ka r^{n - 1} + \sum_{i = 2}^n \binom{n}{i} p^{ki}a^i r^{n - i} \\
    &= r^n + np^kar^{n - 1} \pmod{p^{k + 1}}
  \end{align*}
\end{proof}

We can adapt Hensel's lemma to matrix groups.

\begin{definition}
  Define filtrations
  \begin{align*}
    \GL_N^{(k)}(\Z_p)
    &= \ker(\GL_N(\Z_p) \to \GL_N(\Z/p^k)) \\
    &= \{I + p^k A: A \in \Mat_{N \times N}(\Z_p)\} \\
    \SL_N^{(k)}(\Z_p)
    &= \ker(\SL_N(\Z_p) \to \SL_N(\Z/p^k)) \\
    &= \{I + p^k A: A \in \Mat_{N \times N}(\Z_p), \det(I + p^kA) = 1\}
  \end{align*}
\end{definition}

\begin{proposition}
  \(\GL_N^{(1)}(\Z_p)\) and \(\SL_N^{(1)}(\Z_p)\) are pro-\(p\) groups.
\end{proposition}

\begin{proof}
  Write
  \[
    \GL_N^{(1)}(\Z_p) = \varprojlim_{k \in \Z} \GL_N^{(1)}(\Z/p^k)
  \]
  and \(\GL_N^{(1)}(\Z/p^k) = \{I + pA: A \in \Mat_{N \times N}(\Z/p^k)\}\) has order \(p^{N^2(k - 1)}\). \(\SL_N^{(1)}(\Z_p)\) is a closed subgroup of \(\GL_N^{(1)}(\Z_p)\) and is also a pro-\(p\) group.
\end{proof}

For the rest of the section we assume \(p\) is an odd prime.

\begin{proposition}
  The continuous function \(A \mapsto A^p\) maps \(\GL_N^{(k)}(\Z_p)\) onto \(\GL_N^{(k + 1)}(\Z_p)\). Same for \(\SL\).
\end{proposition}

Slogan: every element in \(\GL_n^{k + 1}(\Z_p)\) has a \(p\)th root.

\begin{proof}
  The proof is by Hensel-like successive approximations. Claim for all \(r \geq 1\), for all \(A\),
  \[
    (I + p^rA)^p
    = I + p^{r + 1}A + p^{r + 2}B
    = I + p^{r + 1}A \pmod{p^{r + 2}}
  \]
  where \(B\) is some polynomial of \(A\): for \(\ell \geq 2\) the term
  \[
    \binom{p}{p - \ell} p^{r\ell} A^{\ell}
  \]
  always has a factor \(p^{r + 2}\).

  Let \(I + p^{k + 1}A \in \GL_N^{(k + 1)}(\Z_p)\). We show inductively that: for all \(n \geq 1\), exist matrices \(B_n, E_n\) both expressible as polynomials in \(A\) such that
  \begin{itemize}
  \item \(B_{n + 1} = B_n \pmod{p^n}\),
  \item \((I + p^k B_n)^p = I + p^{k + 1}A + p^{k + n + 1}E_n\).
  \end{itemize}
  Note that \(B_n, E_n\)'s commute and therefore we can apply binomial theorem. For \(n = 1\), choose \(B_1 = A\). Then
  \[
    (I + p^kA)^p = I + p^{k + 1}A + p^{k + 2}E_1.
  \]
  Inductively define \(B_{n + 1} = B_n - p^n E_n\),
  \begin{align*}
    (I + p^k B_{n + 1})^p
    &= (I + p^k B_n - p^{k + n}E_n)^p \\
    &= (I + p^kB_n)^p - p \cdot p^{k + n} E_n (I + p^k B_n)^{p - 1} + O(p^{k + n + 2}) \\
    &= I + p^{k + 1}A + p^{k + n + 1}E_n - p^{k + n + 1} E_n (I + O(p^k)) + O(p^{k + n + 2}) \\
    &= I + p^{k + 1}A + p^{k + n + 2}E_{n + 1}
  \end{align*}
  for some \(E_{n + 1}\). Thus the proposition holds for \(\GL\).

  For \(\SL\), suffcies to show \(\det C^p = 1\) then \(\det C = 1\). See example sheet 3 Q10: \(\Z_p^\times = \Z_p \times C_{p - 1}\).
\end{proof}

\begin{lemma}
  \[
    (I + p^kA)(I + p^kB) = (I + p^k B)(I + p^kA) = I + p^k(A + B) \pmod{p^{k + 1}}.
  \]
\end{lemma}

\begin{proposition}
  For all \(k\),
  \[
    \Phi(\GL_N^{(k)}(\Z_p)) = \GL_N^{(k + 1)}(\Z_p)
  \]
  and
  \[
    \GL_N^{(k)}/\GL_N^{(k + 1)} \cong \F_p^{N^2}.
  \]
\end{proposition}

\begin{proof}
  By the previous proposition
  \[
    \GL_N^{(k + 1)} \subseteq (\GL_N^{(k)})^p \subseteq \Phi(\GL_n^{(k)}).
  \]
  By the lemma \(\GL_N^{(k)}/\GL_N^{(k + 1)}\) is abelian and of exponent \(p\) so is isomorphic to \(\F_p^d\) for some \(d\). But we have already seen that \(|\GL_N^{(k)}/\GL_N^{(k + 1)}| = p^{N^2}\) so \(d = N^2\). As \(\Phi(\F_p^{N^2}) = 1\), \(\Phi(\GL_N^{(k)}) \subseteq \GL_N^{(k + 1)}\).
\end{proof}

\begin{corollary}
  For any \(k\), the continuous map \(A \mapsto A^p\) induces an isomorphism
  \[
    \GL_N^{(k)}/\GL_N^{(k + 1)} \to \GL_N^{(k + 1)}/\GL_N^{(k + 2)}.
  \]
\end{corollary}

\begin{theorem}
  If \(H\) is a closed subgroup of \(\GL_N^{(1)}\) then \(d(H) \leq N^2\).
\end{theorem}

\begin{proof}
  Suffices to show \(d(H) \leq N^2\) for any subgroup \(H\) of each finite group \(G = \GL_N^{(1)}/\GL_N^{(k + 1)}\) for each \(k\). For each \(H \leq G\), for \(m \leq k\), set
  \begin{align*}
    G_m &= \GL_N^{(m)}/\GL_N^{(k + 1)} \\
    H_m &= H \cap G_m
  \end{align*}
  Induction to show \(d(H_m) \leq N^2\): for \(m = k\)
  \[
    H_k \leq G_k = \GL_N^{(k)}/\GL_N^{(k + 1)} \cong \F^{N^2}_p.
  \]
  Inductively, let \(e\) be the dimension of
  \[
    H_m/H_{m + 1} \leq G_m/G_{m + 1} \cong \F_p^{N^2}.
  \]
  Have a surjection \(H_m/\Phi(H_m) \to H_m/H_{m + 1}\) (?). Take \(e\) elements \(h_1, \dots, h_e\) of \(H_m\) which generate \(H_m/H_{m + 1}\). The \(p\)th-power map gives an isomorphism \(G_m/G_{m + 1} \cong G_{m + 1}/G_{m + 2}\) and hence \(h_1^p, \cdots, h_e^p\) are linearly independent in \(G_{m + 1}/G_{m + 2}\), thus linearly independent in \(H_{m + 1}/\Phi(H_{m + 1})\) (?). By extending to a basis, we can find \(y_1, \dots, y_{d - e}\) elements of \(H_{m + 1}\) such that \(H_{m + 1} = \langle h_1^p, \dots, h_e^p, y_1, \dots, y_{d - e} \rangle\). Then
  \[
    H_m = \langle h_1, \dots, h_e \rangle H_{m + 1} = \langle h_1, \dots, h_e, y_1, \dots, y_{d - e} \rangle
  \]
  so \(d(H_m) \leq d(H_{m + 1})\).
\end{proof}

\begin{corollary}[Non-examinable]
  There is no closed nonabelian free pro-\(p\) subgroup in \(\GL_N(\Z_p)\).
\end{corollary}

\begin{proof}[Sketch proof]
  \(\hat F_{(p)}\) has normal subgroups of index \(p^n\) for all \(n\). These subgroups, by a form of basic correspondence, are free pro-\(p\) of rank \(p^n(r - 1) + 1\), absurd.
\end{proof}

Compare this with the result that \(\SL_2(\Z)\) contains a nonabelian free subgroup.

As a converse we have

\begin{theorem}[Non-examinable]
  If \(G\) is a pro-\(p\) group and exists \(R\) such that \(d(H) \leq R\) for all \(H \leq_c G\) then there exists an abelian normal subgroup \(A \cong \Z_p^e \leq G\) (\(e \leq R\)) such that \(G/A \embed \GL_R(\Z_p) \times F\) where \(F\) is a finite \(p\)-group.
\end{theorem}

\section{Cohomology of groups}

\subsection{Group rings and chain complexes}

Let \(G\) be an abstract group.

\begin{definition}[group ring]\index{group ring}
  The \emph{group ring} \(\Z G\) is the free abelian group with basis \(G\), with multiplication given on basis elements by \(g \cdot h = gh\).
\end{definition}

\(\Z G\) is in general noncommutative, but is commutative if \(G\) is abelian. The multiplicative identity is \(1 e = e\). Note that \(\Z G\) is not necessarily an integral domain, for example if \(G\) has torsion element.

\begin{definition}[\(G\)-module]\index{\(G\)-module}
  A \emph{\(G\)-module} is a \(\Z G\)-module.
\end{definition}

\begin{remark}\leavevmode
  \begin{enumerate}
  \item We only need to think about the action of basis elements.
  \item A \(G\)-module \(M\) is trivial if \(g \cdot m = m\) for all \(g \in G, m \in M\).
  \end{enumerate}
\end{remark}

\begin{definition}
  If \(M_1, M_2\) are \(G\)-modules, a morphism of \(G\)-modules or a \(G\)-linear map is a \(\Z G\)-module homomorphism \(M_1 \to M_2\).
\end{definition}

\begin{definition}
  Let \(M_1, M_2\) be \(G\)-modules. The \emph{\(\Hom\)-group} \(\Hom_G(M_1, M_2)\) is the set of \(G\)-linear maps \(M_1 \to G_2\) with the structure of an abelian group.
\end{definition}

\begin{definition}[chain complex]\index{chain complex}
  A \emph{chain complex of \(G\)-modules} is a sequence of \(G\)-modules and \(G\)-module maps
  \[
    \begin{tikzcd}
      M_s \ar[r] & \cdots \ar[r] & M_n \ar[r, "d_n"] & \cdots \ar[r, "d_{t + 1}"] & M_t \ar[r] & \cdots \ar[r] & M_t
    \end{tikzcd}
  \]
  such that \(d_n \compose d_{n + 1} = 0\) for all \(n\). Sometimes the chain complex is written as \((M_n, d_n)\).

  The complex is \emph{exact at \(M_n\)} if \(\im d_{n + 1} = \ker d_n\). The complex is \emph{exact} if it is exact at \(M_n\) for all \(t < n < s\).

  The \emph{homology} of the complex is the sequence of abelian groups \(H_S(M_\bullet) = \ker d_S, H_m(M_\bullet) = \ker d_n/\im d_{n + 1}, H_t(M_\bullet) = M_t/\im d_{t + 1}\).
\end{definition}

Revision on free/projective modules and free/projective resolution.

\begin{eg}
  Let \(X\) be a simplicial complex whose universal cover \(\widetilde X\) is contractible. let \(G = \pi_1X\) and let \(X_n\) be the set of \(n\)-simplices of \(X\). Now \(G\) acts on \(\widetilde X\) with quotient \(X\) and no fixed points. Thus the set of \(n\)-simplices of \(\widetilde X\) is in bijection with \(G \times X_n\). The reduced simplicial chain complex of \(\widetilde X\) takes the form
  \[
    \begin{tikzcd}
      \cdots \ar[r] & \Z G\{X_2\} \ar[r] & \Z G \{X_1\} \ar[r] & \Z G\{X_0\} \ar[r] & \Z \ar[r] & 0
    \end{tikzcd}
  \]
  which is a free resolution of \(\Z\) by \(G\)-modules.
\end{eg}

\begin{definition}[group cohomology]\index{group cohomology}
  Let \(F_\bullet\) be a projective resolution of \(\Z\) by \(G\)-modules. Let \(M\) be a \(G\)-module. Apply the functor \(\Hom_G(-, M)\) to get a chain complex
  \[
    \begin{tikzcd}
      \Hom_G(F_0, M) \ar[r, "d^1"] & \Hom_G(F_1, M) \ar[r, "d^2"] & \cdots
    \end{tikzcd}
  \]
  The \emph{\(n\)th cohomoogy group with coefficients in \(M\)} is then
  \[
    H^n(G, M) = \ker d^{n + 1}/\im d^n.
  \]
  Elements of \(\ker d^{n + 1}\) and \(\im d^n\) are called \emph{\(n\)-cocycles} and \emph{\(n\)-coboundaries} respectively.
\end{definition}

\begin{eg}
  Let \(G = \Z = \langle t\rangle\) (written multiplicatively). Consider the chain complex
  \[
    \begin{tikzcd}
      0 \ar[r] & \Z G \ar[r, "d_1"] & \Z G \ar[r, "\varepsilon"] & \Z \ar[r] & 0
    \end{tikzcd}
  \]
  where
  \begin{align*}
    \varepsilon(\sum n_g g) &= \sum n_g \\
    d_1(x) &= x(t - 1)
  \end{align*}
  It is easy to check this is exact with perhaps the exception \(\ker \varepsilon \subseteq \im d_1\). To do so suppose \(x = \sum_{k = K}^L n_k t^k \in \ker \varepsilon\) so \(\sum n_k = 0\). Then
  \begin{align*}
    x &= n_L t^{L - 1} (t - 1) + n_L t^{L - 1} + \sum_{k = K}^{L - 1} n_k t^k \\
      &= n_L t^{L - 1} (t - 1) + (n_L + n_{L - 1})t^{L - 2} (t - 1) + (n_L + n_{L - 1})t^{L - 2} + \sum_{k = K}^{L - 2} n_k t^k \\
      &= \cdots \\
      &= \text{ some expression } \cdot (t - 1) + \underbrace{(n_L + \dots + n_K) t^{K - 1}}_{= 0}
  \end{align*}

  Now let \(M\) be a \(G\)-module and apply \(\Hom_G(-, M)\) to get
  \[
    \begin{tikzcd}
      \Hom_G(\Z G, M) \ar[r, "d^1"] & \Hom_G(\Z G, M) \ar[r] & 0
    \end{tikzcd}
  \]
  Note that \(\Hom_G(\Z G, M) \cong M\) as abelian groups so we can rewrite the chain complex as
  \[
    \begin{tikzcd}
      M \ar[r, "(t - 1) \cdot "] & M \ar[r] & 0
    \end{tikzcd}
  \]
  so
  \begin{align*}
    H^0(G, M) &= \ker d^1 = \{m \in M: tm = m\} = M^G \\
    H^1(G, M) &= M/\im d^1 = M/\langle (t - 1) M\rangle = M_G
  \end{align*}
  which are called \emph{invariants}\index{invariant} and \emph{coinvariants} of \(M\) respectively. \(H^n(G, M) = 0\) for \(n \geq 2\).
\end{eg}

\begin{proposition}\label{prop:cohomological dimension of free group}
  If \(G\) is a free group then \(H^n(G, M) = 0\) for all \(n \geq 2\).
\end{proposition}

\begin{proof}[Non-examinable]
  Let \(X\) be a wedge of circles with \(\pi_1 X = G\). The universal cover \(\widetilde X\) is a tree so contractible. The simplicial chain complex of \(\widetilde X\) gives a free resolution of \(G\)-modules of length \(1\).
\end{proof}

\begin{definition}[cohomological dimension]\index{cohomological dimension}
  A group \(G\) has \emph{cohomological dimension} \(n\), written \(\mathrm{cd}(G) = n\), if \(H^m(G, M) = 0\) for all \(M\) for all \(m > n\) but exists \(M\) such that \(H^n(G, M) \ne 0\). If no such \(n\) exists then \(\mathrm{cd}(G) = \infty\).
\end{definition}

Thus free groups have cohomological dimension \(1\). The converse is a also true, by a deep theorem of Stallings and Swan.\index{Stallings-Swan theorem}

We now investigate morphisms between complexes of \(G\)-modules, which should really be done in the context of homological algebra using derived categories. The proofs are omitted.

\begin{definition}[chain map]
  Let \((A_n, \alpha_n)\) and \((B_n, \beta_n)\) be chain complexes of \(G\)-modules. A \emph{chain map} is a sequence of \(G\)-linear maps \(f_n: A_n \to B_n\) such that
  \[
    f_{n - 1} \compose \alpha_n = \beta_n \compose f_n
  \]
  for all \(n\).
\end{definition}

\begin{proposition}
  A chain map \((f_n): (A_n) \to (B_n)\) induces maps \(f_*: H_n(A_\bullet) \to H_n(B_\bullet)\).
\end{proposition}

\begin{corollary}
  A \(G\)-linear map \(f: M \to N\) induces maps \(f_*: H^*(G, M) \to H^*(G, N)\).
\end{corollary}

\begin{proposition}
  If
  \[
    \begin{tikzcd}
      0 \ar[r] & M_1 \ar[r] & M_2 \ar[r] & M_3 \ar[r] & 0
    \end{tikzcd}
  \]
  is a short exact sequence of \(G\)-modules then there is a long exact sequence
  \[
    \begin{tikzcd}[column sep=small]
      \cdots \ar[r] & H^n(G, M_1) \ar[r] & H^n(G, M_1) \ar[r] & H^n(G, M_3) \ar[r] & H^{n + 1}(G, M_1) \ar[r] & \cdots
    \end{tikzcd}
  \]
\end{proposition}

\subsection{Different projective resolutions}

\begin{theorem}
  The definition of \(H^n(G, M)\) does not depend on the choice of projective resolutions.
\end{theorem}

This follows from the homological algebra fact that projective resolutions are unique up to quasi-isomorphism. The proof is non-examniable \emph{except} for the definition of the chain map between two complexes.

\subsection{Bar resolution}

We define the so-called bar resolution\index{bar resolution} for the trivial \(G\)-module \(\Z\). Let \(G^{(n)}\) be the set of symbols \([g_1|g_2| \cdots |g_n]\), \(g_i \in G\). Let \(F_n = \Z G \{G^{(n)}\}\). Define
\begin{align*}
  d_0: F_0 &\to \Z \\
  \sum n_g g &\mapsto \sum n_g
\end{align*}
i.e.\ the augmentation map. Define
\begin{align*}
  d_n: F_n &\to F_{n - 1} \\
  [g_1| \cdots |g_n] &\mapsto g_1[g_2| \cdots | g_n] \\
           &+ \sum (-1)^i [g_1| \cdots| g_ig_{i + 1}| \cdots | g_n] \\
           &+ (-1)^n [g_1| \cdots |g_{n - 1}]
\end{align*}

\begin{proposition}
  The bar resolution is a free resolution of \(\Z\) by \(G\)-modules.
\end{proposition}

\begin{proof}[Non-examinable]
  \(F_n\) is \(G\)-isomorphic to \(\Z\{G^{n + 1}\}\) (with diagonal \(G\)-action) via \([g_1| \cdots |g_n] \mapsto (1, g_1, g_1g_2, \dots, g_1 \cdots g_n)\). The latter is a chain complex with boundary maps
  \[
    (g_0, \dots, g_n) \mapsto \sum (-1)^i (g_0, \dots, \hat g_i, \dots, g_n)
  \]
  and the complex is acyclic via the obvious chain homotopy
  \[
    (g_0, \dots, g_n) \mapsto (1, g_0, \dots, g_n).
  \]
\end{proof}

Since different projective resolutions give the same cohomology groups we might reinterpret group cohomology in terms of bar resolution.

\begin{definition}
  The group of \emph{\(n\)th cochains} of \(G\) with coefficients in \(M\) is
  \[
    C^n(G, M) = \{G^n \to M\} = \Hom_G(F_n, M).
  \]
  The \emph{\(n\)th coboundary map} is
  \begin{align*}
    d^n: C^{n - 1}(G, M) &\to C^n(G, M) \\
    \phi &\mapsto ((g_1, \dots, g_n) \mapsto g_1 \cdot \phi(g_2, \dots, g_n) \\
                         &+ \sum (-1)^i \phi(g_1g_2, \dots, g_n) \\
                         &+ (-1)^n \phi(g_1, \dots g_{n - 1})
  \end{align*}
  The \emph{\(n\)th cocycle} and \emph{\(n\)th coboundary} are
  \begin{align*}
    Z^n(G, M) &= \ker d^{n + 1} \\
    B^n(G, M) &= \im d^n
  \end{align*}
  The \emph{\(n\)th cohomology} is defined to be
  \[
    H^n(G, M) = Z^n(G, M)/B^n(G, M).
  \]
\end{definition}

We can write out the low-dimensional cocyles and coboundaries explicitly.
\[
  H^0(G, M) = \ker d^1 = \{m \in M: gm = m \text{ for all } g\} = M^G
\]
is called the set of \emph{invariants} of \(M\).
\begin{align*}
  \ker d^2 &= \{\phi: G \to M: \phi(gh) = g \phi(h) + \phi(g)\} \\
  \im d^1 &= \{\phi: G \to M: \text{ exists } m \text{ such that } \phi(g) = (g - 1)m\}
\end{align*}
are called \emph{crossed homomorphisms} and \emph{principal crossed homomorphisms}.

\begin{eg}
  If \(M\) has trivial \(G\)-action then
  \[
    H^1(G, M) = \Hom(G, M).
  \]
\end{eg}

\begin{proposition}
  Let \(\alpha: G_1 \to G_2\) be a group homomorphism and \(M\) a \(G_2\)-module. Then there is a natural homomorphism \(\alpha^*: H^n(G_2, M) \to H^n(G_1, M)\).
\end{proposition}

\begin{proof}
  Given \(f \in C^n(G_2, M)\), set \(\alpha^*f \in C^n(G_1, M)\) to be the composition \(f \compose \alpha^n\).
\end{proof}

Suppose we have a short sequence of groups
\[
  \begin{tikzcd}
    1 \ar[r] & H \ar[r] & G \ar[r] & Q \ar[r] & 1.
  \end{tikzcd}
\]
There is in general no long exact sequence on cohomologies in the style of the snake lemma.

\begin{eg}
  Let \(M = \Z\) (with trivial actions) and a short exact sequence \(0 \to \Z \to \Z^2 \to \Z \to 0\). Then the sequence
  \[
    \begin{tikzcd}[row sep=small]
      H^2(\Z, \Z) \ar[r] \ar[d, equal] & H^2(\Z^2, \Z) \ar[r] & H^2(\Z, \Z) \ar[d, equal] \\
      0 & & 0
    \end{tikzcd}
  \]
  cannot be exact as \(H^2(\Z^2, \Z) \ne 0\).
\end{eg}

There is, however, \emph{some} exact sequences coming from spectral sequences, namely the five-term exact sequence. In low dimensions they can be described explicitly. We state the result below and sketch the proof.

\begin{lemma}
  Let \(H \normal G\) and let \(M\) be a \(G\)-module. Let \(G\) act on \(C^n(H, M)\) via
  \[
    (g \cdot \phi)(h_1, \dots, h_n) = g\phi(g^{-1} h_1g, \dots, g^{-1}h_n g).
  \]
  Then this gives an action of \(G\) on \(H^n(H, M)\). Moreover \(H\) acts trivially.
\end{lemma}

\begin{proof}
  The first part is an easy computation:
  \begin{align*}
    (g \cdot d^n \phi)(h_1, \dots, h_n)
    &= g d^n\phi(g^{-1}h_1g, \dots, g^{-1}h_ng) \\
    &= g(g^{-1}h_1g) \phi(g^{-1}h_2g, \dots, g^{-1}h_ng) \\
    &+ \sum (-1)^i g \phi(g^{-1}h_1g, \dots, g^{-1} h_ih_{i + 1} g, \dots, g^{-1} h_n g) \\
    &+ (-1)^n g \phi(g^{-1}h_1g, \dots, g^{-1}h_{n - 1}g) \\
    &= h_1 (g \cdot \phi)(h_2, \dots, h_n) \\
    &+ \sum (-1)^i d (g \cdot \phi) (h_1, \dots, h_i h_{i + 1}, \dots, h_n) \\
    &+ (-1)^n d(g \cdot \phi) (h_1, \dots, h_{n - 1}) \\
    &= (d^n(g \cdot \phi))(h_1, \dots, h_n)
  \end{align*}

  To show \(H\) acts trivially, we show if \(h \in H\), \(\phi \in Z^n(G, M)\) then \(h \cdot \phi - \phi \in \im d^n\). Induction on \(n\). \(n = 1\),
  \[
    0 = (d^2 \phi)(h_1, h_2) = h_1\phi(h_2) - \phi(h_1h_2) + \phi(h_1)
  \]
  so
  \[
    \phi(h_1h_2) = h_1\phi(h_2) + \phi(h_1)
  \]
  then
  \begin{align*}
    (h \cdot \phi - \phi)(h_1)
    &= (h \cdot \phi)(h_1) - \phi(h_1) \\
    &= h \phi(h^{-1}h_1h) - \phi(h_1) \\
    &= h(h^{-1} \phi(h_1h) + \phi(h^{-1})) - \phi(h_1) \\
    &= h_1\phi(h) + \phi(h_1) + h\phi(h^{-1}) - \phi(h_1) \\
    &= h_1\phi(h) - \phi(h) \\
    &= (h_1 - 1) \phi(h) \in \im d^1
  \end{align*}
  The induction process is another messy calculation and is left as an exercise.
\end{proof}

Note if \(G\) has trivial action and \(\phi \in C^1(H, M)\) then
\[
  (g \cdot \phi)(h) = \phi(g^{-1}hg)
\]
so \(\phi \in H^1(H, M)^G\) if and only if \(\phi(h) = \phi(g^{-1}hg)\) for all \(g \in G, h \in H\). Such a \(\phi: H \to M\) is called a \(G\)-invariant homomorphism.

\begin{theorem}[inflation-restriction exact sequence]\index{inflation-restriction exact sequence}
  Let \(H \normal G\) and \(Q = G/H\). Let \(M\) be a \(G\)-module. Then there is an exact sequence
  \[
    \begin{tikzcd}
      0 \ar[r] & H^1(Q, M^H) \ar[r] & H^1(G, M) \ar[r] & H^1(H, M)^G \ar[dll, out=0, in=180, overlay] \\
      & H^2(Q, M^H) \ar[r] & H^2(G, M)
    \end{tikzcd}
  \]
\end{theorem}

Note that \(H^1(H, M)^G = H^1(H, M)^Q\) by the previous lemma.

\begin{proof}[Non-examinable]
  We only define the maps appearing in the sequence. This is done via the restriction map
  \begin{align*}
    H^n(G, M) &\to H^n(H, M)^G \\
    \phi &\mapsto \phi|_{H^n}
  \end{align*}
  the inflation map
  \begin{align*}
    H^n(Q, M^H) &\to H^n(G, M) \\
    \phi &\mapsto \phi \compose q^n
  \end{align*}
  where \(q: G \to Q\), and the transgression map \(Tg: H^1(H, M) \to H^2(Q, M^H)\) defined as follow: choose a set-theoretic section \(s: Q \to G\), i.e.\ a transversal, with \(s(1) = 1\). Define
  \begin{align*}
    \rho: G &\to H \\
    g &\mapsto g \cdot s(gH)^{-1}
  \end{align*}
  If \(\phi: H \to M\) is a \(Q\)-invariant cocycle, define
  \begin{align*}
    Tg(\phi): G^2 &\to M \\
    (g_1, g_2) &\mapsto \phi(\rho(g_1)\rho(g_2)) - \phi(\rho(g_1g_2))
  \end{align*}
  \(Tg(\phi)\) descends to \(Q^2 \to M\).
\end{proof}

\begin{corollary}[Hopf formula]\index{Hopf formula}
  Let \(F\) be free, \(R \normal F\) and \(Q = F/R\). If \(A\) is abelian with trivial \(F\)-action then
  \[
    H^2(Q, A) \cong \frac{\{\text{\(F\)-invariant homomorphisms } R \to A\}}{\{\text{restrictions of homomorphisms } F \to A\}}.
  \]
\end{corollary}

\begin{eg}
  Suppose \(Q = \langle x_1, \dots, x_d| r_1, \dots, r_n \rangle\) is a presentation, so \(F = F \{x_1, \dots, x_d\}, R = \langle\langle r_1, \dots, r_m \rangle\rangle\). Then
  \begin{align*}
    d(H^1(Q, \Z)) &\leq d \\
    d(H^2(Q, \Z)) &\leq m
  \end{align*}
\end{eg}

\subsection{Cohomology and group extensions}

Let \(E\) be a group, with an abelian normal subgroup \(M\). Let \(G = E/M\). Such an \(E\) is called an \emph{extension of \(G\) by \(M\)}\index{extension}. Two extensions are \emph{equivalent}\index{extension!equivalent} if there is a commutative diagram of homomorphisms
\[
  \begin{tikzcd}
    1 \ar[r] & M \ar[r] \ar[d, equal] & E \ar[r] \ar[d] & G \ar[r] \ar[d, equal] & 1 \\
    1 \ar[r] & M \ar[r] & E' \ar[r] & G \ar[r] & 1
  \end{tikzcd}
\]

\begin{lemma}
  Equivalent extensions are isomorphic as groups.
\end{lemma}

\begin{proof}
  Same as five lemma.
\end{proof}

Note that \(M\) comes with the structure of a \(G\)-module: the conjugation action of \(E\) on \(M\) descends to a \(G\)-action. If this action is trivial, the extension is called a \emph{central extension}\index{extension!central}.

Given a \(G\)-module \(M\), the group extension problem is concerned about the classification of the extensions. We can always form the \emph{semidirect product} \(E = M \rtimes G\). It is sometimes also called a \emph{split extension}\index{extension!split}.

\begin{definition}[splitting]
  The \emph{splitting} of an extension \(E\) is a group homomorphism \(G \to E\) that is a section to \(E \to G\).
\end{definition}

\begin{proposition}
  Extensions which have a splitting are equivalent to \(M \rtimes G\).
\end{proposition}

\begin{proof}
  Set \(M \rtimes G \to E, (m, g) \mapsto i(m) s(g)\) where \(s\) is a section of \(E \to G\).
\end{proof}

Let \(E\) be an arbitrary extension of \(G\) by \(M\). Let \(s: G \to E\) be a set-theoretic section with \(s(1) = 1\). To measure how far \(s\) is from being a homomorphism, consider the function
\[
  \phi(g_1, g_2) = s(g_1) s(g_2) s(g_1g_2)^{-1}.
\]
Then \(s\) is a homomorphism if and only if \(\phi\) is constant. The image of \(\phi\) is in \(M\) so \(\phi: G^2 \to M\) is an element of \(C^2(G, M)\). Claim that in fact \(\phi \in Z^2(G, M)\).

\begin{proof}
  We compute \(s(g_1)s(g_2)s(g_3)\) in two ways:
  \begin{align*}
    s(g_1)s(g_2)s(g_3)
    &= \phi(g_1, g_2) s(g_1g_2) s(g_3) \\
    &= \phi(g_1, g_2) \phi(g_1g_2, g_3) s(g_1g_2g_3)\\
    s(g_1)s(g_2)s(g_3)
    &= s(g_1) \phi(g_2, g_3) s(g_2g_3) \\
    &= s(g_1) \phi(g_2, g_3) s(g_1)^{-1} s(g_1) s(g_2g_3) \\
    &= s(g_1) \phi(g_2, g_3) s(g_1)^{-1} \phi(g_1, g_2g_3) s(g_1g_2g_3)
  \end{align*}
  so
  \[
    \phi(g_1, g_2) \phi(g_1g_2, g_3) = s(g_1) \phi(g_2, g_3) s(g_1)^{-1} \phi(g_1, g_2g_3).
  \]
  Recognising the first three terms on RHS as the action of \(G\) on \(M\) and convert to additive notation in \(M\), we get
  \[
    \phi(g_1, g_2) + \phi(g_1g_2, g_3) = g_1 \phi(g_2, g_3) + \phi(g_1, g_2, g_3).
  \]
\end{proof}

In addition \(\phi\) is a \emph{normalised cocycle}\index{normalised cocycle}, i.e.
\[
  \phi(1, g) = \phi(g, 1) = 0.
\]

If we had chosen a different section \(s': G \to E\), consider \(\psi(g) = s'(g) s(g)^{-1}\) so \(\psi \in C^1(G, M)\). Have
\begin{align*}
  s'(g_1)s'(g_2)
  &= \psi(g_1)s(g_1) \psi(g_2)s(g_2) \\
  &= \psi(g_1)s(g_1) \psi(g_2)s(g_1)^{-1} s(g_1)s(g_2) \\
  &= \psi(g_1)s(g_1)\psi(g_2)s(g_1)^{-1} \phi(g_1, g_2) s(g_1g_2) \\
  &= \psi(g_1)s(g_1)\psi(g_2)s(g_1)^{-1} \phi(g_1, g_2)
\end{align*}
and a comparison with \(s'(g_1)s'(g_2) = \phi'(g_1, g_2)s'(g_1g_2)\) shows \([\phi] \in H^2(G, M)\) is well-defined. This shows part of

\begin{theorem}
  Let \(G\) be a group and \(M\) a \(G\)-module. There exists a bijection
  \[
    \{\text{equivalence classes of extensions of \(G\) by \(M\)}\} \longleftrightarrow H^2(G, M).
  \]
\end{theorem}

\begin{proof}
  Let to construct the inverse map. Let \([\phi] \in H^2(G, M)\) where \(\phi\) is a \emph{normalised cocycle}. Define a group structure on the set \(M \times G\) by
  \[
    (m_1, g_1) \cdot (m_2, g_2) = (m_1 + g_1 \cdot m_2 + \phi(g_1, g_2), g_1g_2).
  \]
  By the assumption on \(\phi\), this defines a group structure with identity \((0, 1)\) and the inverse of \((m, g)\) is \((-g^{-1} \cdot (m + \phi(g, g^{-1})), g^{-1})\). This is an extension.

  If we choose a different normalised cocycle \(\phi'\) such that \(\phi - \phi' = d^2 \psi\), then the obvious map \(E_\phi \to E_{\phi'}, (m, g) \mapsto (m + \psi(g), g)\) is an equivalence of extensions.

  It is an exercise to check the two maps are inverses to each other.
\end{proof}

One result that is used in the proof is

\begin{lemma}
  Every cohomology class is represented by some normalised cocycle.
\end{lemma}

\begin{proof}
  Let \(\phi \in Z^2(G, M)\). Let \(\psi(g) = \phi(1, g)\). Then \(\phi - d^2\psi\) is normalised:
  \begin{align*}
    (\phi - d^2\psi)(1, g)
    &= \phi(1, g) - (\phi(1, g) - \phi(1, g) + \phi(1, 1))
      = \phi(1, g) - \phi(1, 1) \\
    (\phi - d^2\psi)(g, 1)
    &= \phi(g, 1) - g \phi(1, 1)
  \end{align*}
  and they both vanish since \(\phi\) is a cocycle.
\end{proof}

We may recover Hopf formula from this identification. Suppose \(G\) has presentation \(\langle x_1, \dots, x_n | r_1, \dots, r_m \rangle\). Then take \(F\) to be the free groups on \(x_i\)'s and \(R = \ker (F \to G)\). Suppose \(E\) is a central extension of \(G\) by \(A\). Choose some preimages \(\overline x_i \in E\) of generators \(x_i\) of \(G\). Let \(\overline r_i\) be the element of \(E\) given by replacing each occurrence of \(x_i\) in \(r_i\) with \(\overline x_i\). Then \(\overline r_i \in A = \ker (E \to G)\), say \(a_i\). Write down a group presentation
\[
  \overline E = \langle \overline x_1, \dots, \overline x_n, A | \overline r_1 = a_1, \dots, \overline r_m = a_m, A \text{ central}, \text{relations of A}\rangle
\]
There exists a natural diagram of exact rows
\[
  \begin{tikzcd}
    & A \ar[r] \ar[d, equal] & \overline E \ar[r] \ar[d] & G \ar[r] \ar[d, equal] & 1 \\
    1 \ar[r] & A \ar[r] & E \ar[r] & G \ar[r] & 1
  \end{tikzcd}
\]
It follows that \(A \embed \overline E\) and \(\overline E \cong E\). Can try to define \(F\)-invariant homomorphism \(R \to A\) by \(r_i \mapsto a_i\). Fact (non-examinable): this is a well-defined \(F\)-invariant homomorphism if and only if \(A \to \overline E\) is an injection. We made a choice of preimages \(\overline x_i\) of \(x_i\) in \(E\). A different choice \(\overline x_i'\) differ from \(\overline x_i\) by an element \(b_i \in A\). Then \(x_i \mapsto b_i\) gives a homomoprhism \(f: F \to A\) and \(\overline r_i' = \overline r_i f(b_i)\).

\begin{eg}
  Let \(G = \langle x_1, x_2| x_1x_2x_1^{-1}x_2^{-1}x_1 \rangle\). We show \(H^2(G, \Z) = 0\). Any central extension of \(G\) by \(\Z\) has a presentation
  \[
    E = \langle \overline x_1, \overline x_2, t | \overline x_1 \overline x_2 \overline x_1^{-1} \overline x_2^{-1} \overline x_1 = t^k, t \text{ central} \rangle.
  \]
  Now we can make a substitution \(\overline x_1 \mapsto \overline x_1 t^{-k} = \overline x_1'\),
  \[
    E \cong \langle \overline x_1', \overline x_2, t | \overline x_1' t^k \cdot \overline x_2 (\overline x_1' t^k)^{-1} \overline x_2^{-1} (\overline x_1' t^k) = t^k, t \text{ central}\rangle = E'
  \]
  \(E\) and \(E'\) are equivalent as extensions and we can simplify \(E'\)
  \begin{align*}
    \langle \overline x_1', \overline x_2, t | \overline x_1' \overline x_2 (\overline x_1')^{-1} \overline x_2^{-1} \overline x_1' = 1, t \text{ central}\rangle = \Z \times G
  \end{align*}
  It follows that \(H^2(G, \Z) = 0\).
\end{eg}

\subsection{Worked example: \(\Z^2\)}

Let \(T = \Z^2 = \langle a, b \rangle\). We will classify all central extensions of \(T\) by \(\Z\). Start with a free resolution derived from topology
\[
  \begin{tikzcd}
    0 \ar[r] & \Z T \ar[r, "\beta"] & (\Z T)^2 \ar[r, "\alpha"] & \Z T \ar[r, "\varepsilon"] & \Z \ar[r] & 0
  \end{tikzcd}
\]
where
\begin{itemize}
\item \(\varepsilon\) is the augmentation map.
\item \(\alpha(x, y) = x(a - 1) + y(b - 1)\).
\item \(\beta(z) = (z(1 - b), z(a - 1))\).
\end{itemize}
Exactness can either be derived from topology (square tiling of the plane), or direct computation.

Apply \(\Hom_{\Z T}(-, \Z)\) to get
\[
  \begin{tikzcd}
    \Hom_{\Z T}(\Z T, \Z) \ar[r, "\alpha^*"] & \Hom_{\Z T}((\Z T)^2, \Z) \ar[r, "\beta^*"] & \Hom_{\Z T}(\Z T, \Z) \ar[r] & 0
  \end{tikzcd}
\]
where
\begin{align*}
  \beta^*(f)(z)
  &= f(z (1 - b), z(a - 1)) \\
  &= f(z - zb, 0) + f(0, za - z) \\
  &= (b - 1) \cdot f(z, 0) + (1 - 1) \cdot f(0, z) \\
  &= 0
\end{align*}
so \(\beta^* = 0\). Similarly \(\alpha^* = 0\). Thus
\[
  H^i(T, \Z) =
  \begin{cases}
    \Z & i = 0\\
    \Z^2 & i = 1 \\
    \Z & i = 2
  \end{cases}
\]

To get extensions, we turn to bar resolutions. We seek a chain map
\[
  \begin{tikzcd}
    \dots \ar[r] & \Z T\{T^2\} \ar[r, "d_2"] \ar[d, "f_2"] & \Z T \{T\} \ar[r, "d_1"] \ar[d, "f_1"] & \Z T \ar[r, "\varepsilon"] \ar[d, "f_0"] & \Z \ar[r] \ar[d, equal] & 0 \\
    0 \ar[r] & \Z T \ar[r, "\beta"] & (\Z T)^2 \ar[r, "\alpha"] & \Z T \ar[r, "\varepsilon"] & \Z \ar[r] & 0
  \end{tikzcd}
\]
Obviously \(f_0 = \id\). \(f_1\) should satisfy \(\alpha f_1 = f_0 d_1 = d_1\). Want to find an element \((x_{r, s}, y_{r, s}) \in (\Z T)^2\) such that
\[
  \alpha(x_{r, s}, y_{r, s}) = d_1([a^rb^s]) = a^rb^s - 1 = (a^r - 1)b^s + (b^s - 1)
\]
then define \(f_1\) by \([a^rb^s] \mapsto (x_{r, s}, y_{r, s})\). By commutativity of \(T\),
\begin{align*}
  x_{r, s} &= \frac{a^r - 1}{a - 1} b^s = S(a, r) b^s \\
  y_{r, s} &= \frac{b^s - 1}{b - 1} = S(b, s)
\end{align*}
where
\[
  S(a, r) =
  \begin{cases}
    1 + a + \dots + a^{r - 1} & r \geq 0 \\
    -(a^{-1} + \dots + a^r) & r < 0
  \end{cases}
\]

So \(f_1([a^rb^s]) = (S(a, r)b^s, S(b, s))\). By a messy calculation we similarly find
\[
  f_2([a^rb^s|a^tb^u]) = S(a, r)b^sS(b, u).
\]

A cohomology class \(p \in \Z \cong \Hom_{\Z T}(\Z T, \Z)\) is represented by the \(2\)-cochain given by the composition
\[
  (a^rb^s, a^tb^u) \mapsto S(a, r)b^sS(b, u) \mapsto p r u
\]
so the group structure on the set \(\Z \times T\) corresponding to this cochain is
\[
  (m, a^rb^s) \cdot (n, a^tb^u) = (m + n + pru, a^{r + t} b^{n + s}).
\]
More concretely, this group has a \(3\)-dimensional representation
\[
  (m, a^rb^s) \mapsto
  \begin{pmatrix}
    1 & pr & m \\
    0 & 1 & s \\
    0 & 0 & 1
  \end{pmatrix}
\]
The group of central extensions of \(T\) by \(\Z\) is generated by \(p = 1\).

\subsection{Cohomology of profinite groups}

The cohomology theory works for profinite groups.

\begin{definition}[\(G\)-module]\index{\(G\)-module}
  Let \(G\) be a profinite group. A \emph{finite \(G\)-module} is a finite abelian group \(M\) with a continuous \(G\)-action \(G \times M \to M\).
\end{definition}

To avoid defining the group ring of a profinite ring, we use the ad hoc definition

\begin{definition}\index{group cohomology!profinite group}
  Let \(G\) be a profinite group and \(M\) a finite \(G\)-module. Define
  \[
    C^n(G, M) = \{G^n \to M \text{ continuous}\}
  \]
  and \(d^n\) given by the same formula as before. Define \(H^n(G, M) = \ker d^{n + 1}/\im d^n\).
\end{definition}

Course convention: all general results in this chapter and example sheet 4 may be assumed to hold for profinite groups, where all groups are profinite, all functions are continuous and all modules are finite.

\begin{eg}
  An extension of \(G\) by \(M\) is a profinite group \(E\) with \(M \normal E\) such that \(E/M \cong G\). Equivalence of extensions is a continuous homomorphism respecting \(M\) and \(G\). Then there exists a bijection between equivalent classes of extensions and \(H^2(G, M)\).
\end{eg}

One can treat profinite groups as discrete groups, but the resulting cohomology theory is horrid. Another question: why finite modules only? For example consider the exact sequence of \(\hat \Z\)-modules with trivial \(\hat \Z\)-action
\[
  \begin{tikzcd}
    0 \ar[r] & \Z \ar[r] & \Q \ar[r] & \Q/\Z \ar[r] & 0
  \end{tikzcd}
\]
Have
\[
  H^1(\hat \Z, \Z) = H^1(\hat \Z, \Q) = 0
\]
as the continuous map from \(\hat \Z \to \Z\) has compact image. \(H^1(\hat \Z, \Q/\Z) \cong \Q/\Z\). But we should have a long exact sequence, which implies that \(H^2(\hat \Z, \Z)\). Thus free profinite groups \(\hat \Z\) does not have ``cohomologicial dimension'' \(1\).

\subsubsection{Pro-\(p\) groups of cohomological dimension 1}

For simplicity in this section assuming all pro-\(p\) groups are tfg. The aim of this section is to prove Stallings-Swan for tfg pro-\(p\) groups\index{Stallings-Swan theorem!pro-\(p\) group}\index{cohomological dimension!pro-\(p\) group}, i.e.\ \Cref{prop:cohomological dimension of free group} and its converse:

\begin{theorem}
  \label{thm:Stallings-Swan for pro-p group}
  A tfg pro-\(p\) group \(G\) is free if and only if \(\mathrm{cd}(G) = 1\), if and only if \(H^2(G, \F_p) = 0\).
\end{theorem}

Note that for any non-trivial tfg pro-\(p\) group \(G\), in particular free pro-\(p\) groups, \(\mathrm{cd}(G) \geq 1\) as
\[
  H^1(G, \F_p) \cong \Hom(G, \F_p) \ne 0.
\]

We first show the equivalence of the characterisations

\begin{theorem}
  Let \(G\) be a pro-\(p\) group. Then
  \[
    \mathrm{cd}(G) = \max(n: H^n(G, \F_p) \ne 0).
  \]
\end{theorem}

\begin{definition}[simple]\index{simple}
  A \(G\)-module \(M\) is \emph{simple} if the only \(G\)-submodules are \(0\) and \(M\).
\end{definition}

\begin{proposition}
  Fix \(n \geq 0\). Let \(G\) be a profinite group and suppose \(H^n(G, S) = 0\) for all simple finite \(G\)-modules \(S\). Then \(H^n(G, M) = 0\) for all finite \(M\).
\end{proposition}

\begin{proof}
  Suppose for contradiction \(M\) of minimal size has nonvanishing \(H^n(G, M)\). \(M\) is not simple so exists \(G\)-submodule \(N \leq M\), giving rise to a short exact sequence
  \[
    \begin{tikzcd}
      0 \ar[r] & N \ar[r] & M \ar[r] & M/N \ar[r] & 0
    \end{tikzcd}
  \]
  of \(G\)-modules. By using long exact sequence and minimality of \(M\), \(H^n(G, M) = 0\), absurd.
\end{proof}

\begin{definition}[\(p\)-primary component]\index{\(p\)-primary component}
  Let \(M\) be a finite \(G\)-module. Let \(M_p\) be the Sylow \(p\)-subgroup of \(M\), called the \emph{\(p\)-primary component} of \(M\). Then \(M = \bigoplus_p M_p\).
\end{definition}

\begin{proposition}
  Let \(G\) be a pro-\(p\) group, \(M\) a finite \(G\)-module. Then
  \[
    H^n(G, M) = H^n(G, M_p)
  \]
  for \(n \geq 1\).
\end{proposition}

\begin{proof}
  Write \(M = M_p \oplus M'\) where \(M'\) is the direct sum of other \(q\)-primary components. Then
  \[
    H^n(G, M) = H^n(G, M_p) \oplus H^n(G, M')
  \]
  (finite \(p\)-group case is an exercise in example sheet 4) and we show \(H^n(G, M') = 0\). Let \(\phi: G^n \to M'\) be a continuous function. Claim \(\phi\) factors as \(G^n \to (G/K)^n \to M'\) for some \(K \normal_o G\).

  \begin{proof}
    We want to find \(K\) such that each fibre of \(\phi\) is a union of cosets of \(K^n\). For each \(m \in M'\), \(\phi^{-1}(m)\) is open and closed, so can be written as \(\phi^{-1}(m) = \bigcup (a_i + K_i^n)\) where \(K_i \normal_o G\). The cover may be taken to be finite and we take \(K\) to be the intersection of all the \(K_i\)'s.
  \end{proof}

  But \(H^n(G/K, M') = 0\) as \(G/K\) is a finite \(p\)-group, so exists \(\psi_K: (G/K)^{n - 1} \to M\) such that \(\phi_K = d^n\psi_K\). Now set \(\psi: G^{n - 1} \to (G/K)^{n - 1} \to M'\) so \(\phi = d^n \psi\).
\end{proof}

\begin{remark}
  The argument actually shows that if \(G = \varprojlim G/K\) then \(H^n(G, M) = \varinjlim H^n(G/K, M)\).
\end{remark}

\begin{proposition}
  Let \(G\) be a pro-\(p\) group. The only simple \(p\)-primary \(G\)-module is \(\F_p\).
\end{proposition}

\begin{proof}
  Example sheet 4.
\end{proof}

Combining these gives

\begin{proposition}
  Let \(G\) be a pro-\(p\) group. If \(H^n(G, \F_p) = 0\) then \(H^n(G, M) = 0\) for all finite modules \(M\).
\end{proposition}

\begin{proposition}
  Suppose exists \(n\) such that \(H^n(G, M) = 0\) for all \(M\) then \(\mathrm{cd}(G) \leq n - 1\).
\end{proposition}

\begin{proof}[Non-examinable]
  By course convention we shall prove this for an abstract group \(G\). The main idea is \emph{dimension shifting}: suppose there is a short exact sequence of \(G\)-modules
  \[
    \begin{tikzcd}
      0 \ar[r] & M \ar[r] & N \ar[r] & M' \ar[r] & 0
    \end{tikzcd}
  \]
  where \(N\) is cohomologically trivial. Then from the long exact sequence one know \(H^i(G, M') \cong H^{i + 1}(G, M)\).

  Example sheet 4 shows that for \(K \leq G\), the following holds for the coinduced module \(\mathrm{coind}^K_G(M) = \Hom_{\Z K}(\Z G, M)\):
  \[
    H^n(G, \mathrm{coind}^K_G(M)) \cong H^n(K, M).
  \]
  So take \(K = 1\), have \(\mathrm{coind}^K_G(M) = \Hom_\Z(\Z G, M)\) cohomologically trivial. Finally the map
  \begin{align*}
    \alpha: M &\to \Hom(\Z G, M) \\
    m &\mapsto (x \mapsto xm)
  \end{align*}
  is an injection so gives the required short exact sequence.
\end{proof}

\begin{corollary}
  Free pro-\(p\) groups have cohomological dimension \(1\).
\end{corollary}

\begin{proof}
  Suffice to show \(H^2(G, \F_p) = 0\), i.e.\ to show every extension of \(G\) by \(\F_p\) splits. Let \(G\) be free on \(X\) for some \(X\) finite. Suppose we have an extension
  \[
    \begin{tikzcd}
      1 \ar[r] & \F_p \ar[r] & E \ar[r] & F(X) \ar[r] & 1
    \end{tikzcd}
  \]
  \(E\) is again a pro-\(p\) group. For each \(x \in X\) choose a preimage \(e_x \in E\). It extends to a unique homomorphism \(F(X) \to E\).
\end{proof}

Note that the proof works for free groups as well, so providing an algebraic proof of \Cref{prop:cohomological dimension of free group}.

\begin{theorem}
  Let \(G\) and \(G'\) be tfg pro-\(p\) groups. Let \(f: G \to G'\) be a continuous homomorphism. Assume
  \begin{itemize}
  \item \(f^*: H^1(G', \F_p) \to H^1(G, \F_p)\) is an isomorphism,
  \item \(f^*: H^2(G', \F_p) \to H^2(G, \F_p)\) is an injection.
  \end{itemize}
  Then \(f\) is an isomorphism.
\end{theorem}

Heuristics: \(H^1(G, \F_p) = \Hom(G, \F_p) = \Hom(G/\Phi(G), \F_p)\), the dual of the \(\F_p\)-vector space \(G/\Phi(G)\). The first condition tells us something about generators. In particular \(f\) is a surjection. \(H^2\) is related to relations, and the second condition says that we impose no additional relations so \(f\) is an injection.

\begin{proof}[Non-examinable]
  Let \(G_n = \gamma_n^{(p)}(G)\), the lower central \(p\)-series. Recall that \(G_n\) are all open, \(G = \varprojlim G/G_n\). \(G_n\)'s are fully characteristic, therefore inducing maps \(f_n: G/G_n \to G'/G_n'\). We will show that they are all isomorphisms and so is \(f\).

  Induction on \(n\). For \(n = 2\), \(f_2: G/\Phi(G) \to G'/\Phi(G')\). By the remark before the transpose of \(f_2\) is an isomorphism, so is \(f_2\) itself.

  Suppose the result holds for \(n\). If we can show \(G_n/G_{n + 1} \to G_n'/G_{n + 1}'\) is an isomorphism then combining the induction hypothesis we deduce the result for \(n + 1\) from the diagram
  \[
    \begin{tikzcd}
      1 \ar[r] & G_n/G_{n + 1} \ar[r] \ar[d, "\cong"] & G/G_{n + 1} \ar[r] \ar[d] & G/G_n \ar[r] \ar[d, "\cong"] & 1 \\
      1 \ar[r] & G_n'/G_{n + 1}' \ar[r] & G'/G_{n + 1}' \ar[r] & G'/G_n' \ar[r] & 1
    \end{tikzcd}
  \]

  \(G_n/G_{n + 1}\) is a finite-dimensional \(\F_p\)-vector space so \(G_n/G_{n + 1} \to G_n'/G_{n + 1}'\) is an isomorphism if and only if its dual \(H^1(G_n'/G_{n + 1}', \F_p) \to H^1(G_n/G_{n + 1}, \F_p)\) is. A homomorphism \(\phi: G_n \to \F_p\) factors through \(G_n/G_{n + 1}\) if and only if \(\phi([g, g']) = 0\) for all \(g \in G, g' \in G_n\), if and only if
  \[
    0 = \phi(g^{-1}(g')^{-1}gg') = - \phi(g^{-1}g'g) + \phi(g'),
  \]
  if and only if \(\phi\) is \(G\)-invariant. Thus \(H^1(G_n/G_{n + 1}, \F_p) = H^1(G_n, \F_p)^G\). The five term exact sequence induced by
  \[
    \begin{tikzcd}
      1 \ar[r] & G_n \ar[r] & G \ar[r] & G/G_n \ar[r] & 1
    \end{tikzcd}
  \]
  says we have a commutative diagram of exact sequences
  \[
    \begin{tikzcd}
      H^1(G'/G'_n) \ar[r] \ar[d, "\cong"] & H^1(G') \ar[r] \ar[d, "\cong"] & H^1(G'_n)^{G'} \ar[r] \ar[d] & H^2(G'/G'_n) \ar[r] \ar[d, "\cong"] & H^2(G') \ar[d, hook] \\
      H^1(G/G_n) \ar[r] & H^1(G) \ar[r] & H^1(G_n)^G \ar[r] & H^2(G/G_n) \ar[r] & H^2(G)
    \end{tikzcd}
  \]
  By induction hypothesis and injectivity on \(H^2\), the middle vertical map is an isomorphism by five lemma. Therefore \(G_n/G_{n + 1} \cong G_n'/G_{n + 1}'\).
\end{proof}

In fact we get for free from the proof

\begin{theorem}
  If \(\Gamma\) and \(\Gamma'\) are finitely generated abstract groups and \(f: \Gamma \to \Gamma'\) is a homomorphism and the same conditions hold, then \(\hat f: \hat \Gamma_{(p)} \to \hat \Gamma_{(p)}'\) is an isomorphism.
\end{theorem}

\begin{proof}
  Set \(\Gamma_n = \gamma_n^{(p)}(\Gamma)\). Then \(\hat \Gamma_{(p)} = \varprojlim \Gamma/\Gamma_n\). Proceed as before.
\end{proof}

\begin{proof}[Proof of \Cref{thm:Stallings-Swan for pro-p group}]
  Suppose \(x_1, \dots, x_d\) is a generating set of minimal size. Let \(F\) be the free pro-\(p\) group on \(x_i\) and consider \(f: F \to G\). \(F/\Phi(F) \to G/\Phi(G)\) is an isomorphism since they are the same \(\F_p\)-vector space and \(H^2(G, \F_p) \to H^2(F, \F_p)\) is an injecition. Thus \(f\) is an isomorphism.
\end{proof}

\begin{eg}
  Let \(\Gamma = \langle x_1, x_2| x_1x_2x_1^{-1}x_2^{-1}x_1 \rangle\). Recall \(H^2(\Gamma, \Z) = 0\). The same argument shows \(H^2(\Gamma, \F_p) = 0\). \(H^1(\Gamma, \F_p) = \Hom(\Gamma, \F_p)\). Let \(\phi: \Gamma \to \F_p\). Then
  \[
    0 = \phi(x_1x_2x_1^{-1}x_2^{-1}x_1) = \phi(x_1)
  \]
  and no further relation so \(H^1(\Gamma, \F_p) = \F_p\) generated by \(x_1 \mapsto 0, x_2 \mapsto 1\). Let \(f: \Z \to \Gamma, 1 \mapsto x_2\). Then \(f\) induces \(\hat \Gamma_{(p)} \cong \Z_p\).
\end{eg}

\subsubsection{Presentation of pro-\(p\) groups}

\begin{definition}[presentation of pro-\(p\) group]\index{presentation}
  Let \(X\) be a finite set and \(F\) a free pro-\(p\) group on \(X\). Let \(R \subseteq F\). The pro-\(p\) group with \emph{presentation} \(\floor{X|R}_p\) is defined to be \(F/\overline{\langle\langle R\rangle\rangle}\).
\end{definition}

Note that not all elements in \(\floor{X|R}_p\) can be written as a product of elements of \(X\).

\begin{lemma}
  Let \(F_{\mathrm{abs}}\) be the abstract free group on \(X\) and let \(R \subseteq F_{\mathrm{abs}}\). Let \(\Gamma = \langle X | R\rangle, G = \floor{X|R}_p\). Then \(G = \hat \Gamma_{(p)}\).
\end{lemma}

\begin{proof}
  Suffices to look at the \(p\)-group quotients of \(G\) and \(\Gamma\). A quotient \(\Gamma \to P\), where \(P\) is a \(p\)-group, is the same as a function \(X \to P\) such that its extension to \(F_{\mathrm{abs}}\) contains \(R\) in the kernel. But this is exactly the same as a continuous quotient \(G \to P\).
\end{proof}

\begin{theorem}
  \label{thm:size of generators and relators of pro-p group}
  Let \(G\) be a tfg pro-\(p\) group. Let \(X\) be a finite tgs of \(G\). Let \(r_X\) be the minimal size of a set \(R \subseteq F(X)\) such that \(G = \floor{X|R}_p\). Then
  \[
    |X| - r_X = \dim_{\F_p} H^1(G, \F_p) - \dim_{\F_p} H^2(G, \F_p).
  \]
  In particular if \(X\) is a minimal generating set then \(r_X = \dim H^2(G, \F_p)\).
\end{theorem}

\begin{remark}\leavevmode
  \begin{enumerate}
  \item One may ask the same question for abstract groups. If \(\Gamma\) is a finitely generated (abstract) group, \(X\) a finite generating set, let \(\rho_X\) be the minimal size of an \(R\) such that \(\Gamma = \langle X| R\rangle\). Then what can we say about \(|X| - \rho_X\)? It is a subtle question and in general the answer depends on \(X\).
  \item For \(G\) finite \(p\)-group, let \(X\) be a generating set. One may ask must \(\rho_X = r_X\)? Certainly \(r_X \leq \rho_X\) by the lemma. The other direction is open.
  \end{enumerate}
\end{remark}

\begin{lemma}
  Let \(G\) and \(L\) be profinite groups. Assume \(L\) acts continuously on \(G\) by homomorphism via \(\rho: L \times G \to G\). Then there is a proper open normal subgroup of \(G\) which is invariant under the action of \(L\).
\end{lemma}

Note that if we assume \(G\) is tfg then this follows from the old trick of taking all intersections.

\begin{proof}
  Let \(U\) be a proper open normal subgroup of \(G\). Claim \(\tilde L = \{\ell \in L: \ell \cdot U = U\}\) is open in \(L\). If this claim holds, there are finitely many subgroups of the form \(\ell \cdot U\) by orbit-stabiliser. Their intersection is then an \(L\)-invariant open normal subgroup.

  Let \(\ell \in \tilde L\). For each \(u \in U\) we have \(\ell \cdot u \in U\). Can find \(A_u \subseteq L, B_u \subseteq U\) open such that
  \[
    (\ell, u) \in A_u \times B_u \subseteq \rho^{-1}(U).
  \]
  \(B_u\)'s cover \(U\) which is compact so we can take a finite subcover \(B_{u_1}, \dots, B_{u_k}\). Take \(A = A_{u_1} \cap \cdots \cap A_{u_k}\). Left to show \(A \subseteq \tilde L\): if \(a \in A, u \in U\) then exists \(u_i\) such that \(u \in B_{u_i}\) and \(a \in A_{u_i}\), hence \((a, u) \in A_{u_i} \times B_{u_i} \subseteq \rho^{-1}(U)\). Thus \(A \cdot U \subseteq U\).
\end{proof}

\begin{lemma}
  Let \(F\) be a free pro-\(p\) group, \(N \normal F\) a closed proper normal subgroup of \(F\). Then exists a set \(R \subseteq N\) of size \(r\) such that \(N = \overline{\langle\langle R\rangle\rangle}\) if and only if \(\dim_{\F_p} H^1(N, \F_p)^F \leq r\).
\end{lemma}

\begin{proof}
  Recall
  \begin{align*}
    H^1(N, \F_p)^F
    &= \{\phi: N \to \F_p \text{ homomorphism such that } \phi(f^{-1}nf) = \phi(n)\} \\
    &= \{\phi: N/N^p[N, F] \to \F_p\}
  \end{align*}
  If \(N = \overline{\langle\langle R\rangle\rangle}\), an \(F\)-invariant map \(\phi: N \to \F_p\) is determined by the restriction to \(R\), so there is an injection \(H^1(N, \F_p)^F \embed \F_p^{|R|}\).

  Conversely suppose \(\dim H^1(N, \F_p)^F = r\), then \(\dim N/N^p[N, F] = r\). Let \(R \subseteq N\) be a lift of a basis of the vector space. \(R\) has the property that every \(F\)-invariant homomorphism \(N \to \F_p\) which kills \(R\) is trivial. Claim \(N = \overline{\langle\langle R\rangle\rangle}\): suppose \(N' = \overline{\langle\langle R\rangle\rangle} \ne N\). Then \(N' \Phi(N) \ne N\) by definition of Frattini subgroup, so \(M = N/N'\Phi(N) \ne 0\). \(M\) is an abelian pro-\(p\) group with a continuous action of \(F\). By the previous lemma \(M\) has a \(F\)-invariant proper open subgroup \(U\). Now \(M/U\) is a finite \(F\)-module which is an abelian \(p\)-group, so by the characterisation of simple modules there is a map \(M/U \to \F_p\). This contradicts
  \[
    N \to N/N'\Phi(N) = M \to M/U \to \F_p
  \]
  which kills all of \(R\).
\end{proof}

\begin{proof}[Non-examinable proof of \Cref{thm:size of generators and relators of pro-p group}]
  This follows from minimal generating set has size equal to \(\dim G/\Phi(G) = \dim H^1(G, \F_p)\).

  Let \(N = \ker(F(X) \to G)\). We obtain the five term exact seqeunce
  \[
    \begin{tikzcd}
      0 \ar[r] & H^1(G) \ar[r] & H^1(F) \ar[r] & H^1(N)^F \ar[r] & H^2(G) \ar[r] & H^2(F) = 0 \\
      & \dim H^1(G) & {|X|} & r_X & \dim H^2(G)
    \end{tikzcd}
  \]
  Now take Euler characteristic.
\end{proof}

\printindex
\end{document}

% https://www.dpmms.cam.ac.uk/~grw46/partiiiprofinite.html