# Prove that there's a unique morphism that completes the commutative diagram

I have to prove that there's a unique $\gamma : M'' \rightarrow N''$ that completes this diagram considering the rows are exact.

$$\begin{array} MM' \stackrel{f_1}{\longrightarrow} & M & \stackrel{f_2}{\longrightarrow} & M'' {\longrightarrow} &0\\ \downarrow{\alpha} & \downarrow{\beta} \\ N' \stackrel{g_1}{\longrightarrow} & N & \stackrel{g_2}{\longrightarrow} & N'' \end{array}$$

Since $f_2$ is surjective for all $x \in M''$ there's at least one $y\in M$ so that $f_2 (y) = x$. Call $y = f^{-1}_2 (x)$. Now consider $\gamma(x) = g_2(\beta(f^{-1}_2 (x)))$. Then $$\gamma (f_2(x)) = g_2(\beta(f^{-1}_2 (f_2(x)))) = g_2(\beta(x))$$

So that would be it, but I'm not 100% sure this $\gamma$ is well defined because $f_2$ is not injective and I can only guarantee that $x \in f^{-1}_2(f(x))$. I imagine I can fix a certain $x \in M''$ and construct $\gamma$ so that is works that particular $x$, and since I can do this for all of them, then it's well defined, but I'm not convinced that this is right or the best way to do it.

Any help would be greatly appreciated.

One should approch this more conceptually:

The uniqueness is an immediate consequence of the surjectivity of $f_2$ (You can view this as a definition of the term surjective).

The existence follows from the universal property of the cokernel, which is the same as the fundamental homomorphism theorem:

The morphism $g_2 \circ \beta$ annihilates anything, which comes from $f_1$, hence it factors over the cokernel of $f_1$, which is $M''$.

Your construction is correct and you also identified the remaining problem: to prove that your construction is well defined. Proceed as follows:

(You should use the left side of the diagram somehow...)

Suppose that also $f_2(y^{\prime})=x$. Then $f_2(y^{\prime}-y)=0$ and therefore $y^{\prime}-y\in \text{Ker} f_2=\text{Im} f_1$. So there is an $z\in M^{\prime}$ such that $f_1(z)=y^{\prime}-y$. Because of the commutative diagram it holds that $g_1\alpha(z)=\beta f_1(z)=\beta(y^{\prime}-y)$ and that $g_2\beta(y^{\prime}-y)=g_2\beta f_1(z)=g_2g_1\alpha(z)=0$. Hence, $0=g_2\beta(y^\prime -y)=g_2(\beta(y^\prime)-\beta(y)) =g_2\beta(y^\prime)-g_2\beta(y)$, and hence $g_2\beta(y)=g_2\beta(y^{\prime})$, so therefor $\gamma$ is well defined. $\require{AMScd}$ \begin{CD} M^\prime @>f_1>> M @>f_2>> M^{\prime\prime} @>>> 0\\ @V\alpha VV= @V\beta VV= @VV\gamma V \\ N^\prime @>>g_1> N @>>g_2> N^{\prime\prime} \end{CD}