Prove that the group generated by sum of two subgroups is isomorphic with their cartesian product 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?
 A: Lemma: Let $G$ be a group and $H\le G, K\triangleleft G$ then $H\vee K=HK$
Proof:

*

*$HK\subset H\vee K$.

*$HK\le G$.

*$H\vee K$ is the smallest subgroup of $G$ containing both $H$ and $K$. $\square$

Given $G$ is abelian, hence $H\vee K=HK$.
Verify (or see here):
$$\begin{align}
\varphi : H\times K&\to HK,\\
(h, k) &\mapsto hk
\end{align}$$
is an isomorphism.
A: One way to define the (internal) direct product $G=H\bowtie K$ of two subgroups $H,K$ of a group is that all of the following is satisfied:

*

*$G=HK$.

*$H\cap K=\{e\}.$

*$H,K\unlhd G$.

It is a standard exercise to show that $H\times K\cong H\bowtie K.$ (For a proof, see Theorem 9.6 of Gallian's, "Contemporary Abstract Algebra (Eighth Edition)" or see this question.)

Let $T=\langle H_1\cup H_2\rangle$.
We have that $H_i=\langle H_i\cup \{e\}\rangle$ is a subgroup of $T$. (As $T$ is the smallest subgroup of the ambient group that contains $H_i$. But $H_i$ is itself a group and so must be a subgroup of $T$.) Since the ambient group is abelian, $T$ is abelian, so each of the subgroups in $T$ is normal; hence $H_i\unlhd T$.
We are given that $H_1\cap H_2=\{ e\}$.
Since, again, $T$ is abelian, we have $T=H_1H_2$ (because any set product $AB$ is a subgroup iff $AB=BA$; see here).
Therefore,
$$\begin{align}
T&\cong H_1 \bowtie H_2\\
&\cong H_1\times H_2.
\end{align}$$
