Suppose $F=\{0,1,w,w^2\}$ is a field of $4$ elements, where $w$ is a root of $x^2+x+1$. (This means: $w^2=w+1,w=w^2+1, 1=w+w^2,w^3=1,2w=2w^2=1+1=0$). In order to find out the remainder $$\frac{(1+w x+x^2) (1+w^2 x+w x^2)}{x^3-1}$$, I write in Mathematica:
$$\text{PolynomialRemainder}\left[\left(w x+x^2+1\right) \left(w^2 x+w x^2+1\right),x^3-1,x\right]$$
and I get $$\left(w^3+w+1\right) x^2+\left(w^2+2 w\right) x+2 w^2+1$$. Of course, then I have to do by hand some simplifications (last step) using the equalities mentioned at the beggining of this question. And so finally, I get:$$w x^2+ w^2 x+1$$. What I am asking is : Is there a way to put a command in Mathematica to make for me this last step? or even better to make Mathematica understand that $F=\{0,1,w,w^2\}$ is the mentioned field? Thanks.
EDIT
I made some corrections on the first line
PolynomialMod[p, {char, irred}]
will give you the reduced form ofp
(e.g.(1+w) x
instead ofw^2 x
as written above). $\endgroup$In[128]:= PolynomialReduce[(1 + w x + x^2) (1 + w^2 x + w x^2), {x^3 - 1, w^2 + w + 1}, Modulus -> 2][[2]] Out[128]= 1 + x + w x + w x^2
This is the "canonical" result, insofar asw^2
is rewritten asw+1
. $\endgroup$