# Extensions of $\mathbb{Z}$ by $\mathbb{Z}$

Given two groups $$G$$ and $$H$$, an extension of $$G$$ by $$H$$ is a group $$K$$ with a normal subgroup $$N$$ isomorphic to $$H$$ such that the quotient group $$K/N$$ is isomorphic to $$G$$ (equivalently, $$1 \to H \to K \to G \to 1$$ is an exact sequence).

So, up to isomorphism, how many (not necessarily abelian) extensions of $$\mathbb{Z}$$ by $$\mathbb{Z}$$ are there?

One obvious extension is the direct product $$\mathbb{Z} \times \mathbb{Z}$$. Another extension is the group with the same underlying set as $$\mathbb{Z} \times \mathbb{Z}$$ and $$(a,b) \ast (c,d)$$ still defined to be $$(a+c,b+d)$$ if $$b$$ is even, but it is defined to be $$(a-c,b+d)$$ if $$b$$ is odd (or simply, $$(a+(-1)^bc,b+d)$$). This nontrival extension is the semidirect product $$\mathbb{Z} \rtimes \mathbb{Z}$$ corresponding to the homomorphism $$\mathbb{Z} \to \operatorname{Aut}(\mathbb{Z})$$ where even integers act as the identity and odd integers act as negation.

The answer would be $$2$$ if the direct product and the even/odd semidirect product were the only extensions up to isomorphism. Is this in fact the case?

Yes they are the only two. Since the infinite cyclic group is free, any such extension must split, and $$|{\rm Aut}({\mathbb Z})| = 2$$, so there are only two possible actions in the semidirect product: the trivial action and inversion.
Conveniently, there is a standard line of attack for such questions which works when the subgroup in the extension is abelian: classify actions $$\rho$$ of the quotient $$G$$ on the subgroup $$A$$, and for each such $$G$$-module structure on $$A$$, compute $$H^2(G, A_\rho)$$ (group cohomology).
1. How many group actions are there of $$\mathbb{Z}$$ on $$\mathbb{Z}$$ (compatible with $$+$$ on the right): answer: 2, since there are two maps from $$\mathbb{Z}$$ to $$\text{Aut}(\mathbb{Z}) = \pm 1$$.
2. For each of these $$\mathbb{Z}$$-modules, compute the group cohomology $$H^2(\mathbb{Z}, M)$$. Since $$\mathbb{Z}$$ has homological dimension $$1$$, these are both trivial, and so the only two extensions are the ones you wrote down.