Discrete Mathematics/Finite fields

Introduction
Recall from the previous section that we considered the case where F[x]/ analogous to modular arithmetic but with polynomials, and that when we are looking at numbers modulo n, we have a field iff Zn is a field if n is prime.

Can we say something similar about F[x]/? Indeed, if m(x) is irreducible then F[x]/ is a field.

This section deals with these kinds of fields, known as a finite field.

Definitions
We have the object F[x]/ where this is the set of polynomials in F[x] are divided by the polynomial m(x).

Of the elements in F[x]/ we can easily define addition, subtraction, multiplication, division and so on normally but with a reduction modulo m(x) to get the desired remainder.

We have that F[x]/ is a commutative ring with identity, and if m(x) is irreducible then F[x]/ is a field.

If m(x) has degree n, then
 * $$\mathbf{F}[x] / \langle m(x) \rangle = \{ a_{n-1} x^{n-1} + a_{n-2} x^{n-2} + \dots + a_0 x^0 | a_i \in \mathbf{F} \} $$

If F is Zp (so p is prime) then $$| \mathbf{F}[x] / \langle m(x) \rangle | = p^n$$

Properties
Now remember with complex numbers C, we have "invented" the symbol i to stand for the root of the solution x2+1=0. In fact, we have C=R[x]/.

When we have a general finite field, we can do this also. We write this often as F[x]/=F(&alpha;) where &alpha; is "the root of" m(x) - we define &alpha; to be the root of m(x).

F(&alpha;) in fact is the smallest field which contains F and &alpha;.

Finite field theorems
We have a number of theorems associated with finite fields.


 * 1) If F is a finite field, |F|=q, then q=pk for some k $$\ge$$ 1 and p prime.
 * 2) There then is a monic irreducible polynomial m(x) with degree k such that F=Zp[x]/=Zp(&alpha;) with &alpha; a root of m(x) over Zp
 * 3) There is an element &gamma;&isin;F such that the order (the least element n such that &gamma;n=1) of &gamma; is q-1, so &gamma; is primitive in F, and we can generate elements of F (not zero) from powers of &gamma;, i.e. F={0, &gamma;0=1, &gamma;1, ..., &gamma;q-2, &gamma;q-1=1}
 * 4) F is a vector space with dimension k over Zp. It has basis {1, &alpha;, &alpha;2,...,&alpha;n-1} where n is the degree of m(x), so we have F={an-1&alpha;n-1+...+a0&alpha;0|ai&isin;F}
 * 5) If a&isin;F, a+...+a p times (pa) is 0.
 * 6) If m2(x) is any other irreducible polynomial of degree k over Zp then F is isomorphic (meaning basically equal to, except for a change in symbols) to Zp/ - so all ways of writing this field are basically the same. So there is essentially one field of size q=pk and we denote it GF(pk) (GF meaning Galois Field).

Some examples
Let's look at a few examples that go through these ideas.

The complex numbers
Complex numbers, briefly, are numbers in the form
 * $$ a + bi$$

where i is the solution to the equation x2+1=0

These numbers in fact form a field, however it is not a finite field.

Take m(x)=x2+1, with the field F being R. Then we can form the complex numbers as F/. Now F/ = { a+bx | a, b &isin; R} because the remainders must be of degree less than m(x) - which is 2.

So then (a+bx)(c+dx)=ac+bdx2+(ad+bc)x.

But remember that we are working in F/. So x2 modulo x2+1, can be written as (x2+1)-1=-1, and substituting -1 above yields a rather familiar expression.

If we let the symbol i to be the "root of x2+1", then i2+1=0 and i2=-1. The rest of the field axioms follow from here. We can then say the complex numbers C=R/=R(i).

The Zp case
We can still do this for some field in general. Let's take Z3 for example, and pick m(x)=x2+x+2. m(x) is irreducible - m(0)=2, m(1)=4=1, m(2)=4+2+2=8=2.

So Z3/ is a finite field. Assume &alpha; is a root of m(x). Then Z3(&alpha;) = { a+b&alpha;|a, b &isin; Z3}. Since Z3/<x2+x+2> is finite, we can list out all its elements. We have the constant terms, then the &alpha; terms, then the &alpha;+constant terms, and so on. We have {0, 1, 2, &alpha;, &alpha;+1, &alpha;+2, 2&alpha;, 2&alpha;+1, 2&alpha;+2}.

Now we have &alpha;2+&alpha;+2=0, then
 * &alpha;2=-&alpha;-2
 * &alpha;2=2&alpha;-2=2&alpha;+1

(Recall the coefficients are in Z3! We are working in Z3/<m(x)>)

We can verify multiplication works mod m(x) - for example
 * (1+2&alpha;)(2+&alpha;) = 2 + &alpha;+4&alpha;+2&alpha;2

Reducing coefficients normally mod 3 we get
 * (1+2&alpha;)(2+&alpha;) = 2 + 2&alpha; + 2&alpha;2

Now using the formula above for &alpha;2
 * (1+2&alpha;)(2+&alpha;)
 * = 2 + 2&alpha; + 2(2&alpha;+1)
 * = 2 + 2&alpha;+4&alpha;+2
 * = 2 + 6&alpha;+2
 * = 2 + 2 = 4 = 1

Verify for yourself that multiplication and other operations work too.

Primitive elements
Recall from ../Modular arithmetic/ that the order of a number a modulo n, in a field, is the least power such that ak-1=1 in Zn, with k the size of this field. Since the order is defined over a field, this leads us to consider whether we have primitive elements in F[x]/<m(x)> - which we do. If we have F(&alpha;), just like in Zn, &alpha; is primitive iff the order of &alpha; is q-1 where q is the number of elements in F[x]/<m(x)>.

Let's take Z2/<x2+x+1>. Is &alpha; (root of x2+x+1) primitive?

First, if &alpha; is a root of x2+x+1,
 * &alpha;2+&alpha;+1=0
 * &alpha;2=-&alpha;-1=&alpha;+1

Now, let us calculate powers of &alpha;
 * 1, &alpha;
 * &alpha;2=&alpha;+1
 * &alpha;3=&alpha;(&alpha;2)=&alpha;(&alpha;+1)=&alpha;2+&alpha;=(&alpha;+1)+&alpha;=1

Recall that the size of this field is 4 (the n in Zn, in this case, 2, raised to the power of the degree of the polynomial, in this case 2). Now we have &alpha;3=&alpha;4-1=1, and &alpha; is primitive.

We generally want to look at powers of &alpha; in F(&alpha;), to see whether they are primitive, since we already know about the orders of the constants in F(&alpha;) - which we've looked at in ../Modular arithmetic/.