6
$\begingroup$

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

$\endgroup$
3
  • 1
    $\begingroup$ People here generally like users to post code as Mathematica code instead of just images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find this meta Q&A helpful $\endgroup$
    – Michael E2
    Commented Feb 12, 2021 at 14:32
  • 2
    $\begingroup$ PolynomialMod[p, {char, irred}] will give you the reduced form of p (e.g. (1+w) x instead of w^2 x as written above). $\endgroup$
    – Michael E2
    Commented Feb 12, 2021 at 14:50
  • 2
    $\begingroup$ 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 as w^2 is rewritten as w+1. $\endgroup$ Commented Feb 13, 2021 at 17:28

1 Answer 1

7
$\begingroup$

Note that your filed F is a Galois extension field (in MMA written: GF[{2,2}]). You can look it up in the help if you know a bit about the theory.

But to keep things simple and not using the Galois package of MMA, we may simply put your restrictions into replacement rules:

t = PolynomialRemainder[(1 + w x + x^2) (1 + w^2 x + w x^2), (x^3 - 
     1), x] // Expand;
t //. {w^3 -> 1, w^4 -> w, w + w^2 -> 1, a_ i_Integer -> a Mod[i, 2] }

(*1 + w^2 x + w x^2*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.