Let $R$ be a PID and let $p$ be a prime in $R$.
(a) Let $M$ be a finitely generated torsion $R$-module. Use the previous exercise to prove that $p^{k-1}M/p^kM \cong F^{n_k} $ where $F$ is the field $R/(p)$ and $n_k$ is the number of elementary divisors of $M$ which are powers $p^a$ with $a \ge k$.
(b) Suppose $M_1$ and $M_2$ are isomorphic finitely generated torsion $R$-modules. Use (a) to prove that, for every $ k \ge 0$, $M_1$ and $M_2$ have the same number of elementary divisors $p^a$ with $a \ge k$. Prove that this implies $M_1$ and $M_2$ have the same set of elementary divisors.
I am referring to the exercise 12.1.12 of Dummit-Foote book Abstract Algebra. I have proved the part (a) and that $M_1$ and $M_2$ have the same number of elementary divisors with $p^a$ with $a \ge k$.
I have difficulties to prove that $M_1$ and $M_2$ have the same set of elementary divisors.
Can anyone help me...thanks in advance....