Modular congruence Created 2026-09-24 Updated 2026-10-14
For integers and a positive integer modulus , modular congruence means
Thus for some integer : the two integers differ by complete cycles of length . For example, because , and because . A modular congruence need not be an equality of integers.
On a twelve-position clock labelled , adding five to nine follows . Hence : the final position remembers the remainder while forgetting a complete revolution.
Figure 1.
Adding five to nine takes five clockwise steps and ends at two modulo twelve
. Details.
The same idea tracks any count repeating every steps. It also lets us compute sums and products with small residue classes, reducing intermediate results without changing the final class. The justification comes from addition and multiplication being well-defined on residue classes.
In Disquisitiones arithmeticae (1801), Carl Friedrich Gauss defines modular congruence by divisibility in article 1; article 2 describes the integers and adopts . These passages document his presentation and notation, without claiming that repeating remainders began in 1801. [ref]
For a prime number and , multiplication by gives a permutation of the nonzero residue classes. For modulo seven, the representatives map to : the same collection in a different order. Repeating this permutation from one visits all six representatives before returning.
Figure 1.
Multiplication by three modulo seven permutes all six nonzero residue classes
. The upper arrows show each input and its image. The lower arrows repeatedly apply the same permutation to one, displaying the powers modulo seven. The highlighted final one is the first positive return, at exponent six. Details.
For modulo seven, the permutation cycles are instead and . The powers of two visit only the permutation cycle containing one, so their multiplicative order is three. Both permutation cycles return after three steps; applying the permutation six times still fixes every nonzero residue class. Fermat's little theorem guarantees a return at six, not that every base visits every nonzero residue class.
Figure 2.
Multiplication by two modulo seven gives two permutation cycles of length three
. Every arrow multiplies by two modulo seven. The left permutation cycle contains one and hence the powers of two. The right permutation cycle contains the other three nonzero residue classes. Their common length three divides . Details.
More generally, every permutation cycle of this map has length equal to the multiplicative order of : starting at a nonzero residue class , a return means , and its modular multiplicative inverse allows cancellation of . Thus the nonzero residue classes split into equal-length permutation cycles, which also explains the divisibility of the multiplicative order into .
The product argument gives a short proof outline. Since multiplication by is a permutation of the nonzero residue classes,
Every factor is a unit, so their product has a modular multiplicative inverse and can be cancelled. This leaves . The whole argument works for , where the product is just one.[ref]
One-equation partition regularity over odd integers Created 2026-10-07 Updated 2026-10-14
A rational homogeneous equation has a monochromatic positive odd solution in every finite colouring of the odd integers exactly when its full coefficient sum is zero. Sufficiency uses a constant odd vector. For necessity, clear denominators and, if the total is nonzero, colour by odd residue classes modulo . A common odd residue is invertible, so a solution would require , impossible. This is stronger than the zero-sum-subset criterion for unrestricted partition regularity.
For a prime number , the nonzero residue classes form the multiplicative group of the finite field . Every class has a unique multiplicative inverse. A class equals its own inverse precisely when , so in the field and or .
For an odd prime, pair each remaining class with its distinct inverse. Each pair contributes one to the product, leaving
For , the same congruence is . This proves Wilson's theorem.
If is a prime number and , multiplication by permutes the nonzero residue classes modulo : implies because has a multiplicative inverse. Multiplying all the permuted classes gives
The factorial is a nonzero element of the finite field , so cancellation is valid. Therefore
which is Fermat's little theorem.
Fix a positive integer and an integer coprime to . We use Dirichlet characters modulo , extended by zero on integers not coprime to , and write for the principal Dirichlet character. For a nonprincipal Dirichlet character, the sum over one complete period is zero. Its partial sums are therefore . Partial summation gives
The integral converges locally uniformly there, so these Dirichlet L-functions are holomorphic at one. On the other hand,
has a simple pole at one, with residue .
The assumed nonvanishing of a nonprincipal Dirichlet L-function at one for real Dirichlet characters also excludes vanishing for nonreal ones. To prove this, form the product over all Dirichlet characters
Use the logarithm supplied by the absolutely convergent Euler product. The Orthogonality of Dirichlet characters yields
Thus . If a nonreal Dirichlet character had , its distinct conjugate would also have a zero there, since . These two zeros would outweigh the single pole of the principal factor; all other factors are bounded near one. It would follow that as , contradicting the lower bound. Together with the assumption for real Dirichlet characters, this proves for every nonprincipal Dirichlet character.
The first-degree part of the Euler product logarithm gives
The omitted terms are bounded uniformly, since . For each nonprincipal factor, its logarithm remains bounded: choose a holomorphic logarithm near the now established nonzero value ; the Euler-product branch differs from it by a fixed integral multiple of on a sufficiently small real interval. For the principal factor,
Applying Orthogonality of Dirichlet characters again gives
The right side diverges as , so the arithmetic progression contains infinitely many primes. This proves Dirichlet's theorem on arithmetic progressions: every reduced residue class modulo contains infinitely many primes. The argument also covers and , when there need not be a nonreal character.
For the sharper statement about reciprocal primes in a fixed arithmetic progression, use the given prime-counting function asymptotic with fixed:
The second equivalence follows by integration by parts in the logarithmic integral function. Partial summation yields
For any , choose a fixed so large that the relative error in is at most for . The initial integral is a constant, while the remaining integral lies between
The boundary term is . Divide by , let , and then let . We obtain
Only a relative asymptotic is deduced from the given information; an additive error, or uniformity for a growing modulus , would require additional estimates.
An integer square is divisible by four exactly when its base is even: an even base has square , while an odd base has square . Apply this observation to the triangular number obtained above. Since is even,
Checking the four residue classes of modulo four, the products have residues , respectively. Therefore
The original PDF has two alternatives modulo four; the TeX transcription incorrectly turns the second alternative into a modulus-three expression.
The modular congruence first implies . Multiplication by such an permutes the nonzero residue classes modulo the prime : if , cancellation gives . Multiply all these residues and cancel their nonzero product to obtain , the usual short proof of Fermat little theorem.
Now . By the Euclid lemma, either or . In the latter case, because ,
contradicting the preceding product argument, since is odd. Thus
No unproved assertion about the number of fourth roots is needed.
For a prime number , every nonzero residue class has a unique multiplicative inverse modulo : Bezout identity supplies one because its representative is coprime to , and cancellation modulo a prime gives uniqueness. Pair each residue with its inverse. The only unpaired residues satisfy , so ; the Euclid lemma gives or . For odd , these are distinct. Every other pair contributes one to the product of all nonzero residues, leaving
For , as well. This proves Wilson theorem in all cases.
For an odd prime, set . Pair the upper half of the factorial with the negatives of the lower half:
If , then is even. Therefore
This constructs a square root of minus one modulo a prime explicitly.
Fix a modulus and a residue class with . The Dirichlet characters modulo are the one-dimensional characters of a representation of , extended by zero on nonunits. Let be the principal Dirichlet character.
For every nonprincipal Dirichlet character the partial sums are bounded: the sum over a full period is zero, and a remaining incomplete period has bounded length. Partial summation therefore continues its Dirichlet L-function holomorphically to by
This shows in particular that it has no pole at one. By contrast
has a simple pole there. We use the stipulated nonvanishing for every real nonprincipal Dirichlet character, and establish the remaining nonvanishing as follows.
For real , take the product over all Dirichlet characters. The Euler product logarithms and Orthogonality of Dirichlet characters give
Thus this product is real and at least one. If a nonreal Dirichlet character had , complex conjugation would also give . These are distinct factors. Two zeros and only one possible simple pole force the whole product to tend to zero as , contradicting the lower bound. Hence all nonprincipal Dirichlet characters have , under the given real-character assumption.
For , absolute convergence of each Euler product gives
with bounded remainder as : the terms of prime-power exponent at least two have total modulus at most . Since a nonprincipal defines a holomorphic function that is nonzero near one, its Euler-product logarithm differs from a local holomorphic logarithm by a fixed integer multiple of on a short real interval. It is therefore bounded there. For the principal Dirichlet character the pole instead gives
Apply the Dirichlet character orthogonality relation at each prime. The prime-character sum near one yields
This tends to infinity. A finite set of primes would have a bounded sum as , so every coprime residue class contains infinitely many primes. This proves the Dirichlet theorem on primes in arithmetic progressions from the specified assumption. In fact it proves divergence of the corresponding reciprocal-prime series and gives Dirichlet density .
Finally, for real each prime satisfies
The integrands are nonnegative, so Tonelli theorem permits summation inside the integral. At a fixed , exactly primes from the residue class have entered. Therefore
Both sides are finite, since they are bounded respectively by and . The values of a counting function at its isolated jump endpoints do not change this integral.
The Von Mangoldt function is supported on prime powers:
Write . A convenient form of the Siegel–Walfisz theorem is: for every fixed , uniformly for and ,
The implied constant can be ineffective because of possible Siegel zeros; the modulus bound is logarithmic, not an unrestricted uniformity assertion.
Apply this to modulus five and separate the reduced residue classes:
The last sum is : only powers of five can contribute in the zero residue class. By the orthogonality of roots of unity,
since two is coprime to five and the sum including vanishes. As , the Siegel–Walfisz theorem yields
The sum is complex-valued, but the displayed error controls its absolute difference from the real main term.