Let $R$ be a commutative ring, and let $M$ be a module with submodules $A,B \subset M$. Show that if $A \cap B=0$ and $A+B=M$, then there are $R$-module isomorphism $M/A \cong B$ and $M/B \cong A$.
Here is what I have:
Since $M=A+B$, then every $m$ in $M$ can be written as $a+b$ for some $a\in A$ and $b\in B$. Define
$$f:M \to B$$
$$m=a+b \to b$$
This is well defined: Assume that $a_1+b_1=a_2+b_2$, then $b_1=a_2+b_2-a_1$, and then we have $b_1=f(a_1+b_1)=f(a_1+(a_2+b_2-a_1))=f(a_2+b_2)=b_2$.
It is an $R$-module homomorphism:
$f((a_1+b_1)+(a_2+b_2))=f((a_1+a_2)+(b_1+b_2))=b_1+b_2=f(a_1+b_1)+f(a_2+b_2)$
Let $r\in R$, $f(r(a+b))=f(ra+rb)=rb=rf(a+b)$
$f$ is surjective, as $B\subset M$, so for all $b\in B$, we can find an a pre-image in $M$ (which is basically $b$ itself).
Since the kernal $K$ of $f$ is $A$, then by the first isomorphism theorem, we have $M/K=M/A\cong f(M)=B$. Is it correct? Thanks.