Skip to content

Finite Fields

In this lesson you’ll learn exactly which finite fields exist, how to build GF(pn)GF(p^n) from an irreducible polynomial, how to compute in GF(4)GF(4) and GF(8)GF(8), and why GF(4)GF(4) is not Z4\mathbb{Z}_4.

Classification of finite fields. A field with qq elements exists if and only if q=pnq = p^n for a prime pp and integer n1n \ge 1. For each such qq there is exactly one field of that order, up to isomorphism.

This is one of the most satisfying classification theorems in mathematics: a complete and short answer.

Why no field of order 6? A field’s characteristic must be prime, and a finite field of characteristic pp is a vector space over Fp\mathbb{F}_p, so its size is pnp^n. Since 6 is not a prime power, there’s nothing to build.

Notation: GF(q)GF(q) or Fq\mathbb{F}_q. When q=pq = p is prime, GF(p)=ZpGF(p) = \mathbb{Z}_p.

GF(pn)GF(p^n) is not Zpn\mathbb{Z}_{p^n}

Section titled “GF(pn)GF(p^n)GF(pn) is not Zpn\mathbb{Z}_{p^n}Zpn​”

This is the single most common misconception in the topic, so it’s worth stating bluntly.

Z4\mathbb{Z}_4 is not a field: 2 has no inverse, since 2b2b is even and never 1(mod4)\equiv 1 \pmod 4. But GF(4)GF(4) exists and is a field. They are different rings of the same size.

The differences:

  • Z4\mathbb{Z}_4 has characteristic 4; GF(4)GF(4) has characteristic 2.
  • In GF(4)GF(4), x+x=0x + x = 0 for every element.
  • Z4\mathbb{Z}_4 is cyclic under addition; GF(4)GF(4)‘s additive group is Z2×Z2\mathbb{Z}_2 \times \mathbb{Z}_2.

Only when n=1n = 1 do the two coincide.

The recipe uses the theorem from the previous lesson.

  1. Find an irreducible polynomial ff of degree nn over Fp\mathbb{F}_p.
  2. Form Fp[x]/f\mathbb{F}_p[x]/\langle f \rangle.

Since ff is irreducible, the quotient is a field. Its elements are the remainders on division by ff, that is, polynomials of degree <n< n. There are pp choices for each of nn coefficients, giving pnp^n elements exactly as required.

Different irreducible polynomials of the same degree give isomorphic fields, which is the uniqueness half of the classification. In practice a specific polynomial gets standardized so that implementations interoperate.

Take p=2p = 2, n=2n = 2, and f=x2+x+1f = x^2 + x + 1, which is irreducible over F2\mathbb{F}_2 because neither 0 nor 1 is a root.

Elements: 0,1,a,a+10, 1, a, a+1, writing aa for the coset of xx. The defining relation is

a2+a+1=0a2=a+1a^2 + a + 1 = 0 \quad \Longrightarrow \quad a^2 = a + 1

using that 1=1-1 = 1 in characteristic 2.

GF(4) addition - coefficientwise mod 2, which is XOR
+ 0 1 a a+1
0 0 1 a a+1
1 1 0 a+1 a
a a a+1 0 1
a+1 a+1 a 1 0

The whole diagonal is 0, so every element is its own additive inverse and the characteristic is 2. The additive group is ℤ₂ × ℤ₂, not ℤ₄.

Identity: 0. Cells holding it mark inverse pairs.

GF(4) multiplication - reduced using a² = a + 1
× 0 1 a a+1
0 0 0 0 0
1 0 1 a a+1
a 0 a a+1 1
a+1 0 a+1 1 a

Every nonzero row is a rearrangement of 1, a, a+1, so all three nonzero elements are invertible. Note a · (a+1) = 1, so a and a+1 are inverses.

Identity: 1. Cells holding it mark inverse pairs.

Reading the multiplication table: aa=a+1a \cdot a = a + 1, and a(a+1)=a2+a=(a+1)+a=1a \cdot (a+1) = a^2 + a = (a+1) + a = 1. So a1=a+1a^{-1} = a+1.

Note a3=aa2=a(a+1)=1a^3 = a \cdot a^2 = a(a+1) = 1, so aa has multiplicative order 3 and generates GF(4)={1,a,a2}GF(4)^* = \{1, a, a^2\}.

GF(q)GF(q)^*, the nonzero elements under multiplication, is cyclic of order q1q - 1.

A generator is called a primitive element. This is a strong statement - it says every finite field’s nonzero part is as simple as possible - and it’s why discrete logarithms make sense in finite fields, and hence why Diffie-Hellman works there.

For GF(4)GF(4): aa is primitive, since a1=aa^1 = a, a2=a+1a^2 = a+1, a3=1a^3 = 1.

Combining with Lagrange: every nonzero xx satisfies

xq1=1,soxq=x  for all xGF(q)x^{q-1} = 1, \qquad \text{so} \qquad x^q = x \ \text{ for all } x \in GF(q)

including x=0x = 0. That identity is used constantly in coding theory.

In characteristic pp, the map

ϕ(x)=xp\phi(x) = x^p

is a field homomorphism, because (x+y)p=xp+yp(x+y)^p = x^p + y^p there - all the middle binomial coefficients are divisible by pp. It’s the “freshman’s dream,” true in characteristic pp and false over R\mathbb{R}.

On Fp\mathbb{F}_p itself, ϕ\phi is the identity by Fermat’s little theorem. On GF(pn)GF(p^n) it generates a cyclic group of nn automorphisms, and that group is the Galois group of the extension. Finite fields have the simplest possible Galois theory.

Example 1: Why is there no field of order 6?

Solution. Suppose FF had 6 elements. Its characteristic must be prime, so 2, 3, or 5. A finite field of characteristic pp contains Fp\mathbb{F}_p and is a vector space over it, so F=pn|F| = p^n for some nn.

6=236 = 2 \cdot 3 is not a prime power. No such field exists.

Z6\mathbb{Z}_6 exists as a ring, of course, but has zero divisors: 23=02 \cdot 3 = 0.

Example 2: Build GF(8)GF(8).

Solution. 8=238 = 2^3, so we need an irreducible cubic over F2\mathbb{F}_2. Candidates with nonzero constant term (or xx would divide them): x3+x+1x^3+x+1 and x3+x2+1x^3+x^2+1.

Test f=x3+x+1f = x^3+x+1: f(0)=1f(0) = 1, f(1)=1+1+1=1f(1) = 1+1+1 = 1. No roots, and a cubic with no root is irreducible. ✓

GF(8)=F2[x]/x3+x+1GF(8) = \mathbb{F}_2[x]/\langle x^3+x+1\rangle

Elements are all c2x2+c1x+c0c_2x^2 + c_1x + c_0 with ci{0,1}c_i \in \{0,1\}: eight of them, matching one 3-bit byte fragment. The relation is a3=a+1a^3 = a + 1.

Powers of aa: a,a2,a3=a+1,a4=a2+a,a5=a3+a2=a2+a+1,a6=a3+a2+a=a2+1,a7=a3+a=1a, a^2, a^3 = a+1, a^4 = a^2+a, a^5 = a^3+a^2 = a^2+a+1, a^6 = a^3+a^2+a = a^2+1, a^7 = a^3 + a = 1.

Seven distinct powers before returning to 1, so aa is primitive and GF(8)Z7GF(8)^* \cong \mathbb{Z}_7.

Example 3: Compute in GF(4)GF(4).

Find (a+1)2(a+1)^2 and a1a^{-1}.

Solution. Using a2=a+1a^2 = a+1 and characteristic 2 (so 2a=02a = 0):

(a+1)2=a2+2a+1=a2+1=(a+1)+1=a(a+1)^2 = a^2 + 2a + 1 = a^2 + 1 = (a+1) + 1 = a

For the inverse of aa: from a2=a+1a^2 = a + 1, multiply by… simpler, note

a(a+1)=a2+a=(a+1)+a=1a(a+1) = a^2 + a = (a+1) + a = 1

So a1=a+1a^{-1} = a+1. ✓ (And symmetrically (a+1)1=a(a+1)^{-1} = a.)

Notice (a+1)2=a(a+1)^2 = a and a2=a+1a^2 = a+1: squaring swaps the two, which is the Frobenius map in action.

Example 4: Why GF(4)Z4GF(4) \ne \mathbb{Z}_4.

Solution. In GF(4)GF(4), characteristic 2 means x+x=0x + x = 0 for every element, so

1+1=01 + 1 = 0

In Z4\mathbb{Z}_4, 1+1=201 + 1 = 2 \ne 0.

The additive groups differ: GF(4)+Z2×Z2GF(4)^+ \cong \mathbb{Z}_2\times\mathbb{Z}_2 (every element of order 2), while Z4\mathbb{Z}_4 is cyclic with 1 of order 4.

And decisively, Z4\mathbb{Z}_4 isn’t a field at all: 20=02 \cdot 0 = 0, 21=22\cdot1 = 2, 22=02\cdot2 = 0, 23=22\cdot3 = 2, so 2 never produces 1.

Example 5: Solve a linear equation in GF(4)GF(4).

Solve ax+1=0a x + 1 = 0.

Solution. In characteristic 2, 1=1-1 = 1, so the equation is ax=1ax = 1, giving x=a1=a+1x = a^{-1} = a+1.

Check: a(a+1)=1a(a+1) = 1, so ax+1=1+1=0ax + 1 = 1 + 1 = 0

Example 6: Count irreducible polynomials.

How many monic irreducible quadratics are there over F2\mathbb{F}_2?

Solution. Monic quadratics over F2\mathbb{F}_2: x2x^2, x2+1x^2+1, x2+xx^2+x, x2+x+1x^2+x+1. Four in total.

  • x2=xxx^2 = x \cdot x: reducible.
  • x2+1=(x+1)2x^2+1 = (x+1)^2 over F2\mathbb{F}_2, since 2x=02x = 0: reducible.
  • x2+x=x(x+1)x^2+x = x(x+1): reducible.
  • x2+x+1x^2+x+1: no root, so irreducible.

Exactly one. That’s why GF(4)GF(4) has a canonical construction - there’s no other choice of modulus.

For higher degrees there are several, and any of them gives an isomorphic field. Two monic irreducible cubics exist over F2\mathbb{F}_2, and both build GF(8)GF(8).

Example 7: The identity xq=xx^q = x.

Verify x4=xx^4 = x for all xGF(4)x \in GF(4).

Solution. For x=0x = 0: 0=00 = 0

For nonzero xx, the multiplicative group has order 3, so x3=1x^3 = 1 and hence x4=xx^4 = x

Explicitly: 14=11^4 = 1; a4=a3a=1a=aa^4 = a^3 \cdot a = 1 \cdot a = a; (a+1)4=(a+1)3(a+1)=a(a+1)^4 = (a+1)^3(a+1) = a… let’s check that directly. (a+1)2=a(a+1)^2 = a from Example 3, so (a+1)4=a2=a+1(a+1)^4 = a^2 = a+1

So every element of GF(4)GF(4) is a root of x4xx^4 - x, which means x4xx^4 - x factors completely over GF(4)GF(4). In general xqxx^q - x is exactly the product of (xα)(x - \alpha) over all αGF(q)\alpha \in GF(q), which is one clean way to characterize the field.

AES. The Advanced Encryption Standard operates on bytes as elements of GF(28)GF(2^8), constructed as F2[x]/x8+x4+x3+x+1\mathbb{F}_2[x]/\langle x^8+x^4+x^3+x+1\rangle. One byte is one field element, which is why the construction is so convenient in hardware. The S-box is essentially the map xx1x \mapsto x^{-1} in this field, chosen because inversion is highly nonlinear and so resists linear cryptanalysis.

Reed–Solomon codes. QR codes, CDs, DVDs, Blu-ray, and NASA deep-space links use Reed–Solomon over GF(256)GF(256). A QR code can lose up to 30% of its area and still decode, because the data are values of a polynomial over a finite field and enough surviving points determine it uniquely. The Voyager probes’ images reached Earth through these codes.

RAID storage. RAID 6 tolerates two simultaneous disk failures by storing two parity blocks computed in GF(28)GF(2^8). Recovering a failed drive means solving a small linear system over that field.

Elliptic-curve cryptography. Curves are defined over GF(p)GF(p) or GF(2n)GF(2^n). The security assumption is the difficulty of the discrete logarithm in the curve’s group, which relies on the field being finite and the group being cyclic of large prime order.

Random number generation. Linear feedback shift registers are multiplication by a primitive element in GF(2n)GF(2^n), and choosing a primitive polynomial gives maximal period 2n12^n - 1. Used in GPS signal generation, Bluetooth frequency hopping, and hardware test patterns.

Combinatorial designs. Finite projective planes are built from finite fields, and the existence question for orders that are not prime powers is a hard open problem. The nonexistence of a projective plane of order 10 was settled in 1989 by thousands of hours of computer search.

For which values of n does a field with n elements exist?
Is GF(4) the same ring as ℤ₄?
In GF(4) with a² = a + 1, what is a · (a + 1)?
How do you construct GF(8)?
What is the structure of GF(q)*, the nonzero elements under multiplication?
How many monic irreducible quadratics are there over 𝔽₂?