Abstract AlgebraFields and Extensions

Finite Fields GF(pⁿ)

GF(pⁿ) = ℤₚ[x]/(f) for an irreducible f of degree n: add and multiply polynomials mod p and mod f, and find inverses with the Euclidean algorithm.

Not started Jump to practice

Codes on every phone and the ciphers behind secure web pages run on arithmetic in finite fields. Besides $\mathbb{Z}_{p}$ there are fields of size $4, 8, 9, 16, 25, \dots$, built with the quotient-ring construction from polynomials over $\mathbb{Z}_{p}$.

Why it works

Facts about finite fields.
(1) A finite field $F$ has prime characteristic $p$: the additive order of $1$ is finite, and if it were $ab$ with $a, b \gt 1$, then $(a \cdot 1)(b \cdot 1) = 0$ would give zero divisors. So $F$ contains a copy of $\mathbb{Z}_{p}$.
(2) $|F| = p^{n}$: $F$ is a vector space over $\mathbb{Z}_{p}$ of some dimension $n$, and each vector has $n$ coordinates with $p$ choices each.
(3) For every prime power $p^{n}$ there is a field of that size, unique up to isomorphism, called $\mathrm{GF}(p^{n})$; it is $\mathbb{Z}_{p}[x]/(f)$ for any irreducible $f$ of degree $n$. (Existence and uniqueness are proved in Judson, chapter 22.)

Arithmetic in $\mathbb{Z}_{p}[x]/(f)$. Elements are polynomials of degree less than $n$ with coefficients mod $p$. Add coefficientwise. Multiply, then replace $x^{n}$ using $f = 0$. Invert with the Euclidean algorithm, or by search in small fields.

$\mathrm{GF}(8) = \mathbb{Z}_{2}[x]/(x^{3} + x + 1)$. Every nonzero element is a power of $x$, so multiplying becomes adding exponents mod 7.

Worked example: Multiplying in $\mathrm{GF}(8)$

In $\mathbb{Z}_{2}[x]/(x^{3} + x + 1)$, compute $(x^{2} + 1)(x^{2} + x)$.
  1. Multiply: $x^{4} + x^{3} + x^{2} + x$.
  2. Here $x^{3} = x + 1$ (since $x^{3} + x + 1 = 0$ and $-1 = 1$), so $x^{4} = x^{2} + x$.
  3. Substitute: $(x^{2} + x) + (x + 1) + x^{2} + x = 2x^{2} + 3x + 1 = x + 1$ (mod 2).

Answer: $x + 1$.

Worked example: An inverse in $\mathrm{GF}(8)$

Find the inverse of $x + 1$ in $\mathbb{Z}_{2}[x]/(x^{3} + x + 1)$.
  1. Try $x^{2} + x$: $(x + 1)(x^{2} + x) = x^{3} + 2x^{2} + x = x^{3} + x$.
  2. $x^{3} + x = (x + 1) + x = 1$.

Answer: $(x + 1)^{-1} = x^{2} + x$.

Worked example: The field with 4 elements

Write the multiplication of $\mathrm{GF}(4) = \mathbb{Z}_{2}[x]/(x^{2} + x + 1)$.
  1. Elements: $0, 1, x, x + 1$, with $x^{2} = x + 1$.
  2. $x \cdot x = x + 1$, $x(x + 1) = x^{2} + x = 1$, $(x + 1)^{2} = x^{2} + 1 = x$.

Answer: The nonzero elements $1, x, x + 1$ form a cyclic group of order $3$.

The choice of $f$ does not matter. Over $\mathbb{Z}_{2}$, both $x^{3} + x + 1$ and $y^{3} + y^{2} + 1$ are irreducible, and both quotients are $\mathrm{GF}(8)$. An isomorphism sends $x$ to $y^{2} + y$, which is a root of $x^{3} + x + 1$ in the second field (check it).

Common mistake

Thinking $\mathrm{GF}(4)$ is $\mathbb{Z}_{4}$. In $\mathbb{Z}_{4}$, $2 \cdot 2 = 0$, so it is not a field. $\mathrm{GF}(4)$ has characteristic $2$ ($1 + 1 = 0$), and its elements are polynomials, not the numbers $0$ to $3$. The other common slip is forgetting to reduce by $f$ after multiplying: the answer must have degree less than $n$.

Key idea

Every finite field has $p^{n}$ elements and characteristic $p$; $\mathrm{GF}(p^{n}) = \mathbb{Z}_{p}[x]/(f)$ for an irreducible $f$ of degree $n$. Compute with remainders: coefficients mod $p$, powers of $x$ reduced by $f = 0$.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • Thomas W. Judson, Abstract Algebra: Theory and Applications (open textbook), chapter 22, Finite Fields (section 22.1, Structure of a Finite Field)
  • John A. Beachy and William D. Blair, Abstract Algebra, online study guide (Northern Illinois University), section 6.5, Finite Fields
  • MIT OpenCourseWare 18.702 Algebra II (Spring 2011), lecture notes on finite fields
@teddyrookbook GitHub