TITLE: When does a subgroup H of a group G have a complement in G?
QUESTION [29 upvotes]: Let H be a subgroup of G.  (We can assume G finite if it helps.)  A complement of H in G is a subgroup K of G such that HK = G and |H∩K|=1.  Equivalently, a complement is a transversal of H (a set containing one representative from each coset of H) that happens to be a group.
Contrary to my initial naive expectation, it is neither necessary nor sufficient that one of H and K be normal.  I ran across both of the following counterexamples in Dummit and Foote:

It is not necessary that H or K be normal.  An example is S4 which can be written as the product of H=⟨(1234), (12)(34)⟩≅D8 and K=⟨(123)⟩≅ℤ3, neither of which is normal in S4.
It is not sufficient that one of H or K be normal.  An example is Q8 which has a normal subgroup isomorphic to Z4 (generated by i, say), but which cannot be written as the product of that subgroup and a subgroup of order 2.

Are there any general statements about when a subgroup has a complement?  The Wikipedia page doesn't have much to say.  In practice, there are many situations where one wants to work with a transversal of a subgroup, and it's nice when one can find a transversal that is also a group.  Failing that, one can ask for the smallest subgroup of G containing a transversal of H.

REPLY [2 votes]: A lot can be said in the finitely generated abelian case, just by using the structure theorem. 
Call a group transversal if every subgroup has a complement; non-transversal of it has proper, nontrivial subgroups, none of which has a complement; and semi-transversal if it is not transversal but some proper, nontrivial subgroup has a complement.
Take a finite abelian group $G=\mathbb{Z}/p_1^{e_1}\mathbb{Z}\times\ldots\times\mathbb{Z}/p_k^{e_k}\mathbb{Z}$ with $r\geq 0$, distinct primes $p_1,\ldots,p_k$ and $e_i\geq 1$. 
Then $G$ is transversal when $e_i=1$ for all $i$, semi-transversal when $k>1$ and $e_i>1$ for some $i$, and non-transversal when $k=1$ and $e_1>1$.
For an infinite finitely generated abelian group $G$, $G$ is non-transversal if $G=\mathbb{Z}$, and semi-transversal otherwise.
Given a finitely generated abelian group $G$ and $S\subseteq G$, call $S$ independent if $0\not\in S$ and for all $x_1,\ldots,x_k\in S$, $r_1,\ldots, r_k\in\mathbb{Z}$, we have that $\sum_{i=1}^k r_ix_i=0$ implies $r_ix_i=0$ for all $i$. Call $S$ a basis of $G$ if it is independent and $G=\left< S\right>$.
Then if $H\leq G$, $H$ has a complement if and only if $H$ has a basis that can be expanded to a basis of $G$.  If $S$ is a basis for $H$ and $S\subseteq T$ for some basis $T$ of $G$, then the complement of $H$ is $\left< T\backslash S\right>$.
So if $G$ is a vector space over $\mathbb{Z}/p\mathbb{Z}$ then any subgroup has a complement, since any subspace has a basis that can be completed to the whole space. My definition of independence is the same as linear independence.
If $G$ is a free module over $\mathbb{Z}/p^n\mathbb{Z}$ then my definition of independence is weaker than linear independence. I would like to say that $H\leq G$ has a complement if and only if it has a module basis, but I can't prove the reverse direction of this.
I know less about the divisible abelian case, except that if $G$ is a divisible abelian group then saying that $H\leq G$ has a complement is the same as saying that $H$ is divisible. In particular $\mathbb{Q}$ and the Prufer $p$-group $\mathbb{Z}(p^\infty)$ are both non-transversal.