import Definitions.Def_NarrowRayClassGroup import Mathlib.NumberTheory.LSeries.Basic import Mathlib.Analysis.SpecialFunctions.Gamma.Deligne set_option autoImplicit false open NumberField NumberField.InfinitePlace Complex Deep.NTSupply nonZeroDivisors namespace M4aTorus noncomputable section variable (K : Type*) [Field K] [NumberField K] def rayZetaCoeff (𝔣 : Ideal (π“ž K)) (C : NarrowRayClassGroup K 𝔣) (n : β„•) : β„• := Nat.card {I : (Ideal (π“ž K))⁰ // Ideal.absNorm (I : Ideal (π“ž K)) = n ∧ βˆƒ hc : FractionalIdeal.mk0 K I ∈ coprimeToModulus K 𝔣, NarrowRayClassGroup.mk K 𝔣 ⟨FractionalIdeal.mk0 K I, hc⟩ = C} def rayZeta (𝔣 : Ideal (π“ž K)) (C : NarrowRayClassGroup K 𝔣) (s : β„‚) : β„‚ := LSeries (fun n ↦ rayZetaCoeff K 𝔣 C n) s def rayClassLSeries (𝔣 : Ideal (π“ž K)) (Ο‡ : NarrowRayClassGroup K 𝔣 β†’* β„‚) (s : β„‚) : β„‚ := βˆ‘' C : NarrowRayClassGroup K 𝔣, Ο‡ C * rayZeta K 𝔣 C s def completedRayL (𝔣 : Ideal (π“ž K)) (Ο‡ : NarrowRayClassGroup K 𝔣 β†’* β„‚) (S : Finset {w : InfinitePlace K // IsReal w}) (s : β„‚) : β„‚ := ((|(discr K : ℝ)| * (Ideal.absNorm 𝔣 : ℝ) : ℝ) : β„‚) ^ (s / 2) * Gammaℝ s ^ (nrRealPlaces K - S.card) * Gammaℝ (s + 1) ^ S.card * Gammaβ„‚ s ^ nrComplexPlaces K * rayClassLSeries K 𝔣 Ο‡ s end end M4aTorus