When is $HK \cong H \times K$?

Suppose $G$ is a group and $H$ and $K$ are subgroups such that $G = HK$ and $H \cap K = \left\{e\right\}$, the identity element of $G$. When can we say that $HK \cong H\times K$?

I tried to set up the canonical map $(h,k) \to hk$ and worked out that this is an isomorphism if and only if $H \subset C(K)$ or $K \subset C(H)$, where $C$ denotes the centralizer, since $h_{1}k_{1}h_{2}k_{2} = h_{1}h_{2}k_{1}k_{2}$ and therefore $hk = kh$ for each $h \in H$, $k \in K$.

Is there a better way of saying this? How do I obtain a characterization of when $HK \cong H\times K$? Here I just picked a map (albeit canonical) and worked out when it would be an isomorphism. What if some other map works?

• This is true if and only if $H$ and $K$ are both normal subgroups of $G$. – Derek Holt Apr 17 '15 at 16:40

Your condition on centralizers is a good one. Nevertheless, the condition that both $H$ and $K$ are normal in $G$ is also equivalent to this, and is the easiest way to highlight a direct product structure.
• Could you give some hint on why the condition is equivalent to $H$ and $K$ being normal? I tried to show it but couldn't. Maybe I'm missing something easy. – Seven Apr 18 '15 at 4:03
• Of course. Let $K$ and $H$ be two subgroups that $<K,H>=G$ and $H\cap K$ is trivial. Then your condition on centralizers trivially implies mine. For the other implication, take $h\in H$ and $k\in K$ and use my condition about normalization to show that $[h,k]\in H\cap K$ and conclude. – Clément Guérin Apr 18 '15 at 6:06
• Thanks for the explanation. Also about the part of choosing the canonical map to set up an isomorphism. Why should this be the only valid isomorphism? How can I prove $H \times K \cong HK$ implies $H$ and $K$ normal without setting up an explicit isomorphism between them? – Seven Apr 18 '15 at 6:23
• Well, without the explicit isomorphism it is not necessarily true. It may be hard to state this completely in a comment but you can show that some semi direct product are actually direct product. For instance take $\mathbb{Z}_2$ acting (via $\phi$ on $\mathfrak{S}_3$ by the conjugation by $(1,2)$. Then one can show that $\mathfrak{S}_3\rtimes_{\phi}\mathbb{Z}_2=:G$ is isomorphic to $\mathfrak{S}_3\times\mathbb{Z}_2$.However the obvious copy $H=\mathbb{Z}_2$ is not normal in $G$. – Clément Guérin Apr 18 '15 at 6:51