$A \oplus B \cong A \oplus C$ implies $B \cong C$ where $A,B,C$ are finitely generated $R$ modules and $R$ is a PID There are number of similar questions to this, but I have read through them all and the answers either rely on results that I don't have access to or I'm unsure how to translate them to this situation.
The exact problem is as follows. Suppose $R$ is a PID, $A,B$ and $C$ are finitely generated $R$ modules and that $A \oplus B \cong A \oplus C$, then $B \cong C$.
It seems like we should be able to apply the structure theorem for finitely generated modules over a PID. In the version I'm most familiar with, this result says that given a PID $R$ and an $R$ module $M$, we have that
$$
M \cong R^n \oplus R/(a_1) \oplus ...\oplus R/(a_m)
$$
where $n \in \mathbb{N}$, $a_i \in R$, and $a_1|a_2|...|a_n$. Further, if
$$
M \cong R^s \oplus R/(b_1) \oplus ...\oplus R/(b_t)
$$
and $b_1|...b|t$, then we have that $n=s$, $m=t$ and $a_i$ is associate to $b_i$ for all $a_i$.
Applying that to this problem at hand, we can write down decompositions for $A,B$, and $C$:
$$
A \cong R^a\oplus R/(a_1)\oplus ... \oplus R/(a_l)
$$
$$
B \cong R^b\oplus R/(b_1)\oplus ... \oplus R/(b_m)
$$
$$
C \cong R^c\oplus R/(c_1)\oplus ... \oplus R/(c_n)
$$
So we have that
$$
R^a\oplus R/(a_1)\oplus ... \oplus R/(a_l) \oplus R^b\oplus R/(b_1)\oplus ... \oplus R/(b_m) \cong R^a\oplus R/(a_1)\oplus ... \oplus R/(a_l) \oplus R^c\oplus R/(c_1)\oplus ... \oplus R/(c_n) 
$$
$$
R^{a+b}\oplus R/(a_1)\oplus ... \oplus R/(a_l) \oplus R/(b_1)\oplus ... \oplus R/(b_m) \cong R^{a+c} \oplus R/(a_1)\oplus ... \oplus R/(a_l) \oplus R/(c_1)\oplus ... \oplus R/(c_n) 
$$
What I would like to do here is to apply the uniqueness part of the structure theorem I referenced above, but it is not at all clear to me why the divisibility condition on the invariant factors would still hold, since now we have factors from from $A$ and $B$ on the left hand side and the same problem on the right. What am I missing here? Is this easier to understand with the elementary divisor form?
Also as I mentioned at the beginning, I know there are some similar questions already posed, but I have read them and I am still unsure, so if you give a link to another question please try to explain more precisely how that question applies.
 A: By uniqueness of the structure theorem, we have $b = c$ so we may well assume that all modules are of torsion. As you say, it is not clear from the way we've written things how the invariant factors relate to each other.
One may use a different formulation of the structure theorem, splitting each $a_i$ into irreducible factors, using the Chinese remainder theorem, and regrouping quotients based on the irreducible appearing. We end up with a decomposition
$$
M = M[p_1] \oplus \ldots \oplus  M[p_r]
$$
where $M[p_i]$ is a sum of quotients of the form $R/(p_i^{\alpha_i})$. Going through the proof of the structure theorem one sees that the $p_i$'s appearing in this decomposition are unique up to associates and so are the powers $\alpha_i$ appearing in each so called $p_i$-torsion $M[p_i]$. One can show that $(A\oplus B)[p_i] = A[p_i] \oplus B[p_i]$ (think of $M[p_i]$ as the elements of $M$ such that $p_i^k m = 0$ for some $k$).
Hence, we many assume that both $A, B$ and $C$ are of $p$-torsion,
$$
A = \bigoplus_{i=1}^n R/(p^{a_i}), \quad B = \bigoplus_{i=1}^k R/(p^{b_i}), \quad C = \bigoplus_{i=1}^l R/(p^{c_i}).
$$
If $A \oplus B \simeq A \oplus C$, by uniqueness of the structure theorem (in this version) we have that $(a_1,\ldots, a_n,b_1,\ldots,b_k)$ up to reordering coincides with $(a_1,\ldots,a_n,c_1,\ldots,c_l)$. Hence $(b_j)$ and $(c_j)$ are - up to reordering - the same. This shows that $B \simeq C$.
