[proofplan]
The strategy is to express $\langle \pi_X, \pi_X \rangle$ in two ways: as a sum of squared multiplicities, and as the number of $G$-orbits on $X \times X$. The first comes from the orthogonality of irreducible characters: if $\pi_X = \sum m_i \chi_i$ then $\langle \pi_X, \pi_X \rangle = \sum m_i^2$. The second comes from [Inner Product of Permutation Characters](/theorems/2434). The transitive hypothesis on $X$ already supplies one orbit on $X \times X$ (the diagonal); $2$-transitivity adds exactly one more orbit (the "off-diagonal"), and conversely, having only two orbits on $X \times X$ — together with the multiplicities counting irreducibles — forces $\pi_X$ to split into the trivial character plus exactly one other irreducible.
[/proofplan]
[step:Decompose $\pi_X$ into irreducibles and locate the trivial character]
Since $G$ acts transitively on $X$, by [Multiplicity of Trivial Character Equals Number of Orbits](/theorems/2433) the multiplicity of the trivial character $1_G$ in $\pi_X$ is exactly $1$. Write the irreducible decomposition of $\pi_X$:
\begin{align*}
\pi_X = 1_G + \sum_{i=2}^k m_i\, \chi_i,
\end{align*}
where $\chi_2, \ldots, \chi_k$ are pairwise distinct non-trivial irreducible characters of $G$ and $m_i \geq 1$. Set $m_1 := 1$ for the multiplicity of $1_G$ for notational uniformity.
[guided]
The setup uses that $\pi_X$ is a character of a representation, so by [Completeness of Irreducible Characters](/theorems/2424) it is a non-negative integer combination of irreducible characters:
\begin{align*}
\pi_X = \sum_i m_i \chi_i.
\end{align*}
Transitivity of $G$ on $X$ pins down $m_1$, the multiplicity of $1_G$: by [Multiplicity of Trivial Character Equals Number of Orbits](/theorems/2433), this equals the number of orbits, which is $1$ under transitivity. So we know already $\pi_X = 1_G + \sum_{i \geq 2} m_i \chi_i$ with the remaining $\chi_i$ distinct non-trivial irreducibles and $m_i \geq 1$ (we list only those that actually appear).
[/guided]
[/step]
[step:Compute $\langle \pi_X, \pi_X \rangle$ in two ways]
First expression — via [Row Orthogonality](/theorems/2430). Since irreducible characters are orthonormal, expanding bilinearly,
\begin{align*}
\langle \pi_X, \pi_X \rangle = \left\langle \sum_i m_i \chi_i, \sum_j m_j \chi_j \right\rangle = \sum_{i, j} \overline{m_i}\, m_j\, \langle \chi_i, \chi_j \rangle = \sum_i m_i^2,
\end{align*}
using $m_i \in \mathbb{Z}_{\geq 1}$ (so $\overline{m_i} = m_i$) and $\langle \chi_i, \chi_j \rangle = \delta_{ij}$.
Second expression — via [Inner Product of Permutation Characters](/theorems/2434). The hypothesis there requires $G$ acting on finite sets, which holds for $X_1 = X_2 = X$ (a single finite set). Applying the theorem to the diagonal action on $X \times X$:
\begin{align*}
\langle \pi_X, \pi_X \rangle = \text{number of orbits of } G \text{ on } X \times X.
\end{align*}
Equating the two expressions:
\begin{align*}
\sum_{i=1}^k m_i^2 = \text{number of orbits of } G \text{ on } X \times X.
\end{align*}
[guided]
Two evaluations of $\langle \pi_X, \pi_X \rangle$ form the bridge. The first uses that the irreducible characters are an orthonormal basis under $\langle \cdot, \cdot \rangle$. Expanding $\pi_X = \sum m_i \chi_i$ on both sides of the inner product and using $\langle \chi_i, \chi_j \rangle = \delta_{ij}$, the cross terms vanish and the diagonal terms contribute $|m_i|^2 = m_i^2$ (multiplicities are non-negative integers). So $\langle \pi_X, \pi_X \rangle = \sum m_i^2$.
The second evaluation uses [Inner Product of Permutation Characters](/theorems/2434): $\langle \pi_{X_1}, \pi_{X_2} \rangle$ equals the number of orbits of $G$ on $X_1 \times X_2$, applied with $X_1 = X_2 = X$. The hypothesis is finiteness of the acted-on sets, satisfied here.
Combining: $\sum m_i^2$ equals the number of orbits of $G$ on $X \times X$. This is the central identity of the proof.
[/guided]
[/step]
[step:Translate $2$-transitivity to the orbit count on $X \times X$]
By definition, $G$ is $2$-transitive on $X$ if for every two pairs $(x_1, x_2), (x_1', x_2') \in X \times X$ with $x_1 \neq x_2$ and $x_1' \neq x_2'$, there exists $g \in G$ with $g(x_1, x_2) = (x_1', x_2')$. We claim this is equivalent to $G$ having exactly two orbits on $X \times X$ under the diagonal action.
The set $X \times X$ partitions into the **diagonal** $\Delta = \{(x, x) : x \in X\}$ and its complement $X \times X \setminus \Delta = \{(x_1, x_2) : x_1 \neq x_2\}$. Both are $G$-invariant: the diagonal because the action is diagonal, and its complement by definition (the action sends distinct pairs to distinct pairs, since $g$ is a bijection of $X$).
- Restricted to $\Delta$, the diagonal action of $G$ is the action of $G$ on $X$ (via the bijection $X \to \Delta$, $x \mapsto (x, x)$). Transitivity on $X$ implies transitivity on $\Delta$, so $\Delta$ is a single $G$-orbit.
- The complement $X \times X \setminus \Delta$ is non-empty because $|X| > 2 \geq 2$, hence in particular $|X| \geq 2$.
Hence $G$ has at least two orbits on $X \times X$ ($\Delta$ and at least one orbit in $X \times X \setminus \Delta$), and equals exactly two if and only if $G$ acts transitively on $X \times X \setminus \Delta$. Transitivity of $G$ on $X \times X \setminus \Delta$ is precisely $2$-transitivity. Conclusion:
\begin{align*}
G \text{ is } 2\text{-transitive on } X \iff G \text{ has exactly two orbits on } X \times X \iff \langle \pi_X, \pi_X \rangle = 2.
\end{align*}
[guided]
The diagonal $\Delta$ is always a $G$-invariant subset of $X \times X$ (the diagonal action preserves equality of coordinates). Under transitivity on $X$, it is a single orbit — for any $(x, x), (y, y) \in \Delta$, taking $g \in G$ with $gx = y$ gives $g(x,x) = (y,y)$.
The complement consists of ordered pairs of distinct elements. The action of $G$ on this complement is what $2$-transitivity refers to: $G$ is $2$-transitive on $X$ iff for any two ordered pairs of distinct elements, there is an element of $G$ taking the first to the second. This is precisely transitivity of $G$ on $X \times X \setminus \Delta$.
So total orbits on $X \times X$ = (orbits on $\Delta$) + (orbits on complement) = $1$ + (number of orbits on complement). Two orbits total iff one orbit on the complement iff $2$-transitivity. Combined with Step 2's identity $\sum m_i^2 = $ (number of orbits on $X \times X$), we get $\sum m_i^2 = 2$ iff $2$-transitivity.
A subtle point: we use $|X| > 2$ — actually, we only used $|X| \geq 2$ to ensure the complement is non-empty. The hypothesis $|X| > 2$ is the natural condition under which $2$-transitivity is non-degenerate, but the equivalence we just established requires only $|X| \geq 2$.
[/guided]
[/step]
[step:Solve $\sum m_i^2 = 2$ to characterise the decomposition of $\pi_X$]
Suppose $G$ is $2$-transitive on $X$. By Step 3, $\langle \pi_X, \pi_X \rangle = 2$, so by Step 2,
\begin{align*}
\sum_{i=1}^k m_i^2 = 2 \quad \text{with } m_1 = 1 \text{ and all } m_i \in \mathbb{Z}_{\geq 1}.
\end{align*}
The unique solution in positive integers is $k = 2$ and $m_1 = m_2 = 1$. (Any $m_i \geq 2$ would contribute at least $4$, exceeding $2$; and $\sum m_i^2 = 2$ with all $m_i \geq 1$ requires exactly two terms, each equal to $1$.) Hence
\begin{align*}
\pi_X = 1_G + \chi_2,
\end{align*}
where $\chi := \chi_2$ is irreducible (non-trivial since distinct from $\chi_1 = 1_G$).
Conversely, suppose $\pi_X = 1_G + \chi$ with $\chi$ irreducible. Then $\sum m_i^2 = 1^2 + 1^2 = 2$, so by Step 3 $G$ is $2$-transitive on $X$.
[guided]
The Diophantine equation $\sum m_i^2 = 2$ with $m_i \geq 1$ has the unique solution: two terms, each equal to $1$. (The minimum value of any single $m_i^2$ is $1$, attained at $m_i = 1$. Sums of squares of positive integers: $1 = 1^2$, $2 = 1^2 + 1^2$, $4 = 2^2 = 1^2 + 1^2 + 1^2 + 1^2$, etc. So $\sum = 2$ forces exactly two terms.)
Combined with $m_1 = 1$ from Step 1 (the multiplicity of $1_G$), we get $k = 2$ and $m_2 = 1$. Hence $\pi_X = 1_G + \chi_2$ with $\chi_2$ a single irreducible character distinct from $1_G$.
The converse is immediate: if $\pi_X = 1_G + \chi$ with $\chi$ irreducible, then $\langle \pi_X, \pi_X \rangle = 1 + 1 = 2$, which by Step 3 is equivalent to $2$-transitivity. So the decomposition shape $\pi_X = 1_G + \chi$ (with $\chi$ irreducible) is precisely the character-theoretic signature of $2$-transitivity.
[/guided]
[/step]