TITLE: Finitely generated abelian groups: If $G \times K$ is isomorphic to $H \times K$, then $G$ is isomorphic to $H$.
QUESTION [7 upvotes]: Let $G,H,K$ be finitely generated abelian groups.  If $G \times  K$ is isomorphic to $H \times K$, then $G$ is isomorphic to $H$.
What I have thought is that fundamental theorem of abelian groups can be used, but I don't know how to do next.  Please help me.

REPLY [3 votes]: Or if you access to A Course on Group Theory by J.J.Rose see this:

Corollary 8.42: Let $G$ be a non-trivial finitely generated abelian group and let $$G=H_1\times...\times H_m=K_1\times ....\times K_n$$ where $m,n$ are positive integers and $H_i,K_j$ are non-trivial indecomposable subgroups of $G$ Then $m=n$ and, by relabeling the suffices if necessary, $$H_i=K_j$$ for each $i=1,...n$