$M\simeq X\oplus Y$ and $M/X \simeq Y$

69 Views Asked by At

I am trying to prove that if $M,X,Y$ are modules over a ring $D$, then $M\simeq X\oplus Y$ $\Longleftrightarrow$ $M/X \simeq Y$

"$\Longrightarrow$'' I consider the map $f_1:x\in X \rightarrow (x,0)\in X\oplus Y$ and $f_2:(x,y)\in X\oplus Y \rightarrow y \in Y$ and using $M/X \simeq (X\oplus Y)/X \simeq (X\oplus Y)/\text{Ker}(f_2) \simeq \text{Im}(f_2)=Y$

However I can not prove it the other way.