Polynomial Congruences

The Mod Operator for Polynomials

Recall from Modular Arithmetic that the whole of integer modular arithmetic grew out of a single result: the Division Theorem, which says that any integer can be written uniquely as with . Everything after that (congruence classes, , linear congruences, the CRT) was really just bookkeeping around remainders.

Now that Polynomial Rings has handed us a Division Theorem for over any field , we can run the entire story again with polynomials playing the part of integers. This lecture is the polynomial mirror of Topics 3 and 4, and almost every statement in it will look familiar; the only real change is that the size condition "" gets replaced by the degree condition "".

Note

Notation
The mod operator returns the remainder when one polynomial is divided by another in , for any field . That is, given polynomials with , we have

where and for some polynomials .

Basically, is just "do the long division and throw the quotient away". The Division Theorem is what makes this a legitimate operator: it guarantees that the pair exists and is unique, so there is exactly one possible answer. Notice that the remainder is allowed to be the zero polynomial, which is exactly the statement .

The coefficients must live in a field, and every coefficient has to be reduced inside that field before you read off your answer. This is the single most common slip when the field is ; a coefficient of in is not a coefficient of , it is a coefficient of , and writing it the wrong way will make a perfectly correct division look wrong.

Example. In , find .
The two polynomials have the same degree, so the quotient is just the constant ;

and , so the division has finished. Therefore, .

Example. In , find .
First reduce the coefficients in : since in , the polynomial being divided is really . Dividing,

since in . Therefore, ; equivalently, in .

The Remainder Theorem from Polynomial Rings gets this instantly and with no long division at all: dividing by leaves remainder , and here , so

Whenever the divisor is linear, use the Remainder Theorem; long division by is wasted effort. Notice also that this answer is genuinely field-dependent: over the same computation gives , so in . The polynomial did not change, the field did.

Example. In , find .
Long division, remembering that every coefficient is reduced mod as we go:

Collecting the quotient terms , and gives

and . Therefore, .

Example. In , find .
The divisor is linear, so the Remainder Theorem applies with ;

Therefore, . (As a check, the full division gives .)

Congruence of Polynomials

With a mod operator in hand, congruence is defined exactly as it was for integers.

Note

Notation
Given polynomials , we say that and are congruent modulo , and write

to mean that , or equivalently that .

Basically, two polynomials are congruent when they leave the same remainder, which is the same as saying their difference is a multiple of the modulus. These are the same two descriptions we had for integers in Modular Arithmetic, and in practice you pick whichever is cheaper: computing two remainders, or subtracting and doing one divisibility check.

There is a third description that we will make official in the next section, and it is the one that gets used most: and are congruent mod exactly when they are equal as elements of the quotient system . So there are three equivalent formulations to keep straight:

  • (equal remainders),
  • (the difference is a multiple of the modulus),
  • in (equal in the quotient).

Example. In , verify that using both of the first two formulations.
For the remainder version, divide each side by . Since , we get , so

while already has degree and so is its own remainder. Both sides leave remainder .
For the divisibility version, subtract:

which is visibly a multiple of . Therefore, the congruence holds, and the two tests agree as the mod operator promises they must.

The Set of Polynomials Modulo m(x)

For integers, the set of remainders modulo was packaged into the ring (see Modular Rings and Units). The polynomial version does exactly the same thing with the set of possible remainders modulo .

Note

Definition 7.11
Given any polynomial with degree , the set of polynomials modulo is denoted , and is the algebraic system with elements

and addition and multiplication operations the same as in , except always reduced to the remainder with smallest degree modulo .

Basically, the elements are exactly the possible remainders on division by ; every polynomial of degree less than , and nothing else. You add and multiply as normal polynomials and then reduce mod at the end, in the same way that arithmetic in is ordinary integer arithmetic followed by taking a remainder.

Note

Notation
We may write " in " (or similarly) to mean the same thing as .

This matches the habit from earlier topics of writing " in " rather than ""; the notation emphasises the relation, the notation emphasises that we are working inside a fixed finite system where the reduced form is the element.

Counting is easy: an element is determined by its coefficients , each chosen freely from . So if is finite,

The count depends only on the degree of , not on which polynomial of that degree you chose. Whether factors or not changes the structure enormously (that is the subject of Irreducible Polynomials), but never the number of elements.

Example. List the elements of .
Here and , so the elements are all with , and there are of them:

Therefore, there are exactly elements. Notice that this is not ; it has nine elements, but the arithmetic is completely different, as the next example shows.

Example. In , compute and .
Addition never needs reducing, since the sum of two polynomials of degree still has degree :

Multiplication does need reducing. The key relation is , i.e.

so every that appears can be swapped for on sight:

Therefore, and in . Substituting is the same operation as dividing by and keeping the remainder; it is just far faster, and you should always reach for it once the modulus is fixed.

Example. List the elements of and write down its multiplication table.
Here , so the elements are . The relation gives

using . Reducing every product with this,

which fills in the table:

Therefore, has four elements and the multiplication table above. Notice that every nonzero row contains a , so every nonzero element has a multiplicative inverse; by the definition in Rings and Fields this system is a field with four elements, which is something can never give us (there is no that is a field). This is exactly why polynomial quotients matter, and it happens here because has no roots in ; more on that in Irreducible Polynomials.

Reducing Powers in the Quotient

Computing a high power of inside is the polynomial version of computing in , and there are the same two ways to do it: grind out the division, or find a small power of that collapses to something trivial and exploit it. The second way is almost always faster, and it is the direct analogue of reducing an exponent modulo the order in Order and Primitive Elements.

Example. Find in .
By long division, taking one quotient term at a time:

and , so we stop. Collecting the quotient terms,

so the remainder is .
Alternatively, and much faster, use the relation directly:

Therefore, in . Notice how means the powers of cycle with period ; this is precisely an order calculation, with playing the role of a unit.

Example. Find in .
By long division, remembering that in subtracting is the same as adding:

so the quotient is and

Alternatively, use from the previous section, which gives

so the powers of cycle with period and

Therefore, in ; both routes agree, and the second one took three lines.

Example. Find in , and find in .
Nobody is doing these by long division. From the previous examples, in the first system and in the second, so in each case we reduce the exponent modulo that period:

For the second, and , so

Therefore, and . Reduce the exponent modulo the period of , never modulo the degree of ; the degree tells you how big the remainders are allowed to be, not how the powers repeat.

Solving Linear Congruences with Polynomial Moduli

Now for the polynomial version of Linear Congruences and Diophantine Equations. Given , we want to solve the general linear congruence

for the unknown polynomial . Compare this with : the method is word-for-word the same, with of polynomials (from the polynomial Euclidean algorithm in Polynomial Rings) replacing of integers.

  • Find . If , there is no solution; stop.
  • Find polynomials such that , e.g. via the Euclidean algorithm and working backwards.
  • The general solution is then

Basically, is playing the role of an inverse: the Bézout identity says , so multiplying the congruence through by converts the left-hand side from into , and then everything divides by . The divisibility condition appears for exactly the same reason as did for integers; the reachable values of are precisely the multiples of the gcd.

The modulus shrinks from to , and forgetting this is the classic mistake. In the integer case a single class mod split into separate classes mod ; here a single class mod splits into separate classes mod , by the count of elements in the quotient when is finite. If a question asks for the answer modulo the original , you have to list all of them by repeatedly adding .

In , subtraction is identical to addition, because ; so signs never matter and you may freely replace every minus with a plus. This is a genuine convenience when back-substituting through the Euclidean algorithm (no sign bookkeeping at all), but it is also the single most common source of confusion in this topic, because the same manipulation in or absolutely does need its signs. Always know which field you are in before you start cancelling.

Example. Solve in .
First run the Euclidean algorithm on and . Dividing,

so the last nonzero remainder is . (It is worth checking the first line: , and adding gives as required.) Since divides everything, a solution exists.

Now work backwards from the second line to build the Bézout identity:

so and . As a check,

and adding leaves exactly .

Since , neither the right-hand side nor the modulus shrinks, and the general solution is

using in . Checking the answer by multiplying out, and using the fact that squaring in kills all the cross terms,

Therefore, the solution is . Amusingly the answer is itself, i.e. happens to be its own "square root of " here; that is a coincidence of this example, not a general phenomenon.

Example. In , solve (a) , and (b) .
Both parts need the same gcd, so compute it once. In ,

so . (Both lines are just the factorisations and in disguise.)
(a) Does divide ? By the Remainder Theorem the remainder is the value at , namely ; so no. Therefore, part (a) has no solutions.
(b) Here , which is divisible by , so solutions exist. From the first division line,

giving . Dividing the pieces by ,

so the general solution is

using in as before. Checking with ,

since . Therefore, the solution to (b) is . Notice the modulus really did shrink, from degree down to degree ; modulo the original there are solutions, namely and , and indeed in as well.

Example. Solve in .
This one is over , so signs matter again; recall and in . Running the Euclidean algorithm,

where the middle line uses , so the remainder is . The last nonzero remainder is the constant , whose monic form is ; so and a solution exists.

Working backwards,

Multiplying through by in to make the gcd monic,

so . Since , the general solution is modulo :

Now , so , giving

Checking: with we get , so

Therefore, the solution is .

The Chinese Remainder Theorem for Polynomials

Everything from Simultaneous Congruences and the CRT carries over as well, with the same pairwise-coprime hypothesis and the same uniqueness statement.

Note

Theorem 7.12 (Chinese Remainder Theorem)
Suppose that , and that for the system of congruences

all the moduli are pairwise coprime (that is, for all ). Then the system of congruences has a solution, and the solution is unique modulo .

The proof is analogous to the integer case from Simultaneous Congruences and the CRT, so the lecture only sketches it; the substitution argument below is constructive anyway, which is really all we need in practice.

Pairwise coprime means coprime in pairs, not "no factor common to all of them". Exactly as with integers, is not enough; you must check every pair separately. Notice also that "coprime" here means the gcd is the constant polynomial , i.e. the two moduli share no common factor of degree .

To solve a system, we use the same substitution method as in the integer case:

  • Solve the first congruence and write in terms of some polynomial .
  • Substitute this into the second congruence and solve for in terms of some new polynomial .
  • Rewrite in terms of , substitute into the third congruence, and so on.
  • The final expression for , with ranging over all of , describes every solution.

Basically, each congruence narrows the family of possible down further, and the parameter keeps track of whatever freedom is left. Since the final answer is unique modulo the product of the moduli, the degree of the product is a free sanity check: the reduced answer must have degree less than .

Example. Solve the following system of polynomial congruences in :

First check the hypothesis: has constant term , so it is not divisible by , and the only factor of of positive degree is ; hence and the CRT applies. The answer will be unique modulo

From the first congruence,

Substituting this into the second congruence,

using in . So must be the inverse of modulo ; and the gcd is , so an inverse exists. Rather than run the full Euclidean algorithm, notice that

so the inverse is and

Substituting back,

Checking both congruences with : modulo we have , so ; and modulo we showed earlier that , so . Both hold. Therefore, the general solution is

and its degree is comfortably below , as the uniqueness statement requires.

Example. Solve and in .
Coprimality first: by the Remainder Theorem, divides only if were in , which it is not; so the moduli are coprime and the answer is unique modulo

From the first congruence, . Substituting into the second,

We need the inverse of modulo . Using ,

so . Multiplying through,

since in . Hence , and

Checking: at we get , so ; and modulo we have , so . Both hold. Therefore,

So the whole of Topics 3 and 4 transfers across intact: remainders, congruence classes, a finite quotient system, linear congruences solved by Bézout, and simultaneous congruences solved by substitution. The only things you have to keep watch over are which field the coefficients live in (because in but not in ), and the fact that "size" now means degree; once those two habits are in place, every method here is one you have already used on integers.