Primes in Arithmetic Progressions: Statement

Take the arithmetic progression 1,5,9,13,17,21,…1, 5, 9, 13, 17, 21, \dots. These are numbers congruent to 1  41 \bmod 4. Does it contain infinitely many primes? What about 3,7,11,15,19,…3, 7, 11, 15, 19, \dots, the class 3  43 \bmod 4? 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 LL-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 LL-function to a character. It studied that function's behavior at s=1s=1. This template was later generalized enormously (Dedekind zeta functions, Artin LL-functions, automorphic LL-functions). The big picture is this: fix a modulus q≥1q \geq 1. Consider the ϕ(q)\phi(q) residue classes a  qa \bmod q with gcd⁡(a,q)=1\gcd(a,q)=1. These are exactly the classes that can contain infinitely many primes. Any other class a  qa \bmod q with gcd⁡(a,q)=d>1\gcd(a,q) = d > 1 consists of numbers all divisible by dd. Such a class hence contains at most one prime. Dirichlet's theorem asserts that each of these ϕ(q)\phi(q) 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 1/ϕ(q)1/\phi(q) among all primes. This article states the qualitative theorem and its quantitative strengthening precisely. It explains the role of Dirichlet characters and LL-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 LL-functions. Here we make its logical role in the argument completely explicit.

Key takeaways
  • Fix q≥1q \geq 1. The residue class a  qa \bmod q can contain infinitely many primes only if gcd⁡(a,q)=1\gcd(a,q)=1; there are ϕ(q)\phi(q) such classes.
  • Dirichlet's theorem: every class a  qa \bmod q with gcd⁡(a,q)=1\gcd(a,q)=1 contains infinitely many primes.
  • The quantitative form: π(x;q,a)∼1ϕ(q)xlog⁡x\pi(x; q, a) \sim \dfrac{1}{\phi(q)} \dfrac{x}{\log x} as x→∞x \to \infty, for each fixed qq and each admissible aa.
  • Proof strategy: attach a Dirichlet character χ  q\chi \bmod q to an LL-function L(s,χ)=∑χ(n)n−sL(s,\chi) = \sum \chi(n) n^{-s}; orthogonality of characters isolates a single residue class.
  • The crux is nonvanishing: L(1,χ)≠0L(1,\chi) \neq 0 for every nontrivial character χ\chi — this is what makes the class-isolating sum finite rather than divergent.
  • We prove the qualitative theorem in full for q=4q=4 (infinitude of primes ≡1\equiv 1 and ≡3  4\equiv 3 \bmod 4), exhibiting every step of the character/LL-function machinery in miniature.
  • Key idea: Dirichlet characters convert "which residue class" into "which linear combination of LL-functions," and L(1,χ)≠0L(1,\chi)\neq 0 converts that combination into a genuine, non-cancelling contribution from every admissible class.

Where this lives today

The character/LL-function technique introduced for this theorem is the direct ancestor of the entire modern apparatus of LL-functions: Dedekind zeta functions of number fields, Artin LL-functions attached to Galois representations, automorphic LL-functions in the Langlands program, and elliptic curve LL-functions in the Birch–Swinnerton-Dyer conjecture all generalize the pattern "attach an LL-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 1/ϕ(q)1/\phi(q) 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 L(1,χ)≠0L(1,\chi) \neq 0 get proved for a general Dirichlet character, and how does it connect to class numbers of quadratic fields?

DefinitionDirichlet characters, Dirichlet LL-functions, and the counting function π(x;q,a)\pi(x;q,a)

Let q≥1q \geq 1 be an integer.

Dirichlet character. A Dirichlet character modulo qq is a function χ:Z→C\chi : \mathbb{Z} \to \mathbb{C} such that: 1. χ(n+q)=χ(n)\chi(n+q) = \chi(n) for all nn (periodicity mod qq); 2. χ(n)=0\chi(n) = 0 if gcd⁡(n,q)>1\gcd(n,q) > 1, and χ(n)≠0\chi(n) \neq 0 if gcd⁡(n,q)=1\gcd(n,q)=1; 3. χ(mn)=χ(m)χ(n)\chi(mn) = \chi(m)\chi(n) for all m,nm,n (complete multiplicativity). Equivalently, χ\chi is induced by a group homomorphism (Z/qZ)×→C×(\mathbb{Z}/q\mathbb{Z})^\times \to \mathbb{C}^\times, extended by zero to non-units. The set of Dirichlet characters mod qq forms a group G^\widehat{G} under pointwise multiplication, isomorphic to G=(Z/qZ)×G = (\mathbb{Z}/q\mathbb{Z})^\times, of order ϕ(q)\phi(q). The character χ0\chi_0 with χ0(n)=1\chi_0(n) = 1 for gcd⁡(n,q)=1\gcd(n,q)=1 and χ0(n)=0\chi_0(n)=0 otherwise is the principal character.

Orthogonality relations. For gcd⁡(a,q)=gcd⁡(b,q)=1\gcd(a,q) = \gcd(b,q) = 1,

∑χ  qχ(a)χ(b)‾=ϕ(q)⋅[a≡b(modq)],\sum_{\chi \bmod q} \chi(a)\overline{\chi(b)} = \phi(q) \cdot [a \equiv b \pmod q],

and for any two characters χ,ψ  q\chi,\psi \bmod q,

∑n=1qχ(n)ψ(n)‾=ϕ(q)⋅[χ=ψ].\sum_{n=1}^{q} \chi(n)\overline{\psi(n)} = \phi(q)\cdot[\chi = \psi].

In particular, taking b=1b=1, for gcd⁡(a,q)=1\gcd(a,q)=1:

[n≡a(modq)]=1ϕ(q)∑χ  qχ(a)‾ χ(n),(gcd⁡(n,q)=1).[n \equiv a \pmod q] = \frac{1}{\phi(q)} \sum_{\chi \bmod q} \overline{\chi(a)} \, \chi(n), \qquad (\gcd(n,q)=1).

Dirichlet LL-function. For a Dirichlet character χ  q\chi \bmod q, define for Re⁡(s)>1\operatorname{Re}(s) > 1

L(s,χ)=∑n=1∞χ(n)ns=∏p(1−χ(p)ps)−1,L(s,\chi) = \sum_{n=1}^{\infty} \frac{\chi(n)}{n^s} = \prod_{p} \left(1 - \frac{\chi(p)}{p^s}\right)^{-1},

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 χ=χ0\chi = \chi_0 is principal mod qq, then L(s,χ0)L(s,\chi_0) agrees with ζ(s)\zeta(s) up to removing the Euler factors at primes p∣qp \mid q:

L(s,χ0)=ζ(s)∏p∣q(1−p−s).L(s,\chi_0) = \zeta(s) \prod_{p \mid q} \left(1 - p^{-s}\right).

If χ≠χ0\chi \neq \chi_0, L(s,χ)L(s,\chi) extends to an entire function on Re⁡(s)>0\operatorname{Re}(s) > 0 (indeed to all of C\mathbb C), because the partial sums ∑n≤Nχ(n)\sum_{n \le N} \chi(n) are bounded (they vanish over each full period of length qq), which lets partial summation control the tail of the series for Re⁡(s)>0\operatorname{Re}(s) > 0.

Prime-counting function in a progression. For gcd⁡(a,q)=1\gcd(a,q)=1, set

π(x;q,a)=#{p≤x:p prime, p≡a(modq)}.\pi(x; q, a) = \#\{p \le x : p \text{ prime},\ p \equiv a \pmod q\}.

Intuition — prose building the mental picture

Think of the integers laid along a number line and colored by residue mod qq. Fixing q=4q=4, the primes larger than 22 must be odd, so they fall into the class 1  41 \bmod 4 or the class 3  43 \bmod 4 — never 00 or 2  42 \bmod 4, since those are even. The question "are there infinitely many primes ≡3(mod4)\equiv 3 \pmod 4" is answered by a short, classical Euclid-style trick (shown below). But "are there infinitely many primes ≡1(mod4)\equiv 1 \pmod 4" already resists elementary tricks in general moduli, and for a general modulus qq and general admissible residue aa, 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 qq is, by the orthogonality relations, an average of characters χ(n)\chi(n) — the characters are the "harmonics" on the finite abelian group (Z/qZ)×(\mathbb{Z}/q\mathbb{Z})^\times. Summing log⁡p\log p over primes in a fixed class becomes a linear combination of sums ∑pχ(p)log⁡p/ps\sum_p \chi(p)\log p / p^s over all characters χ\chi mod qq, weighted by χ(a)‾\overline{\chi(a)}. Each such character sum is controlled by the corresponding LL-function via −L′(s,χ)/L(s,χ)=∑nΛ(n)χ(n)n−s-L'(s,\chi)/L(s,\chi) = \sum_n \Lambda(n)\chi(n) n^{-s}. The trivial character's LL-function is ζ(s)\zeta(s) in disguise, which has a genuine pole at s=1s=1 — this pole is the source of the primes, exactly as in the ordinary Prime Number Theorem. Every other character's LL-function must, crucially, be nonzero at s=1s=1; otherwise its logarithmic derivative would itself have a pole there, contributing spurious poles that could cancel the one real pole coming from χ0\chi_0, and the argument would give no primes at all in the class.

Figure
Distributing primes mod 4: the two admissible classes and orthogonality of characters
Primes mod 4, up to x = 40 (excluding p = 2) n 1 40 3 5 7 11 13 17 19 23 29 31 ● red = 3 (mod 4) ● blue = 1 (mod 4) count so far: 3 mod 4 → 6 primes, 1 mod 4 → 5 primes (roughly even split) Orthogonality (q=4): [n ≡ 1] = ½( χ₀(n) + χ(n) ), [n ≡ 3] = ½( χ₀(n) − χ(n) ) where χ(n) is the nonprincipal character mod 4: χ(1)=1, χ(3)=−1, χ(2)=χ(0)=0. L(s,χ) = 1 − 3⁻ˢ + 5⁻ˢ − 7⁻ˢ + … Need: this does NOT vanish at s = 1.

The central theorems

TheoremDirichlet's theorem on primes in arithmetic progressions

Let q≥1q \geq 1 and aa be integers with gcd⁡(a,q)=1\gcd(a,q) = 1. Then the arithmetic progression

a, a+q, a+2q, a+3q, …a,\ a+q,\ a+2q,\ a+3q,\ \dots

contains infinitely many primes.

TheoremQuantitative form: Prime Number Theorem for arithmetic progressions

Let q≥1q \geq 1 be fixed and let aa be an integer with gcd⁡(a,q)=1\gcd(a,q) = 1. Then

π(x;q,a)∼1ϕ(q)⋅xlog⁡x(x→∞),\pi(x; q, a) \sim \frac{1}{\phi(q)} \cdot \frac{x}{\log x} \qquad (x \to \infty),

i.e. lim⁡x→∞π(x;q,a)⋅ϕ(q)log⁡xx=1\displaystyle \lim_{x \to \infty} \pi(x;q,a) \cdot \frac{\phi(q) \log x}{x} = 1. Equivalently, since π(x)∼x/log⁡x\pi(x) \sim x/\log x by The Prime Number Theorem: Statement and Heuristics,

lim⁡x→∞π(x;q,a)π(x)=1ϕ(q)\lim_{x \to \infty} \frac{\pi(x;q,a)}{\pi(x)} = \frac{1}{\phi(q)}

for every fixed admissible residue a  qa \bmod q: the primes are asymptotically equidistributed among the ϕ(q)\phi(q) admissible classes.

Both statements require gcd⁡(a,q)=1\gcd(a,q)=1: this is not a simplifying convenience but a genuine necessary condition, verified next.

LemmaNecessity of the coprimality hypothesis

If gcd⁡(a,q)=d>1\gcd(a,q) = d > 1, then the progression a,a+q,a+2q,…a, a+q, a+2q, \dots contains at most one prime.

Proof

Every term of the progression has the form a+kqa + kq for k≥0k \geq 0. Since d∣ad \mid a and d∣qd \mid q, we get d∣(a+kq)d \mid (a+kq) for every kk. So every term of the progression is divisible by d>1d > 1. A term a+kqa+kq is prime only if it equals dd itself (the only way an integer divisible by d>1d>1 can be prime is if the integer is dd, forcing the cofactor to be 11). Since a+kqa + kq is a strictly increasing function of kk for q≥1q \geq 1, at most one value of kk can give a+kq=da+kq = d. Hence at most one term of the progression is prime. ■\blacksquare

∎

This is why Dirichlet's theorem is stated only for gcd⁡(a,q)=1\gcd(a,q)=1: it is exactly the boundary case where the elementary divisibility obstruction from the lemma disappears, and the number of admissible classes is precisely ϕ(q)\phi(q), explaining why ϕ(q)\phi(q) appears as the equidistribution denominator. We now prove the qualitative theorem completely for q=4q = 4, which contains, in miniature, every structural ingredient of the general proof (character orthogonality, an LL-function for each character, the pole of ζ\zeta at χ0\chi_0, and nonvanishing of L(1,χ)L(1,\chi) for χ≠χ0\chi \neq \chi_0), while remaining fully elementary and self-contained — no properties of L(1,χ)L(1,\chi) beyond what we prove by hand are used.

TheoremDirichlet's theorem for modulus 4

There are infinitely many primes ≡1(mod4)\equiv 1 \pmod 4, and infinitely many primes ≡3(mod4)\equiv 3 \pmod 4.

Proof

Step 1: primes ≡3(mod4)\equiv 3 \pmod 4 (elementary, Euclid-style). Suppose for contradiction there are only finitely many, say p1,…,prp_1, \dots, p_r (all odd, all ≡3  4\equiv 3 \bmod 4; possibly r=0r=0). Consider

N=4p1p2⋯pr−1.N = 4p_1p_2\cdots p_r - 1.

Then N≡3(mod4)N \equiv 3 \pmod 4 and N>1N > 1 (if r=0r=0, N=−1N=-1; discard that degenerate case by first checking 33 itself is such a prime, so r≥1r \geq 1 always). Since NN is odd, every prime factor of NN is odd, hence ≡1\equiv 1 or 3(mod4)3 \pmod 4. Not all prime factors can be ≡1(mod4)\equiv 1 \pmod 4: a product of numbers each ≡1(mod4)\equiv 1 \pmod 4 is again ≡1(mod4)\equiv 1 \pmod 4 (since 1⋅1≡11 \cdot 1 \equiv 1), but N≡3(mod4)N \equiv 3 \pmod 4. So NN has at least one prime factor p≡3(mod4)p \equiv 3 \pmod 4. This pp cannot be any of p1,…,prp_1,\dots,p_r, since p∣Np \mid N but pi∣(N+1)p_i \mid (N+1), so pi∤Np_i \nmid N (as pi≥3>1p_i \geq 3 > 1). This contradicts that p1,…,prp_1,\dots,p_r was the complete list. Hence there are infinitely many primes ≡3(mod4)\equiv 3 \pmod 4.

Step 2: primes ≡1(mod4)\equiv 1 \pmod 4 (character/LL-function method). Define the nonprincipal character mod 44:

χ(n)={0n even1n≡1(mod4)−1n≡3(mod4).\chi(n) = \begin{cases} 0 & n \text{ even} \\ 1 & n \equiv 1 \pmod 4 \\ -1 & n \equiv 3 \pmod 4. \end{cases}

One checks directly χ(mn)=χ(m)χ(n)\chi(mn) = \chi(m)\chi(n) for all m,nm,n (verify on the four residues mod 4; e.g. χ(3)χ(3)=(−1)(−1)=1=χ(9)=χ(1)\chi(3)\chi(3) = (-1)(-1) = 1 = \chi(9) = \chi(1)), so χ\chi is indeed a Dirichlet character mod 44, and it is the unique nonprincipal one since (Z/4Z)×≅Z/2Z(\mathbb{Z}/4\mathbb{Z})^\times \cong \mathbb{Z}/2\mathbb{Z} has exactly 22 characters. Form

L(s,χ)=∑n=1∞χ(n)ns=1−13s+15s−17s+19s−⋯ ,Re⁡(s)>0,L(s,\chi) = \sum_{n=1}^\infty \frac{\chi(n)}{n^s} = 1 - \frac{1}{3^s} + \frac{1}{5^s} - \frac{1}{7^s} + \frac{1}{9^s} - \cdots, \qquad \operatorname{Re}(s) > 0,

where convergence for Re⁡(s)>0\operatorname{Re}(s) > 0 (not just >1> 1) holds because the partial sums of χ(n)\chi(n) are bounded by 11 (they telescope in pairs +1−1+1-1), so Dirichlet's test for series applies. In particular the series converges (conditionally) at s=1s=1:

L(1,χ)=1−13+15−17+⋯=π4L(1,\chi) = 1 - \frac13 + \frac15 - \frac17 + \cdots = \frac{\pi}{4}

(the Leibniz series for π/4\pi/4; this exact value is not needed below, only that L(1,χ)≠0L(1,\chi) \neq 0, which follows since the series is a nonzero alternating series with strictly decreasing terms — its value lies strictly between the first partial sum 11 and the second 1−1/3=2/31 - 1/3 = 2/3, so L(1,χ)∈[2/3,1]L(1,\chi) \in [2/3, 1] , in particular L(1,χ)≠0L(1,\chi) \ne 0). Nonvanishing of L(1,χ)L(1,\chi), self-contained. For an alternating series ∑(−1)kbk\sum (-1)^k b_k with bk=1/(4k+1)b_k = 1/(4k+1) or 1/(4k+3)1/(4k+3) strictly decreasing to 00, the partial sums oscillate with strictly shrinking amplitude and the limit lies strictly between any two consecutive partial sums. Concretely S2=1−1/3=2/3≤L(1,χ)≤1=S1S_2 = 1 - 1/3 = 2/3 \leq L(1,\chi) \leq 1 = S_1. Hence L(1,χ)>0L(1,\chi) > 0; in particular L(1,χ)≠0L(1,\chi) \neq 0. 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 Re⁡(s)>1\operatorname{Re}(s) > 1, both ζ(s)=∑n−s\zeta(s)=\sum n^{-s} and L(s,χ)L(s,\chi) have absolutely convergent Euler products (as in Dirichlet Series and Euler Products):

ζ(s)=∏p(1−p−s)−1,L(s,χ)=∏p(1−χ(p)p−s)−1.\zeta(s) = \prod_p (1-p^{-s})^{-1}, \qquad L(s,\chi) = \prod_p (1 - \chi(p)p^{-s})^{-1}.

Taking logarithms (valid termwise for Re⁡(s)>1\operatorname{Re}(s)>1 since each factor is close to 11) and differentiating in ss:

−ζ′(s)ζ(s)=∑plog⁡pps−1=:∑nΛ(n)ns,−L′(s,χ)L(s,χ)=∑nΛ(n)χ(n)ns,-\frac{\zeta'(s)}{\zeta(s)} = \sum_{p} \frac{\log p}{p^s - 1} =: \sum_n \frac{\Lambda(n)}{n^s}, \qquad -\frac{L'(s,\chi)}{L(s,\chi)} = \sum_n \frac{\Lambda(n)\chi(n)}{n^s},

where Λ\Lambda is the von Mangoldt function, and the second identity uses complete multiplicativity of χ\chi exactly as the first uses multiplicativity implicit in the Euler product for ζ\zeta. Isolating the class 1  41 \bmod 4 by orthogonality. For odd nn (i.e. gcd⁡(n,4)=1\gcd(n,4)=1), orthogonality of the two characters mod 44 gives

[n≡1 ⁣ ⁣(mod4)]=12(1+χ(n)),[n≡3 ⁣ ⁣(mod4)]=12(1−χ(n)),[n \equiv 1 \!\!\pmod 4] = \frac{1}{2}\big(1 + \chi(n)\big), \qquad [n \equiv 3\!\!\pmod4] = \frac{1}{2}\big(1 - \chi(n)\big),

which is immediate from χ(n)=±1\chi(n) = \pm 1 on odd nn. Hence, restricting the von Mangoldt sum to prime powers (only primes pp and no higher powers matter asymptotically, since ∑p∑k≥2p−kslog⁡p\sum_p \sum_{k\geq2} p^{-ks}\log p converges absolutely for Re⁡(s)>1/2\operatorname{Re}(s) > 1/2 and is therefore bounded as s→1+s \to 1^+):

∑p≡1(4)log⁡pps=12∑p oddlog⁡pps+12∑p oddχ(p)log⁡pps+O(1)\sum_{p \equiv 1 (4)} \frac{\log p}{p^s} = \frac12 \sum_{p \text{ odd}} \frac{\log p}{p^s} + \frac12 \sum_{p\text{ odd}} \frac{\chi(p)\log p}{p^s} + O(1)

as s→1+s \to 1^+, where the two main sums are, up to the bounded prime-power corrections above,

12(−ζ′(s)ζ(s))+12(−L′(s,χ)L(s,χ))+O(1).\frac12\left(-\frac{\zeta'(s)}{\zeta(s)}\right) + \frac12 \left(-\frac{L'(s,\chi)}{L(s,\chi)}\right) + O(1).

Behavior as s→1+s \to 1^+. Since ζ(s)\zeta(s) has a simple pole at s=1s=1 with residue 11 (standard fact used already in the The Prime Number Theorem: Statement and Heuristics discussion), we have ζ(s)∼(s−1)−1\zeta(s) \sim (s-1)^{-1} near s=1s=1, so

−ζ′(s)ζ(s)=1s−1+O(1)→+∞ as s→1+.-\frac{\zeta'(s)}{\zeta(s)} = \frac{1}{s-1} + O(1) \quad \to \quad +\infty \text{ as } s \to 1^+.

Since L(s,χ)L(s,\chi) is continuous at s=1s=1 (it is given there by a convergent series, as shown above) and L(1,χ)≠0L(1,\chi) \neq 0, the function L′(s,χ)/L(s,χ)L'(s,\chi)/L(s,\chi) is continuous and finite at s=1s=1 — in particular it stays bounded as s→1+s \to 1^+. Therefore

∑p≡1(4)log⁡pps=12(s−1)+O(1)⟶+∞as s→1+.\sum_{p \equiv 1 (4)} \frac{\log p}{p^s} = \frac{1}{2(s-1)} + O(1) \quad \longrightarrow \quad +\infty \qquad \text{as } s \to 1^+.

Conclusion. If there were only finitely many primes ≡1(mod4)\equiv 1 \pmod 4, the sum ∑p≡1(4)(log⁡p)p−s\sum_{p \equiv 1(4)} (\log p) p^{-s} would be a finite sum of continuous functions of ss, hence would converge to a finite number as s→1+s \to 1^+. This contradicts the divergence just established. Hence there are infinitely many primes ≡1(mod4)\equiv 1 \pmod 4. ■\blacksquare

∎

The proof technique used above — analytic continuation of an Euler product's logarithmic derivative, combined with the nonvanishing of L(1,χ)L(1,\chi) to isolate a divergent contribution — is exactly the technique in the general proof of Dirichlet's theorem. In general modulus qq, one runs the identical argument with all ϕ(q)\phi(q) characters mod qq simultaneously:

∑p≡a(q)log⁡pps=1ϕ(q)∑χ  qχ(a)‾(−L′(s,χ)L(s,χ))+O(1),\sum_{p \equiv a (q)} \frac{\log p}{p^s} = \frac{1}{\phi(q)}\sum_{\chi \bmod q} \overline{\chi(a)} \left(-\frac{L'(s,\chi)}{L(s,\chi)}\right) + O(1),

and the same dichotomy occurs: the principal character χ0\chi_0 contributes the divergent ζ\zeta-pole term 1ϕ(q)⋅1s−1+O(1)\frac{1}{\phi(q)}\cdot\frac{1}{s-1} + O(1), while every nonprincipal χ\chi contributes a bounded term provided L(1,χ)≠0L(1,\chi) \neq 0. The nonvanishing L(1,χ)≠0L(1,\chi) \neq 0 for a general nonprincipal character mod qq (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 ζ(s)\zeta(s) and all L(s,χ)L(s,\chi) for complex characters), properly the subject of a dedicated treatment of Dirichlet LL-functions and is treated as the key external input for the general theorem here.

CorollarySum of reciprocals of primes in a class diverges

For gcd⁡(a,q)=1\gcd(a,q)=1, ∑p≡a(q)p≤x1p=1ϕ(q)log⁡log⁡x+O(1)\displaystyle \sum_{\substack{p \equiv a (q) \\ p \le x}} \frac{1}{p} = \frac{1}{\phi(q)}\log\log x + O(1) as x→∞x \to \infty; in particular ∑p≡a(q)1/p\sum_{p \equiv a(q)} 1/p diverges, a quantitative strengthening of infinitude.

Proof

This follows from the same pole/nonvanishing dichotomy applied to log⁡ζ(s)\log \zeta(s) and log⁡L(s,χ)\log L(s,\chi) in place of their logarithmic derivatives, using log⁡ζ(s)=log⁡1s−1+O(1)\log\zeta(s) = \log\frac{1}{s-1} + O(1) near s=1s=1 and Mertens-type partial summation to pass from the Dirichlet-series statement to the explicit log⁡log⁡x\log\log x asymptotic; the details mirror Mertens' second theorem for ζ(s)\zeta(s) itself and are omitted here as they parallel the proof above verbatim with log⁡\log replacing −′/-{}'/{}.

∎

Worked examples

Example 1: modulus 5, exhibiting all four Dirichlet characters and orthogonality by hand. Let q=5q = 5. Then (Z/5Z)×={1,2,3,4}(\mathbb{Z}/5\mathbb{Z})^\times = \{1,2,3,4\} is cyclic of order 44, generated by g=2g=2 (21=2,22=4,23=3,24=12^1=2, 2^2=4, 2^3=3, 2^4=1). The four characters χj\chi_j, j=0,1,2,3j=0,1,2,3, are determined by χj(2)=ij\chi_j(2) = i^j where i=−1i = \sqrt{-1}:

nn11223344
χ0(n)\chi_0(n)11111111
χ1(n)\chi_1(n)11ii−i-i−1-1
χ2(n)\chi_2(n)11−1-1−1-111
χ3(n)\chi_3(n)11−i-iii−1-1

(Here χ2\chi_2 is the unique real nonprincipal character, the Legendre-symbol character mod 5; χ1,χ3\chi_1,\chi_3 are complex conjugates of each other.) Let us verify orthogonality isolates n≡2(mod5)n \equiv 2 \pmod 5 correctly:

14∑j=03χj(2)‾ χj(n).\frac{1}{4}\sum_{j=0}^3 \overline{\chi_j(2)}\,\chi_j(n).

At n=2n=2: χ0(2)‾χ0(2)+χ1(2)‾χ1(2)+χ2(2)‾χ2(2)+χ3(2)‾χ3(2)=1⋅1+iˉ⋅i+(−1)(−1)+(−i)‾⋅(−i)=1+1+1+1=4\overline{\chi_0(2)}\chi_0(2) + \overline{\chi_1(2)}\chi_1(2) + \overline{\chi_2(2)}\chi_2(2)+\overline{\chi_3(2)}\chi_3(2) = 1\cdot1 + \bar i \cdot i + (-1)(-1) + \overline{(-i)}\cdot(-i) = 1 + 1 + 1 + 1 = 4, giving 14⋅4=1\frac14 \cdot 4 = 1. ✓. At n=3n=3: χ0(2)‾χ0(3)+χ1(2)‾χ1(3)+χ2(2)‾χ2(3)+χ3(2)‾χ3(3)=1⋅1+iˉ(−i)+(−1)(−1)+(−i)‾(i)=1+(−i)(−i)+1+i(i)\overline{\chi_0(2)}\chi_0(3) + \overline{\chi_1(2)}\chi_1(3) + \overline{\chi_2(2)}\chi_2(3) + \overline{\chi_3(2)}\chi_3(3) = 1\cdot 1 + \bar i(-i) + (-1)(-1) + \overline{(-i)}(i) = 1 + (-i)(-i) + 1 + i(i). Let us be careful: iˉ=−i\bar i = -i, so χ1(2)‾χ1(3)=(−i)(−i)=i2=−1\overline{\chi_1(2)}\chi_1(3) = (-i)(-i) = i^2 = -1. And χ3(2)‾=−i‾=i\overline{\chi_3(2)} = \overline{-i} = i, so χ3(2)‾χ3(3)=i⋅i=i2=−1\overline{\chi_3(2)}\chi_3(3) = i \cdot i = i^2 = -1. Total: 1+(−1)+1+(−1)=01 + (-1) + 1 + (-1) = 0, giving 14⋅0=0\frac14 \cdot 0 = 0. ✓ matches [3≡2(mod5)]=0[3 \equiv 2 \pmod 5] = 0. This confirms concretely, in a modulus with genuinely complex characters (unlike the q=4q=4 case, which only involved real values ±1\pm1), that the orthogonality relation used in the proof correctly isolates a single class. Extending Step 2 of the q=4q=4 proof to q=5q=5 would require establishing L(1,χj)≠0L(1,\chi_j) \neq 0 for j=1,2,3j=1,2,3 — routine for χ2\chi_2 (real character; class-number-type positivity) but requiring the general complex-character nonvanishing argument for χ1,χ3\chi_1,\chi_3.

Example 2: numerically checking equidistribution, q=10q=10, up to x=200x = 200. The admissible residues mod 1010 are a∈{1,3,7,9}a \in \{1,3,7,9\} (coprime to 1010), so ϕ(10)=4\phi(10)=4 and Dirichlet's theorem predicts each class holds asymptotically 1/41/4 of all primes >5>5. Primes up to 200200 (excluding 2,52,5, the non-admissible small primes): there are 4646 primes below 200200 total, minus the two exceptions 2,52,5, leaving 4444 primes distributed among the four classes. Direct counting gives:

  • p≡1(mod10)p \equiv 1 \pmod{10}: 11,31,41,61,71,101,131,151,181,19111, 31, 41, 61, 71, 101, 131, 151, 181, 191 — count 1010.
  • p≡3(mod10)p \equiv 3 \pmod{10}: 3,13,23,43,53,73,83,103,113,163,173,1933, 13, 23, 43, 53, 73, 83, 103, 113, 163, 173, 193 — count 1212.
  • p≡7(mod10)p \equiv 7 \pmod{10}: 7,17,37,47,67,97,107,127,137,157,167,1977, 17, 37, 47, 67, 97, 107, 127, 137, 157, 167, 197 — count 1212.
  • p≡9(mod10)p \equiv 9 \pmod{10}: 19,29,59,79,89,109,139,149,179,19919, 29, 59, 79, 89, 109, 139, 149, 179, 199 — count 1010.

Total 10+12+12+10=4410+12+12+10 = 44. ✓ matches the total count. Each class has roughly 44/4=1144/4 = 11 primes; the actual counts 10,12,12,1010,12,12,10 are close, illustrating equidistribution as a limiting statement — at this small range x=200x=200 the fluctuation is still visible (this is the beginning of the phenomenon called Chebyshev's bias, where classes containing quadratic non-residues mod qq tend to lead slightly more often at small xx, a second-order effect entirely consistent with, and not contradicting, the first-order asymptotic π(x;10,a)∼14π(x)\pi(x;10,a) \sim \frac14 \pi(x) that Dirichlet's quantitative theorem guarantees only in the limit).

CounterexampleWhy gcd⁡(a,q)=1\gcd(a,q)=1 cannot be dropped

Take q=6q = 6, a=4a = 4; here gcd⁡(4,6)=2>1\gcd(4,6) = 2 > 1, violating the coprimality hypothesis. The progression is

4,10,16,22,28,34,40,…4, 10, 16, 22, 28, 34, 40, \dots

Every term equals 4+6k=2(2+3k)4 + 6k = 2(2+3k), manifestly even, hence divisible by 22. The only way such a term can be prime is if the term itself equals 22; but 4+6k=24+6k=2 forces k=−2/3∉Zk=-2/3\notin\mathbb Z — 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 66, only a∈{1,5}a\in\{1,5\} are coprime to 66 (since ϕ(6)=2\phi(6)=2), and indeed one checks 1,5  61,5\bmod 6 each contain infinitely many primes (7,13,19,31,…7,13,19,31,\dots and 5,11,17,23,29,41,…5,11,17,23,29,41,\dots) while a∈{0,2,3,4}  6a \in \{0,2,3,4\}\bmod 6 each contain at most one prime (namely none, none, the single prime 33, 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

SituationWhat holdsWhat fails / must be checked
gcd⁡(a,q)=1\gcd(a,q)=1Infinitely many primes ≡a(modq)\equiv a \pmod q (Dirichlet)—
gcd⁡(a,q)=d>1\gcd(a,q)=d>1At most one prime in the classTheorem's hypothesis excludes this case entirely
Fixed qq, x→∞x \to \inftyπ(x;q,a)∼x/(ϕ(q)log⁡x)\pi(x;q,a)\sim x/(\phi(q)\log x)Quantitative form requires qq fixed as x→∞x\to\infty; uniformity in qq growing with xx is the much harder Siegel–Walfisz / GRH-type territory
Small xxClasses need not be close to equal"Chebyshev's bias": classes containing quadratic non-residues mod qq tend to lead at small xx; asymptotic equality is a limit statement only
q=1q=1Reduces to ordinary PNT π(x)∼x/log⁡x\pi(x)\sim x/\log xϕ(1)=1\phi(1)=1, single class = all integers, consistent but trivial case
Nonprincipal character χ\chi mod qqL(1,χ)L(1,\chi) finite and generally nonzeroNonvanishing L(1,χ)≠0L(1,\chi)\ne0 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
PG
Peter Gustav Lejeune Dirichlet
1805–1859 · Prussia/German states

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 LL-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.

History
- 1805 — born in Düren, then part of the French Empire.
- 1825 — proves a special case of Fermat's Last Theorem for exponent 55.
- 1837 — publishes the theorem on primes in arithmetic progressions, introducing LL-functions and character sums.
- 1855 — succeeds Gauss as professor at Göttingen.
- 1859 — dies in Göttingen; his lecture notes on number theory, edited by Dedekind, become the classic Vorlesungen über Zahlentheorie.
Why is gcd⁡(a,q)=1\gcd(a,q)=1 the right hypothesis, rather than something about aa or qq being prime?

Coprimality is exactly the algebraic condition that prevents a fixed nontrivial common factor from dividing every term of the progression. If d=gcd⁡(a,q)>1d=\gcd(a,q)>1, then dd divides every term a+kqa+kq, so no term beyond dd itself can be prime — this is a purely elementary divisibility obstruction with nothing to do with primality of aa or qq individually. Conversely, when gcd⁡(a,q)=1\gcd(a,q)=1 there is no such algebraic obstruction, and Dirichlet's theorem shows this necessary condition is also sufficient. Neither aa nor qq needs to be prime: e.g. a=8,q=15a=8, q=15 has gcd⁡(8,15)=1\gcd(8,15)=1 and the class 8  158 \bmod 15 does contain infinitely many primes, even though neither 88 nor 1515 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 qq), or about primes in a progression that are also close together, require separate and substantially harder machinery (large sieve methods, zero-density estimates for LL-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 π(x;4,3)\pi(x;4,3) tends to exceed π(x;4,1)\pi(x;4,1) for most (though not all) values of xx, suggesting classes containing quadratic non-residues mod qq have a slight statistical edge at moderate xx. This does not contradict Dirichlet's quantitative theorem: the theorem is a statement about the limit π(x;q,a)/π(x)→1/ϕ(q)\pi(x;q,a)/\pi(x) \to 1/\phi(q), 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 1/ϕ(q)1/\phi(q).

Why can't we just adapt Euclid's proof of infinitude of primes to every progression, as we did for 3 mod 43 \bmod 4?

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 ≡3  4\equiv 3 \bmod 4, minus 11, is ≡3  4\equiv 3 \bmod 4 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 3,5,7  83,5,7 \bmod 8, 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 LL-function machinery.

What role does the Euler totient function ϕ(q)\phi(q) play beyond just counting admissible classes?

Beyond counting the ϕ(q)\phi(q) classes coprime to qq (as in The Euler Totient Function), ϕ(q)\phi(q) is exactly the order of the character group mod qq, which is what makes the orthogonality relations — and hence the 1/ϕ(q)1/\phi(q) normalization constant in both the class-isolating formula and the final density — appear. The quantity ϕ(q)\phi(q) is thus doing double duty: it is simultaneously "number of coprime residues" and "number of Dirichlet characters mod qq," and these two roles are what force the density of each admissible class to be 1/ϕ(q)1/\phi(q) rather than some other normalization.

Is the qualitative theorem (infinitude) strictly weaker than the quantitative form (density 1/ϕ(q)1/\phi(q))?

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 ∑p≡a(q)1/ps→∞\sum_{p\equiv a(q)} 1/p^s \to \infty as s→1+s\to1^+, close to but not identical to the sharp asymptotic π(x;q,a)∼x/(ϕ(q)log⁡x)\pi(x;q,a)\sim x/(\phi(q)\log x); 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 ζ\zeta) was adapted to Dirichlet LL-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 L(s,χ)L(s,\chi) on the line Re⁡(s)=1\operatorname{Re}(s)=1 (the analogue of ζ(1+it)≠0\zeta(1+it)\ne0). GRH-type hypotheses become relevant only when one wants much sharper error terms in the asymptotic — for instance uniform bounds valid as qq grows together with xx (as in the Siegel–Walfisz theorem, and conjecturally far better under GRH) — but the basic statement of the theorem requires no unproven hypothesis.

Before this