Identifying the finite symmetric groups Is there a single first-order sentence $\varphi$ in the language of groups such that for every finite $\mathfrak{A}$ we have $$\mathfrak{A}\models\varphi\quad\iff\quad\mathfrak{A}\cong S_n\mbox{ for some finite $n$}?$$
Clearly this can be done with a first-order theory in place of a single sentence: if for each $n$ we let $\varphi_n$ be the sentence asserting "Either the structure is isomorphic to $S_m$ for some $m\le n$, or the structure has $>n!$ elements," then the finite models of $\{\varphi_n:n\in\mathbb{N}\}$ are exactly the finite symmetric groups. Similarly, a single second-order sentence can do the job. However, I don't see how to do the job with a single first-order sentence.
 A: Yes. The key observation is that the symmetric groups $S_n$ (at least for $n>6$) uniformly interpret their action by permutations on the set $[n] = \{1,\dots,n\}$. The interpretation is explained in this answer by Itai Bar-Natan, but I'll repeat it here for completeness.

*

*For $n>6$, $\sigma\in S_n$ is a transposition if and only if $\sigma$ has order $2$ and for every conjugate $\sigma' = \rho\sigma\rho^{-1}$, $\sigma\sigma'$ has order $1$, $2$, or $3$. So the set $T$ of transpositions is uniformly definable. In another answer to the same question, Noam Elkies points out that when $n=6$, $T$ is not even definable, since the outer automorphism of $S_6$ maps $T$ to the set $T_3$ of products of three disjoint transpositions.

*The set $X = \{(\tau_1,\tau_2)\in T^2\mid \tau_1\neq \tau_2\text{ and }\tau_1\tau_2\text{ has order }3\}$ is also uniformly definable. Note that a pair $(\tau_1,\tau_2)$ is in $X$ if and only if $\tau_1$ and $\tau_2$ are distinct transpositions which are not disjoint, i.e., there is a unique element $k\in [n]$ such that $\tau_1$ and $\tau_2$ both move $k$. We think of the pair $(\tau_1,\tau_2)$ as identifying the element $k$.

*The equivalence relation $\sim$ on $X$ given by $(\tau_1,\tau_2)\sim (\tau_1',\tau_2')$ if and only if the pairs $(\tau_1,\tau_2)$ and $(\tau_1',\tau_2')$ both identify the same element $k$ is uniformly definable by the formula asserting that for all $i,j\in \{1,2\}$, $\tau_i = \tau_j'$ or $(\tau_i,\tau_j')\in X$. Note $X/{\sim}$ is in natural bijection with $[n]$.

*Finally, the induced action of $S_n$ on $X/{\sim}$ is uniformly definable by conjugation. Note that if $(\tau_1,\tau_2)\in X$ and identifies the element $k\in [n]$, say $\tau_1 = (k\, i)$ and $\tau_2 = (k\, j)$, then for any $\sigma\in S_n$, $\sigma\tau_1\sigma^{-1} = (\sigma(k)\,\sigma(i))$ and $\sigma\tau_2\sigma^{-1} = (\sigma(k)\,\sigma(j))$. So $(\sigma\tau_1\sigma^{-1},\sigma\tau_2\sigma^{-1})\in X$ and identifies the element $\sigma(k)$. It follows that this action of $S_n$ on $X$ respects the equivalence relation $\sim$.

Given all this, we can identify the symmetric groups by the following sentence: (1) $G\cong S_n$ for some $n\leq 6$, or (2) (a) the formula defining $\sim$ defines an equivalence relation on the definable set $X\subseteq G^2$ and (b) conjugation defines a group action of $G$ on $X/{\sim}$ (in particular it respects $\sim$) and (c) this action is faithful and (d) for any pair of distinct elements of $X/{\sim}$, there is an element of $G$ which transposes them and fixes the rest of the elements of $X/{\sim}$.
The finite symmetric groups certainly satisfy this sentence. And if a finite group $G$ satisfies this sentence, then the action of $G$ on $X/{\sim}$ gives a homomorphism $G\to S_{X/{\sim}}$ which is injective (because the action is faithful) and surjective (because the symmetric group on the finite set $X/{\sim}$ is generated by transpositions). So $G$ is isomorphic to $S_{X/{\sim}}$.
