Two equivalent conditions proof (related to semiproduct of groups) Let $G$ be a group, and let $N$ be a normal subgroup of $G$, $H$ any subgroup of $G$.
I wish to prove the equivalence of 
(i) $G$ is the product of subgroups, $G=NH$, where $N\cap H=\{e\}$.
(ii) There exists a homomorphism $G\to H$ that is the identity on $H$ and whose kernel is $N$.

I am not very sure how to prove their equivalence.
What I note is that second isomorphism theorem, $NH/N\cong H/(N\cap H)$, so $G/N\cong H$ seems to be promising for (i) implies (ii), but not sure of the details.
Thanks for help.
 A: Suppose (i) holds and we take the map $\phi: G \to H$ given by $\phi(nh) = h$.
This is well-defined since $N \cap H = \{e\}$, thus the representation $g = nh$ is unique for any $g \in G$.
It is clearly surjective, since for any $h \in H$ we have $eh \in NH = G$ with $\phi(eh) = h$.
Since $N \lhd G$, for any $h \in H$, we have $hN = Nh$, thus:
$nhn'h' = n(n''h)h' = (nn'')hh'$, for some $n'' \in N$, and:
$\phi((nh)(n'h')) = \phi((nn'')hh') = hh' = \phi(nh)\phi(n'h')$, so $\phi$ is a homomorphism.
Clearly, $\phi$ is the identity on $H$, and if $g = nh \in \text{ker }\phi$, we have $g = ne$, that is $g \in N$, so $\text{ker }\phi \subseteq N$. The other inclusion is trivial.
If (ii) holds, then $N$, being a kernel, is normal in $G$. Since $N \lhd G$, we know that $NH = HN$, thus $NH$ is a subgroup of $G$. Since our posited homomorphism is the identity on $H$, it is surjective, thus $H \cong G/N$. Thus every element of $G$ can be written in the form $nh$, since the cosets $Nh$ thus partition $G$, and we have $G = NH$.
Suppose $g \in N \cap H$. Then (if we call our homomorphism $\psi$), we have $\psi(g) = e$, since $N = \text{ker }\psi$. On the other hand, since $g \in H$, we have $\psi(g) = g$, thus $N \cap H = \{e\}$.
