While studying abstract algebra I encountered the following question:
Given an abelian group $G$ and its two sub-groups $H_1, H_2$, such that $H_1 \cap H_2=\{e\}$, prove that the group generated by $\langle H_1 \cup H_2 \rangle$ is isomorphic with the group $H_1 \times H_2$ (their Cartesian product, with the operation being the one from $G$ along the coordinates, so $(a,b)(c,d)=(ac, bd)$).
From what I understand I should suggest a bijection that preserves the operations of these groups. However I don't quite know how to go about this. I was thinking of the following: for each element $a$ of $\langle H_1 \cup H_2 \rangle$ we first express is at a linear combination of elements from $H_1 \cup H_2$ (so $a = (H_1)_1^{k_1}(H_1)_2^{k_2}...(H_2)_1^{q_1}(H_2)_2^{q_2}...$), separate the elements from $H_1$ and $H_2$ into two expressions ($R_1 = (H_1)_1^{k_1}(H_1)_2^{k_2}..., R_2=(H_2)_1^{q_1}(H_2)_2^{q_2}...$), and place the results of these expressions into their respective coordinates of the pair from the Cartesian product group (so $(R_1, R_2)$). Since $G$ is abelian, we don't have to worry about the order of the operations.
Does such proposition hold any water?