Polynomials and the Polynomial Ring
August 25, 20269 min readbeginner
So far the elements of our rings have been numbers: integers, residues, things you can write on a single line. The next step is to allow elements that are several numbers in a row.
So far the elements of our rings have been numbers: integers, residues, things you can write on a single line. The next step is to allow elements that are several numbers in a row. A polynomial is exactly that: a finite list of numbers, written in a particular notation that makes addition and multiplication look natural. This note introduces polynomials, defines the polynomial ring , walks through addition and multiplication by hand, and points at the one inconvenience that the next note will fix.
01.What a polynomial is, concretely
A polynomial in the variable with integer coefficients looks like
It has four terms. Each term is a coefficient (here , , , ) multiplied by a power of (here , , , and ). The largest power of that appears is the degree of the polynomial. In this example the degree is .
The variable is purely a placeholder. You should not, at this stage, think of it as a number that you might evaluate the polynomial at. Think of as a tag that keeps track of which slot a coefficient sits in. The polynomial above is just the list of numbers
read as "the constant term is , the term is , the term is , the term is , and the term is ." Writing it as instead of as a list of five numbers is a notational habit that makes the arithmetic rules easy to remember. Nothing is hidden in the powers of . They are book-keeping.
A polynomial is allowed to have a coefficient of zero, in which case that term is usually dropped from the written form. The polynomial has a zero coefficient at the slot, and we just do not write . The list view (with explicit zeros) and the symbolic view (with zeros suppressed) are the same polynomial.
02.Polynomials with coefficients in a ring
The same idea works if the coefficients are not integers but residues modulo . Consider a polynomial whose coefficients are in :
This is a polynomial of degree with coefficient list . Each entry of the list is a residue class modulo , not an arbitrary integer. The coefficient at the slot is , and the rest are , , and , all in .
The general definition. Given any commutative ring , the polynomial ring in one variable, written
is the set of all polynomials with coefficients drawn from . So is the set of polynomials whose coefficients are integers, those with rational coefficients, and those whose coefficients live in for some chosen . Cryptography wants for a specific cryptographic-size .
The operations on are inherited from , plus a rule for how the powers of multiply. We will see both rules in worked form below.
03.Adding polynomials
Addition of two polynomials happens slot by slot. Line up the two polynomials so that matching powers of sit in the same column, then add the coefficients in each column. The coefficient sum is computed in the underlying ring .
A small example over . Add and .
Arrange:
| First polynomial | |||
| Second polynomial | |||
| Sum (mod ) |
The column: . The column: . The constant column: . So the answer is . Notice that the addition of coefficients is reduced modulo , exactly as in .
If the two polynomials have different degrees, the lower-degree one has implicit zeros in the missing slots, and the column sum just copies the value of the higher-degree polynomial there.
Addition is straightforward. The interesting operation is multiplication.
04.Multiplying polynomials, schoolbook style
Polynomial multiplication is the rule "multiply each term of the first polynomial by each term of the second, then add up everything that lands in the same column." The rule for combining a power of with another power is the obvious one:
That is the only new rule. Everything else follows from distributivity.
A worked example over . Compute in .
Multiply each pair of terms:
- (since )
- (since )
Now group by power of and add:
- column: .
- column: .
- Constant: .
So in .
The reductions modulo are quietly happening at each step. We could have done all the integer arithmetic first and reduced the final coefficients modulo at the end. Both approaches give the same answer, because reduction commutes with arithmetic (Modular Arithmetic).
A slightly bigger example over . Compute in .
Multiply each pair:
- (since )
Group:
- column: .
- column: (since ).
- column: .
- Constant: .
So the answer is . The coefficient came out to zero, which is fine, and that slot just disappears from the written form.
Notice the degree of the answer: the first polynomial has degree , the second has degree , and the product has degree . That is general. When you multiply a polynomial of degree by one of degree , the product has degree exactly (assuming the leading coefficients do not happen to multiply to zero, which can happen in for non-prime ). The growth of degree under multiplication is the inconvenience that the next note will solve.
as a ring
Run through the ring axioms for , using the rules for polynomial addition and multiplication just defined.
The additive group . Closure: adding polynomial slot-by-slot keeps coefficients in . Associativity and commutativity: inherited from . Identity: the zero polynomial (every slot is zero). Inverses: negate every coefficient. In , the negation of a residue is . So is an abelian group.
Multiplication. Closure: schoolbook multiplication produces another polynomial in . Associativity and commutativity: inherited from once you check that the rule is associative and commutative, which it is. Identity: the polynomial (degree zero, constant coefficient ). Distributivity over addition: the way the schoolbook multiplication is defined.
So is a commutative ring with identity, for every choice of . It is not a field, even when is prime, because most polynomials do not have polynomial inverses. The polynomial does not have a polynomial with , because the product of two non-constant polynomials always has degree at least .
06.The degree problem
We are headed towards a structure that has finitely many elements, because the cryptography needs every key to be a fixed-size object. But has infinitely many elements: there is no upper bound on the degree of a polynomial. Multiplying two polynomials almost always grows the degree, so even if you started with two short polynomials, repeated multiplication would produce arbitrarily long ones.
That is the degree problem in plain words. It is the reason we cannot use as the home for the cryptographic objects. We need a way to "fold" higher-degree polynomials back down into a fixed range, the same way modular arithmetic folds large integers back into .
The fix is exactly analogous to what we did with the integers: introduce a modulus and reduce. For integers, the modulus was a positive integer , and reduction kept the answer in . For polynomials, the modulus is itself a polynomial, traditionally called , and reduction by keeps the answer's degree strictly below the degree of .
The next note builds that idea up properly. The key new word is quotient ring, the construction , which is what the slash in is doing. The particular choice of that ML-KEM and ML-DSA use is , with . The reduction rule that comes out of that choice is striking: every becomes . We will see why this is so clean in the next note, and why the resulting ring is the right home for lattice cryptography.
07.A short exercise
Compute the following in .
- . Slot-by-slot: column , constant . Answer: .
- . Pairs: , , , . Reduce: , , , . Group: .
- The degree of in . Both factors are non-zero, leading coefficients are and , so the leading term of the product is . Degree .
Doing a few of these by hand is the cheapest way to make the rules feel routine before the abstraction starts piling up in the next note.