Solution (source code)

= Solution

Let $f\in R[X]$ have degree $n$. A useful reduction prime must preserve its degree and make its reduction separable. Thus exclude the leading coefficient and <discriminant> from $P$; after localizing at those elements one may make $f$ monic. The residue base <field> is $k=\operatorname{Frac}(R/P)$, not necessarily the ring $R/P$ itself. Then \b[the <Galois group> of the reduced <polynomial> embeds in the generic group, with the same action on the corresponding roots].

Here is the <unramified reduction of a polynomial Galois group> argument. A UFD is integrally closed. Let $E$ be the <splitting field> over $F$, and use the root algebra $B$ obtained by adjoining all roots after inverting the <discriminant>. It is finite étale over the resulting normal base: successive simple-root adjunctions are unramified, and the distinct generic components separate over a normal ring. Choose a prime $Q$ above $P$. The residue <field> $k_Q$ is generated over $k$ by the reduced roots, so it is their <splitting field>. The <decomposition group>
$$
D_Q=\{\sigma\in\operatorname{Gal}(E/F):\sigma Q=Q\}
$$
acts on $k_Q$. Its residue action is onto $\operatorname{Gal}(k_Q/k)$; this is the local decomposition-group description of the unramified fiber. Equivalently, the geometric points of that fiber form a free transitive Galois-group set, and the commuting residue-field action identifies the residue group with a stabilizer subgroup of the generic group.

The kernel is the <inertia group>. An element in that kernel fixes every reduced root. Since the <discriminant> is a unit, distinct roots have distinct reductions; consequently it fixes every original root and is the identity. Therefore
$$
\boxed{D_Q\simeq\operatorname{Gal}(\overline f/k)\leq\operatorname{Gal}(f/F).}
$$
Choosing another prime changes this subgroup by conjugacy, which does not change the cycle types available for computing the generic group.

When $k=\mathbb F_q$, its splitting-field group is generated by <Frobenius>. A reduced irreducible factor of degree $d_i$ contributes one $d_i$-cycle. Hence a squarefree factorization with degrees $d_1,\ldots,d_r$ proves that the generic group contains that <cycle type>. Irreducible degree-preserving reduction also proves generic irreducibility by <Gauss's lemma>: a nontrivial monic factorization would reduce to one. Several good primes, a discriminant-square test and permutation-group arguments can then identify the group. A ramified or degree-dropping prime does not justify the same cycle test.