How to factor a polynomial quickly in $\mathbb{F}_5[x]$

259 Views Asked by At

I was doing an exercise in Brzezinski's Galois Theory Through Exercises and needed to factor the polynomial $x^6+5x^2+x+1=x^6+x+1$ in $\mathbb{F}_5[x]$. Is there a quick way to do this?

I can see it has no roots and therefore no linear factors, so it must either factor as the product of a quadratic and a quartic or two cubics, but listing the irreducible quadratics and cubics mod $5$ is laborious. I found all of the irreducible quadratics, which are \begin{multline} x^2\pm 2, \, x^2+x+1, \, x^2+x+2, \, x^2+2x-2, \, x^2+2x-1, \\ x^2-2x+2, \, x^2-2x-2, \, x^2-x+1, x^2-x+2 \end{multline} and checked that none of these are factors, so it must factor as the product of two cubics, which I know I could find either by finding all irreducible cubics or by writing $$ x^6+x+1 = (x^3+ax^2+bx+c)(x^3+dx^2+ex+f) $$ and then equating coefficients.

I used a computer to perform the Berlekamp algorithm which yielded the factorisation $$ x^6+5x^2+x+1 = (x^3-2x^2-1)(x^3+2x^2-x-1) $$ but it would take me a very long time to do this by hand. Can anyone suggest any tricks that could be applied here?

2

There are 2 best solutions below

5
On BEST ANSWER

The observation made by user8268 is the key to the following paper and pencil factorization. Not ruling out the existence of other possibilities — that trick simply works like charm.


Let $\alpha$ be a root of $p(x)=x^6+x+1$ in some extension field of $\Bbb{F}_5$. By Galois theory it follows that $$ \alpha^5=\frac{\alpha^6}{\alpha}=-\frac{\alpha+1}{\alpha}=-1-1/\alpha $$ is another root. The projective linear trasformation (aka a Möbius transformation) $$f(t)=-1-1/t$$ is "famous" for having order three. Meaning that its third iterate is the identity: $f(f(f(t)))=t$. It follows that the Frobenius automorphism $\alpha\mapsto \alpha^5$ cycles back to $\alpha$ after three rounds. Therefore the minimum polynomial of $\alpha$ is (a factor of) $$ m(x)=(x-\alpha)(x-f(\alpha))(x-f(f(\alpha)))=(x-\alpha)(x+1+\frac1\alpha)(x+\frac1{1+\alpha}). $$ Here I used the fact that $f(f(t))=-1/(1+t)$.

Expanding $m(x)$ gives $$ m(x)=x^3+Ax^2+Bx-1, $$ where $A=(1+3\alpha-\alpha^3)/(\alpha+\alpha^2)$ and $B=(1-3\alpha^2-\alpha^3)/(\alpha+\alpha^2).$

How does this help the factorization? The key is that, upon inspection, we see that $A-B=3$. This narrows down the family of putative factors to those of the form $$ x^3+Ax^2+(A-3)x-1. $$

All of the above, together with the OPs observation that the polynomial has no roots in $\Bbb{F}_5$, implies that we are looking for a factorization of the form $$ x^6+x+1=(x^3+Ax^2+(A-3)x-1)(x^3+Cx^2+(C-3)x-1)\qquad(*) $$ with $A,C\in\Bbb{F}_5$. Looking at the terms of degree five (or the linear terms) on the R.H.S. of $(*)$ tells us that $A+C=0$, so $C=-A$. Expanding further, and looking at the quadratic terms we get the equation $$ 0=-A+(A-3)(C-3)-C=AC-4(A+C)+9=AC-1=-A^2-1. $$ This has two solutions $A=\pm2$ in $\Bbb{F}_5$. It is straight forward to check that this gives the desired factorization.


The same observation allows us to factor for example $g(x)=x^8+x+1$ in $\Bbb{F}_7[x]$. Testing shows that $g(2)=0=g(4)$. The above process, this time starting from $\alpha^7=f(\alpha)$, leads to a full factorization $$g(x)=(x-2)(x-4)(x^3-3x-1)(x^3-x^2+3x-1).$$ We see the same difference of three in the coefficients of the quadratic and linear terms of the two cubic factors.

See this older question and its answers for an earlier incarnation of this projective linear transformation in this context. There was no need to identify the cubic factors there. I only posted this because I had never noticed that difference of three. Undoubtedly that is a known fact given that this particular Möbius transformation appears regularly.

0
On

My approach is almost certainly not what the author had in mind, but this technique seems quite effective:

If $\alpha$ is a root of a cubic factor in some extension, then by Vieta the constant term of the cubic factor is $- \alpha \cdot \alpha^5 \cdot \alpha^{25} = -\alpha^{31}.$

So compute $x^{31}$ modulo $x^6+x+1$ in $\mathbb{F}_5[x]$: $$\begin{align*} x^6 &\equiv -x - 1\\ x^{30} &\equiv -x^5 -1 \\ x^{31} &\equiv -x^6 - x \\ &\equiv 1, \end{align*}$$

This means $-\alpha^{31} = -1$ for every root $\alpha$ of $x^6+x+1$, so both cubic factors have constant term $-1$. (This computation also rules out the possibility of quadratic or linear factors: all such factors divide $x^{25}-x$, and only $x-1$ divides both $x^{25}-x$ and $x^{31}-1$.)

So each cubic factor looks like $x^3 + xL(x) -1$, where $L(x)$ is a degree $1$ polynomial in $\mathbb{F}_5[x]$.

This means we are looking for linear polynomials $L_1(x)$ and $L_2(x)$ such that $$ \begin{align*} x^6 + x + 1 &= (x^3 + x\,L_1(x) - 1)\cdot (x^3 + x\,L_2(x)-1) \\ &= (x^3-1)^2 + x(x^3-1)\cdot(L_1(x)+L_2(x)) + x^2\cdot L_1(x)L_2(x). \end{align*} $$ It's worth noting that a decomposition of the form $$ (x^3-1)^2 + x(x^3-1)\cdot \text{ linear } + x^2 \cdot \text{ quadratic }$$ is unique, as the linear term can be determined from the $x^5$ and $x^1$ coefficients, and then the quadratic factor can be solved for. Here we have $$x^6 + x + 1 = (x^3-1)^2 + x(x^3-1)\cdot (-1) + x^2\cdot(x^2+2x)$$ so $$ \begin{align*} L_1(x) + L_2(x) &= -1 \\ L_1(x) \cdot L_2(x) &= x^2 + 2x \end{align*} $$ and we can use (for example) the quadratic formula to find $L_1$ and $L_2$: $$ \begin{align*} L_1(x), \; L_2(x) &= \frac{-1 \pm \sqrt{-4x^2-8x+1}}{2} \\ &= \frac{-1\pm\sqrt{x^2+2x+1}}{2} \qquad \text{ (reminder: coefficients are in $\mathbb{F}_5$)} \\ &= -2x, \; 2x-1. \end{align*} $$ So $x^6+x+1 = (x^3-2x^2-1)(x^3+2x^2-x-1)$ in $\mathbb{F}_5[x]$.