Zeta and L-valuesBlueprintDependency graphThesis
Contents

GeneralizedBernoulliEGF.lean

Statement index · Original Lean file

1/-2Swarm smwl46mfx, member m4, direction d11.34# The exponential generating function of the generalized Bernoulli numbers5(thesis, Definition 2.2)67`Thesis.generalizedBernoulli` is defined by the Bernoulli-polynomial formula8`B_{n,χ} = N^{n-1} ∑_{a=1}^N χ(a) B_n(a/N)` (equation (2.9)). Here we prove that it is9the coefficient sequence of the generating function of Definition 2.2:1011`(∑_n B_{n,χ} T^n/n!) · (e^{NT} - 1) = ∑_{a=1}^{N} χ(a) · T e^{aT}`1213in `ℚ⟦T⟧`, i.e. `∑_n B_{n,χ}T^n/n! = ∑_a χ(a) T e^{aT}/(e^{NT}-1)`, together with its14coefficientwise consequences: the recursion15`∑_{i<n} C(n,i) B_{i,χ} N^{n-i} = n ∑_{a=1}^N χ(a) a^{n-1}` and the parity vanishing.16-/17import Thesis.GeneralizedBernoulli1819open PowerSeries20open scoped BigOperators2122namespace Thesis2324variable {N : ℕ}2526/-- The uniform cancellation of the `zpow` in the definition of `generalizedBernoulli`. -/27theorem zpow_pred_mul_self (hN : 0 < N) (n : ℕ) :28 (N : ℚ) ^ ((n : ℤ) - 1) * (N : ℚ) = (N : ℚ) ^ n := by29 cases n with30 | zero =>31 have hNq : ((N : ℚ)) ≠ 0 := by exact_mod_cast hN.ne'32 simp only [Nat.cast_zero, zero_sub, zpow_neg_one, pow_zero]33 exact inv_mul_cancel₀ hNq34 | succ k =>35 have h : (((k + 1 : ℕ) : ℤ) - 1) = (k : ℤ) := by push_cast; ring36 rw [h, zpow_natCast, pow_succ]3738/-- Mathlib's Bernoulli-polynomial generating function, in the shape used below. -/39theorem bernoulliPoly_egf (x : ℚ) :40 (mk fun n => ((Polynomial.bernoulli n).eval x) / (n.factorial : ℚ)) * (exp ℚ - 1)41 = X * rescale x (exp ℚ) := by42 have h := Polynomial.bernoulli_generating_function (A := ℚ) x43 simpa [div_eq_mul_inv, mul_comm, smul_eq_mul] using h4445/-- **The `N`-rescaled identity at the point `a/N`**, with the `zpow` of the definition:46`(∑_n N^{n-1}B_n(a/N)T^n/n!)(e^{NT}-1) = T e^{aT}`. -/47theorem bernoulliPoly_egf_rescale (hN : 0 < N) (a : ℕ) :48 (mk fun n => ((N : ℚ) ^ ((n : ℤ) - 1) * ((Polynomial.bernoulli n).eval ((a : ℚ) / N)) /49 (n.factorial : ℚ))) * (rescale (N : ℚ) (exp ℚ) - 1)50 = X * rescale (a : ℚ) (exp ℚ) := by51 have hNq : ((N : ℚ)) ≠ 0 := by exact_mod_cast hN.ne'52 have h := bernoulliPoly_egf ((a : ℚ) / N)53 have h' := congrArg (rescale (N : ℚ)) h54 rw [map_mul, map_sub, map_one] at h'55 have hX : (rescale (N : ℚ)) (X * rescale ((a : ℚ) / N) (exp ℚ))56 = C (N : ℚ) * (X * rescale (a : ℚ) (exp ℚ)) := by57 rw [map_mul, PowerSeries.rescale_X, PowerSeries.rescale_rescale,58 mul_comm ((a : ℚ) / N) (N : ℚ), mul_div_cancel₀ _ hNq, mul_assoc]59 rw [hX] at h'60 have h1 : (rescale (N : ℚ)) (mk fun n =>61 ((Polynomial.bernoulli n).eval ((a : ℚ) / N)) / (n.factorial : ℚ))62 = mk fun n => ((N : ℚ) ^ n * ((Polynomial.bernoulli n).eval ((a : ℚ) / N)) /63 (n.factorial : ℚ)) := by64 ext n65 simp only [coeff_rescale, coeff_mk]66 ring67 rw [h1] at h'68 -- divide by `N`, using the cancellation of `zpow`69 have hC : C ((N : ℚ)⁻¹) * (mk fun n => ((N : ℚ) ^ n *70 ((Polynomial.bernoulli n).eval ((a : ℚ) / N)) / (n.factorial : ℚ)))71 = mk fun n => ((N : ℚ) ^ ((n : ℤ) - 1) *72 ((Polynomial.bernoulli n).eval ((a : ℚ) / N)) / (n.factorial : ℚ)) := by73 ext n74 simp only [coeff_C_mul, coeff_mk]75 have hc := zpow_pred_mul_self (N := N) hN n76 rw [← hc]77 ring_nf78 rw [mul_inv_cancel₀ hNq, one_mul]79 have h'' := congrArg (fun f => C ((N : ℚ)⁻¹) * f) h'80 have hL : C ((N : ℚ)⁻¹) * ((mk fun n => ((N : ℚ) ^ n *81 ((Polynomial.bernoulli n).eval ((a : ℚ) / N)) / (n.factorial : ℚ))) *82 (rescale (N : ℚ) (exp ℚ) - 1))83 = (mk fun n => ((N : ℚ) ^ ((n : ℤ) - 1) *84 ((Polynomial.bernoulli n).eval ((a : ℚ) / N)) / (n.factorial : ℚ))) *85 (rescale (N : ℚ) (exp ℚ) - 1) := by86 rw [← mul_assoc, hC]87 have hR : C ((N : ℚ)⁻¹) * (C (N : ℚ) * (X * rescale (a : ℚ) (exp ℚ)))88 = X * rescale (a : ℚ) (exp ℚ) := by89 rw [← mul_assoc, ← map_mul, inv_mul_cancel₀ hNq, map_one, one_mul]90 rw [hL, hR] at h''91 exact h''9293/-- **The generating function of Definition 2.2**: the character-weighted sum. -/94theorem generalizedBernoulli_egf {N : ℕ} (hN : 0 < N) (χ : DirichletCharacter ℚ N) :95 (mk fun n => generalizedBernoulli χ n / (n.factorial : ℚ)) *96 (rescale (N : ℚ) (exp ℚ) - 1)97 = ∑ a ∈ Finset.Icc 1 N, χ a • (X * rescale (a : ℚ) (exp ℚ)) := by98 have hterm : ∀ a ∈ Finset.Icc 1 N,99 (mk fun n => ((N : ℚ) ^ ((n : ℤ) - 1) *100 ((Polynomial.bernoulli n).eval ((a : ℚ) / N)) / (n.factorial : ℚ))) *101 (rescale (N : ℚ) (exp ℚ) - 1) = X * rescale (a : ℚ) (exp ℚ) :=102 fun a _ => bernoulliPoly_egf_rescale hN a103 have hsum : (∑ a ∈ Finset.Icc 1 N, χ a •104 ((mk fun n => ((N : ℚ) ^ ((n : ℤ) - 1) *105 ((Polynomial.bernoulli n).eval ((a : ℚ) / N)) / (n.factorial : ℚ))) *106 (rescale (N : ℚ) (exp ℚ) - 1)))107 = ∑ a ∈ Finset.Icc 1 N, χ a • (X * rescale (a : ℚ) (exp ℚ)) := by108 refine Finset.sum_congr rfl fun a ha => ?_109 rw [hterm a ha]110 rw [← hsum]111 have hsmul : ∀ a ∈ Finset.Icc 1 N, χ a •112 ((mk fun n => ((N : ℚ) ^ ((n : ℤ) - 1) *113 ((Polynomial.bernoulli n).eval ((a : ℚ) / N)) / (n.factorial : ℚ))) *114 (rescale (N : ℚ) (exp ℚ) - 1))115 = (χ a • (mk fun n => ((N : ℚ) ^ ((n : ℤ) - 1) *116 ((Polynomial.bernoulli n).eval ((a : ℚ) / N)) / (n.factorial : ℚ)))) *117 (rescale (N : ℚ) (exp ℚ) - 1) := by118 intro a _119 rw [smul_mul_assoc]120 rw [Finset.sum_congr rfl hsmul, ← Finset.sum_mul]121 congr 1122 ext n123 simp only [map_sum, coeff_smul, coeff_mk, smul_eq_mul, generalizedBernoulli]124 rw [Finset.mul_sum, Finset.sum_div]125 refine Finset.sum_congr rfl fun a _ => ?_126 have hmap : Polynomial.map (algebraMap ℚ ℚ) (Polynomial.bernoulli n)127 = Polynomial.bernoulli n := by128 rw [show (algebraMap ℚ ℚ) = RingHom.id ℚ from rfl, Polynomial.map_id]129 rw [hmap]130 ring131132lemma coeff_exp_sub_one_rescale (hN : 0 < N) (m : ℕ) :133 coeff (m + 1) (rescale (N : ℚ) (exp ℚ) - 1)134 = (N : ℚ) ^ (m + 1) / ((m + 1).factorial : ℚ) := by135 have h1 : (coeff (m + 1)) (1 : ℚ⟦X⟧) = 0 := by136 rw [coeff_one, if_neg (Nat.succ_ne_zero m)]137 rw [map_sub, coeff_rescale, coeff_exp, h1, sub_zero]138 simp [div_eq_mul_inv]139140lemma coeff_zero_rescale_exp_sub_one (hN : 0 < N) :141 coeff 0 (rescale (N : ℚ) (exp ℚ) - 1) = 0 := by142 have h1 : (coeff 0) (1 : ℚ⟦X⟧) = 1 := by rw [coeff_one, if_pos rfl]143 rw [map_sub, coeff_rescale, coeff_exp, h1]144 norm_num145146lemma coeff_mk_mul_exp_sub_one (hN : 0 < N) (f : ℕ → ℚ) (n : ℕ) :147 coeff n ((mk f) * (rescale (N : ℚ) (exp ℚ) - 1))148 = ∑ i ∈ Finset.range n, f i * ((N : ℚ) ^ (n - i) / ((n - i).factorial : ℚ)) := by149 rw [coeff_mul, Finset.Nat.sum_antidiagonal_eq_sum_range_succ_mk, Finset.sum_range_succ]150 have hzero : (coeff (n, n - n).1) (mk f) *151 (coeff (n, n - n).2) (rescale (N : ℚ) (exp ℚ) - 1) = 0 := by152 simp only [coeff_mk, Nat.sub_self]153 rw [coeff_zero_rescale_exp_sub_one hN, mul_zero]154 rw [hzero, add_zero]155 refine Finset.sum_congr rfl fun i hi => ?_156 have hlt : i < n := Finset.mem_range.mp hi157 simp only [coeff_mk]158 rw [show n - i = (n - i - 1) + 1 by omega, coeff_exp_sub_one_rescale hN]159160end Thesis