$H \triangleleft G,K \triangleleft G, H \cap K=e$, then, $HK$ is a subgroup of $G$ and $HK$ isomorphic to $H\times K$, where, $\triangleleft$ denotes normal subgroup.
If $G$ isomorphic to $H\times K$, then, $H \triangleleft G,K \triangleleft G, H \cap K=e$ and $HK$ isomorphic to $H×K$
From 1, we get the conditions on H and K is sufficient for HK to be isomorphic to H×K. Are the above conditions necessary?
My attempt:
I have been given that H and K are subgroups of G such that HK forms a subgroup of G and $HK$ isomorphic to $H\times K$. I need to check whether this implies $H$ and $K$ are normal in $G$ and intersection is identity. From 2, we have if we replace $G$ by $HK$, $H$ and $K$ are normal in $HK$ and intersection is identity. But this does not necessarily imply $H$ and $K$ normal in $G$. But I cannot find a counterexample to prove this.