TITLE: Cancellation property for direct products
QUESTION [6 upvotes]: I must be misunderstanding something very elementary, because every proof I see of this uses advanced methods (including the one in my course notes). Suppose $G, H, K$ are groups such that $G \times H \cong G \times K$. We have to prove that $K \cong H$. Now we know $G \times \{ 1 \} $ is a normal subgroup of the direct product, so we can cancel it out. By the second isomorphism theorem we obtain:
$(G \times H)/G \times \{ 1 \} \cong (G \times \{ 1 \})(\{ 1 \} \times H)/G \times \{ 1 \} \cong \{ 1 \} \times H$
and likewise for $K$. Consequently, $\{ 1 \} \times K \cong \{ 1 \} \times H$ and $K \cong H$.
What is wrong with this proof?

REPLY [4 votes]: While it is true that $G\times H/H\cong G\times K/K$, this in no way implies that $H\cong K$. In fact, this cancellation property you are speaking of is simply not true. Take $G=\prod\limits_{i=1}^\infty \mathbb{Z},\ H=\mathbb{Z},\ K=\mathbb{Z\times Z.}$

REPLY [4 votes]: Your error here is that you are assuming the two copies of $G$ in your group are the same subgroup, rather than different-but-isomorphic subgroups.
The result you claim is not true in general; you need to assume that the groups are e.g. finite. For example, it does not hold even if the groups are all finitely presented and $G\cong\mathbb{Z}$ (see here).