Varun Thakore

Understanding Field Extensions

Pre-requisites: Modular Arithmetic, Polynomial Long Division

In this post we will understand field extensions using examples. We will start with basic definitions and develop our understanding of the topic. Let us start with Groups.

Groups#

A group is a set of elements G={a,b,c,...}G = \{a, b, c,...\} and an operation \oplus for which the following axioms hold:

  • Closure: for any a,bGa, b \in G, the element ab a \oplus b is in GG
  • Associative: for any a,b,cGa, b, c \in G, (ab)c=a(bc)(a \oplus b) \oplus c = a \oplus (b \oplus c)
  • Identity: There is an identity element ee in GG for which ae=ea=aa \oplus e = e \oplus a = a, for all aGa \in G
  • Inverse: For each aGa \in G, there is an inverse (a)(-a) such that a(a)=ea \oplus (-a) = e

A group GG for which ab=baa \oplus b = b \oplus a, for all a,bGa, b \in G is called abelian or commutative.

Some examples of groups:

  1. Set of integers Z\mathbb{Z} with addition operation ++ forms an abelian group.
  2. Set {0,1,2,....,n1}\{0,1,2,....,n-1\} denoted by Zn\mathbb{Z}_n under mod-nn addition, where nn is a positive integer

We will now introduce Fields.

Fields#

A field is a set F\mathbb{F} of at least two elements, with two binary operation ++ and *, for which following axioms are satisfied :

  • The set F\mathbb{F} forms an abelian group (whose identity is called 0) under the operation ++
  • The set F=F{0}={aF,a0}\mathbb{F}^* = \mathbb{F} - \{0\} = \{a \in \mathbb{F}, a \neq 0\} forms an abelian group (whose identity is called 1) under the operation *
  • Distributivity: for all x,y,zFx, y, z \in \mathbb{F}, x(y+z)=xy+xzx*(y+z) = x*y +x*z

Some examples of fields:

  1. Set of real numbers R\mathbb{R} under addition and multiplication
  2. Set of complex numbers C\mathbb{C} under addition and multiplication
  3. Set of rational numbers Q\mathbb{Q} under addition and multiplication
  4. Set {0,1}\{0,1\} under mod-22 addition and multiplication
  5. Set {0,1,2,....,p1}\{0,1,2,....,p-1\} denoted by Fp\mathbb{F}_p under mod-pp addition and multiplication, where pp is a prime number. These are called Prime Fields.

We can verify that all the above examples satisfy the field axioms. The sets in example (4) and (5) are finite thus they are examples of a finite field. Now let’s state a theorem on extension of Prime Fields.

Theorem 1: Let N\mathbb{N} denote set of natural numbers. For all primes pNp \in \mathbb{N} and kN,k1k \in \mathbb{N}, k \geq 1 there exists a field with pkp^k elements denoted by Fpk\mathbb{F}_{p^k}. Fpk\mathbb{F}_{p^k} is called degree kk extension of Fp\mathbb{F}_p.

We will exclude the proof of above theorem since the main objective of this post is to understand field extensions.

Let us go through few non-examples of fields :

  1. Set of integers Z\mathbb{Z} under addition and multiplication is not an example of field since multiplicative inverse does not exist for all non-zero elements of Z\mathbb{Z}.
  2. Let p=2p=2 and k=2k=2 in Theorem 1. The set F4={0,1,2,3}\mathbb{F}_4 = \{0,1,2,3\} under mod-44 addition and multiplication is not a field since there is no multiplicative inverse for element 22 i.e there does not exist an element xF4x\in \mathbb{F}_4 such that 2x2*x mod 4=14 = 1

In the above example, we saw that F4={0,1,2,3}\mathbb{F}_4 = \{0,1,2,3\} is not a field but as per Theorem 1 there exists a field with p=2p=2 and k=2k=2. We will see the construction of this field in further sections and in general see the construction of Fpk\mathbb{F}_{p^k}. But before that let’s introduce Commutative Rings.

Commutative Rings#

A commutative ring RR is a set with two binary operations ++ and *, which satisfies the following axioms:

  • The set RR forms an abelian group (whose identity is called 0) under the operation ++
  • The set RR is closed under multiplication i.e. for any a,bRa, b \in R, the element ab a * b is in RR
  • Multiplicative Identity: for all aRa \in R, there is an multiplicative identity 11 in RR for which a1=1a=aa * 1 = 1 * a = a
  • Multiplication is associative i.e. for all a,b,cRa, b, c \in R, a(bc)=(ab)ca*(b*c) = (a*b)*c
  • Multiplication is commutative i.e. for all a,bRa, b\in R, ab=baa*b = b*a
  • Distributivity: for all a,b,cRa, b, c \in R, a(b+c)=ab+aca*(b+c) = a*b +a*c

We can see that Commutative Rings satisfy all the Field axioms excluding the multiplicative inverse property i.e. in a commutative ring all non-zero elements need not have a multiplicative inverse.

Some examples of commutative ring :

  1. Set of integers Z\mathbb{Z} under addition and multiplication
  2. Set of polynomials in variable XX with integer coefficients denoted by Z[X]\mathbb{Z}[X], under polynomial addition and multiplication
  3. Set of polynomials in variable XX with coefficients in field F\mathbb{F} denoted by F[X]\mathbb{F}[X], under polynomial addition and multiplication

We can verify that the above examples satisfy all the field axioms except that there are elements in these sets which do not have a multiplicative inverse.

Now before we construct Fpk\mathbb{F}_{p^k}, the degree kk extension of Fp\mathbb{F}_p, let us go through polynomials.

Polynomials#

Let us start by defining the degree of a polynomial. Let PP be a polynomial such that

P=i=0tfixiP=\sum_{i=0}^{t} f_i x^i \nonumber

then the degree of PP denoted by deg(P)deg(P) is defined as deg(P)=maxi{fi0}deg(P) = \underset{i}{\mathrm{max}} \{f_i \neq 0\}.

Let RR be a commutative ring. Then R[X]R[X] denotes the ring of polynomials in variable XX with coefficients in RR.

A polynomial of degree d\leq d in R[X]R[X] is given by

f(X)=f0+f1X+f2X2+....+fdXdf(X) = f_0 + f_1 X + f_2 X^2 + .... + f_d X^d

where f0,f1,f2,....,fdRf_0, f_1, f_2,....,f_d \in R and fd0f_d \neq 0.

R[X]R[X] is the union of all the polynomials over all degrees in N0\mathbb{N} \bigcup 0 .

R[X]=dN0{polynomials of degreed} R[X] = \bigcup_{d \in \mathbb{N} \bigcup 0 } \{ \text{polynomials of degree} \leq d\} \nonumber

Next, we will go through two important results regarding polynomials.

Lemma 1: Let F\mathbb{F} be a field. Let F[X]\mathbb{F}[X] denote the ring of polynomials in variable XX with coefficients in F\mathbb{F}. For all gg, hh F[X]\in \mathbb{F}[X] where hh is non-zero there exists unique qq, rr F[X]\in \mathbb{F}[X] such that g=hq+r    and    deg(r)<deg(h)g = h \cdot q + r \;\;\text{and}\;\; deg(r) < deg(h).

Lemma 2: Let gg, hh F[X]\in \mathbb{F}[X] where gg and hh are non-zero. Let II be a set such that I(g,h)={ug+vhu,vF[X]}I(g,h) = \{u \cdot g + v \cdot h \mid u,v \in \mathbb{F}[X] \}. Let pp be a non-zero polynomial of lowest degree in I(g,h)I(g,h). Then pp is a GCD(g,h)GCD(g,h).

Note that Lemma 1 is similar to Euclid’s division lemma for integers and Lemma 2 is similar to extended euclidean algorithm for integers. Now we will define irreducible polynomials which are used in the definition of extension field Fpk\mathbb{F}_{p^k}.

Irreducible Polynomials: Let f(X)F[X]f(X) \in \mathbb{F}[X] be a polynomial with coefficients in F\mathbb{F}. f(X)f(X) is irreducible over F\mathbb{F} if f(X)f(X) cannot be written as a product of two polynomials g(X)h(X)g(X)*h(X) where g,hF[X]g,h \in \mathbb{F}[X] and deg(g),  deg(f)1deg(g), \; deg(f) \geq 1.

Examples:

  1. Let F\mathbb{F} be a field of real numbers R\mathbb{R} then the polynomial f(X)=X2+3X+2f(X) = X^2 + 3X + 2 is reducible over R\mathbb{R} since f(X)=X2+3X+2=(X+1)(X+2)f(X) = X^2 + 3X + 2 = (X+1)*(X+2)
  2. Let F\mathbb{F} be a field of real numbers R\mathbb{R} then g(X)=X2+1g(X)=X^2+1 is irreducible over R\mathbb{R} since it cannot be written as a product of two polynomials of degree greater than equal to 1 with coefficients in R\mathbb{R}.
  3. Let F\mathbb{F} be a field of complex numbers C\mathbb{C} then the polynomial g(X)=X2+1g(X)=X^2+1 is reducible over C\mathbb{C} since g(X)=X2+1=(Xi)(X+i)g(X)=X^2+1 = (X-i)*(X+i) where i=1i=\sqrt{-1}.

Now we will state an important result about irreducible polynomials.

Lemma 3: For all primes pp and dNd \in \mathbb{N}, there exists an irreducible polynomial of degree equal to dd in Fp[X]\mathbb{F}_p[X] where Fp\mathbb{F}_p is the field {0,1,2,...,p1}\{0,1,2,...,p-1\} and Fp[X]\mathbb{F}_p[X] denotes the ring of polynomials over XX with coefficients in Fp\mathbb{F}_p.

Now a polynomial of degree d\leq d in Fp\mathbb{F}_p can be written as f(X)=f0+f1X+f2X2+....+fdXd f(X) = f_0 + f_1 X + f_2 X^2 + .... + f_d X^d . The number of polynomials of degree d\leq d is p(d+1)p^{(d+1)}, since there are total d+1d+1 coefficients and each coefficient can take pp values from Fp\mathbb{F}_p.

Field Extension#

Now we will construct Fpk\mathbb{F}_{p^k} using the theorems and definitions we have seen so far.

For k=1k=1, Fp\mathbb{F}_{p} is the set {0,1,2,3,...,p1}\{0,1,2,3,...,p-1\} with mod-pp addition and multiplication operations defined on it. These are Prime Fields which we saw in earlier section.

For kNk \in \mathbb{N} and k1k \neq 1, let g(X)g(X) be a degree kk irreducible polynomial with coefficients in Fp\mathbb{F}_{p} i.e. g(X)Fp[X]g(X) \in \mathbb{F}_p[X] and deg(g)=kdeg(g)=k, from Lemma 3 we know that such a polynomial exists. Then Fpk\mathbb{F}_{p^k} is defined as follows :

  1. Elements are from the set {f(X)Fp[X],deg(f)<k}\{f(X) \in \mathbb{F}_p[X], deg(f) < k\}. The number of elements = number of polynomial of deg(f)<kdeg(f) < k in Fp[X]\mathbb{F}_p[X] = pkp^k

  2. Operations are polynomial addition and multiplication modulo g(X)g(X)

Now let us check that if the above definition of Fpk\mathbb{F}_{p^k} satisfies the field axioms.

Commutativity, Associativity and Distributivity of * on ++ follows directly from the polynomial addition and multiplication modulo g(X)g(X) operations. Also, 00 is the additive inverse and 11 is the multiplicative inverse.

Existence and Uniqueness of additive inverse: For every f(X)Fp[X],deg(f)<kf(X) \in \mathbb{F}_p[X], deg(f) < k there exists h(X)Fp[X],deg(h)<kh(X) \in \mathbb{F}_p[X], deg(h) < k such that f(X)+h(X)=g(X)f(X) + h(X) = g(X).

Taking modulo g(X)g(X) on both sides (f(X)+h(X))  mod-g(X)=0(f(X) +h(X)) \;\text{mod-} g(X)=0 i.e. h(X)h(X) is additive inverse of f(X)f(X). This follows from the fact that coefficients of f(X)f(X) are in Fp\mathbb{F}_p, thus they have additive inverse which are the corresponding coefficients of h(X)h(X).

Existence and Uniqueness of multiplicative inverse: For every f(X)Fp[X],deg(f)<kf(X) \in \mathbb{F}_p[X], deg(f) < k there exists h(X)Fp[X],deg(h)<kh(X) \in \mathbb{F}_p[X], deg(h) < k such that f(X)h(X)=1  mod-g(X)f(X) * h(X) = 1 \;\text{mod-} g(X). Moreover such an h(X)h(X) is unique.

f(X)Fp[X],deg(f)<kf(X) \in \mathbb{F}_p[X], deg(f) < k and g(X)Fp[X],deg(g)=kg(X) \in \mathbb{F}_p[X], deg(g) = k is an irreducible polynomial thus GCD(f,g)=1GCD(f,g) = 1. Using Lemma 2,

I(f,g)={uf+vgu,vF[X]} I(f,g) = \{u \cdot f + v \cdot g \mid u,v \in \mathbb{F}[X] \} \nonumber

Thus u,vFp[X]\exists u,v \in \mathbb{F}_p[X] such that u(X)f(X)+v(X)g(X)=1u(X) \cdot f(X) + v(X) \cdot g(X) = 1.

Taking mod g(X)g(X) on both sides, u(X)f(X)=1  mod-g(X)u(X) \cdot f(X) = 1 \;\text{mod-} g(X) . Thus u(X)u(X) is an inverse of f(X)f(X).

We can further reduce u(X)u(X) using Lemma 1, q,rFp[X]\exists q,r \in \mathbb{F}_p[X] s.t. u=qg+r u = q \cdot g + r and deg(r)<deg(g)=k deg(r) < deg(g)=k. Thus (qg+r)f=1  mod-g(q \cdot g + r) f = 1 \;\text{mod-} g. Now rf=1  mod-gr \cdot f = 1 \;\text{mod-} g. Thus rr is the multiplicative inverse of ff in Fpk\mathbb{F}_{p^k}.

We have just shown that Fpk\mathbb{F}_{p^k} satisfies the field axioms. Fpk\mathbb{F}_{p^k} is called a degree kk extension of Fp\mathbb{F}_{p}. Note that FpFpk\mathbb{F}_{p} \subseteq \mathbb{F}_{p^k} i.e. Fp\mathbb{F}_{p} is prime subfield of Fpk\mathbb{F}_{p^k}. Note that αFpk\forall \alpha \in \mathbb{F}_{p^k},

pα=α+α+....+αp times=0p \cdot \alpha = \underbrace{\alpha + \alpha + .... + \alpha}_\text{p times} = 0

pp is called the characteristic of Fpk\mathbb{F}_{p^k}. By convention characteristic of R\mathbb{R}, C\mathbb{C} and Q\mathbb{Q} is 00.

Example: Let p=2p=2 and k=2k=2 i.e. we will construct F22=F4\mathbb{F}_{2^2}=\mathbb{F}_{4} using the above definitions.

Let g(X)g(X) be a degree k=2k=2 irreducible polynomial with coefficients in F2\mathbb{F}_{2} i.e. g(X)F2[X]g(X) \in \mathbb{F}_2[X] and deg(g)=k=2deg(g)=k=2.

Note that there are four polynomial of degree 2 in F2[X]\mathbb{F}_2[X] and the only irreducible polynomial is X2+X+1X^2+ X +1. The other three polynomials are reducible. Since

X2=XX X^2 = X \cdot X \nonumber X2+X=X(X+1) X^2 + X = X \cdot (X+1) \nonumber X2+1=(X+1)(X+1) X^2 + 1 = (X+1) \cdot (X+1) \nonumber

Thus g(X)=X2+X+1g(X)=X^2+ X +1.

Now total number of elements in F22\mathbb{F}_{2^2} is pk=4p^k=4. The elements are from the set {f(X)F2[X],deg(f)<2}\{f(X) \in \mathbb{F}_2[X], deg(f)< 2\} which is precisely the set {0,1,X,X+1}\{ 0, 1, X, X+1\}.

The operations defined on F22\mathbb{F}_{2^2} are polynomial addition and multiplication modulo g(X)=X2+X+1g(X)=X^2+ X +1.

Let us add two elements from the set.

X+(X+1)=2X+1  mod-(X2+X+1)=1  mod-(X2+X+1) X +(X+1) = 2X +1 \;\text{mod-} (X^2+ X +1) = 1 \;\text{mod-} (X^2+ X +1)

The last equality follows from the fact that all coefficients are mod-pp. The addition table for all the field elements is as follows:

+0011XXX+1X+1
000011XXX+1X+1
111100X+1X+1XX
XXXXX+1X+10011
X+1X+1X+1X+1XX1100

Let us multiply two elements from the set.

(X+1)(X+1)=X2+2X+1  mod-(X2+X+1)=X2+1  mod-(X2+X+1)=X (X+1)\cdot(X+1) = X^2 + 2X +1 \;\text{mod-} (X^2+ X +1) = X^2 + 1 \;\text{mod-} (X^2+ X +1) = X

The last equality follows from polynomial long division. The multiplication table for all the field elements is as follows:

*0011XXX+1X+1
0000000000
110011XXX+1X+1
XX00XXX+1X+111
X+1X+100X+1X+111XX

This concludes the post on field extensions. We gradually developed our understanding of the topic starting from definition of Groups to a basic example of field extension.

References#

  1. Chapter 7: Introduction to Finite Fields, Course notes by Prof. David Forney
  2. Chapter 2: Elliptic Curve Cryptography, An Introduction to Bitcoin by Prof. Saravanan Vijayakumaran