Contents
TheoremD.lean
Statement index · Original Lean file
1
import Thesis.ParityZeros2import Mathlib.NumberTheory.LSeries.DirichletContinuation3import Mathlib.NumberTheory.LSeries.HurwitzZetaValues45/-!6# Theorem D (Washington, Theorem 4.2) at negative integers78For a Dirichlet character `χ` of level `N` and `n ≥ 2`,9`L(1-n, χ) = -B_(n,χ)/n`, where `B_(n,χ)` is the generalized Bernoulli number10defined in `Thesis/GeneralizedBernoulli.lean` by the Bernoulli–polynomial formula.1112Since Mathlib's `DirichletCharacter.LFunction` is *defined* through Hurwitz zeta,13`LFunction χ s = N^(-s) ∑_j χ j ζ (j/N) s`, the identity is the Hurwitz special14value `ζ(1-n, x) = -B_n(x)/n` (`HurwitzZeta.hurwitzZeta_neg_nat`) summed over15`ZMod N`, together with the reindexing `ZMod N ≃ {1, …, N}`. The endpoint16`a = N` uses `B_n(1) = B_n(0)` for `n ≠ 1`, which is where the hypothesis `2 ≤ n`17enters (at `n = 1` the correct endpoint is `B_1(1) = 1/2`).18-/1920namespace Thesis2122open scoped BigOperators23open HurwitzZeta2425/-- Reindexing: a sum over `ZMod N` against one over `1 ≤ a ≤ N`, provided the26function agrees at `0` and `N` (the two representatives of the class `0`). -/27lemma sum_univ_zmod_eq_sum_Icc {N : ℕ} [NeZero N] {M : Type*} [AddCommMonoid M]28 (F : ℕ → M) (hN : F N = F 0) :29 ∑ j : ZMod N, F j.val = ∑ a ∈ Finset.Icc 1 N, F a := by30 have hNpos : 0 < N := Nat.pos_of_ne_zero (NeZero.ne N)31 refine Finset.sum_bij (fun j (_ : j ∈ Finset.univ) => if j = 0 then N else j.val)32 ?_ ?_ ?_ ?_33 · intro j _34 by_cases hj : j = 035 · simp only [hj, if_true, Finset.mem_Icc]36 omega37 · have h1 : 0 < j.val := Nat.pos_of_ne_zero (by simpa [ZMod.val_eq_zero] using hj)38 have h2 : j.val < N := ZMod.val_lt j39 simp only [hj, if_false, Finset.mem_Icc]40 omega41 · intro j _ k _ hjk42 by_cases hj : j = 0 <;> by_cases hk : k = 043 · rw [hj, hk]44 · exfalso45 simp only [hj, hk, if_true, if_false] at hjk46 have := ZMod.val_lt k47 omega48 · exfalso49 simp only [hj, hk, if_true, if_false] at hjk50 have := ZMod.val_lt j51 omega52 · simp only [hj, hk, if_false] at hjk53 exact ZMod.val_injective N hjk54 · intro b hb55 obtain ⟨h1, h2⟩ := Finset.mem_Icc.mp hb56 refine ⟨(b : ZMod N), Finset.mem_univ _, ?_⟩57 by_cases hbN : b = N58 · subst hbN59 simp60 · have hlt : b < N := lt_of_le_of_ne h2 hbN61 have hne : (b : ZMod N) ≠ 0 := by62 intro h63 rw [ZMod.natCast_eq_zero_iff] at h64 have hb : 0 < b := by omega65 have := Nat.le_of_dvd hb h66 omega67 simp only [hne, if_false]68 exact ZMod.val_natCast_of_lt hlt69 · intro j _70 by_cases hj : j = 071 · subst hj72 simpa using hN.symm73 · simp only [hj, if_false]7475/-- The Bernoulli–polynomial endpoint identity `B_n(1) = B_n(0)` for `n ≠ 1`. -/76lemma bernoulli_eval_one_eq_eval_zero {n : ℕ} (hn : n ≠ 1) :77 Polynomial.eval (1 : ℂ) (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli n)) =78 Polynomial.eval (0 : ℂ) (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli n)) := by79 rw [Polynomial.eval_map, Polynomial.eval_map, Polynomial.eval₂_at_one, Polynomial.eval₂_at_zero,80 Polynomial.bernoulli_eval_one, Polynomial.coeff_zero_eq_eval_zero,81 Polynomial.bernoulli_eval_zero, bernoulli_eq_bernoulli'_of_ne_one hn]8283/-- The Hurwitz-zeta step: at `s = 1 - n` with `n ≥ 2` each Hurwitz factor is84`-B_n(j.val/N)/n`. (For `n = 1`, i.e. `s = 0`, the special value of Hurwitz zeta85is not available in Mathlib; see the module documentation.) -/86lemma hurwitzZeta_toAddCircle_one_sub {N : ℕ} [NeZero N] {n : ℕ} (hn : 2 ≤ n) (j : ZMod N) :87 hurwitzZeta (ZMod.toAddCircle j) ((1 - n : ℤ) : ℂ) =88 -(1 / (n : ℂ)) *89 Polynomial.eval ((j.val : ℂ) / (N : ℂ))90 (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli n)) := by91 have hNpos : (0 : ℝ) < N := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne N)92 have hx : ((j.val : ℝ) / (N : ℝ)) ∈ Set.Icc (0 : ℝ) 1 := by93 refine Set.mem_Icc.mpr ⟨by positivity, ?_⟩94 rw [div_le_one hNpos]95 have := ZMod.val_lt j96 exact_mod_cast Nat.le_of_lt this97 have hn1 : 1 ≤ n := by omega98 have hcast : ((1 - n : ℤ) : ℂ) = -(((n - 1 : ℕ)) : ℂ) := by99 rw [Nat.cast_sub hn1]100 push_cast101 ring102 have hnat : ((n - 1 : ℕ) : ℂ) = (n : ℂ) - 1 := by103 simpa using Nat.cast_sub hn1104 have hk : n - 1 ≠ 0 := by omega105 have h := hurwitzZeta_neg_nat (k := n - 1) (x := (j.val : ℝ) / (N : ℝ)) hk hx106 rw [ZMod.toAddCircle_apply, hcast, h, hnat, Nat.sub_add_cancel hn1]107 push_cast108 ring109110/-- **Theorem D** for `n ≥ 2`: `L(1-n, χ) = -B_(n,χ)/n`. -/111theorem LFunction_neg_eq_generalizedBernoulli_of_two_le {N : ℕ} [NeZero N]112 (χ : DirichletCharacter ℂ N) {n : ℕ} (hn : 2 ≤ n) :113 DirichletCharacter.LFunction χ ((1 - n : ℤ) : ℂ) = dirichletValue χ n := by114 have hn1 : 1 ≤ n := by omega115 have hnne : n ≠ 1 := by omega116 have hN : (N : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr (NeZero.ne N)117 have hexp : -(((1 - n : ℤ)) : ℂ) = ((n - 1 : ℕ) : ℂ) := by118 rw [Nat.cast_sub hn1]119 push_cast120 ring121 have hz : (N : ℂ) ^ ((n : ℤ) - 1) = (N : ℂ) ^ (n - 1) := by122 have : (n : ℤ) - 1 = ((n - 1 : ℕ) : ℤ) := (Nat.cast_sub hn1).symm123 rw [this, zpow_natCast]124 rw [DirichletCharacter.LFunction, ZMod.LFunction, hexp, Complex.cpow_natCast]125 simp only [hurwitzZeta_toAddCircle_one_sub hn]126 have hreindex :127 ∑ j : ZMod N, χ j * Polynomial.eval ((j.val : ℂ) / (N : ℂ))128 (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli n)) =129 ∑ a ∈ Finset.Icc 1 N, χ (a : ZMod N) * Polynomial.eval ((a : ℂ) / (N : ℂ))130 (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli n)) := by131 rw [← sum_univ_zmod_eq_sum_Icc (M := ℂ)132 (fun a => χ (a : ZMod N) * Polynomial.eval ((a : ℂ) / (N : ℂ))133 (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli n))) ?_]134 · refine Finset.sum_congr rfl (fun a _ => ?_)135 rw [ZMod.natCast_zmod_val]136 · simp only [ZMod.natCast_self, Nat.cast_zero, zero_div]137 rw [div_self hN, bernoulli_eval_one_eq_eval_zero hnne]138 have hsum : ∑ j : ZMod N, χ j * (-(1 / (n : ℂ)) *139 Polynomial.eval ((j.val : ℂ) / (N : ℂ))140 (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli n))) =141 -(1 / (n : ℂ)) * ∑ a ∈ Finset.Icc 1 N, χ (a : ZMod N) *142 Polynomial.eval ((a : ℂ) / (N : ℂ))143 (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli n)) := by144 rw [← hreindex]145 conv_rhs => rw [Finset.mul_sum]146 refine Finset.sum_congr rfl (fun j _ => ?_)147 ring148 rw [hsum, dirichletValue, generalizedBernoulli, hz]149 ring150151/-- Reindexing a sum over `ZMod N` as a sum over `1 ≤ a ≤ N` (no endpoint152hypothesis needed: both `0` and `N` are mapped to the class `0`). -/153lemma sum_univ_zmod_eq_sum_Icc' {N : ℕ} [NeZero N] {M : Type*} [AddCommMonoid M]154 (G : ZMod N → M) : ∑ j : ZMod N, G j = ∑ a ∈ Finset.Icc 1 N, G (a : ZMod N) := by155 have h := sum_univ_zmod_eq_sum_Icc (M := M) (F := fun a : ℕ => G (a : ZMod N))156 (by rw [ZMod.natCast_self, Nat.cast_zero])157 rw [← h]158 exact Finset.sum_congr rfl (fun j _ => by rw [ZMod.natCast_zmod_val])159160161/-- At $s=0$ and for an even character of modulus at least two, the negative-integer162formula follows from parity alone and does not require the missing Hurwitz-zeta value. -/163theorem LFunction_zero_eq_generalizedBernoulli_of_even {N : ℕ} [NeZero N] (hN : 2 ≤ N)164 (χ : DirichletCharacter ℂ N) (hχ : χ (-1) = 1) :165 DirichletCharacter.LFunction χ 0 = dirichletValue χ 1 := by166 have hB : generalizedBernoulli χ 1 = 0 :=167 generalizedBernoulli_eq_zero_of_even hN χ hχ odd_one168 have hzero : χ (0 : ZMod N) = 0 := DirichletCharacter.map_zero' χ (by omega)169 have hfun : Function.Even (χ : ZMod N → ℂ) := DirichletCharacter.Even.to_fun hχ170 change ZMod.LFunction (χ : ZMod N → ℂ) 0 = dirichletValue χ 1171 rw [ZMod.LFunction_apply_zero_of_even hfun, hzero, dirichletValue, hB]172 norm_num173174175/-- The `n = 1` case of Theorem D, conditional on the special value176`ζ(0, x) = 1/2 - x` of the Hurwitz zeta function for `0 < x < 1`.177178Mathlib proves `hurwitzZeta_neg_nat` only for `k ≠ 0`; the missing `k = 0` value is179listed as a TODO there ("requires Fourier series which are only conditionally180convergent"). Everything else in this case is elementary. -/181theorem LFunction_zero_eq_generalizedBernoulli182 (hζ : ∀ x : ℝ, x ∈ Set.Ioo (0 : ℝ) 1 → hurwitzZeta (x : UnitAddCircle) 0 = 1 / 2 - x)183 {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N) :184 DirichletCharacter.LFunction χ 0 = dirichletValue χ 1 := by185 have hNpos : (0 : ℝ) < N := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne N)186 have hN1 : 1 ≤ N := Nat.pos_of_ne_zero (NeZero.ne N)187 have hN : (N : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr (NeZero.ne N)188 have hLHS : DirichletCharacter.LFunction χ 0 =189 ∑ j : ZMod N, χ j * hurwitzZeta (ZMod.toAddCircle j) 0 := by190 rw [DirichletCharacter.LFunction, ZMod.LFunction]191 simp192 have hRHS : dirichletValue χ 1 =193 -(∑ a ∈ Finset.Icc 1 N, χ (a : ZMod N) *194 Polynomial.eval ((a : ℂ) / (N : ℂ))195 (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli 1))) := by196 rw [dirichletValue, generalizedBernoulli]197 simp198 rw [hLHS, hRHS]199 -- left side: split the sum over `ZMod N` at the class of `0`200 have hL : ∑ j : ZMod N, χ j * hurwitzZeta (ZMod.toAddCircle j) 0 =201 χ 0 * (-(1 / 2)) +202 ∑ a ∈ Finset.Ico 1 N, χ (a : ZMod N) * (1 / 2 - (a : ℂ) / (N : ℂ)) := by203 rw [sum_univ_zmod_eq_sum_Icc']204 rw [← Finset.Ico_insert_right hN1, Finset.sum_insert (by simp)]205 congr 1206 · rw [ZMod.natCast_self, ZMod.toAddCircle_eq_zero.mpr rfl, HurwitzZeta.hurwitzZeta_zero,207 riemannZeta_zero]208 ring209 · refine Finset.sum_congr rfl (fun a ha => ?_)210 rw [Finset.mem_Ico] at ha211 have ha0 : (0 : ℝ) < a := by exact_mod_cast ha.1212 have haN : (a : ℝ) < N := by exact_mod_cast ha.2213 rw [ZMod.toAddCircle_natCast,214 hζ ((a : ℝ) / (N : ℝ)) ⟨by positivity, by rw [div_lt_one hNpos]; exact haN⟩]215 push_cast216 ring217 rw [hL]218 -- right side: `B₁(x) = x - 1/2`, then split at `a = N`219 have hB : ∀ a ∈ Finset.Icc 1 N,220 Polynomial.eval ((a : ℂ) / (N : ℂ))221 (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli 1)) =222 (a : ℂ) / (N : ℂ) - 1 / 2 := by223 intro a _224 rw [Polynomial.bernoulli_one]225 simp226 have hR : -(∑ a ∈ Finset.Icc 1 N, χ (a : ZMod N) *227 Polynomial.eval ((a : ℂ) / (N : ℂ))228 (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli 1))) =229 -(∑ a ∈ Finset.Ico 1 N, χ (a : ZMod N) * ((a : ℂ) / (N : ℂ) - 1 / 2) +230 χ 0 * (1 - 1 / 2)) := by231 congr 1232 have h1 : ∑ a ∈ Finset.Icc 1 N, χ (a : ZMod N) *233 Polynomial.eval ((a : ℂ) / (N : ℂ))234 (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli 1)) =235 ∑ a ∈ Finset.Icc 1 N, χ (a : ZMod N) * ((a : ℂ) / (N : ℂ) - 1 / 2) :=236 Finset.sum_congr rfl (fun a ha => by rw [hB a ha])237 rw [h1, ← Finset.Ico_insert_right hN1, Finset.sum_insert (by simp)]238 simp only [ZMod.natCast_self]239 rw [div_self hN]240 ring241 rw [hR]242 have hneg : ∑ a ∈ Finset.Ico 1 N, χ (a : ZMod N) * (1 / 2 - (a : ℂ) / (N : ℂ)) =243 -(∑ a ∈ Finset.Ico 1 N, χ (a : ZMod N) * ((a : ℂ) / (N : ℂ) - 1 / 2)) := by244 rw [← Finset.sum_neg_distrib]245 exact Finset.sum_congr rfl (fun a _ => by ring)246 rw [hneg]247 ring248249/-- **Theorem D**, conditional on the `s = 0` special value of the Hurwitz zeta250function (the only ingredient missing from Mathlib for the `n = 1` case). -/251theorem LFunction_neg_eq_generalizedBernoulli_of_hurwitzZeta_zero252 (hζ : ∀ x : ℝ, x ∈ Set.Ioo (0 : ℝ) 1 → hurwitzZeta (x : UnitAddCircle) 0 = 1 / 2 - x)253 {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N) {n : ℕ} (hn : 0 < n) :254 DirichletCharacter.LFunction χ ((1 - n : ℤ) : ℂ) = dirichletValue χ n := by255 rcases Nat.lt_or_ge n 2 with hn2 | hn2256 · interval_cases n257 simpa using LFunction_zero_eq_generalizedBernoulli hζ χ258 · exact LFunction_neg_eq_generalizedBernoulli_of_two_le χ hn2259260/-! ### Consistency checks against the source261262The thesis writes Theorem D for `n ≥ 1`; the `n = 1` case (`s = 0`) is the only263one blocked on the missing Hurwitz value. The checks below verify that the264formalized statement reproduces the source's equation (2.5) (`ζ(1-n) = -B_n/n`)265and the level-one `n = 1` value `-B_(1,𝟙) = -1/2`, where the thesis convention266`B_1(1) = 1/2` is what makes the identity true. -/267268/-- The project's statement shape (with the unused `IsPrimitive` hypothesis), for `n ≥ 2`. -/269theorem LFunction_neg_eq_generalizedBernoulli_of_two_le' {N : ℕ} [NeZero N]270 (χ : DirichletCharacter ℂ N) (_ : DirichletCharacter.IsPrimitive χ) {n : ℕ} (hn : 2 ≤ n) :271 DirichletCharacter.LFunction χ ((1 - n : ℤ) : ℂ) = dirichletValue χ n :=272 LFunction_neg_eq_generalizedBernoulli_of_two_le χ hn273274/-- Equation (2.5) of the thesis, recovered from Theorem D at level `1`:275`ζ(1-n) = -B_n/n` for `n ≥ 2`. -/276theorem riemannZeta_one_sub_eq {n : ℕ} (hn : 2 ≤ n) :277 riemannZeta ((1 - n : ℤ) : ℂ) = -((bernoulli n : ℚ) : ℂ) / (n : ℂ) := by278 have h := LFunction_neg_eq_generalizedBernoulli_of_two_le (N := 1)279 (1 : DirichletCharacter ℂ 1) hn280 rw [dirichletValue, generalizedBernoulli_modOne_of_ne_one (1 : DirichletCharacter ℂ 1)281 (by omega)] at h282 simpa using h283284/-- The `n = 1` value at level `1`: `L(0, 𝟙) = -B_(1,𝟙) = -1/2`. This is the285endpoint convention `B_1(1) = +1/2` of equation (2.9); it is the only case of the286`n = 1` statement that does not need `ζ(0, x)` for `0 < x < 1`. -/287theorem LFunction_zero_modOne :288 DirichletCharacter.LFunction (1 : DirichletCharacter ℂ 1) 0 =289 dirichletValue (1 : DirichletCharacter ℂ 1) 1 := by290 rw [dirichletValue, generalizedBernoulli_modOne]291 simp [riemannZeta_zero]292 norm_num293294/-! ### The exact analytic input missing for `n = 1`295296Mathlib's `hurwitzZeta_neg_nat` covers `ζ(-k, x)` only for `k ≠ 0`. The `k = 0`297value `ζ(0, x) = 1/2 - x` is the only missing ingredient; by the functional298equation `hurwitzZetaOdd_one_sub` at `s = 1` it is equivalent to the boundary299value of the sawtooth Fourier series,300`sinZeta x 1 = π (1/2 - x)`, whose *series* Mathlib has301(`hasSum_one_div_nat_pow_mul_sin` at `k = 1`) but whose identification with the302analytically continued `sinZeta` is an Abel/Dirichlet-theorem step Mathlib does303not have. -/304305/-- `ζ(0, x) = 1/2 - x` for `0 < x < 1`, from the sawtooth Fourier value. -/306lemma hurwitzZeta_zero_of_sinZeta_one {x : ℝ} (hx : x ∈ Set.Ioo (0 : ℝ) 1)307 (h : sinZeta (x : UnitAddCircle) 1 = (Real.pi : ℂ) * (1 / 2 - x)) :308 hurwitzZeta (x : UnitAddCircle) 0 = 1 / 2 - x := by309 have hxIco : x ∈ Set.Ico (0 : ℝ) 1 := ⟨le_of_lt hx.1, hx.2⟩310 have hx0 : (x : UnitAddCircle) ≠ 0 := fun hzero => by311 have hxzero : x = 0 := (AddCircle.coe_eq_zero_iff_of_mem_Ico (p := 1) hxIco).mp hzero312 linarith [hx.1]313 have hs : ∀ n : ℕ, (1 : ℂ) ≠ -n := by314 intro n hcon315 have hre := congrArg Complex.re hcon316 simp only [Complex.one_re, Complex.neg_re, Complex.natCast_re] at hre317 have hnn : (0 : ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n318 linarith319 have h1 := hurwitzZetaOdd_one_sub (x : UnitAddCircle) (s := 1) hs320 rw [show (1 : ℂ) - 1 = 0 by ring, h] at h1321 have hsin : Complex.sin ((Real.pi : ℂ) * 1 / 2) = 1 := by322 have harg : (Real.pi : ℂ) * 1 / 2 = ((Real.pi / 2 : ℝ) : ℂ) := by push_cast; ring323 rw [harg, ← Complex.ofReal_sin, Real.sin_pi_div_two, Complex.ofReal_one]324 have hc : (2 * (Real.pi : ℂ)) ^ (-(1 : ℂ)) = (2 * (Real.pi : ℂ))⁻¹ := by325 rw [show (-(1 : ℂ)) = (-1 : ℂ) by ring, Complex.cpow_neg_one]326 have hpi : (Real.pi : ℂ) ≠ 0 := by exact_mod_cast Real.pi_ne_zero327 have h2 : (2 : ℂ) * (2 * (Real.pi : ℂ))⁻¹ * 1 * 1 * ((Real.pi : ℂ) * (1 / 2 - x)) =328 1 / 2 - x := by329 field_simp330 rw [hc, hsin, Complex.Gamma_one, h2] at h1331 simpa only [hurwitzZeta, hurwitzZetaEven_apply_zero, if_neg hx0, zero_add] using h1332333/-- **Theorem D** from the sawtooth Fourier value (equivalent form of the334hypothesis of `LFunction_neg_eq_generalizedBernoulli_of_hurwitzZeta_zero`). -/335theorem LFunction_neg_eq_generalizedBernoulli_of_sinZeta_one336 (hsin : ∀ x : ℝ, x ∈ Set.Ioo (0 : ℝ) 1 →337 sinZeta (x : UnitAddCircle) 1 = (Real.pi : ℂ) * (1 / 2 - x))338 {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N) {n : ℕ} (hn : 0 < n) :339 DirichletCharacter.LFunction χ ((1 - n : ℤ) : ℂ) = dirichletValue χ n :=340 LFunction_neg_eq_generalizedBernoulli_of_hurwitzZeta_zero341 (fun x hx => hurwitzZeta_zero_of_sinZeta_one hx (hsin x hx)) χ hn342343/-! ### The imprimitive (Euler-factor) correction344345SOURCE_AUDIT item 5: for the tower product and Theorem 2.16 the character must be346the *primitive* one inducing a level-`N` character; passing the principal character347modulo `N` changes the Euler factor. The classical derivation of the correction348multiplies the generalized Bernoulli numbers by `(1 - χ(p) p^{n-1})` for each349extra prime, which needs Raabe's multiplication formula (not in Mathlib).350351Theorem D, applied at two levels, gives the correction directly from Mathlib's352`DirichletCharacter.LFunction_changeLevel`, with no Raabe formula. -/353354/-- The generalized Bernoulli number at level `N` in terms of the one at a level355`M ∣ N`, twisted by the Euler factor `∏_{p | N} (1 - χ(p) p^{n-1})`. -/356theorem dirichletValue_changeLevel {M N : ℕ} [NeZero M] [NeZero N] (hMN : M ∣ N)357 (χ : DirichletCharacter ℂ M) {n : ℕ} (hn : 2 ≤ n) :358 dirichletValue (DirichletCharacter.changeLevel hMN χ) n =359 (∏ p ∈ N.primeFactors, (1 - χ p * (p : ℂ) ^ (n - 1))) * dirichletValue χ n := by360 have hn0 : (n : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr (by omega)361 have hc : (((1 - n : ℤ)) : ℂ) = 1 - (n : ℂ) := by push_cast; ring362 have hne : (((1 - n : ℤ)) : ℂ) ≠ 1 := by363 intro h364 have h' : (1 - n : ℤ) = 1 := by exact_mod_cast h365 omega366 have hcl := DirichletCharacter.LFunction_changeLevel hMN χ (s := ((1 - n : ℤ) : ℂ)) (Or.inr hne)367 rw [LFunction_neg_eq_generalizedBernoulli_of_two_le (DirichletCharacter.changeLevel hMN χ) hn,368 LFunction_neg_eq_generalizedBernoulli_of_two_le χ hn] at hcl369 have hexp : -(((1 - n : ℤ)) : ℂ) = ((n - 1 : ℕ) : ℂ) := by370 rw [hc, Nat.cast_sub (le_trans (by norm_num) hn)]371 push_cast372 ring373 have hfac : ∀ p ∈ N.primeFactors, (1 - χ p * (p : ℂ) ^ (-(((1 - n : ℤ)) : ℂ)))374 = (1 - χ p * (p : ℂ) ^ (n - 1)) := by375 intro p _376 rw [hexp, Complex.cpow_natCast]377 rw [mul_comm, hcl, Finset.prod_congr rfl hfac]378379set_option linter.style.haveILetI false in380/-- SOURCE_AUDIT item 5, machine-checked: the generalized Bernoulli number at level381`N` is the primitive one twisted by the Euler factor382`∏_{p | N} (1 - χ₀(p) p^{n-1})`. This is the reason Theorem 2.16 and the tower383product must use `χ.primitiveCharacter` rather than the raw level-`N` character. -/384theorem dirichletValue_eq_primitive {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N)385 {n : ℕ} (hn : 2 ≤ n) :386 dirichletValue χ n =387 (∏ p ∈ N.primeFactors, (1 - χ.primitiveCharacter p * (p : ℂ) ^ (n - 1))) *388 dirichletValue χ.primitiveCharacter n := by389 have hne : NeZero χ.conductor := ⟨χ.conductor_ne_zero⟩390 haveI := hne391 have h := dirichletValue_changeLevel χ.conductor_dvd_level χ.primitiveCharacter hn392 rwa [DirichletCharacter.changeLevel_primitiveCharacter] at h393394end Thesis