1.2.2. Linear congruences
This section is based on part of [BUR11, Sec. 4.4].
Definition 1.2.2.1.
Let be an integer. A linear congruence (in one indeterminate) is an equation of the form
where and is an indeterminate. An integer is a solution to the linear congruence if . These definitions extend to several indeterminates in the natural way.
The following theorem is a variant of Theorem 1.1.3.23.
Theorem 1.2.2.2.
Let be an integer and . Consider the linear congruence
where is an indeterminate. Set so that in particular . The following statements hold:
-
(1)
The linear congruence (1.2.2.3) admits a solution if and only if .
- (2)
Proof.
We make the following observation: the linear congruence (1.2.2.3) is equivalent to the linear Diophantine equation . Indeed, an integer is a solution to the linear congruence (1.2.2.3) if and only if there exists such that or, equivalently, .
(1) Immediate from Theorem 1.1.3.23.
(2a) Let be integers such that
By Proposition 1.2.1.6(4), we have
Since , we have . Since , Proposition 1.2.1.8 yields
Since , Proposition 1.2.1.2 implies that . This proves the claim.
(2b) Recall that by assumption. For the integer is a solution to the linear congruence (1.2.2.3):
and therefore ; here, we use that since . Using again Theorem 1.1.3.23, we only need to prove the following: for every there exists an integer such that
By the Division with Remainder Theorem (Theorem 1.1.1.8), we may write with and . Then
is a multiple of , as required (alternatively, one can apply Proposition 1.2.1.8 to the congruence using that ). Conversely, suppose that satisfies
for some . By Proposition 1.2.1.6(4), we have since is a solution to the linear congruence (1.2.2.3), as shown above. This finishes the proof. ∎
We list some important corollaries of Theorem 1.2.2.2.
Corollary 1.2.2.4.
Let be an integer and . Set . The linear congruence admits an integer solution if and only if . In this case, there are exactly pairwise non-congruent solutions modulo .
Proof.
Immediate from Theorem 1.2.2.2. ∎
Corollary 1.2.2.5.
Not covered in the lecture Let be an integer and . If , then the linear congruence admits a unique integer solution modulo .
Proof.
Immediate from Corollary 1.2.2.4. ∎
Corollary 1.2.2.6.
Not covered in the lecture Let be a prime. Let be such that . The linear congruence admits a unique integer solution modulo .
Proof.
The assumption implies that . The claim is now immediate from Corollary 1.2.2.5. ∎
Corollary 1.2.2.7.
Not covered in the lecture Let be a prime and let . The linear congruence
admits an integer solution if and only if . In this case, the solution is unique modulo .
Proof.
If , then and the congruence is false. If , then the claims are immediate from Corollary 1.2.2.6. ∎
Remark 1.2.2.8.
Not covered in the lecture Let be an integer and with . Consider the congruence
Recall that we consider its solutions modulo . The unique solution to this congruence (Corollary 1.2.2.5) can be computed algorithmically as follows:
-
(1)
Compute a pair of Bézout coefficients such that , for example using the procedure in the proof of Bézout’s Identity (Theorem 1.1.3.7).
-
(2)
Since , the integer satisfies and hence
Example 1.2.2.9.
Not covered in the lecture Let , , and . We have . Consider the linear congruence
We compute Bézout coefficients for using the Extended Euclidean Algorithm (Theorem 1.1.3.6) (or by direct inspection):
Indeed, . The integer is a solution to the congruence, since
is divisible by .
End of Lecture 6
The following theorem, and its proof, reminds us of the procedure for solving a system of linear equations studied in the Linear Algebra course.
Theorem 1.2.2.10.
Let be an integer and . Set and suppose that . For given , the system of linear congruences
| (1.2.2.11) | |||
has a unique solution modulo . Thus, if and are solutions to the system, we must have and .
Proof.
Since by assumption, Corollary 1.2.2.5 implies that the linear congruence
admits a unique solution modulo . Let be such a solution. We now take a hint from linear algebra: since
the system of linear congruences (1.2.2.11) can be written as
where the congruence is understood coordinate-wise. Observe that
Consider the vector
We claim that and give a solution to the system of linear congruences (1.2.2.11). Indeed,
Since , Proposition 1.2.1.6(4) implies that
The claim readily follows.
To prove that the solution is unique modulo , suppose that give a solution to the system of linear congruences (1.2.2.11). By definition, there exist such that
Multiplying on the left by the matrix yields
for certain integers . Consequently,
Multiplying by as above, we obtain
Since , Proposition 1.2.1.6(4) yields the congruences
Hence, every solution to the system of linear congruences (1.2.2.11) is congruent coordinate-wise modulo to the solution constructed above. This finishes the proof. ∎
We explain how to use the proof of Theorem 1.2.2.10 to solve an explicit system of linear congruences.
Example 1.2.2.12.
Not covered in the lectureConsider the system of linear congruences
We have
Notice that , and hence the system admits a unique solution modulo (Theorem 1.2.2.10). We need to solve the linear congruence
We could use the method in Remark 1.2.2.8, but instead we observe that
and, since , the integer is a solution. The solution to the original system of linear congruences is therefore given by the coordinates of the column vector
Since we are interested in the solutions modulo , we may replace
by and
by . Indeed,
but since .