Search

Search papers and lessons

Irreducible Polynomial

Level 2 · 12 min read

An irreducible polynomial cannot be split into a product of two smaller polynomials over the same field, so it plays the role that prime numbers play for integers.

On this page

  • Colour = topic mix
  • Discrete math
  • Abstract algebra
  • ReadReady to readNot yet

TL;DR

A polynomial is irreducible over a field if it has degree at least 1 and cannot be written as a product of two polynomials of smaller degree with coefficients in that field. The idea is the polynomial version of a prime number: every polynomial over a field factors into irreducibles in essentially one way. Irreducibility is what lets you build new fields out of old ones by working with remainders.

Builds on: Polynomial, Field (Abstract Algebra) · Leads to: Finite Field, linear block codes, and vector spaces over extension fields

Where it's used

Byte arithmetic in symmetric encryption. The Advanced Encryption Standard, a Symmetric Encryption cipher, treats each byte as a polynomial of degree at most 7 with coefficients 0 or 1. Multiplying two bytes means multiplying the polynomials and then taking the remainder after division by the irreducible polynomial x8+x4+x3+x+1x^8 + x^4 + x^3 + x + 1. That remainder step is what makes every nonzero byte invertible, which the cipher needs.

Error-correcting codes for storage and QR codes. Many codes that repair damaged data, including the Reed-Solomon family used on printed QR codes, do their arithmetic on bytes in the same way. The field they use has 256 elements and is built from an irreducible polynomial of degree 8 over the integers mod 2; QR codes use x8+x4+x3+x2+1x^8 + x^4 + x^3 + x^2 + 1, so that byte arithmetic is again a remainder step.

Building a field of any prime-power size. When you need a field with pnp^n elements and n>1n \gt 1, the integers mod pp are not enough, because they are a field only when pp is prime and have only pp elements. The standard construction takes polynomials mod an irreducible polynomial of degree nn over the integers mod pp. Choosing which irreducible polynomial to use gives a different labelling of the same field.

How it works

Take the smallest interesting case: polynomials over the field with two elements, Z/2Z\mathbb{Z}/2\mathbb{Z}, where we add and multiply modulo 2. Each polynomial of degree 2 that is monic (leading coefficient 1) has the form x2+ax+bx^2 + ax + b with a,ba, b in {0,1}\{0, 1\}. There are four such polynomials: x2x^2, x2+1x^2 + 1, x2+xx^2 + x and x2+x+1x^2 + x + 1.

  1. Test x2x^2. It equals x⋅xx \cdot x, a product of two polynomials of degree 1. So it is reducible. Check: x⋅x=x2x \cdot x = x^2.
  2. Test x2+1x^2 + 1. Try (x+1)(x+1)=x2+2x+1(x + 1)(x + 1) = x^2 + 2x + 1. Modulo 2, 2x=02x = 0, so the product is x2+1x^2 + 1. So it is reducible. Check: (x+1)2≡x2+1(mod2)(x+1)^2 \equiv x^2 + 1 \pmod 2.
  3. Test x2+xx^2 + x. It equals x(x+1)x(x + 1), reducible. Check: x⋅(x+1)=x2+xx \cdot (x+1) = x^2 + x.
  4. Test x2+x+1x^2 + x + 1. A factorisation would need two factors of degree 1, of the form (x+a)(x+b)(x + a)(x + b). Multiplying out gives x2+(a+b)x+abx^2 + (a + b)x + ab. We need ab=1ab = 1, which forces a=b=1a = b = 1, and then a+b=2≡0a + b = 2 \equiv 0, not 1. So no factorisation exists. Check: the only candidates for aa and bb are 0 and 1, and none works.
  5. Use the root test. For a degree-2 polynomial, having no factor of degree 1 is the same as having no root. The values are f(0)=1f(0) = 1 and f(1)=1+1+1=3≡1f(1) = 1 + 1 + 1 = 3 \equiv 1. Neither is 0, so there is no root. Check: x2+x+1x^2 + x + 1 is irreducible.
  6. Count the result. Over the two-element field, exactly one monic quadratic is irreducible, namely x2+x+1x^2 + x + 1. It is the one that builds a four-element field, in the same way that the prime 2 builds the two-element one.
flowchart TD
  A["Polynomial f of degree 2 or 3"] --> B{"Has a root in the field?"}
  B -- "yes" --> C["Reducible: factor is x minus the root"]
  B -- "no" --> D["Irreducible"]

The math

Definition: Irreducible polynomial

Let FF be a field and f∈F[x]f \in F[x] a polynomial with deg⁡f≥1\deg f \ge 1. We say ff is irreducible over FF if whenever f=ghf = g h with g,h∈F[x]g, h \in F[x], one of gg or hh is a nonzero constant. Otherwise ff is reducible.

Here F[x]F[x] means all polynomials with coefficients from FF, and deg⁡f\deg f is the largest power of xx that appears with a nonzero coefficient. A nonzero constant is a unit, so it does not count as a real factor. Irreducibility depends on the field: the same polynomial can be irreducible over one field and reducible over another.

Factoring a quadratic (walkthrough step 4)

Over F=Z/2ZF = \mathbb{Z}/2\mathbb{Z}, the monic quadratics are x2+ax+bx^2 + ax + b with a,b∈Fa, b \in F. A factorisation x2+ax+b=(x+u)(x+v)x^2 + ax + b = (x + u)(x + v) requires

u+v=a,uv=b.u + v = a, \qquad uv = b.

For x2+x+1x^2 + x + 1 we need uv=1uv = 1 and u+v=1u + v = 1. The only nonzero element is 11, so u=v=1u = v = 1, giving u+v=0≠1u + v = 0 \ne 1. Hence no factorisation exists.

The root test for small degrees (walkthrough step 5)

Suppose deg⁡f∈{2,3}\deg f \in \{2, 3\} and f=ghf = gh with g,hg, h non-constant. Then deg⁡g+deg⁡h=deg⁡f≤3\deg g + \deg h = \deg f \le 3, and each degree is at least 1, so one of them is 1. A polynomial ax+ba x + b with a≠0a \ne 0 has the root r=−b/ar = -b/a in FF. Conversely, a root rr of ff gives a factor (x−r)(x - r), by the factor theorem. So for degree 2 or 3:

f is irreducible  ⟺  f(r)≠0 for every r∈F.f \text{ is irreducible} \iff f(r) \ne 0 \text{ for every } r \in F.

For x2+x+1x^2 + x + 1 over Z/2Z\mathbb{Z}/2\mathbb{Z}, the values f(0)=1f(0) = 1 and f(1)=1f(1) = 1 are both nonzero, so it is irreducible.

Unique factorisation

Every nonzero polynomial over a field can be written as a nonzero constant times a product of irreducible polynomials, and the factors are unique up to order and constants. This is the polynomial analogue of the fundamental theorem of arithmetic for the integers.

Remainders give a field (walkthrough step 6)

Let ff be irreducible of degree nn over FF. Consider the set of remainders on division by ff, which are the polynomials of degree less than nn, with addition and multiplication done modulo ff. Every nonzero remainder gg has an inverse, because ff and gg share no factor and so their greatest common divisor is a constant, and a Bezout identity sg+tf=1s g + t f = 1 gives ss as an inverse of gg modulo ff. So the remainders form a field with ∣F∣n|F|^n elements.

For f=x2+x+1f = x^2 + x + 1 over Z/2Z\mathbb{Z}/2\mathbb{Z}, the remainders are 0,1,x,x+10, 1, x, x + 1, and modulo ff we have x2≡x+1x^2 \equiv x + 1. Check: x⋅(x+1)=x2+x≡(x+1)+x=1x \cdot (x + 1) = x^2 + x \equiv (x + 1) + x = 1. So x−1=x+1x^{-1} = x + 1.

Worked examples

Example
Example 1: a tiny case over the integers mod 3

Is f(x)=x2+1f(x) = x^2 + 1 irreducible over Z/3Z\mathbb{Z}/3\mathbb{Z}?

  1. Evaluate at each element. f(0)=0+1=1f(0) = 0 + 1 = 1.
  2. f(1)=1+1=2f(1) = 1 + 1 = 2.
  3. f(2)=4+1=5≡2(mod3)f(2) = 4 + 1 = 5 \equiv 2 \pmod 3.
  4. No value is 0, so ff has no root.
  5. For degree 2, no root means irreducible. So x2+1x^2 + 1 is irreducible over Z/3Z\mathbb{Z}/3\mathbb{Z}.

The same polynomial over Z/2Z\mathbb{Z}/2\mathbb{Z} is reducible, since (x+1)2=x2+2x+1≡x2+1(x + 1)^2 = x^2 + 2x + 1 \equiv x^2 + 1. The field decides the answer.

Example
Example 2: a degree-3 polynomial over the integers mod 2

Test f(x)=x3+x+1f(x) = x^3 + x + 1 and g(x)=x3+xg(x) = x^3 + x over Z/2Z\mathbb{Z}/2\mathbb{Z}.

  1. For ff: f(0)=0+0+1=1f(0) = 0 + 0 + 1 = 1.
  2. f(1)=1+1+1=3≡1f(1) = 1 + 1 + 1 = 3 \equiv 1.
  3. Neither value is 0, so ff has no root. Since deg⁡f=3\deg f = 3, Step 4 says ff is irreducible.
  4. For gg: g(0)=0g(0) = 0, so x=0x = 0 is a root.
  5. The factor theorem gives g=x⋅(x2+1)g = x \cdot (x^2 + 1), so gg is reducible.
  6. Because ff is irreducible of degree 3, the remainders modulo ff form a field with 23=82^3 = 8 elements.

The root test sorts the two polynomials in one step each. The irreducible one builds a field of size 8.

Example
Example 3: multiplying bytes in the Advanced Encryption Standard

In the cipher, a byte with bits b7b6…b0b_7 b_6 \dots b_0 stands for the polynomial b7x7+⋯+b0b_7 x^7 + \dots + b_0 over Z/2Z\mathbb{Z}/2\mathbb{Z}. Compute {57}⋅{83}\{57\} \cdot \{83\}, where {57}\{57\} is the byte 01010111 and {83}\{83\} is 10000011. The reduction polynomial is m(x)=x8+x4+x3+x+1m(x) = x^8 + x^4 + x^3 + x + 1.

  1. The first byte is x6+x4+x2+x+1x^6 + x^4 + x^2 + x + 1, and the second is x7+x+1x^7 + x + 1.
  2. Multiply, keeping coefficients mod 2. The terms are x13+x11+x9+x8+x6+x5+x4+x3+1x^{13} + x^{11} + x^9 + x^8 + x^6 + x^5 + x^4 + x^3 + 1. Pairs such as x7+x7x^7 + x^7 cancel.
  3. Reduce x13x^{13}. Since x8≡x4+x3+x+1(modm)x^8 \equiv x^4 + x^3 + x + 1 \pmod m, we get x13=x5⋅x8≡x9+x8+x6+x5x^{13} = x^5 \cdot x^8 \equiv x^9 + x^8 + x^6 + x^5.
  4. Substitute and combine. The x9x^9, x8x^8, x6x^6 and x5x^5 terms cancel against the new ones, leaving x11+x4+x3+1x^{11} + x^4 + x^3 + 1.
  5. Reduce x11=x3⋅x8≡x7+x6+x4+x3x^{11} = x^3 \cdot x^8 \equiv x^7 + x^6 + x^4 + x^3. Substitute: x7+x6+x4+x3+x4+x3+1=x7+x6+1x^7 + x^6 + x^4 + x^3 + x^4 + x^3 + 1 = x^7 + x^6 + 1.
  6. Read the bits of x7+x6+1x^7 + x^6 + 1, which are 11000001. That is {c1}\{c1\}.

The remainder step is exactly the division by an irreducible polynomial. Without it the product would not be a byte.

Try it: compute {02}⋅{80}\{02\} \cdot \{80\}, which multiplies xx by x7x^7 and reduces. Answer: x⋅x7=x8≡x4+x3+x+1x \cdot x^7 = x^8 \equiv x^4 + x^3 + x + 1, which is the byte 00011011, or {1b}\{1b\}.

Common mistakes and tradeoffs

It is tempting to think that a polynomial with no roots is always irreducible. This is true only up to degree 3. Over the real numbers, x4+5x2+4=(x2+1)(x2+4)x^4 + 5x^2 + 4 = (x^2 + 1)(x^2 + 4) has no real roots, yet it is reducible. For degree 4 and above, the root test is not enough.

It is tempting to think that a polynomial of prime degree must be irreducible. In fact x2x^2 has prime degree 2 and is reducible. Degree tells you nothing on its own; you have to look for a factorisation.

It is tempting to think that irreducibility is a property of the polynomial alone. In fact it depends on the field. x2+1x^2 + 1 is irreducible over the rationals and over Z/3Z\mathbb{Z}/3\mathbb{Z}, but reducible over Z/2Z\mathbb{Z}/2\mathbb{Z} and over the complex numbers.

It is tempting to think that the remainders modulo any polynomial form a field. In fact they form a field only when the polynomial is irreducible. Modulo the reducible x2+1x^2 + 1 over Z/2Z\mathbb{Z}/2\mathbb{Z}, the element x+1x + 1 is nonzero, yet (x+1)2=x2+1≡0(x + 1)^2 = x^2 + 1 \equiv 0, so it has no inverse.

When to use it: you need a field whose size is a prime power other than a prime, or you need the byte-level arithmetic of a cipher or code. When not to use it: you only need integers mod a prime, which are already a field. Finding an irreducible polynomial of a given degree is done by testing candidates; for small degrees the root test is quick, and for larger degrees standard algorithms are used. In practice, designers often take a standard irreducible polynomial from a published table rather than searching for one.

History

Euclid studied prime numbers, and the uniqueness of prime factorisation for whole numbers is usually credited to Gauss. The polynomial analogue was less visible for a long time, because algebra was mostly about polynomials over the rational or real numbers.

Évariste Galois, in his 1830 memoir on the solvability of equations, worked with arithmetic modulo a prime and with polynomials modulo an irreducible polynomial. This is how fields with prime-power size first appeared; the finite field lesson tells that story in full.

In 1882, Leopold Kronecker showed how to build a new field by adjoining a root of an irreducible polynomial to an existing one. That construction made irreducible polynomials a standard tool in algebra, and it is the same idea used to build finite fields for coding and cryptography today.

Recap

  • A polynomial over a field is irreducible if it has degree at least 1 and cannot be factored into two non-constant polynomials of smaller degree.
  • Irreducibility depends on the field. For degree 2 or 3, it is equivalent to having no root in the field.
  • Every polynomial factors uniquely into irreducibles, which is the polynomial version of the fundamental theorem of arithmetic.
  • Taking remainders modulo an irreducible polynomial gives a field, which is how fields of size pnp^n are built.
  • Read next: Finite Field, which uses these remainders to construct every finite field, and linear block codes, which use the same arithmetic for error correction.

Check yourself

QuestionRecall: what does it mean for a polynomial to be irreducible over a field?Show answer

It has degree at least 1, and whenever it is written as a product of two polynomials over that field, one of the two factors is a nonzero constant. It cannot be split into two non-constant factors.

QuestionComputation: is x2+2x^2 + 2 irreducible over Z/5Z\mathbb{Z}/5\mathbb{Z}? Check the values at 0, 1, 2, 3 and 4.Show answer

f(0)=2f(0) = 2, f(1)=3f(1) = 3, f(2)=6≡1f(2) = 6 \equiv 1, f(3)=11≡1f(3) = 11 \equiv 1, f(4)=18≡3f(4) = 18 \equiv 3. None is 0, so there is no root. For degree 2 that means it is irreducible over Z/5Z\mathbb{Z}/5\mathbb{Z}.

QuestionWhy: why does taking remainders modulo a reducible polynomial fail to give a field?Show answer

If f=ghf = gh with both factors non-constant, then the remainder classes of gg and hh are nonzero but multiply to zero modulo ff. A nonzero element that multiplies to zero cannot have an inverse, so the structure is not a field.

QuestionApplied: a student says the polynomial x4+1x^4 + 1 is irreducible over the real numbers because it has no real roots. Is the conclusion right, and why or why not?Show answer

The conclusion is wrong. The root test is only enough for degrees 2 and 3. Over the reals, x4+1=(x2+2 x+1)(x2−2 x+1)x^4 + 1 = (x^2 + \sqrt{2}\,x + 1)(x^2 - \sqrt{2}\,x + 1). Check: (x2+1)2−(2x)2=x4+2x2+1−2x2=x4+1(x^2+1)^2 - (\sqrt{2}x)^2 = x^4 + 2x^2 + 1 - 2x^2 = x^4 + 1. So it is reducible even though it has no real roots. For degree 4 the student must look for a factorisation, not just check values.

Sources