Proving a set is a subgroup of an abelian group Let $G$ be abelian group. Suppose $H$ and $K$ are subgroups of $G$, and $HK = \{xy:x \in H \text { and } y \in K\}$. Prove that $HK$ is a subgroup of $G$.

Let $xy, ab \in HB.$ Both $H, K$ are closed under multiplication, so $xa \in H, yb \in K.$ Thus, $xayb \in HB.$ Since $G$ is abelian, $xyab \in HB.$
Since both $H, K$ are closed under inverses, $x^{-1} \in H, y^{-1} \in K.$ So, $x^{-1}y^{-1} \in HK$. Since $G$ is abelian, $(xy)^{-1} \in HK.$
Since $e \in H, e \in K, e^2 = e \in HK.$
Please, check my work.
 A: If you can use homomorphisms, then this is clear because $HK$ is the image of the homomorphism $\mu: H \times K \to G$ given by $(h,k) \mapsto hk$.
Here we use that the image of a group homomorphism is a subgroup of the codomain. (*)
The nice feature of this approach is that you only need to prove that $\mu$ is a homomorphism and this is less work than proving directly that $HK$ is a subgroup because you only need to prove $\mu(xy)=\mu(x)\mu(y)$.
You still need to prove (*), but this is a widely useful fact to know.
If you cannot use homomorphisms, you can prove a stronger claim: $HK$ is the subgroup generated by $H$ and $K$.
Indeed, the subgroup generated by $H$ and $K$ is the set of all words $x=x_1 x_2 \cdots x_n$ with $x_i$ or $x_i^{-1}$ in $H \cup K$. Since $G$ is abelian, you can move all the $x_i$ that belong to $H$ to the left to get $x=hk$.
In general, even if $G$ is not abelian, $HK$ is the subgroup generated by $H$ and $K$ when $H$ and $K$ commute pairwise, that is, when $hk=kh$ for all $h \in H$ and $k \in K$. Both proofs work in this case unchanged.
