# cokernel of a homomorphism of groups

Given injective homomorphisms of finitely generated abelian groups $\phi_i \colon G_i\rightarrow G$ and normal subgroups $N_i\subset G_i$ for $i\in\{1,\dots,r\}$ what is the cokernel of the homomorphism $\bigoplus_{i=1}^r G_i \rightarrow\bigoplus_{i=1}^r G_i/N_i\bigoplus G$ given by $(g_1, \dots, g_r)\mapsto (g_1+N_1, \dots, g_r+N_r, \phi_1(g_1)+\dots , \phi_r(g_r))$?

I think that is $\bigoplus_{i=1}^r G_i \bigoplus G/(N_1+\dots N_r)$, where $N_i$ denote the image of $N_i$ in $G$.

But I can't finish the proof.

Remember the following:

Given a morphism $\phi:H\to G$ of abelian groups, the cokernel of $\phi$ is the group $G/\phi(H)$ (with the projection $H\to H/\phi(G)$).

Now, consider $H=\bigoplus_{i=1}^rG_i$, $N=\bigoplus_{i=1}^r N_i$, so that $\dfrac{H}{N}=\bigoplus_{i=1}^r\dfrac{H_i}{N_i}$, and $\phi:H\to G$ given by $\phi(g_1,\ldots,g_r)=\phi_1(g_1)+\cdots+\phi_r(g_r)$. Define $\varphi:H\to \dfrac{H}{N}\oplus G$ by $\varphi(h)=(h+N,\phi(h))$. You're asked to calculate the cokernel of $\varphi$ (this discussion was simply to get to the case $r=1$, to simplify notation).

We know that $\operatorname{coker}\varphi=\dfrac{H/N\oplus G}{\varphi(H)}$.

Consider the morphism $\Psi:\dfrac{H}{N}\oplus G\to \dfrac{G}{\phi(N)}$ given by $\Psi(h+N,g)=(g-\phi(h)+\phi(N))$. Notice that, if $h-h'\in N$, then $g-\phi(h)-(g-\phi(h'))=\phi(h'-h)\in\phi(N)$, so $\Psi$ is well-defined.

Clearly, $\Psi$ is surjective, and its kernel is

\begin{align} \ker\Psi & =\left\{(h+N,g):g-\phi(h)\in\phi(N)\right\}=\left\{(h+N,g):g\in \phi(h+N)\right\}\\ \\ &=\left\{(h+N,g):g=\phi(h+n)\text{ for some }n\in N\right\}=\left\{(h+N,\phi(h)):h\in H\right\}\\ \\ &=\varphi(H)\end{align}

By the first isomorphism theorem, $\dfrac{G}{\phi(N)}=\dfrac{H/N\oplus G}{\varphi(H)}=\operatorname{coker}\varphi$. Notice that $\phi(N)=\phi_1(N_1)+\cdots+\phi_r(N_r)$, thus $$\operatorname{coker}\varphi=\dfrac{G}{\phi_1(N_1)+\cdots+\phi_r(N_r)}.$$