Is the isomorphism class of a Galois group a first-order property? To make this more precise: fix a ground field $K$ and a polynomial $f(x) = a_0 + a_1x + ... + a_n x^n$ with (perhaps unnecessary) $a_n \neq 0$. Then for each possible Galois group $H$ (which one can see are the subgroups of $S_n$) is there a first-order criterion $P_H$ such that $P_H(a_0,...,a_n)$ holds if and only if the splitting field of $f$ has a Galois group isomorphic to $H$?
Or perhaps just one direction - is there a statement $P_H'$ which, when satisfied, implies the Galois group of the splitting field is isomorphic to $H$?
I think this is possible but I do not have a very rigorous argument or sketch in mind. Very very roughly, it seems like it boils down to something like ``label the roots of $f(x)$ as $\alpha_1,...,\alpha_n$ and then one can test whether a permutation of them is an isomorphism of $K[x]/f(x)$ in a first-order way'' but I'm struggling to make that more precise.
 A: Yes.  Fix $N\in\mathbb{N}$ and a subgroup $G\subseteq S_n$.  Then you can write down a first-order formula which says:


*

*there exists a bilinear map $K^N\times K^N\to K^N$ which makes $K^N$ a field such that

*there exist elements $\alpha_1,\dots\alpha_n\in K^N$ such that $f(x)$ factors as $a_n(x-\alpha_1)\dots(x-\alpha_n)$ over this field and $\alpha_1,\dots,\alpha_n$ generate $K^N$ as a field (every element of $K^N$ can be written as a polynomial in the $\alpha_i$, where we only need powers less than $n$ since each $\alpha_i$ has minimal polynomial of degree at most $n$) and

*there exist distinct linear maps $\sigma_g:K^N\to K^N$ for each $g\in G$ which are field automorphisms and satisfy $\sigma_g(\alpha_i)=\alpha_{g(i)}$  (note that distinctness of the $\sigma_g$ is needed since the $\alpha_i$ may not be distinct) and

*every linear map $K^N\to K^N$ which is a field automorphism is equal to one of the $\sigma_g$.


Taken together, this says that $K^N$ is a splitting field of $f$ and its automorphism group is $G$.  Since the splitting field of $f$ has degree at most $n!$, we can take a disjunction of these formulas over all $N\leq n!$ and all $G$ which are isomorphic to $H$ to get a formula which says the Galois group of $f$ is isomorphic to $H$.
