# How can I check whether a given finite group is a semidirect product of proper subgroups?

Suppose, a finite group $G$ is given.

I want to check whether there is a proper normal subgroup $N$ of $G$ and a subgroup $H$ of $G$, such that $G$ is the semidirect product of the groups $N$ and $H$.

In the case that the order of $N$ is coprime to the order of $G/N$, we can simply choose $H:=G/N$ and G is the semidirect product of $N$ and $H$, but how can I find out whether a suitable $H$ exists in general ?

GAP allows to enumerate the normal subgroups of a given finite group $G$, but I have no idea how to search for $H$ with GAP.

• Perhaps you meant that $\;G\;$ is isomorphic to the semidirect product of $\;N\,,\,\,G/H\;$ as the latter is not even a subset of $\;G\;$ . – DonAntonio Feb 19 '16 at 15:55

In general such a subgroup $H$ is called a complement to $N$. Complements could be conjugate, and so GAP has a function ComplementClassesRepresentatives that returns representatives of such classes. (That is, if an empty list is returned there is no complement.)