# Abstract algebra: define constants in a finite field

How can I to define a constant in $Z_{2}$?

For example, I want to create a constant b that inherits the properties of an element from $Z_{2}$. For example

b + b = 0
b^n = b

-

## 1 Answer

Your question focuses on the wrong aspect of finite fields. It's not the numbers 0 and 1 that change because you are working with $Z_2$, it's the arithmetic operators. You could define your own operators plusZ2 and TimesZ2.

An alternative is to load the finite fields package with Needs[FiniteFields], which overloads the relevant arithmetic operators for you.

-
Great! You are right! Thanks. But... I have some large polynomials whose coefficients are in $Z_{2}$... for example: $p(X)=(a+b^2+c^4+5b^6....)X+(.....)X^2+....$ So, how can I simplify $(a+b^2+c^4+5b^6....)$ in a authomatic way? (suppose $(a+b^2+c^4+5b^6...)$ is in arithmetic of $Z_2$) –  user14545 May 22 '14 at 20:53
@user14545. Advise you to follow the link I provided. –  m_goldberg May 22 '14 at 20:59
@user14545. Previous comment is not a brush-off. I simply don't have the experience to help you with the new question you pose in your comment. Try to use the finite fields package. If have trouble solving your problem with it, come back with a new question, which is specific to applying the package to your polynomials. –  m_goldberg May 22 '14 at 21:08
Thanks again. I saw the package that you recommend, but I had some problems. So... I ask again: I load: Needs["FiniteFields"]; fld = GF[2] And, I want to do: a^3+a^2 I write: fld[{a^3}] + fld[{a^2}] but mathematica give me: Subscript[{Mod[a^2 + a^3, 2]}, 2] And I'd like mathematica give me: 0 –  user14545 May 22 '14 at 21:14
@user14545. Please do not ask new questions in a comment. This is not a discussion forum. Bring what you ask above to the attention of the community by writing it up as a new question. –  m_goldberg May 22 '14 at 21:20