Let $A,B,C$ be finitely generated abelian groups. I want to show that $$A\oplus C \cong B \oplus C $$ then $A \cong B$. My idea is as follows: we begin by noting that this has already been proved for $A,B,C$ finite. Let
$A = \mathbb{Z}^{k_1}\oplus A'$
$B = \mathbb{Z}^{k_2}\oplus B'$
$C = \mathbb{Z}^{k_3}\oplus C'$
Then we have $$\mathbb{Z}^{k_1+k_3}\oplus A'\oplus C' \cong \mathbb{Z}^{k_2+k_3}\oplus B'\oplus C'$$ Therefore $k_1 = k_2$ and then I would like to divide out by the infinitary parts to get $$A'\oplus C'\cong B'\oplus C'$$ and since all groups are finite we can use previous theorems to derive $A'\cong B'$ hence $A\cong B$. However I am not sure how to get past the 'dividing bit' as to assume that we can cancel would be circular. How should I proceed? Is the assumption that finitely generated abelian groups cancel even true?