The last-digit filter through the four characters mod 10
ProvedZetaMap.lastDigit_filteranalytic-number-theorydirichlet-l-functionsriemann-zeta-function
For coprime to and every : .
Preamble
import Mathlib open Complex DirichletCharacter ArithmeticFunction
Formal statement
namespace ZetaMap
theorem lastDigit_filter {a : ℕ} (ha : a.Coprime 10) (n : ℕ) :
(if n % 10 = a % 10 then (1 : ℂ) else 0) =
(1 / 4) * ∑ χ : DirichletCharacter ℂ 10, χ (a : ZMod 10)⁻¹ * χ n := by sorry
end ZetaMapSource
mfala22ss, The decimal sieve through the zeta function (note, 2026); general versions in Mathlib (Mathlib/NumberTheory/LSeries, EulerProduct, DirichletCharacter); Mathlib `DirichletCharacter.sum_char_inv_mul_char_eq`
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
For every natural a coprime to 10 and every natural n: the indicator [n mod 10 = a mod 10] (as a complex number) equals (1/4) times the sum, over all complex Dirichlet characters chi mod 10, of chi((a mod 10)^{-1}) chi(n mod 10). The inverse is in ZMod 10 and is a true inverse because a is a unit. This is character orthogonality mod 10, with phi(10) = 4. Concerns: none. Coprimality excludes residues where the identity would fail. Every n is covered, including n = 0 and n not coprime to 10, where both sides are 0.
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.