Section 7.4 Polynomials and Lagrange's Theorem
ΒΆWe've seen several times in this chapter that although one can have theorems of various kinds for congruences, polynomials seems to behave very nicely β even to the point of allowing us to prove statements about the integer output of polynomials! At the same time, it's clear that for good behavior, there is no substitute for prime moduli; the results in the previous sections really confirm this. So how can we combine polynomials and prime modulus?Theorem 7.4.1. Lagrange's Theorem for Polynomials.
If p is prime and f(x) is a non-trivial polynomial (i.e. f not identically zero) with integer coefficients of degree d, then there are at most d congruence classes of solutions of f(x)β‘0 modulo p.
Proof.
This proof is fairly detailed, so feel free to try it out with specific numbers. It proceeds via induction on the degree \(d\) of the polynomial.
First, consider the case where there are no solutions to \(f(x)\equiv 0\) (mod \(p\)). Then there is nothing further to prove, since \(0\leq d\) for any polynomial. This actually proves a base case, for if the degree is \(d=0\) then \(f(x)=c\) for \(c\neq 0\text{.}\) (If \(c=0\) we have the trivial polynomial, which is the excluded case.)
For another base case, suppose that the degree \(d=1\text{.}\) Then we have \(ax+b\equiv 0\) (mod \(p\)), which is the same as \(ax\equiv -b\) (mod \(p\)). In this case \(\gcd(a,p)=1\) and there is exactly one solution by Proposition 5.1.3 (if \(ax+b\) is actually going to have a linear term, otherwise \(p\mid a\)).
Now we'll use some induction. Let's assume that all polynomials with degree \(e\) less than \(d\) have at most \(e\) solutions modulo \(p\text{,}\) and try to examine a generic polynomial \(f\) of degree \(d\text{:}\)
We already dealt with the case where \(f\) has no solutions, so assume further that \(f(b)\equiv 0\) (mod \(p\)) for at least one congruence class \([b]\text{.}\) Consider the following expansion of \(f(x)-f(b)\text{:}\)
Now recall the factorizationβ3βWe could have used this to prove Fact 4.2.3. See also Exercise 7.7.6.
Apply it to the previous formula to factor our \(x-b\text{:}\)
Note that βStuffβ is strictly of degree less than \(d\text{.}\)
Now we can write \(f(x)\equiv 0\) in two ways, recalling that \(f(b)\equiv 0\text{:}\)
\(f(x)\equiv 0\)
\(f(x)\equiv f(x)-f(b)\equiv (x-b)\cdot \text{Stuff}(x)\)
Therefore
implies that \(p\) divides the product of \(x-b\) and the stuff. Crucially, by Lemma 6.3.6 we know \(p\) divides one of these two factors.
Since the βStuffβ function must be a polynomial of degree less than \(d\text{,}\) there are at most \(d-1\) solutions to it modulo \(p\) if \(p\) divides βStuffβ. If \(p\) divides \(x-b\) instead, that is only one more solution for \(f(x)\text{,}\) so there are a total of at most \(d\) solutions available for \(f(x)\text{,}\) including \(x\equiv b\text{.}\)
Finally, \(f(x)\) was an arbitrary polynomial of degree \(d\text{,}\) so the induction statement is proved, and by induction, the theorem works for any non-trivial polynomial.
xxxxxxxxxx
def _(n=(13,prime_range(100))):
counter = 0
pretty_print(html("Zero values of $x^2+1$ mod %s"%(n,)))
pretty_print(html("<ul>"))
for m in [0..n-1]:
if mod(m,n)^2+1==0:
pretty_print(html(r"<li>$%s^2+1\equiv %s\text{ (mod }%s)$</li>"%(m,mod(m,n)^2+1,n)))
counter += 1
pretty_print(html("</ul>"))
pretty_print(html(r"There are $%s$ solutions to $x^2+1\equiv 0$ (mod $%s$)."%(counter,n)))