Modules over Principal Ideal Domains Let $a$ and $b$ be two nonzero elements of a PID $R$. Prove that direct sum $R/(a)\oplus R/(b)$ is isomorphic to the direct sum $R/(u)\oplus R/(v)$, where $u=\gcd(a,b)$ and $v=\operatorname{lcm}(a,b)$.
We are working on Modules in my graduate Abstract Algebra class and we came across this problem and we were thinking of putting it in a form like this:
$R/(d_1)\oplus ... \oplus R/(d_m) $ such that $d_1|d_2|...|d_m$
but we are having trouble seeing how $R/(a)$ can be represented like something of that form.
Would $ \prod d_i = a$?
But our main problem is that our professor will not allow us to use the Chinese Remainder Theorem but instead wants us to put it in invariant factor form($d_i$'s).
Any help would be greatly appreciated :)
 A: Hint: Use unique factorization of elements into irreducibles which are the same as primes because you have a PID. Since it's a PID the non-zero primes are all maximal. Remember that if $a = p^{a_1}_1\dots p^{a_n}_n$ and $b = p^{b_1}_1\dots p^{b_n}_n$ where the $p_i$'s are distincy prime, then $gcd(a,b) = p^{min(a_1,b_1)}_1 \dots p^{min(a_n,b_n)}_n$ and $lcm(a,b) = p^{max(a_1,b_1)}_1 \dots p^{max(a_n,b_n)}_n$. Then apply the Chinese Remainder theorem to break $\mathbb{Z}/(a)$ and $\mathbb{Z}/(b)$ into products of quotients of powers of the $p_i$'s. Since direct products are isomorphic upto rearranging, find a way to move the $\mathbb{Z}/(p^{\alpha_i}_i)$'s around till you reach the desired form (to reach the desired form you need to recombine the $\mathbb{Z}/(p^{\alpha_i}_i)$'s again using Chinese remainder). 
Hence, you will actually use the Chinese Remainder Theorem twice. Once to break up $\mathbb{Z}/(a)$ and $\mathbb{Z}/(b)$, and later to recombine the $\mathbb{Z}/(p^{\alpha_i}_i)$'s for $p_i$ prime. 
