Solution (source code)

= Solution

Let $1\triangleleft N\triangleleft G$ be the given length-two <composition series>. Thus $N$ and $G/N$ are <simple groups>. Let $M$ be any proper nontrivial <normal subgroup> of $G$, such as the penultimate term of another <composition series>.

If $M=N$, its two factors are already the given ones. Suppose $M\ne N$. Since $M\cap N$ is normal in the simple <group> $N$, it is either $1$ or $N$. The latter would mean $N\subseteq M$, but then $M/N$ would be a proper nontrivial <normal subgroup> of $G/N$, impossible. Thus $M\cap N=1$.

Also $M$ cannot be contained in $N$, since it would then be a nontrivial <normal subgroup> of $N$ distinct from $N$. The product $MN$ is a <normal subgroup> of $G$, strictly containing $N$. Simplicity of $G/N$ therefore forces $MN=G$. The <second isomorphism theorem for groups> gives
$$
\boxed{M\cong G/N,\qquad G/M\cong N.}
$$
In particular $M$ is simple. Every other <composition series> has such an $M$ as its last proper term, and no nontrivial refinement inside a simple $M$ is possible. Hence \b[every <composition series> has length two].

The general \b[<Jordan–Hölder theorem>] states that any two <composition series> of a finite <group> have the same length and the same <composition factors> up to <group isomorphism> and permutation. The argument above proves both assertions in this length-two case: another series either uses $N$ itself or has factors isomorphic to the original pair in the opposite order. No general uniqueness theorem was used to prove this special case.