TITLE: Complete the short exact sequence $0\to \mathbb Z\to A\to Z_n \to 0$
QUESTION [5 upvotes]: I want to find all possible $A$ in the following SES:

$$0\to \mathbb Z\to A\to Z_n \to 0$$

I know by structure theorem of finite generated abelian groups, $A\cong \mathbb Z\oplus \mathbb Z_d$. Then how can we find the relation between $d$ and $n$? What are two maps in the middle?
Since this is an exercise in Hatcher's book at the beginning section of homology theory, a solution without using Ext will be much better.

REPLY [5 votes]: This is a nice exercise for a beginning section of homology theory, since doing this without Ext will make you really appreciate the machinery homological algebra has to offer.
I do not think, that I will go through all details, but let us start:
First of all, we have the case $\mathbb Z_d = 0$ (one could refer to this as $d=1$), i.e. a short exact sequence
$$0 \to \mathbb Z \to \mathbb Z \to \mathbb Z_n \to 0.$$
Of course the first map is given by $\cdot m$ for some $m \in \mathbb Z$ and by looking at the cokernel, we get that $m = \pm n$. The second map is given by $1 \mapsto e$, where $e$ is co-prime to $n$.
The much more involved case is the case $d \geq 2$, i.e. where the summand $\mathbb Z_d$ actually occurs.
Call the first map $g: \mathbb Z \to \mathbb Z \oplus \mathbb Z_d$ and the second map $f: \mathbb Z \oplus \mathbb Z_d \to \mathbb Z_n$. Denote the kernel of $f$ by $K$. By exactness we get $K \cong \mathbb Z$.
Note that $f(0,n)=0$. $K$ is torsion free, but $(0,n) \in \mathbb Z \oplus \mathbb Z_d$ is of course torsion (annihilated by $d$), hence we have $(0,n)=(0,0)$, i.e. $d|n$.

So we have all possibilites for $A$, namely $A \in \{\mathbb Z \} \cup
\{\mathbb Z \oplus \mathbb Z_d ~ | ~ d \geq 2,d | n\}$.

We still have to figure out the maps in the second case:
Of course $g$ is given by $g(1) = (m,e)$ for some $m,e \in \mathbb Z, 0 \leq e <d$. Let us call the cokernel $C_{m,e}$.
$C_{m_e}$ is generated by $e_1=(1,0),e_2=(0,1)$ and we have relations $me_1+ee_2=0$ and $de_2=0$, thus $C_{m_e}$ is presented by $$\begin{pmatrix}m&0\\e&d\end{pmatrix}.$$ Upto multiplication in $SL_2(\mathbb Z)$, this should be equal to $$\begin{pmatrix}n&0\\0&1\end{pmatrix}$$, i.e. by looking at fitting ideals, we get that
$$md=\pm n ~~ \text{ and } ~~ (m,e,d)=(1).$$
Thus we have found all possibilities for $g$. To find $f$, note that we have the following commutative diagram of exact sequences:
$$\require{AMScd}
\begin{CD}
0 @>>> \mathbb Z^2 @>\begin{pmatrix}m&0\\e&d\end{pmatrix}>> \mathbb Z^2 @>>> C_{m,e} @>>>0\\
@VVV @VXVV @VVYV @VVV @VVV \\
0 @>>> \mathbb Z^2 @>>\begin{pmatrix}n&0\\0&1\end{pmatrix}> \mathbb Z^2 @>p>> \mathbb Z_n @>>>0
\end{CD}$$
, where $X$ and $Y$ are obtained via the algorithm to determine the Smith normal form.
The map $p \circ Y$ factors through $\mathbb Z \oplus \mathbb Z_d$ and the factorization is $f$.