import Definitions.Def_AutomorphicForm_RationalCentreUnipotentQuotient import Definitions.Def_AutomorphicForm_WhittakerCoefficient import Definitions.Def_NumberField_TateGlobalZeta open MeasureTheory NumberField NumberField.AdelicHaar NumberField.AdelicBox IsDedekindDomain noncomputable section namespace AutomorphicForm namespace RankinSelberg attribute [local instance] NumberField.AdelicHaar.glBorel NumberField.AdelicHaar.borelSpace_glBorel NumberField.AdelicHaar.adeleBorel NumberField.AdelicHaar.borelSpace_adeleBorel variable (K : Type) [Field K] [NumberField K] def quotientIntegrand (pins : CarrierPins K) (ψ : AddChar (AdeleRing (š“ž K) K) ā„‚) (x y φ : AdelicGL2 (š“ž K) K → ā„‚) (w d₁ dā‚‚ : ā„) (g : AdelicGL2 (š“ž K) K) : ā„‚ := ({g : AdelicGL2 (š“ž K) K | NumberField.TateGlobal.ideleNorm K (Matrix.GeneralLinearGroup.det g) ∈ Set.Icc d₁ dā‚‚}.indicator (fun _ => (1 : ā„‚)) g) * whittakerCoefficient K pins ψ x 1 g * (starRingEnd ā„‚) (whittakerCoefficient K pins ψ y 1 g) * φ g * ((NumberField.TateGlobal.ideleNorm K (Matrix.GeneralLinearGroup.det g) ^ (-w) : ā„) : ā„‚) def quotientIntegral (pins : CarrierPins K) (ψ : AddChar (AdeleRing (š“ž K) K) ā„‚) (x y φ : AdelicGL2 (š“ž K) K → ā„‚) (w d₁ dā‚‚ : ā„) : ā„‚ := ∫ q : RationalCentreUnipotentQuotient K, quotientIntegrand K pins ψ x y φ w d₁ dā‚‚ q.out āˆ‚(rationalCentreUnipotentQuotientMeasure K) def shellZeroOutside (S : Finset (HeightOneSpectrum (š“ž K))) : Set (AdelicGL2 (š“ž K) K) := {g | āˆ€ v : HeightOneSpectrum (š“ž K), v āˆ‰ S → Valued.v ((((Matrix.GeneralLinearGroup.det g : (AdeleRing (š“ž K) K)Ė£) : AdeleRing (š“ž K) K)).2 v) = (max (Valued.v (((g : Matrix (Fin 2) (Fin 2) (AdeleRing (š“ž K) K)) 1 0).2 v)) (Valued.v (((g : Matrix (Fin 2) (Fin 2) (AdeleRing (š“ž K) K)) 1 1).2 v))) ^ 2} def sPartIntegral (S : Finset (HeightOneSpectrum (š“ž K))) (pins : CarrierPins K) (ψ : AddChar (AdeleRing (š“ž K) K) ā„‚) (x y φ : AdelicGL2 (š“ž K) K → ā„‚) (w d₁ dā‚‚ : ā„) : ā„‚ := ∫ q in {q : RationalCentreUnipotentQuotient K | q.out ∈ shellZeroOutside K S}, quotientIntegrand K pins ψ x y φ w d₁ dā‚‚ q.out āˆ‚(rationalCentreUnipotentQuotientMeasure K) end RankinSelberg end AutomorphicForm end