TITLE: Relationship between index $n$ subgroups and homomorphisms onto $\mathbb Z/ n \mathbb Z$
QUESTION [6 upvotes]: I've been having a think about the relationship between index $n$ subgroups of a group $G$ and homomorphisms $G \to \mathbb Z / n \mathbb Z$. 

Let's first have a look at the case $n = 2$. 
i) Suppose we have a non-trivial homomorphism $\phi : G \to \mathbb Z / 2 \mathbb Z $, where $G$ is a group. Then $H = \mathrm{ker}\phi$ is a normal subgroup of $G$. Since $\phi$ is non-trivial, $G/H \cong \mathbb Z / 2 \mathbb Z$ and we have that $H$ is a normal subgroup of index $2$ in $G$. So every non-trivial homomorphism $\phi$ gives rise to an index $2$ subgroup $\mathrm{ker}\phi$. 
ii) Suppose $H$ is a subgroup of index $2$ in $G$. Then $H$ is necessarily normal and not equal to $G$. It seems natural to define $\phi : G \to \mathbb Z / 2 \mathbb Z$ by $\phi(H) = 0$, $\phi(G \backslash H) = 1$. This is necessarily a homomorphism, since the product of two elements in $G \backslash H$ must be in $H$ (using normality of $H$). So every index $2$ subgroup gives rise to a non-trivial homomorphism, and the required correspondence is established.

Let's see what happens when we try to generalise this method for higher $n$. 
If $n = 3$, any non-trivial homomorphism $\phi : G \to \mathbb Z / 3 \mathbb Z$ must be surjective, and so the argument used in i) still works; every non-trivial homomorphism $\phi$ gives rise to an index $3$ subgroup $\mathrm{ker}\phi$.
I then come across two problems:

I can't seem to generalise i) for $n$ higher than $3$, since I can't guarantee surjectivity. EDIT: I can guarantee surjectivity if $n$ is prime, though (since non-triviality implies the existence of a $g \in G$ with $\phi(g) = a \neq 0$, and $n$ prime implies the existence of a multiplicative inverse of $a \ (\mathrm{mod } \ n )$). 
I can't even generalise my argument in ii) to the case when $n = 3 $, since normality was key here.

I suppose what I'd like to know is:
A) Is there a nice generalisation of the $n=2$ result? Does it use the same method and, if so, why haven't I managed to get it to work?
B) Is there some other approach to this problem / explanation of why no such approach exists? Perhaps it might be helpful to decompose $\mathbb Z / n \mathbb Z$ according to the prime factorisation of $n$? 
C) Is there anything else relevant to the problem that I haven't thought about? I can see complications may arise in the case where $G$ is not finite.
Thanks.

REPLY [4 votes]: There are several ways of generalizing some or all of the observations you make. The reason you are getting a bit lost is the perhaps unfortunately coincidence that $S_2$, the group of all permutations on the set of two elements, is the same as $\mathbf{Z}_2$, the cyclic group of order $2$; this lead to an attempt to generalize along cyclic groups rather than permutation groups.
Bill Cook has given the standard generalization: 

A group $G$ has a subgroup $H$ of index $n$ if and only if there is a homomorphism of $G$ onto a transitive subgroup of $S_n$. Moreover, the homomorphism can be chosen so that the kernel of the homomorphism is contained in $H$.  

Another line of generalization runs along the observation that a subgroup of index $2$ must necessarily be a normal subgroup. A standard generalization is:

Let $G$ be a finite group. If $H$ is a subgroup of $G$, and $[G:H]$ is the smallest prime that divides $|G|$, then $H\triangleleft G$.

The proof is very different from the proof for the case $[G:H]=2$, but this theorem has the $[G:H]=2$ case as a special case. It uses group actions:
Proof. Since $[G:H]=p$, then there is a homomorphism $G\to S_p$. The kernel of the homomorphism is contained in $H$; let $N$ be the kernel. Then $[G:N]$ divides $|S_p|=p!$ by Lagrange's Theorem. But the smallest prime that divides $|G|$ is $p$, so $[G:N]$ cannot be divisible by any prime smaller than $p$. Therefore, $[G:N]=p$, and since $N\subseteq H$ we conclude that $N=H$. Thus, $H\triangleleft G$, as claimed. $\Box$. 
Another generalization is a simple observation:

A group $G$ has a normal subgroup of index $n$ if and only if there is a onto homomorphism from $G$ onto a group of order $n$.

Proof. If $K$ is a group of order $n$, and $\varphi\colon G\to K$ is an onto homomorphism, let $N=\mathrm{ker}(\varphi)$. Then $G/N\cong K$ by the First Isomorphism Theorem, so $[G:N] = |G/N| = |K| = n$. Thus, $N\triangleleft G$ and $[G:N]=n$, as claimed. Conversely, if $N\triangleleft G$ and $[G:N]=n$, then the canonical projection $\pi\colon G\to G/N$ (with $\pi(g) = gN$) is an onto homomorphism onto a group of order $n$ ($G/N$ is a group because $N\triangleleft G$). $\Box$
As I noted in my comment, you can generalize slightly your observation by restricting to normal subgroups of cyclic number index:
Definition. A positive integer $n$ is called a cyclic number if and only if every group of order $n$ is isomorphic to the cyclic group of order $n$. 
Examples of cyclic numbers are the primes, and $n=pq$ with $p\lt q$ primes and $q\not\equiv 1\pmod{p}$ (e.g., $n=15$). A complete characterization of cyclic numbers is a bit complex to state: given a prime $p$ and a positive integer $\nu$, define
$$\psi(p^{\nu}) = (p^{\nu}-1)(p^{\nu-1}-1)\cdots(p-1).$$
For an integer $n\gt 1$, factor $n$ into primes, $n=p_1^{\nu_1}\cdots p_r^{\nu_r}$, and define
$$\psi(n) = \psi(p_1^{\nu_1})\cdots \psi(p_r^{\nu_r}).$$
Finally, set $\psi(1)=1$. Then $n$ is a cyclic number if and only if $\gcd(n,\psi(n))=1$ and $n$ is squarefree (if $k^2$ divides $n$, then $k=\pm 1$). 
Then a corollary of the theorem above is:

Corollary. Let $n$ be a cyclic number. A group $G$ has a normal subgroup of index $n$ if and only if there is a surjective homomorphism $G\to\mathbf{Z}_n$. 

Proof. If there is a homomorphism $G\to\mathbf{Z}_n$, then by the theorem the kernel is normal of index $|\mathbf{Z}_n|=n$. Conversely, if $N\triangleleft G$ has index $n$, then there is a surjective homomorphism $G\to K$ with $|K|=n$; but since $n$ is a cyclic number, then $K\cong\mathbf{Z}_n$, so there is a surjective homomorphism from $G$ onto $\mathbf{Z}_n$, as claimed. $\Box$
The result cannot be extended to $n$ that are not cyclic numbers. Let $n$ be a number that is not a cyclic number. Then there is a group $K$ such that $|K|=n$ but $K$ is not cyclic. Take $G=K$ and $N=\{e\}$. Then $N\triangleleft G$, $[G:N]=n$, but no homomorphic image of $G$ is cyclic of order $n$.