Primes in Arithmetic Progressions: Statement
Take the arithmetic progression . These are numbers congruent to . Does it contain infinitely many primes? What about , the class ? Both answers are yes. In a precise sense the primes split evenly between the two classes. Each gets "half" of them. This is the content of Dirichlet's theorem on primes in arithmetic progressions. It is one of the founding results of analytic number theory. It is also the theorem that first demonstrated the power of -functions and complex-analytic methods applied to a purely arithmetic question. The question matters because arithmetic progressions are the natural residue-class partition of the integers. Understanding how primes distribute among residue classes is a prerequisite for almost everything that follows in analytic number theory. This ranges from the distribution of primes in short intervals to modern sieve theory and the study of prime gaps. Dirichlet's theorem also introduced, for the first time, the technique of attaching an -function to a character. It studied that function's behavior at . This template was later generalized enormously (Dedekind zeta functions, Artin -functions, automorphic -functions). The big picture is this: fix a modulus . Consider the residue classes with . These are exactly the classes that can contain infinitely many primes. Any other class with consists of numbers all divisible by . Such a class hence contains at most one prime. Dirichlet's theorem asserts that each of these admissible classes contains infinitely many primes. The quantitative refinement is a consequence of the Prime Number Theorem for arithmetic progressions. It shows the primes are asymptotically equidistributed. Each class gets density exactly among all primes. This article states the qualitative theorem and its quantitative strengthening precisely. It explains the role of Dirichlet characters and -functions in the proof strategy. It gives a complete proof of the qualitative statement in the key special case. That case already contains the essential ideas. It also gives a full discussion of what the general proof requires. We treat the general nonvanishing-on-the-line result as the deep input. This is proved elsewhere in the analytic theory of -functions. Here we make its logical role in the argument completely explicit.
- Fix . The residue class can contain infinitely many primes only if ; there are such classes.
- Dirichlet's theorem: every class with contains infinitely many primes.
- The quantitative form: as , for each fixed and each admissible .
- Proof strategy: attach a Dirichlet character to an -function ; orthogonality of characters isolates a single residue class.
- The crux is nonvanishing: for every nontrivial character — this is what makes the class-isolating sum finite rather than divergent.
- We prove the qualitative theorem in full for (infinitude of primes and ), exhibiting every step of the character/-function machinery in miniature.
- Key idea: Dirichlet characters convert "which residue class" into "which linear combination of -functions," and converts that combination into a genuine, non-cancelling contribution from every admissible class.
Where this lives today
The character/-function technique introduced for this theorem is the direct ancestor of the entire modern apparatus of -functions: Dedekind zeta functions of number fields, Artin -functions attached to Galois representations, automorphic -functions in the Langlands program, and elliptic curve -functions in the Birch–Swinnerton-Dyer conjecture all generalize the pattern "attach an -function to an algebraic/arithmetic object, study analytic properties at the edge of convergence, extract arithmetic information." In cryptography, the density of primes in residue classes underlies heuristics for prime generation algorithms (e.g., searching for primes of a specific bit-length and specific residue properties for RSA or elliptic-curve parameter selection), and the equidistribution result assures that restricting search to certain classes for efficiency reasons does not create scarcity. In computational number theory, Dirichlet's theorem justifies sieve-based primality search strategies restricted to classes coprime to small moduli (wheel factorization). In probability and statistics, the equidistribution is a paradigm case of an asymptotic "law" extracted from a deterministic but seemingly erratic sequence, analogous in spirit to equidistribution results in ergodic theory and to Weyl's equidistribution theorem for irrational rotations. In physics, the analytic continuation and pole-detection method (finding arithmetic information encoded in poles/zeros of a Dirichlet series) parallels the use of partition functions and their singularities in statistical mechanics.
Ask the tutor: How does the nonvanishing get proved for a general Dirichlet character, and how does it connect to class numbers of quadratic fields?
Let be an integer.
Dirichlet character. A Dirichlet character modulo is a function such that: 1. for all (periodicity mod ); 2. if , and if ; 3. for all (complete multiplicativity). Equivalently, is induced by a group homomorphism , extended by zero to non-units. The set of Dirichlet characters mod forms a group under pointwise multiplication, isomorphic to , of order . The character with for and otherwise is the principal character.
Orthogonality relations. For ,
and for any two characters ,
In particular, taking , for :
Dirichlet -function. For a Dirichlet character , define for
the series and Euler product converging absolutely by complete multiplicativity, exactly as for the Riemann zeta function (an instance of a general Dirichlet Series and Euler Products construction). If is principal mod , then agrees with up to removing the Euler factors at primes :
If , extends to an entire function on (indeed to all of ), because the partial sums are bounded (they vanish over each full period of length ), which lets partial summation control the tail of the series for .
Prime-counting function in a progression. For , set
Intuition — prose building the mental picture
Think of the integers laid along a number line and colored by residue mod . Fixing , the primes larger than must be odd, so they fall into the class or the class — never or , since those are even. The question "are there infinitely many primes " is answered by a short, classical Euclid-style trick (shown below). But "are there infinitely many primes " already resists elementary tricks in general moduli, and for a general modulus and general admissible residue , no purely elementary argument is known that handles all cases simultaneously — this is exactly why Dirichlet reached for complex analysis. The mechanism is a Fourier-analytic idea transplanted to number theory. The indicator function of a single residue class mod is, by the orthogonality relations, an average of characters — the characters are the "harmonics" on the finite abelian group . Summing over primes in a fixed class becomes a linear combination of sums over all characters mod , weighted by . Each such character sum is controlled by the corresponding -function via . The trivial character's -function is in disguise, which has a genuine pole at — this pole is the source of the primes, exactly as in the ordinary Prime Number Theorem. Every other character's -function must, crucially, be nonzero at ; otherwise its logarithmic derivative would itself have a pole there, contributing spurious poles that could cancel the one real pole coming from , and the argument would give no primes at all in the class.
The central theorems
Let and be integers with . Then the arithmetic progression
contains infinitely many primes.
Let be fixed and let be an integer with . Then
i.e. . Equivalently, since by The Prime Number Theorem: Statement and Heuristics,
for every fixed admissible residue : the primes are asymptotically equidistributed among the admissible classes.
Both statements require : this is not a simplifying convenience but a genuine necessary condition, verified next.
If , then the progression contains at most one prime.
Every term of the progression has the form for . Since and , we get for every . So every term of the progression is divisible by . A term is prime only if it equals itself (the only way an integer divisible by can be prime is if the integer is , forcing the cofactor to be ). Since is a strictly increasing function of for , at most one value of can give . Hence at most one term of the progression is prime.
∎This is why Dirichlet's theorem is stated only for : it is exactly the boundary case where the elementary divisibility obstruction from the lemma disappears, and the number of admissible classes is precisely , explaining why appears as the equidistribution denominator. We now prove the qualitative theorem completely for , which contains, in miniature, every structural ingredient of the general proof (character orthogonality, an -function for each character, the pole of at , and nonvanishing of for ), while remaining fully elementary and self-contained — no properties of beyond what we prove by hand are used.
There are infinitely many primes , and infinitely many primes .
Step 1: primes (elementary, Euclid-style). Suppose for contradiction there are only finitely many, say (all odd, all ; possibly ). Consider
Then and (if , ; discard that degenerate case by first checking itself is such a prime, so always). Since is odd, every prime factor of is odd, hence or . Not all prime factors can be : a product of numbers each is again (since ), but . So has at least one prime factor . This cannot be any of , since but , so (as ). This contradicts that was the complete list. Hence there are infinitely many primes .
Step 2: primes (character/-function method). Define the nonprincipal character mod :
One checks directly for all (verify on the four residues mod 4; e.g. ), so is indeed a Dirichlet character mod , and it is the unique nonprincipal one since has exactly characters. Form
where convergence for (not just ) holds because the partial sums of are bounded by (they telescope in pairs ), so Dirichlet's test for series applies. In particular the series converges (conditionally) at :
(the Leibniz series for ; this exact value is not needed below, only that , which follows since the series is a nonzero alternating series with strictly decreasing terms — its value lies strictly between the first partial sum and the second , so , in particular ). Nonvanishing of , self-contained. For an alternating series with or strictly decreasing to , the partial sums oscillate with strictly shrinking amplitude and the limit lies strictly between any two consecutive partial sums. Concretely . Hence ; in particular . This is the nonvanishing input, proved by hand for this modulus, that in general moduli requires the deeper analytic argument discussed after this proof. Euler product and the logarithmic derivative. For , both and have absolutely convergent Euler products (as in Dirichlet Series and Euler Products):
Taking logarithms (valid termwise for since each factor is close to ) and differentiating in :
where is the von Mangoldt function, and the second identity uses complete multiplicativity of exactly as the first uses multiplicativity implicit in the Euler product for . Isolating the class by orthogonality. For odd (i.e. ), orthogonality of the two characters mod gives
which is immediate from on odd . Hence, restricting the von Mangoldt sum to prime powers (only primes and no higher powers matter asymptotically, since converges absolutely for and is therefore bounded as ):
as , where the two main sums are, up to the bounded prime-power corrections above,
Behavior as . Since has a simple pole at with residue (standard fact used already in the The Prime Number Theorem: Statement and Heuristics discussion), we have near , so
Since is continuous at (it is given there by a convergent series, as shown above) and , the function is continuous and finite at — in particular it stays bounded as . Therefore
Conclusion. If there were only finitely many primes , the sum would be a finite sum of continuous functions of , hence would converge to a finite number as . This contradicts the divergence just established. Hence there are infinitely many primes .
∎The proof technique used above — analytic continuation of an Euler product's logarithmic derivative, combined with the nonvanishing of to isolate a divergent contribution — is exactly the technique in the general proof of Dirichlet's theorem. In general modulus , one runs the identical argument with all characters mod simultaneously:
and the same dichotomy occurs: the principal character contributes the divergent -pole term , while every nonprincipal contributes a bounded term provided . The nonvanishing for a general nonprincipal character mod (real or complex-valued) is the one deep analytic fact not proved here in general; it is a substantial theorem in its own right (via class number formulas for real characters, and a positivity trick of Mertens/de la Vallée Poussin type combining and all for complex characters), properly the subject of a dedicated treatment of Dirichlet -functions and is treated as the key external input for the general theorem here.
For , as ; in particular diverges, a quantitative strengthening of infinitude.
This follows from the same pole/nonvanishing dichotomy applied to and in place of their logarithmic derivatives, using near and Mertens-type partial summation to pass from the Dirichlet-series statement to the explicit asymptotic; the details mirror Mertens' second theorem for itself and are omitted here as they parallel the proof above verbatim with replacing .
∎Worked examples
Example 1: modulus 5, exhibiting all four Dirichlet characters and orthogonality by hand. Let . Then is cyclic of order , generated by (). The four characters , , are determined by where :
(Here is the unique real nonprincipal character, the Legendre-symbol character mod 5; are complex conjugates of each other.) Let us verify orthogonality isolates correctly:
At : , giving . ✓. At : . Let us be careful: , so . And , so . Total: , giving . ✓ matches . This confirms concretely, in a modulus with genuinely complex characters (unlike the case, which only involved real values ), that the orthogonality relation used in the proof correctly isolates a single class. Extending Step 2 of the proof to would require establishing for — routine for (real character; class-number-type positivity) but requiring the general complex-character nonvanishing argument for .
Example 2: numerically checking equidistribution, , up to . The admissible residues mod are (coprime to ), so and Dirichlet's theorem predicts each class holds asymptotically of all primes . Primes up to (excluding , the non-admissible small primes): there are primes below total, minus the two exceptions , leaving primes distributed among the four classes. Direct counting gives:
- : — count .
- : — count .
- : — count .
- : — count .
Total . ✓ matches the total count. Each class has roughly primes; the actual counts are close, illustrating equidistribution as a limiting statement — at this small range the fluctuation is still visible (this is the beginning of the phenomenon called Chebyshev's bias, where classes containing quadratic non-residues mod tend to lead slightly more often at small , a second-order effect entirely consistent with, and not contradicting, the first-order asymptotic that Dirichlet's quantitative theorem guarantees only in the limit).
Take , ; here , violating the coprimality hypothesis. The progression is
Every term equals , manifestly even, hence divisible by . The only way such a term can be prime is if the term itself equals ; but forces — there's no such term at all in this case, so this progression contains zero primes, not even the one exceptional case allowed by the general lemma above. This matches The Euler Totient Function-based count: among residues mod , only are coprime to (since ), and indeed one checks each contain infinitely many primes ( and ) while each contain at most one prime (namely none, none, the single prime , and none respectively). This shows the coprimality hypothesis is not a technical convenience: dropping it produces classes that provably contain no primes at all, the polar opposite of the theorem's conclusion.
Scope, edge cases & common traps
| Situation | What holds | What fails / must be checked |
|---|---|---|
| Infinitely many primes (Dirichlet) | — | |
| At most one prime in the class | Theorem's hypothesis excludes this case entirely | |
| Fixed , | Quantitative form requires fixed as ; uniformity in growing with is the much harder Siegel–Walfisz / GRH-type territory | |
| Small | Classes need not be close to equal | "Chebyshev's bias": classes containing quadratic non-residues mod tend to lead at small ; asymptotic equality is a limit statement only |
| Reduces to ordinary PNT | , single class = all integers, consistent but trivial case | |
| Nonprincipal character mod | finite and generally nonzero | Nonvanishing is not elementary in general; it is the deep external input the proof needs |
The mathematician behind it
Origins · 1 minPeter Gustav Lejeune Dirichlet and how this was discovered
Dirichlet studied in Paris under the circle around Fourier and Legendre, absorbing Gauss's Disquisitiones Arithmeticae — reportedly keeping a copy at his bedside for years. He returned to Prussia to a career spanning Breslau, Berlin, and finally Göttingen, succeeding Gauss himself at Göttingen in 1855. Dirichlet's 1837 memoir proving the theorem on primes in arithmetic progressions introduced, for the first time in history, an -function attached to a character and analyzed its value at the boundary of convergence — a technique that would become the central engine of analytic number theory for the next two centuries. He is equally known for the modern definition of a function as an arbitrary correspondence, the Dirichlet pigeonhole principle, work on the convergence of Fourier series, and the Dirichlet unit theorem in algebraic number theory.
Why is the right hypothesis, rather than something about or being prime?
Coprimality is exactly the algebraic condition that prevents a fixed nontrivial common factor from dividing every term of the progression. If , then divides every term , so no term beyond itself can be prime — this is a purely elementary divisibility obstruction with nothing to do with primality of or individually. Conversely, when there is no such algebraic obstruction, and Dirichlet's theorem shows this necessary condition is also sufficient. Neither nor needs to be prime: e.g. has and the class does contain infinitely many primes, even though neither nor is prime.
Does Dirichlet's theorem tell us anything about gaps between primes in a progression, like twin primes analogues?
No — Dirichlet's theorem and its quantitative form are about density and infinitude, not about gaps or specific patterns within a single class. Questions about, say, the smallest prime in a progression (Linnik's theorem gives a polynomial bound in ), or about primes in a progression that are also close together, require separate and substantially harder machinery (large sieve methods, zero-density estimates for -functions, or in the twin-primes-style direction, results in the spirit of the Green–Tao theorem on arithmetic progressions of primes, which is a different and unrelated statement about primes forming progressions, not primes lying inside a fixed progression).
What exactly is "Chebyshev's bias" and does it contradict the equidistribution claim?
Chebyshev observed empirically that tends to exceed for most (though not all) values of , suggesting classes containing quadratic non-residues mod have a slight statistical edge at moderate . This does not contradict Dirichlet's quantitative theorem: the theorem is a statement about the limit , a first-order asymptotic, while Chebyshev's bias is a genuine but much smaller, second-order oscillation superimposed on that limit. Both are true simultaneously; the bias eventually reverses infinitely often (proven under reasonable hypotheses related to the Prime Number Theorem's error term), consistent with the limiting ratio still being exactly .
Why can't we just adapt Euclid's proof of infinitude of primes to every progression, as we did for ?
Euclid-style arguments work by constructing an auxiliary number forced to have a prime factor in the target class, using a clever multiplicative identity specific to that class (e.g., a product of primes , minus , is and can be shown to need a prime factor in that class). Such tricks exist for a handful of classes across small moduli (the classes , for instance, admit elementary proofs), but no such trick is known that works uniformly across all admissible classes and moduli — the obstruction is genuinely deep, connected to whether certain quadratic residue symbols behave multiplicatively in the needed way, and in general there is no known elementary substitute for the -function machinery.
What role does the Euler totient function play beyond just counting admissible classes?
Beyond counting the classes coprime to (as in The Euler Totient Function), is exactly the order of the character group mod , which is what makes the orthogonality relations — and hence the normalization constant in both the class-isolating formula and the final density — appear. The quantity is thus doing double duty: it is simultaneously "number of coprime residues" and "number of Dirichlet characters mod ," and these two roles are what force the density of each admissible class to be rather than some other normalization.
Is the qualitative theorem (infinitude) strictly weaker than the quantitative form (density )?
Yes, strictly. The quantitative form immediately implies the qualitative one (a class with positive asymptotic density certainly contains infinitely many primes), but the converse implication does not hold in general — infinitude alone says nothing about the rate of growth or the relative proportions among classes. Historically, Dirichlet's original 1837 argument already established a divergence statement equivalent in strength to as , close to but not identical to the sharp asymptotic ; the fully quantitative Prime Number Theorem for arithmetic progressions came later, once the Prime Number Theorem's own proof technique (contour methods, zero-free regions for ) was adapted to Dirichlet -functions.
Does the theorem need the Generalized Riemann Hypothesis?
No. Both the qualitative theorem (infinitude) and the quantitative asymptotic form stated here are unconditional theorems, proved without any Riemann Hypothesis assumption, using only nonvanishing of on the line (the analogue of ). GRH-type hypotheses become relevant only when one wants much sharper error terms in the asymptotic — for instance uniform bounds valid as grows together with (as in the Siegel–Walfisz theorem, and conjecturally far better under GRH) — but the basic statement of the theorem requires no unproven hypothesis.