Lean formalization of the Riemann Hypothesis (Alpöge, 2026-11-20) being cleaned up by members of the Lean community.
Python
refactor(Lib/General/Analysis/FourierTransforms): extract dense character span helper
Rohan Arune0e1ff80986b
diff --git a/src/Lib/General/Analysis/FourierTransforms.lean b/src/Lib/General/Analysis/FourierTransforms.leanindex 8ead9765a26..b59b66f5012 100644--- a/src/Lib/General/Analysis/FourierTransforms.lean+++ b/src/Lib/General/Analysis/FourierTransforms.lean@@ -177,6 +177,31 @@ lemma mul_quotMean_translate [hχ : IsDualFamily B₀ χ] (hF : IsContPeriodic Brw [← quotMean_translate (isContPeriodic_mul hF i) a, ← quotMean_const_mul]simp only [hχ.add_right, mul_assoc, mul_left_comm (χ i a)]+/-- For a dual family `χ` of characters of `B` modulo `B₀` on a compact quotient, the span+of the `L²` images of `i ↦ star (χ i · out)` is dense in `Lp ℂ 2 (.addHaarMeasure ⊤)`. -/+private lemma dense_toLp_span_char [IsTopologicalAddGroup B] [CompactSpace (B ⧸ B₀)]+ [hχ : IsDualFamily B₀ χ] :+ ⊤ ≤ (span ℂ (range (fun i : I ↦+ toLp 2 (Measure.addHaarMeasure (⊤ : Set (B ⧸ B₀))) ℂ+ (star ⟨fun q : B ⧸ B₀ ↦ χ i q.out, (hχ.periodic i).continuous_out⟩)))).topologicalClosure := by+ classical+ let c : AddChar I C(B ⧸ B₀, ℂ) :=+ { toFun i := star ⟨fun q ↦ χ i q.out, (hχ.periodic i).continuous_out⟩+ map_zero_eq_one' := by simp [ext_iff, hχ.zero_apply]+ map_add_eq_mul' i j := by simp [ext_iff, hχ.add_left] }+ have c_apply (i : I) (q : B ⧸ B₀) : c i q = χ (-i) q.out := hχ.conj_apply i q.out+ let μ : Measure (B ⧸ B₀) := .addHaarMeasure ⊤+ let toL2 : C(B ⧸ B₀, ℂ) →L[ℂ] Lp ℂ 2 μ := toLp 2 μ ℂ+ have h_dense : Dense (span ℂ (range c) : Set C(B ⧸ B₀, ℂ)) := by+ have star_c (i : I) : c (-i) = star (c i) := by simp [ext_iff, c_apply, hχ.conj_apply]+ have h_separates (p q : B ⧸ B₀) (hpq : ∀ i : I, c i p = c i q) : p = q :=+ hχ.eq_of_forall_apply_out_eq fun i ↦ by simpa [c_apply] using hpq (-i)+ exact stone_weierstrass_span (MonoidHom.mrange c.toMonoidHom)+ (by simpa using fun i ↦ ⟨-i, star_c i⟩) (by simpa using h_separates)+ rw [top_le_iff, ← dense_iff_topologicalClosure_eq_top, range_comp, ← toL2.coe_coe,+ span_image, map_coe]+ exact (toLp_denseRange ℂ μ ℂ (by simp)).dense_image toL2.continuous h_dense+/-- Fourier inversion for a dual family `χ` of characters of `B` modulo `B₀` (characters `χ i`trivial on `B₀`, with `i ↦ χ i` an injective homomorphism, separating `B ⧸ B₀`): if `F` iscontinuous and `B₀`-periodic and its Fourier coefficients `a i` (the means of `χ i * F` over@@ -203,17 +228,8 @@ lemma fourier_inversion [hχ : IsDualFamily B₀ χ] (hF : IsContPeriodic B₀ Fhave h_orthonormal : Orthonormal ℂ (toL2 ∘ c) := orthonormal_iff_ite.2 fun i j ↦ bysimpa [inner_c, c_apply, quotMean, hχ.add_left, μ, add_neg_eq_zero] usingquotMean_eq_ite (B₀ := B₀) (i + -j)- have h_dense : Dense (span ℂ (range c) : Set C(B ⧸ B₀, ℂ)) := by- have star_c (i : I) : c (-i) = star (c i) := by simp [ext_iff, c_apply, hχ.conj_apply]- have h_separates (p q : B ⧸ B₀) (hpq : ∀ i : I, c i p = c i q) : p = q :=- hχ.eq_of_forall_apply_out_eq fun i ↦ by simpa [c_apply] using hpq (-i)- exact stone_weierstrass_span (MonoidHom.mrange c.toMonoidHom)- (by simpa using fun i ↦ ⟨-i, star_c i⟩) (by simpa using h_separates)- have h_dense_L2 : ⊤ ≤ (span ℂ (range (toL2 ∘ c))).topologicalClosure := by- -- The span of the image of `c` is the image of its dense span.- rw [top_le_iff, ← dense_iff_topologicalClosure_eq_top, range_comp, ← toL2.coe_coe,- span_image, map_coe]- exact (toLp_denseRange ℂ μ ℂ (by simp)).dense_image toL2.continuous h_dense+ have h_dense_L2 : ⊤ ≤ (span ℂ (range (toL2 ∘ c))).topologicalClosure :=+ dense_toLp_span_char (B := B) (B₀ := B₀) (χ := χ)-- `F` as a function on the quotient; the terms of its Fourier series are `a i • c i`.let F' : C(B ⧸ B₀, ℂ) := ⟨fun q ↦ F q.out, hF.continuous_out⟩have h_summable : Summable fun i ↦ a i • c i :=