Let $R$ a commutative ring with the unit and let $N\subset P \subset M$ a $R$-module and $M'\subset M$ another $R$ module. If $N+M' = P + M'$ and $N\cap M' = P \cap M' $ then $N=P$.
My idea was to prove that $P\subset N$. Let $x\in P$, then $x\in P+M'$ then $x\in N+M'$, so there exists $n\in N, m\in M'$, $x = n + m$. Here troubles come. If I am able to prove from here that $x\in M'$ (Maybe by summing or subtracting something and removing the $N$ part...) then $x\in M'\cap P = M'\cap N$ then $x\in N$.
Am I right? Any hint for the missing step? Thank you!
Let $x\in P $. Clearly $x=n+m$ for some $n\in N$ and $m\in M'$. Note that $x-n\in P\cap M'=N\cap M'$. So $x-n=n_1$ for some $n_1\in N$. Thus $x=n+n_1\in N $.