Solution (source code)

= Solution

<Lagrange's theorem> states that for a <subgroup> $L$ of a <finite group> $G$, $|G|=[G:L]|L|$. In particular $|L|$ divides $|G|$; the equal-sized <cosets> partition $G$.

Apply the theorem to $H\cap K$ inside both <subgroups>. Its order divides both coprime orders, so \b[$H\cap K=\{1\}$]. For $h\in H$ and $k\in K$, the <group commutator> $hkh^{-1}k^{-1}$ lies in $K$ by $K$ being a <normal subgroup>, and in $H$ because $kh^{-1}k^{-1}\in H$. It is therefore the identity. Thus \b[every element of $H$ commutes with every element of $K$].

Define $\theta:H\times K\to G$ by $\theta(h,k)=hk$. The cross-commutation just proved gives $\theta(h,k)\theta(h',k')=hh'kk'=\theta(hh',kk')$, so this is a <group homomorphism> from the <direct product of groups>. The product assumption makes it surjective. If $hk=1$, then $h=k^{-1}\in H\cap K$, so both entries are the identity and the <kernel of a group homomorphism> is trivial. Hence
$$
\boxed{G\cong H\times K,\qquad(h,k)\longmapsto hk.}
$$
This proves the <internal direct product theorem> in the present coprime-order setting, rather than merely matching the numbers of elements.