Skip to content

Dirichlet character ​

A periodic multiplicative label χ : ℤ → ℂ modulo N that equals 0 when gcd(n, N) > 1, takes roots of unity when gcd(n, N) = 1, and satisfies χ(ab) = χ(a)χ(b).

Diagram illustrating Dirichlet character
Diagram illustrating Dirichlet character.

Level 1 — First-Principles ​

Suppose you want to count primes that leave a specific remainder when divided by 4—for instance, primes of the form 4k+1 (5,13,17,29,…) versus 4k+3 (3,7,11,19,…). To separate those two residue classes without breaking multiplication, assign each integer a periodic weight repeating every 4 steps:

χ(n)={0if n is even,+1if n≡1(mod4),−1if n≡3(mod4).

Check what happens when you multiply two numbers: (4a+3)(4b+3)≡1(mod4), and (−1)(−1)=+1, so χ(mn)=χ(m)χ(n) holds for every pair of integers.

A rule χ that repeats with period N, maps every number sharing a common factor with N to 0, maps every number coprime to N to a point on the unit circle of the two-dimensional plane of real and imaginary coordinatescomplex plane, and obeys χ(mn)=χ(m)χ(n) is a Dirichlet character modulo N. Multiplying n−s by χ(n) builds a twisted family of functions whose zeros govern primes in arithmetic progressionsDirichlet L-function. Every character inherits its true minimal period from a unique underlying minimal-period character that cannot be factored through a smaller modulusprimitive character.

Limits of the intuition ​

The modulo-4 example takes only real values {−1,0,+1}, which makes a Dirichlet character look like a simple sign switch. For moduli such as N=5, the unit group (Z/5Z)× is cyclic of order 4, so characters take non-real values like i and −i; their L-functions need not be symmetric under real conjugation alone and instead pair χ with its inverse χ−1=χ― in the functional equation.

Level 2 — Undergrad Bridge ​

Algebraically, a Dirichlet character modulo N≥1 is a group homomorphism χ:(Z/NZ)×→C×, extended to a completely multiplicative arithmetic function χ:Z→C by setting χ(n)=χ(nmodN) when gcd(n,N)=1 and χ(n)=0 when gcd(n,N)>1. There are exactly φ(N) Dirichlet characters modulo N, forming a finite abelian group under pointwise multiplication whose identity element is the principal (trivial) character χ0 (taking value 1 on all units modulo N).

Two structural properties drive Stage 00:

  1. Orthogonality: For gcd(a,N)=1, 1φ(N)∑χmodNχ(a)―χ(n) equals 1 if n≡a(modN) and 0 otherwise. This filters arithmetic progressions n≡a(modN) into linear combinations of Dirichlet L-functions.
  2. Parity: Since (−1)2=1 in (Z/NZ)×, every character satisfies χ(−1)∈{+1,−1}. Characters with χ(−1)=1 are even and characters with χ(−1)=−1 are odd. Parity determines which gamma factor (Γ(s/2) versus Γ((s+1)/2)) enters the functional equation, and therefore which non-positive integers are trivial zeros.

Level 3 — Formal Lean Contract ​

In Mathlib4 (Mathlib.NumberTheory.DirichletCharacter.Basic), DirichletCharacter R N is defined as MulChar (ZMod N) R—a multiplicative character from ZMod N to a commutative monoid with zero R (taken as ℂ in Stage 00), automatically sending non-units to 0.

Stage 00 anchors Dirichlet characters in:

  • 00_statement/statements.lean#DirichletLNonvanishingRightOfHalf (upstream src/Statements.lean:10-12): quantifies over every modulus N : ℕ with [NeZero N] and every χ : DirichletCharacter ℂ N (likewise in DirichletLZerosOnLine at src/Statements.lean:14-16 and PrimitiveDirichletLZerosOnLine at src/Statements.lean:18-20).

For the parallel formal-conjectures statement wrapper (comparator/FormalConjecturesStatement.lean, archived on upstream alpoge@c900e67c2 pending re-integration on condensed main), DirichletCharacter.instDecidablePredOddOfDecidableEq_formalConjecturesForMathlib provided the exact named DecidablePred instance for χ.Odd (χ (-1) = -1) required by the if χ.Odd then ... else ... branch inside GRH.trivialZeros. See the page's live verification banner (audit/verification-status.json) for the currently pinned upstream snapshot and local Lean build status (build_status: unverified-locally).

Where this analogy breaks ​

Comparing a Dirichlet character to a simple alternating +1,−1 wave covers only real (quadratic) characters; in general, character values are complex roots of unity rotating around the unit circle, and values vanish on integers sharing a factor with the modulus N.

Formal Lean Anchors ​

def DirichletLNonvanishingRightOfHalf — Upstream source (src/Statements.lean L10-L12)

lean
def DirichletLNonvanishingRightOfHalf : Prop :=
  ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N) (s : ℂ),
    1 / 2 < s.re → (χ ≠ 1 ∨ s ≠ 1) → DirichletCharacter.LFunction χ s ≠ 0
  • complex plane — The two-dimensional coordinate plane of numbers s = σ + it, where the horizontal coordinate σ = Re(s) sets decay rate and the vertical coordinate t = Im(s) sets oscillation frequency.
  • Dirichlet L-function — The meromorphic continuation of ∑ χ(n) n⁻ˢ associated to a Dirichlet character χ, generalizing ζ(s) to track primes across residue classes modulo N.
  • primitive character — A Dirichlet character modulo q whose pattern does not come from any strictly smaller dividing modulus; its modulus q equals its minimal period (conductor).

Referenced By ​

Authoritative Sources ​

  • Beweis des Satzes, dass jede unbegrenzte arithmetische Progression... (paper) — P. G. L. Dirichlet, Abhandlungen der Königlichen Preussischen Akademie der Wissenschaften (1837), pp. 45–81.
  • Introduction to Analytic Number Theory (book) — T. M. Apostol, Springer Undergraduate Texts in Mathematics (1976), Chapter 6: Dirichlet Characters.
  • Mathlib4: DirichletCharacter (mathlib) — Mathlib.NumberTheory.DirichletCharacter.Basic (DirichletCharacter, DirichletCharacter.Odd, DirichletCharacter.Even, pinned mathlib rev 31ce06eaadf4a200c0e1407c5f10953cf606b8f8).

Page Glossary ​

complex plane
The two-dimensional coordinate plane of numbers s = σ + it, where the horizontal coordinate σ = Re(s) sets decay rate and the vertical coordinate t = Im(s) sets oscillation frequency.
Dirichlet L-function
The meromorphic continuation of ∑ χ(n) n⁻ˢ associated to a Dirichlet character χ, generalizing ζ(s) to track primes across residue classes modulo N.
primitive character
A Dirichlet character modulo q whose pattern does not come from any strictly smaller dividing modulus; its modulus q equals its minimal period (conductor).