Development/AutomorphicArithmetic/PrimitiveCosets/LevelFamily.lean
1import Development.AutomorphicArithmetic.PrimitiveCosets.CoreAtH2import Development.AutomorphicArithmetic.PrimitiveCosets.GChiEq3import Development.AutomorphicArithmetic.PrimitiveCosets.GzEq45open UpperTheory.Comparison₂ Deduction.CH Formalism Formalism.HC Formalism.D5 Formalism.RankGapBounds.WeightedMeanData Formalism.LFunctionChainParameters.WeightedSlopeBounds Formalism.LFunctionChainParameters.characterSumData Formalism.LFunctionChainParameters.ThickSetMeanBounds Formalism.LFunctionChainParameters.LErr6Formalism.LFunctionChainParameters.LChain Formalism.LFunctionChainParameters.LHost78open Classical in9private noncomputable def UpperTheory.Comparison₂.level_family_wt (Λ : Level) (ψ : PChar) : ℝ :=10if ψ = PChar.one then 1 else Λ.wt ψ1112private theorem UpperTheory.Comparison₂.level_family_wt_pos (Λ : Level) (ψ : PChar) : 0 < UpperTheory.Comparison₂.level_family_wt Λ ψ := by13unfold UpperTheory.Comparison₂.level_family_wt Level.wt14split_ifs15· exact one_pos16· exact one_pos17· positivity1819private theorem UpperTheory.Comparison₂.level_family_adm (ψ : PChar) : ψ.N = 1 ∨ ψ.χ ≠ 1 := by20by_cases h : ψ.χ = 121· left22have hp := ψ.prim23rw [DirichletCharacter.IsPrimitive, h, DirichletCharacter.conductor_one] at hp24exact hp.symm25· exact Or.inr h2627private theorem UpperTheory.Comparison₂.level_family_sum (Λ : Level) (y : ℝ) :28∑ ψ ∈ Λ.KEPT, UpperTheory.Comparison₂.level_family_wt Λ ψ * (Deduction.Gchi ψ.χ y).re = Λ.Gm y := by29classical30rw [← Finset.add_sum_erase _ _ Λ.one_mem, Level.Gm, Level.Nt]31congr 132· have h1 : UpperTheory.Comparison₂.level_family_wt Λ PChar.one = 1 := by33simp [UpperTheory.Comparison₂.level_family_wt]34rw [h1, one_mul, ← gChi_eq, (Gz_eq y).1]35simp only [An.gChi, PChar.one]36exact (congrArg Complex.re (if_pos rfl)).trans (Complex.ofReal_re _)37· refine Finset.sum_congr (by congr) fun ψ hψ => ?_38have hne : ψ ≠ PChar.one := Finset.ne_of_mem_erase hψ39simp only [UpperTheory.Comparison₂.level_family_wt, if_neg hne, gChi_eq]4041theorem UpperTheory.Comparison₂.level_family :42∀ Λ : Level, ∃ F : Deduction.CharFamily, (∀ y, Deduction.Gm F y = Λ.Gm y) ∧ ∀ θ, Deduction.ZeroFree F θ ↔ Λ.ZeroFreeAbove θ := by43intro Λ44refine ⟨@Deduction.CharFamily.mk Λ.KEPT _ (fun i => i.1.N) (fun i => i.1.ne) (fun i => i.1.χ) (fun i => UpperTheory.Comparison₂.level_family_wt Λ i.1) (fun i => UpperTheory.Comparison₂.level_family_wt_pos Λ i.1) (fun i => UpperTheory.Comparison₂.level_family_adm i.1), fun y => ?_, fun θ => ?_⟩45· rw [← UpperTheory.Comparison₂.level_family_sum Λ y, Deduction.Gm]46exact Finset.sum_coe_sort Λ.KEPT (fun ψ => UpperTheory.Comparison₂.level_family_wt Λ ψ * (Deduction.Gchi ψ.χ y).re)47· simp only [Deduction.ZeroFree, Level.ZeroFreeAbove, PChar.ZeroFreeAbove]48constructor49· intro h ψ hψ s hs50exact h ⟨ψ, hψ⟩ s hs