A finite fields probable prime test using Galois conjugates and Vieta’s formulas

I’ve been trying to extend the cubic Frobenius test to a quartic test, and it’s been challenging. I got an idea for a primality test that isn’t fast, but is interesting in any case. Let $n$ be a probable prime, and $f$ be a monic 4th degree polynomial such that $f$ has no roots in $\mathbb{Z}/n\mathbb{Z}$. If $n$ is prime, then $\mathbb{Z}/n\mathbb{Z}$ is the finite field $\mathbb{F}_{n^4}$. If $\alpha$ is a root of $f$ in $\mathbb{F}_{n^4}$, then $\alpha^n$, $\alpha^{n^2}$, and $\alpha^{n^3}$ are the Galois conjugates of $\alpha$. Because $f$ is the minimal polynomial of $\alpha$, the four Galois conjugates are in fact distinct. These are all roots of $f$ because they are images of $\alpha$ under one or more applications of the Frobenius automorphism which maps $x \in \mathbb{F}_{n^4}$ to $x^n$. The idea of the test is to substitute the four expressions into the four elementary symmetric polynomials in four variables $e_1$, $e_2$, $e_3$,and $e_4$. Cf.: https://en.wikipedia.org/wiki/Elementary_symmetric_polynomial. We then check Vieta’s formulas, Cf.: https://en.wikipedia.org/wiki/Vieta%27s_formulas.

The following script in Pari/gp does this (assuming f is some monic polynomial over $\mathbb{Z}$):

 testquarticsym(n)={while(!polisirreducible(Mod(f,n)),f=f+1);roots=vector(4);for(j=1,4,roots[j]=Mod(Mod(x,f),n)^(n^(j-1)));res=vector(4);for(k=1,15,m=16+k;d=digits(m,2);pr=1;for(j=1,4,if(d[j+1],pr=pr*roots[j]));sumd=0;for(j2=1,4,sumd=sumd+d[j2+1]);res[sumd]=res[sumd]+pr);t=1;for(j=1,4,t=t&&(lift(res[j])==Mod(((-1)^j)*polcoef(f,4-j),n)));return(t)}
meditationatae's avatar

By meditationatae

Canadian

Discover more from meditationatae

Subscribe now to keep reading and get access to the full archive.

Continue reading