$M \oplus M \simeq N \oplus N$ then $M \simeq N.$ Let $M$ and $N$ be finitely generated $R$-modules where $R$ principal domain. Show that if $M \oplus M \simeq N \oplus N$ then $M \simeq N.$
 A: Apply primary decomposition to these modules.
Clearly, the primary decomposition of $M\oplus M$ is just the primary decomposition of $M$ "doubled" in the sense that all factors appear twice as many times in the decomposition of $M\oplus M$ as they do in $M$. We can be certain of this because the "doubled" decomposition of $M$ clearly provides a decomposition for $M\oplus M$, and we are guaranteed uniqueness of types and multiplicities of pieces in the decomposition by the linked theorem.
Suppose $M\ncong N$. Then at least one of two things happens:


*

*$M$ has a indecomposable primary piece that $N$ doesn't have; or

*All the indecomposable primary pieces of $M$ and $N$ are the same, they just differ in number.


In case #1, $M\oplus M$ would also have an indecomposable primary piece which $N\oplus N$ lacks, so they would be nonisomorphic. In case #2, we would argue that the multiplicities of the primary piece differing in $N$ and $M$ produce differing multiplicities in $M\oplus M$ and $N\oplus N$, again making them nonisomorphic.
This proves the contrapositive of the statement.
A: Another way of putting it is to consider that the isomorphism class of a finitely-generated module $M$ over a PID $R$ is uniquely determined by the sequence of its invariant factors
$$
(a_{1}) \supseteq  (a_{2}) \supseteq \dots \supseteq (a_{k}),
$$
with all $a_{i}$ not units, and 
$$
M \cong \bigoplus_{i=1}^{k} \frac{R}{(a_{i})}.
$$
Clearly the sequence of invariant factors for $M \oplus M$ is just
$$
(a_{1}) \supseteq  (a_{1}) \supseteq  (a_{2}) \supseteq  (a_{2}) \supseteq  \dots \supseteq  (a_{k}) \supseteq  (a_{k}).
$$
Now do the same for $N$ and $N \oplus N$, and compare.
