Definition
Congruence equation
For a positive integer m and a univariate polynomial with integer coefficients f(x)=∑i=0naixi, where the unknown x∈Zm, an equation of the form
f(x)≡0(modm)(1)
is called a univariate congruence equation modulo m in the unknown x (Congruence Equation).
If an≡0(modm), the above is called an n-th degree congruence equation.
Systems of congruence equations can be defined similarly.
For related material on linear congruence equations and systems, see Linear Congruence Equations and the Chinese Remainder Theorem.
This article first studies the solvability and solution-set structure of congruence equations, and then briefly introduces methods for solving higher-degree congruence equations.
By the Chinese Remainder Theorem, solving a congruence equation modulo a composite number m can be reduced to solving the cases modulo prime powers. Therefore, below we only introduce the relevant theory for congruence equations modulo prime powers and modulo primes.
Congruence equations modulo prime powers
Assume below that the modulus is m=pe (p∈P, e∈Z>1).
Notice that if x0 is a solution of
f(x)≡0(modpe)
then x0 is also a solution of
f(x)≡0(modpe−1)
This suggests constructing solutions for higher powers of the modulus from solutions for lower powers. We have the following theorem:
Theorem 1 (Hensel's lemma)
For a prime p and an integer e>1, let the integer-coefficient polynomial be f(x)=∑i=0naixi (pe∤an), and let f′(x)=∑i=1niaixi−1 be its derivative. Let x0 be a solution of
f(x)≡0(modpe−1)(2)
Then:
-
If f′(x0)≡0(modp), there exists an integer t such that
x=x0+pe−1t(3)
is a solution of
f(x)≡0(modpe)(4)
-
If f′(x0)≡0(modp) and f(x0)≡0(modpe), then for t=0,1,…,p−1, every x determined by equation (3) is a solution of equation (4).
-
If f′(x0)≡0(modp) and f(x0)≡0(modpe), then no solution of equation (4) can be constructed from equation (3).
Proof
Assume that equation (3) is a solution of equation (4), that is,
f(x0+pe−1t)≡0(modpe)
Rearranging gives
f(x0)+pe−1tf′(x0)≡0(modpe)
Therefore
tf′(x0)≡−pe−1f(x0)(modp)(5)
- If f′(x0)≡0(modp), equation (5) in t has a unique solution t0, and substituting into equation (3) verifies that it is a solution of equation (4).
- If f′(x0)≡0(modp) and f(x0)≡0(modpe), every t makes equation (5) hold, and substituting into equation (3) verifies that each is a solution of equation (4).
- If f′(x0)≡0(modp) and f(x0)≡0(modpe), equation (5) has no solution, so no solution of equation (4) can be constructed from equation (3).
We consequently have the following corollary:
Corollary 1
For the p, e, f(x), and x0 of Theorem 1:
- If s is a solution of f(x)≡0(modp) and f′(s)≡0(modp), there exists xs∈Zpe with xs≡s(modp) such that xs is a solution of equation (4).
- If f(x)≡0(modp) and f′(x)≡0(modp) have no common solution, then equation (4) and f(x)≡0(modp) have the same number of solutions.
Thus, a congruence equation modulo a prime power can be reduced to the case of a congruence equation modulo a prime.
Congruence equations modulo primes
Let p∈P, let f(x)=∑i=0naixi be an integer-coefficient polynomial, where p∤an, and let x∈Zp.
Theorem 2
If
f(x)≡0(modp)(6)
has k distinct solutions x1,x2,…,xk (k≤n), then
f(x)≡g(x)i=1∏k(x−xi)(modp),
where degg=n−k and [xn−k]g(x)=an.
Proof
Apply mathematical induction on k.
-
When k=1, perform polynomial division with remainder: f(x)=(x−x1)g(x)+r, where r∈Z.
Since f(x1)≡0(modp), we have r≡0(modp), and therefore f(x)≡(x−x1)g(x)(modp).
-
Assume the claim holds for k−1 (k>1). Now suppose f(x) has k distinct solutions x1,x2,…,xk. Then f(x)≡(x−x1)h(x)(modp), and therefore
(∀i=2,3,…,k), 0≡f(xi)≡(xi−x1)h(xi)(modp)
Thus h(x) has k−1 distinct solutions x2,x3,…,xk. By the induction hypothesis,
h(x)≡g(x)i=2∏k(x−xi)(modp)
where degg=n−k and [xn−k]g(x)=an.
The claim follows.
Corollary 2
For a prime p,
- (∀x∈Z), xp−1−1≡∏i=1p−1(x−i)(modp).
- (Wilson's theorem) (p−1)!≡−1(modp).
Theorem 3 (Lagrange's theorem)
Equation (6) has at most n distinct solutions.
Proof
Suppose f(x) has n+1 distinct solutions x1,x2,…,xn+1. By Theorem 2, for x1,x2,…,xn,
f(x)≡ani=1∏n(x−xi)(modp)
Let x=xn+1. Then
0≡f(xn+1)≡ani=1∏n(xn+1−xi)(modp)
However, the right-hand side is clearly not a multiple of p, a contradiction.
Corollary 3
If the number of solutions of the congruence equation ∑i=0nbixi≡0(modp) is greater than n, then
(∀i=0,1,…,n), p∣bi.
Theorem 4
If the number of solutions of equation (6) is not p, then there must exist a polynomial satisfying $\deg r [!note]+ Proof
Without loss of generality, let n≥p. Divide f(x) by x^p-x with remainder
f(x)=g(x)(xp−x)+r(x)
where degrBy[Fermat′slittletheorem](/knowledge−pages/math−number−theory−fermat),foreveryintegerx,x^p\equiv x\pmod p$, so:
- If r(x)≡0(modp), then by Corollary 2, f(x) has p distinct solutions.
- If r(x)≡0(modp), then f(x)≡r(x)(modp) shows that f(x) and r(x) have the same solution set.
We can use this theorem to reduce the degree of a congruence equation.
Theorem 5
Let n≤p. Then equation
xn+i=0∑n−1aixi≡0(modp)(7)
has n solutions if and only if there exist integer-coefficient polynomials q(x) and r(x) (degr<n) such that
xp−x=f(x)q(x)+pr(x).(8)
Proof
-
Necessity: polynomial division gives integer-coefficient polynomials q(x) and r1(x) (degr1<n) such that
xp−x=f(x)q(x)+r1(x).
If equation (7) has n solutions, then r1≡0(modp) also has the same n solutions. By Corollary 3, there is an integer-coefficient polynomial r(x) satisfying r1(x)=pr(x), proving the claim.
-
Sufficiency: If equation (8) holds, then by Fermat's little theorem, for every integer x,
0≡xp−x≡f(x)q(x)(modp).
Thus the equation f(x)q(x)≡0(modp) has p solutions.
Let the number of solutions of equation (7) be s. By Lagrange's theorem, s≤n.
Since degq=p−n, Lagrange's theorem shows that the number of solutions of q(x)≡0(modp) is at most p−n. The solution set of f(x)q(x)≡0(modp) is the union of the solution sets of f(x)≡0(modp) and q(x)≡0(modp), so s+(p−n)≥p, and s≥n.
Therefore s=n.
For a non-monic polynomial, since Zp is a field, it can be converted into a monic polynomial, so the theorem applies.
Theorem 6
Let n∣p−1 and p∤a. Then equation
xn≡a(modp)(9)
has a solution if and only if
anp−1≡1(modp).
Moreover, if (9) has a solution, the number of solutions is n.
Note
For the concrete structure of the solution set of equation (9), see k-th power residues.
Proof
-
Necessity: If equation (9) has a solution x0, then
anp−1≡(x0n)np−1≡1(modp)
-
Sufficiency: If anp−1≡1(modp), then
xp−x=x(xp−1−1)=x((xn)np−1−anp−1+anp−1−1)=(xn−a)P(x)+x(anp−1−1)
where P(x) is an integer-coefficient polynomial. Therefore, by Theorem 5, equation (9) has n solutions.
Methods for solving higher-degree congruence equations (and systems)
First, use the Chinese Remainder Theorem to convert solving a system of congruence equations into solving a congruence equation, and convert solving a congruence equation modulo a composite number m into solving one modulo a prime power. Then use Theorem 1 to convert solving a congruence equation modulo a prime power into solving one modulo a prime.
Combining several theorems for congruence equations modulo primes, we only need to consider solving
xn+i=0∑n−1aixi≡0(modp)
where p is prime and n<p.
We can eliminate the xn−1 term by substituting x with x−nan−1, so we only need to consider solving
xn+i=0∑n−2aixi≡0(modp)(10)
where p is prime and n<p.
-
If n=1, see Linear Congruence Equations.
-
If n=2, see Quadratic Residues.
-
If equation (10) can be transformed into
xn≡a(modp),
see k-th power residues.
References
- Congruence Equation -- from Wolfram MathWorld
- Lagrange's theorem (number theory) - Wikipedia
- Pan Chengdong, Pan Chengbiao. Elementary Number Theory.
- Feng Keqin. Elementary Number Theory and Its Applications.
- Min Sihe, Yan Shijian. Elementary Number Theory.