I'm having some struggles with the following exercise:
Let $G$ be a group and let $H_1,H_2\unlhd G$ such that $H_1\cap H_2 = \{1\}$ and $H_1H_2=G.$
Prove that $G\simeq H_1\times H_2$
Because $H_1H_2=G$ we can write any element $g$ of $G$ as:
$$g=h_1h_2$$
with $h_1\in H_1$ and $h_2 \in H_2$ and then I proved that this way representing elements of $G$ is unique. Then I considered the following function:
$$f:G\longrightarrow H_1\times H_1 $$ $$g(=h_1h_2)\mapsto(h_1,h_2)$$
I already showed that $f$ is bijective but I'm having some struggle proving that $f$ is a homomorphism. How can this be proved?
The idea is to show that if $x\in H_1$ and $y\in H_2$, then $xy=yx$.
This is equivalent to showing that $xy(yx)^{-1}=1$, so to $$ xyx^{-1}y^{-1}=1 $$ Now note that $xyx^{-1}\in H_2$, so $xyx^{-1}y^{-1}\in H_2$ as well. Also $yx^{-1}y^{-1}\in H_1$, so $xyx^{-1}y^{-1}\in H_1$. Both statements follows from the subgroups being normal.
Since $H_1\cap H_2=\{1\}$ we have the proof.
The rest follows easily: the map $H_1\times H_2\to G$ defined by $(h_1,h_2)\mapsto h_1h_2$ is quite obviously a homomorphism, due to the above property. Prove it is an isomorphism.