import Definitions.Def_UnramifiedWhittaker_ZetaIntegrand set_option autoImplicit false open IsDedekindDomain NumberField NumberField.AdelicLevel NumberField.AdeleRing noncomputable section namespace NumberField.Idele variable (F : Type) [Field F] [NumberField F] def ord (v : HeightOneSpectrum (π“ž F)) (a : (AdeleRing (π“ž F) F)Λ£) : β„€ := -WithZero.log (Valued.v ((a : AdeleRing (π“ž F) F).2 v)) theorem valued_snd_ne_zero (v : HeightOneSpectrum (π“ž F)) (a : (AdeleRing (π“ž F) F)Λ£) : Valued.v ((a : AdeleRing (π“ž F) F).2 v) β‰  0 := by rw [← val_finiteUnitsComponent] exact (Valuation.ne_zero_iff Valued.v).mpr (Units.ne_zero _) theorem valued_snd_eq_exp_neg_ord (v : HeightOneSpectrum (π“ž F)) (a : (AdeleRing (π“ž F) F)Λ£) : Valued.v ((a : AdeleRing (π“ž F) F).2 v) = WithZero.exp (-(ord F v a)) := by rw [ord, neg_neg, WithZero.exp_log (valued_snd_ne_zero F v a)] theorem ord_mul (v : HeightOneSpectrum (π“ž F)) (a b : (AdeleRing (π“ž F) F)Λ£) : ord F v (a * b) = ord F v a + ord F v b := by have hab : ((a * b : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).2 v = (a : AdeleRing (π“ž F) F).2 v * (b : AdeleRing (π“ž F) F).2 v := rfl simp only [ord] rw [hab, map_mul, WithZero.log_mul (valued_snd_ne_zero F v a) (valued_snd_ne_zero F v b), neg_add] theorem ord_one (v : HeightOneSpectrum (π“ž F)) : ord F v 1 = 0 := by rw [ord] show -WithZero.log (Valued.v (1 : v.adicCompletion F)) = 0 rw [map_one, WithZero.log_one, neg_zero] theorem ord_inv (v : HeightOneSpectrum (π“ž F)) (a : (AdeleRing (π“ž F) F)Λ£) : ord F v a⁻¹ = -ord F v a := by have h := ord_mul F v a a⁻¹ rw [mul_inv_cancel, ord_one] at h omega def unitComponent (v : HeightOneSpectrum (π“ž F)) (a : (AdeleRing (π“ž F) F)Λ£) : v.adicCompletion F := (a : AdeleRing (π“ž F) F).2 v * ((uniformizerUnit F v : (v.adicCompletion F)Λ£) : v.adicCompletion F) ^ (-(ord F v a)) theorem valued_unitComponent (v : HeightOneSpectrum (π“ž F)) (a : (AdeleRing (π“ž F) F)Λ£) : Valued.v (unitComponent F v a) = 1 := by rw [unitComponent, map_mul, map_zpowβ‚€, valued_uniformizerUnit, valued_snd_eq_exp_neg_ord, ← WithZero.exp_zsmul, ← WithZero.exp_add, ← WithZero.exp_zero] congr 1 simp only [zsmul_eq_mul, Int.cast_id, Int.cast_neg, mul_neg, mul_one, neg_neg, neg_add_cancel] theorem unitComponent_mul_unitComponent_inv (v : HeightOneSpectrum (π“ž F)) (a : (AdeleRing (π“ž F) F)Λ£) : unitComponent F v a * unitComponent F v a⁻¹ = 1 := by have h1 : (a : AdeleRing (π“ž F) F).2 v * ((a⁻¹ : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).2 v = 1 := by have h : ((a * a⁻¹ : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).2 v = 1 := by rw [mul_inv_cancel]; rfl exact h simp only [unitComponent] rw [ord_inv, neg_neg, mul_mul_mul_comm, h1, one_mul, ← zpow_addβ‚€ (uniformizerUnit F v).ne_zero, neg_add_cancel, zpow_zero] open scoped Classical in def truncFin (S : Finset (HeightOneSpectrum (π“ž F))) : FiniteAdeleRing (π“ž F) F β†’* FiniteAdeleRing (π“ž F) F where toFun x := ⟨fun v => if v ∈ S then x v else 1, x.2.mono fun v hv => by show (if v ∈ S then x v else 1) ∈ v.adicCompletionIntegers F split_ifs Β· exact hv Β· exact one_mem _⟩ map_one' := by refine Subtype.ext (funext fun v => ?_) show (if v ∈ S then (1 : FiniteAdeleRing (π“ž F) F) v else 1) = (1 : FiniteAdeleRing (π“ž F) F) v split_ifs <;> rfl map_mul' x y := by refine Subtype.ext (funext fun v => ?_) show (if v ∈ S then (x * y) v else 1) = (if v ∈ S then x v else 1) * (if v ∈ S then y v else 1) split_ifs Β· rfl Β· exact (one_mul (1 : v.adicCompletion F)).symm def partAtAdele (S : Finset (HeightOneSpectrum (π“ž F))) : AdeleRing (π“ž F) F β†’* AdeleRing (π“ž F) F where toFun a := (a.1, truncFin F S a.2) map_one' := Prod.ext rfl (map_one (truncFin F S)) map_mul' a b := Prod.ext rfl (map_mul (truncFin F S) a.2 b.2) def partAt (S : Finset (HeightOneSpectrum (π“ž F))) : (AdeleRing (π“ž F) F)Λ£ β†’* (AdeleRing (π“ž F) F)Λ£ := Units.map (partAtAdele F S) open scoped Classical in def unitFin (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) : (FiniteAdeleRing (π“ž F) F)Λ£ where val := ⟨fun v => if v ∈ S then 1 else unitComponent F v a, Filter.Eventually.of_forall fun v => by show (if v ∈ S then (1 : v.adicCompletion F) else unitComponent F v a) ∈ v.adicCompletionIntegers F split_ifs Β· exact one_mem _ Β· rw [HeightOneSpectrum.mem_adicCompletionIntegers] exact (valued_unitComponent F v a).le⟩ inv := ⟨fun v => if v ∈ S then 1 else unitComponent F v a⁻¹, Filter.Eventually.of_forall fun v => by show (if v ∈ S then (1 : v.adicCompletion F) else unitComponent F v a⁻¹) ∈ v.adicCompletionIntegers F split_ifs Β· exact one_mem _ Β· rw [HeightOneSpectrum.mem_adicCompletionIntegers] exact (valued_unitComponent F v a⁻¹).le⟩ val_inv := by refine Subtype.ext (funext fun v => ?_) show (if v ∈ S then (1 : v.adicCompletion F) else unitComponent F v a) * (if v ∈ S then (1 : v.adicCompletion F) else unitComponent F v a⁻¹) = 1 split_ifs Β· exact one_mul 1 Β· exact unitComponent_mul_unitComponent_inv F v a inv_val := by refine Subtype.ext (funext fun v => ?_) show (if v ∈ S then (1 : v.adicCompletion F) else unitComponent F v a⁻¹) * (if v ∈ S then (1 : v.adicCompletion F) else unitComponent F v a) = 1 split_ifs Β· exact one_mul 1 Β· rw [mul_comm] exact unitComponent_mul_unitComponent_inv F v a def unitPart (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) : (AdeleRing (π“ž F) F)Λ£ := Units.map (finIncl (π“ž F) F) (unitFin F S a) theorem ord_uniformizerIdele_self (v : HeightOneSpectrum (π“ž F)) : ord F v (AutomorphicForm.uniformizerIdele F v) = 1 := by rw [ord] show -WithZero.log (Valued.v (((localUnit (π“ž F) F v (uniformizerUnit F v) : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v)) = 1 rw [localUnit_apply_self, valued_uniformizerUnit, WithZero.log_exp, neg_neg] theorem ord_uniformizerIdele_of_ne {v w : HeightOneSpectrum (π“ž F)} (h : w β‰  v) : ord F w (AutomorphicForm.uniformizerIdele F v) = 0 := by rw [ord] show -WithZero.log (Valued.v (((localUnit (π“ž F) F v (uniformizerUnit F v) : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) w)) = 0 rw [localUnit_apply_of_ne (π“ž F) F v (uniformizerUnit F v) h, map_one, WithZero.log_one, neg_zero] theorem ord_eq_zero_iff (v : HeightOneSpectrum (π“ž F)) (a : (AdeleRing (π“ž F) F)Λ£) : ord F v a = 0 ↔ ((finitePartUnits (π“ž F) F a : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v ∈ v.adicCompletionIntegers F ∧ (((finitePartUnits (π“ž F) F a)⁻¹ : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v ∈ v.adicCompletionIntegers F := by rw [IsDedekindDomain.FiniteAdeleRing.integer_and_inv_integer_iff_valuation_eq_one] show ord F v a = 0 ↔ Valued.v ((a : AdeleRing (π“ž F) F).2 v) = 1 constructor Β· intro h have h' : WithZero.log (Valued.v ((a : AdeleRing (π“ž F) F).2 v)) = 0 := by rw [ord] at h; exact neg_eq_zero.mp h rw [← WithZero.exp_log (valued_snd_ne_zero F v a), h', WithZero.exp_zero] Β· intro h rw [ord, h, WithZero.log_one, neg_zero] theorem partAt_fst (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) : ((partAt F S a : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).1 = (a : AdeleRing (π“ž F) F).1 := by rfl theorem partAt_snd_of_mem (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) {v : HeightOneSpectrum (π“ž F)} (hv : v ∈ S) : ((partAt F S a : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).2 v = (a : AdeleRing (π“ž F) F).2 v := by exact if_pos hv theorem partAt_snd_of_not_mem (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) {v : HeightOneSpectrum (π“ž F)} (hv : v βˆ‰ S) : ((partAt F S a : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).2 v = 1 := by exact if_neg hv theorem unitPart_fst (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) : ((unitPart F S a : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).1 = 1 := by rfl theorem unitPart_snd_of_mem (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) : βˆ€ v ∈ S, ((unitPart F S a : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).2 v = 1 := by intro v hv exact if_pos hv theorem unitPart_snd_of_not_mem (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) {v : HeightOneSpectrum (π“ž F)} (hv : v βˆ‰ S) : ((unitPart F S a : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).2 v = (a : AdeleRing (π“ž F) F).2 v * ((uniformizerUnit F v : (v.adicCompletion F)Λ£) : v.adicCompletion F) ^ (-(ord F v a)) := by exact if_neg hv private theorem unitFin_val_mem (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) (v : HeightOneSpectrum (π“ž F)) : ((unitFin F S a : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v ∈ v.adicCompletionIntegers F := by by_cases hv : v ∈ S Β· have h : ((unitFin F S a : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v = 1 := if_pos hv rw [h]; exact one_mem _ Β· have h : ((unitFin F S a : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v = unitComponent F v a := if_neg hv rw [h, HeightOneSpectrum.mem_adicCompletionIntegers]; exact (valued_unitComponent F v a).le private theorem unitFin_inv_mem (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) (v : HeightOneSpectrum (π“ž F)) : (((unitFin F S a)⁻¹ : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v ∈ v.adicCompletionIntegers F := by by_cases hv : v ∈ S Β· have h : (((unitFin F S a)⁻¹ : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v = 1 := if_pos hv rw [h]; exact one_mem _ Β· have h : (((unitFin F S a)⁻¹ : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v = unitComponent F v a⁻¹ := if_neg hv rw [h, HeightOneSpectrum.mem_adicCompletionIntegers]; exact (valued_unitComponent F v a⁻¹).le theorem finitePartUnits_unitPart_mem_unitIdeles (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) : finitePartUnits (π“ž F) F (unitPart F S a) ∈ IsDedekindDomain.FiniteAdeleRing.unitIdeles (π“ž F) F := by exact ⟨fun v => unitFin_val_mem F S a v, fun v => unitFin_inv_mem F S a v⟩ theorem unitPart_mul (S : Finset (HeightOneSpectrum (π“ž F))) (a b : (AdeleRing (π“ž F) F)Λ£) : unitPart F S (a * b) = unitPart F S a * unitPart F S b := by refine Units.ext ?_ show AdelicLevel.finIncl (π“ž F) F ((unitFin F S (a * b) : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) = AdelicLevel.finIncl (π“ž F) F ((unitFin F S a : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) * AdelicLevel.finIncl (π“ž F) F ((unitFin F S b : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) rw [← map_mul] refine congrArg _ (Subtype.ext (funext fun v => ?_)) show ((unitFin F S (a * b) : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v = ((unitFin F S a : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v * ((unitFin F S b : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v by_cases hv : v ∈ S Β· have h1 : ((unitFin F S (a * b) : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v = 1 := if_pos hv have h2 : ((unitFin F S a : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v = 1 := if_pos hv have h3 : ((unitFin F S b : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v = 1 := if_pos hv rw [h1, h2, h3, one_mul] Β· have h1 : ((unitFin F S (a * b) : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v = unitComponent F v (a * b) := if_neg hv have h2 : ((unitFin F S a : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v = unitComponent F v a := if_neg hv have h3 : ((unitFin F S b : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) v = unitComponent F v b := if_neg hv have hab : ((a * b : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).2 v = (a : AdeleRing (π“ž F) F).2 v * (b : AdeleRing (π“ž F) F).2 v := rfl rw [h1, h2, h3] simp only [unitComponent] rw [hab, ord_mul, neg_add, zpow_addβ‚€ (uniformizerUnit F v).ne_zero, mul_mul_mul_comm] private theorem idele_ext {a b : (AdeleRing (π“ž F) F)Λ£} (h₁ : βˆ€ w : InfinitePlace F, infiniteUnitsComponent (π“ž F) F w a = infiniteUnitsComponent (π“ž F) F w b) (hβ‚‚ : βˆ€ w : HeightOneSpectrum (π“ž F), finiteUnitsComponent (π“ž F) F w a = finiteUnitsComponent (π“ž F) F w b) : a = b := Units.ext (Prod.ext (funext fun w => congrArg Units.val (h₁ w)) (Subtype.ext (funext fun w => congrArg Units.val (hβ‚‚ w)))) private theorem iUC_partAt (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) (w : InfinitePlace F) : infiniteUnitsComponent (π“ž F) F w (partAt F S a) = infiniteUnitsComponent (π“ž F) F w a := Units.ext rfl private theorem iUC_unitPart (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) (w : InfinitePlace F) : infiniteUnitsComponent (π“ž F) F w (unitPart F S a) = 1 := Units.ext rfl private theorem iUC_uniformizerIdele (v : HeightOneSpectrum (π“ž F)) (w : InfinitePlace F) : infiniteUnitsComponent (π“ž F) F w (AutomorphicForm.uniformizerIdele F v) = 1 := Units.ext rfl private theorem fUC_partAt_of_mem (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) {w : HeightOneSpectrum (π“ž F)} (hw : w ∈ S) : finiteUnitsComponent (π“ž F) F w (partAt F S a) = finiteUnitsComponent (π“ž F) F w a := Units.ext (if_pos hw) private theorem fUC_partAt_of_not_mem (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) {w : HeightOneSpectrum (π“ž F)} (hw : w βˆ‰ S) : finiteUnitsComponent (π“ž F) F w (partAt F S a) = 1 := Units.ext (if_neg hw) private theorem fUC_unitPart_of_mem (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) {w : HeightOneSpectrum (π“ž F)} (hw : w ∈ S) : finiteUnitsComponent (π“ž F) F w (unitPart F S a) = 1 := Units.ext (if_pos hw) private theorem val_fUC_unitPart_of_not_mem (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) {w : HeightOneSpectrum (π“ž F)} (hw : w βˆ‰ S) : ((finiteUnitsComponent (π“ž F) F w (unitPart F S a) : (w.adicCompletion F)Λ£) : w.adicCompletion F) = (a : AdeleRing (π“ž F) F).2 w * (uniformizerUnit F w : w.adicCompletion F) ^ (-(ord F w a)) := if_neg hw private theorem fUC_uniformizerIdele_self (w : HeightOneSpectrum (π“ž F)) : finiteUnitsComponent (π“ž F) F w (AutomorphicForm.uniformizerIdele F w) = uniformizerUnit F w := Units.ext (by show ((localUnit (π“ž F) F w (uniformizerUnit F w) : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) w = _ rw [localUnit_apply_self]) private theorem fUC_uniformizerIdele_of_ne {v w : HeightOneSpectrum (π“ž F)} (h : w β‰  v) : finiteUnitsComponent (π“ž F) F w (AutomorphicForm.uniformizerIdele F v) = 1 := Units.ext (by show ((localUnit (π“ž F) F v (uniformizerUnit F v) : (FiniteAdeleRing (π“ž F) F)Λ£) : FiniteAdeleRing (π“ž F) F) w = 1 rw [localUnit_apply_of_ne (π“ž F) F v (uniformizerUnit F v) h]) theorem eq_partAt_mul_prod_mul_unitPart (S : Finset (HeightOneSpectrum (π“ž F))) (L : List (HeightOneSpectrum (π“ž F))) (hLS : βˆ€ v ∈ L, v βˆ‰ S) (hL : L.Nodup) (a : (AdeleRing (π“ž F) F)Λ£) (ha : a ∈ NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {v | v ∈ L})) : a = partAt F S a * (L.map fun v => AutomorphicForm.uniformizerIdele F v ^ ord F v a).prod * unitPart F S a := by classical rw [NumberField.AdeleRing.mem_unitIdelesOutside_iff] at ha refine idele_ext F (fun w => ?_) (fun w => ?_) Β· have hMw : infiniteUnitsComponent (π“ž F) F w (L.map fun v => AutomorphicForm.uniformizerIdele F v ^ ord F v a).prod = 1 := by rw [map_list_prod, List.map_map] refine List.prod_eq_one fun x hx => ?_ obtain ⟨v, -, rfl⟩ := List.mem_map.mp hx rw [Function.comp_apply, map_zpow, iUC_uniformizerIdele, one_zpow] rw [map_mul, map_mul, iUC_partAt, hMw, iUC_unitPart, mul_one, mul_one] Β· have hMw : finiteUnitsComponent (π“ž F) F w (L.map fun v => AutomorphicForm.uniformizerIdele F v ^ ord F v a).prod = (finiteUnitsComponent (π“ž F) F w (AutomorphicForm.uniformizerIdele F w) ^ ord F w a) ^ L.count w := by rw [map_list_prod, List.map_map, List.prod_map_eq_pow_single w] Β· rw [Function.comp_apply, map_zpow] Β· intro v hvw _ rw [Function.comp_apply, map_zpow, fUC_uniformizerIdele_of_ne F hvw.symm, one_zpow] rw [map_mul, map_mul, hMw] by_cases hwS : w ∈ S Β· have hwL : w βˆ‰ L := fun h => hLS w h hwS rw [fUC_partAt_of_mem F S a hwS, fUC_unitPart_of_mem F S a hwS, List.count_eq_zero.mpr hwL, pow_zero, mul_one, mul_one] Β· rw [fUC_partAt_of_not_mem F S a hwS, one_mul] refine Units.ext ?_ rw [Units.val_mul, val_fUC_unitPart_of_not_mem F S a hwS, Units.val_pow_eq_pow_val, Units.val_zpow_eq_zpow_val, fUC_uniformizerIdele_self] by_cases hwL : w ∈ L Β· rw [List.count_eq_one_of_mem hL hwL, pow_one, mul_left_comm, ← zpow_addβ‚€ (uniformizerUnit F w).ne_zero, add_neg_cancel, zpow_zero, mul_one] rfl Β· have hw' : w βˆ‰ (↑S βˆͺ {v | v ∈ L} : Set (HeightOneSpectrum (π“ž F))) := by rintro (h | h) Β· exact hwS h Β· exact hwL h have h0 : ord F w a = 0 := (ord_eq_zero_iff F w a).mpr (ha w hw') rw [List.count_eq_zero.mpr hwL, pow_zero, one_mul, h0, neg_zero, zpow_zero, mul_one] rfl theorem diagOne_eq_diagOne_partAt_mul_prod_mul (S : Finset (HeightOneSpectrum (π“ž F))) (L : List (HeightOneSpectrum (π“ž F))) (hLS : βˆ€ v ∈ L, v βˆ‰ S) (hL : L.Nodup) (a : (AdeleRing (π“ž F) F)Λ£) (ha : a ∈ NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {v | v ∈ L})) : diagOne a = diagOne (partAt F S a) * (L.map fun v => diagOne (AutomorphicForm.uniformizerIdele F v) ^ ord F v a).prod * diagOne (unitPart F S a) := by conv_lhs => rw [eq_partAt_mul_prod_mul_unitPart F S L hLS hL a ha] simp only [map_mul, map_list_prod, List.map_map, Function.comp_def, map_zpow] theorem diagOne_mul_finEmbed_localEmbed_of_snd_eq_one {v : HeightOneSpectrum (π“ž F)} (a : (AdeleRing (π“ž F) F)Λ£) (hav : (a : AdeleRing (π“ž F) F).2 v = 1) (x : GL (Fin 2) (v.adicCompletion F)) : diagOne a * AdelicDock.finEmbed (π“ž F) F (AdelicDock.localEmbed (π“ž F) F v x) = AdelicDock.finEmbed (π“ž F) F (AdelicDock.localEmbed (π“ž F) F v x) * diagOne a := by refine Units.ext ?_ rw [Units.val_mul, Units.val_mul, AdelicDock.coe_finEmbed, AdelicDock.coe_localEmbed] refine AdelicDock.matrix_eq_of_mapMatrix_arch_fin_eq (π“ž F) F ?_ ?_ Β· rw [map_mul, map_mul, AdelicDock.mapMatrix_arch_finMat, mul_one, one_mul] Β· rw [map_mul, map_mul, AdelicDock.mapMatrix_fin_finMat] refine AdelicDock.matrix_eq_of_forall_mapMatrix_finAdeleEval_eq (π“ž F) F fun w => ?_ rw [map_mul, map_mul] by_cases hw : w = v Β· have h00 : finAdeleEval (π“ž F) F v (adeleFin (π“ž F) F (a : AdeleRing (π“ž F) F)) = 1 := hav have hdiag : (finAdeleEval (π“ž F) F v).mapMatrix ((adeleFin (π“ž F) F).mapMatrix ((diagOne a : GL (Fin 2) (AdeleRing (π“ž F) F)) : Matrix (Fin 2) (Fin 2) (AdeleRing (π“ž F) F))) = 1 := by ext i j fin_cases i <;> fin_cases j <;> simp [RingHom.mapMatrix_apply, Matrix.map_apply, diagOne_coe_apply, h00] rw [hw, hdiag, AdelicDock.mapMatrix_localMat_self, one_mul, mul_one] Β· rw [AdelicDock.mapMatrix_localMat_of_ne (π“ž F) F v _ hw, mul_one, one_mul] theorem diagOne_partAt_mul_finEmbed_localEmbed (S : Finset (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) {v : HeightOneSpectrum (π“ž F)} (hv : v βˆ‰ S) (x : GL (Fin 2) (v.adicCompletion F)) : diagOne (partAt F S a) * AdelicDock.finEmbed (π“ž F) F (AdelicDock.localEmbed (π“ž F) F v x) = AdelicDock.finEmbed (π“ž F) F (AdelicDock.localEmbed (π“ž F) F v x) * diagOne (partAt F S a) := by exact diagOne_mul_finEmbed_localEmbed_of_snd_eq_one F (partAt F S a) (partAt_snd_of_not_mem F S a hv) x end NumberField.Idele namespace NumberField.Idele open MeasureTheory variable (F : Type) [Field F] [NumberField F] @[reducible] def ideleBorel : MeasurableSpace (AdeleRing (π“ž F) F)Λ£ := borel _ theorem borelSpace_ideleBorel : @BorelSpace (AdeleRing (π“ž F) F)Λ£ _ (ideleBorel F) := @BorelSpace.mk _ _ (ideleBorel F) rfl attribute [local instance] ideleBorel borelSpace_ideleBorel def idelicHaar : Measure (AdeleRing (π“ž F) F)Λ£ := Measure.haar theorem isHaarMeasure_idelicHaar : (idelicHaar F).IsHaarMeasure := by rw [idelicHaar]; infer_instance attribute [local instance] isHaarMeasure_idelicHaar theorem isOpen_unitIdelesOutside (T : Set (HeightOneSpectrum (π“ž F))) : IsOpen (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F T : Set (AdeleRing (π“ž F) F)Λ£) := by have hO : IsOpen {x : FiniteAdeleRing (π“ž F) F | βˆ€ v, v βˆ‰ T β†’ x.1 v ∈ v.adicCompletionIntegers F} := RestrictedProduct.isOpen_forall_imp_mem fun v => Valued.isOpen_valuationSubring _ have h1 : Continuous fun a : (AdeleRing (π“ž F) F)Λ£ => (a : AdeleRing (π“ž F) F).2 := continuous_snd.comp Units.continuous_val have h2 : Continuous fun a : (AdeleRing (π“ž F) F)Λ£ => ((a⁻¹ : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).2 := continuous_snd.comp Units.continuous_coe_inv have hset : (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F T : Set (AdeleRing (π“ž F) F)Λ£) = (fun a : (AdeleRing (π“ž F) F)Λ£ => (a : AdeleRing (π“ž F) F).2) ⁻¹' {x : FiniteAdeleRing (π“ž F) F | βˆ€ v, v βˆ‰ T β†’ x.1 v ∈ v.adicCompletionIntegers F} ∩ (fun a : (AdeleRing (π“ž F) F)Λ£ => ((a⁻¹ : (AdeleRing (π“ž F) F)Λ£) : AdeleRing (π“ž F) F).2) ⁻¹' {x : FiniteAdeleRing (π“ž F) F | βˆ€ v, v βˆ‰ T β†’ x.1 v ∈ v.adicCompletionIntegers F} := by ext a rw [SetLike.mem_coe, NumberField.AdeleRing.mem_unitIdelesOutside_iff, IsDedekindDomain.FiniteAdeleRing.mem_unitIdelesOutside_iff] exact ⟨fun h => Set.mem_inter (fun v hv => (h v hv).1) (fun v hv => (h v hv).2), fun h v hv => ⟨h.1 v hv, h.2 v hv⟩⟩ rw [hset] exact (hO.preimage h1).inter (hO.preimage h2) theorem idelicHaar_unitIdelesOutside_ne_zero (T : Set (HeightOneSpectrum (π“ž F))) : idelicHaar F (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F T : Set (AdeleRing (π“ž F) F)Λ£) β‰  0 := (isOpen_unitIdelesOutside F T).measure_ne_zero _ ⟨1, Subgroup.one_mem _⟩ open scoped Classical in theorem truncFin_eq_mapAlong (S : Finset (HeightOneSpectrum (π“ž F))) : (truncFin F S : FiniteAdeleRing (π“ž F) F β†’ FiniteAdeleRing (π“ž F) F) = RestrictedProduct.mapAlong (fun v : HeightOneSpectrum (π“ž F) => v.adicCompletion F) (fun v : HeightOneSpectrum (π“ž F) => v.adicCompletion F) id Filter.tendsto_id (fun v x => if v ∈ S then x else 1) (Filter.Eventually.of_forall fun v => by intro x hx show (if v ∈ S then x else 1) ∈ (v.adicCompletionIntegers F : Set (v.adicCompletion F)) by_cases h : v ∈ S Β· rw [if_pos h]; exact hx Β· rw [if_neg h]; exact one_mem _) := by funext x exact RestrictedProduct.ext _ _ fun v => rfl open scoped Classical in theorem continuous_truncFin (S : Finset (HeightOneSpectrum (π“ž F))) : Continuous (truncFin F S) := by rw [truncFin_eq_mapAlong] refine RestrictedProduct.mapAlong_continuous _ _ _ _ _ _ fun v => ?_ show Continuous fun x : v.adicCompletion F => if v ∈ S then x else 1 by_cases h : v ∈ S Β· simp only [if_pos h]; exact continuous_id Β· simp only [if_neg h]; exact continuous_const theorem continuous_partAtAdele (S : Finset (HeightOneSpectrum (π“ž F))) : Continuous (partAtAdele F S) := Continuous.prodMk continuous_fst ((continuous_truncFin F S).comp continuous_snd) theorem continuous_partAt (S : Finset (HeightOneSpectrum (π“ž F))) : Continuous (partAt F S) := Continuous.units_map _ (continuous_partAtAdele F S) theorem measurable_partAt (S : Finset (HeightOneSpectrum (π“ž F))) : Measurable (partAt F S) := (continuous_partAt F S).measurable def sPartMeasure (S : Finset (HeightOneSpectrum (π“ž F))) : Measure (AdeleRing (π“ž F) F)Λ£ := Measure.map (partAt F S) ((idelicHaar F).restrict (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S) : Set (AdeleRing (π“ž F) F)Λ£)) theorem sPartMeasure_ne_zero (S : Finset (HeightOneSpectrum (π“ž F))) : sPartMeasure F S β‰  0 := by intro h have h1 := congrArg (fun ΞΌ : Measure (AdeleRing (π“ž F) F)Λ£ => ΞΌ Set.univ) h simp only [sPartMeasure, Measure.map_apply (measurable_partAt F S) MeasurableSet.univ, Set.preimage_univ, Measure.restrict_apply_univ, Measure.coe_zero, Pi.zero_apply] at h1 exact idelicHaar_unitIdelesOutside_ne_zero F _ h1 private def ordHom (v : HeightOneSpectrum (π“ž F)) : (AdeleRing (π“ž F) F)Λ£ β†’* Multiplicative β„€ where toFun a := Multiplicative.ofAdd (ord F v a) map_one' := by rw [ord_one]; rfl map_mul' a b := by rw [ord_mul]; rfl private theorem ord_zpow (v : HeightOneSpectrum (π“ž F)) (a : (AdeleRing (π“ž F) F)Λ£) (n : β„€) : ord F v (a ^ n) = n * ord F v a := by have h : Multiplicative.ofAdd (ord F v (a ^ n)) = Multiplicative.ofAdd (ord F v a) ^ n := map_zpow (ordHom F v) a n rw [← ofAdd_zsmul] at h rw [Multiplicative.ofAdd.injective h, smul_eq_mul] private theorem fUC_partAt_uniformizerIdele (S : Finset (HeightOneSpectrum (π“ž F))) {v : HeightOneSpectrum (π“ž F)} (hv : v βˆ‰ S) (w : HeightOneSpectrum (π“ž F)) : finiteUnitsComponent (π“ž F) F w (partAt F S (AutomorphicForm.uniformizerIdele F v)) = 1 := by by_cases hw : w ∈ S Β· rw [fUC_partAt_of_mem F S _ hw] exact fUC_uniformizerIdele_of_ne F fun h => hv (h β–Έ hw) Β· exact fUC_partAt_of_not_mem F S _ hw private theorem partAt_uniformizerIdele_of_not_mem (S : Finset (HeightOneSpectrum (π“ž F))) {v : HeightOneSpectrum (π“ž F)} (hv : v βˆ‰ S) : partAt F S (AutomorphicForm.uniformizerIdele F v) = 1 := by refine idele_ext F (fun w => ?_) (fun w => ?_) Β· rw [iUC_partAt, iUC_uniformizerIdele, map_one] Β· rw [fUC_partAt_uniformizerIdele F S hv, map_one] private theorem mem_unitIdelesOutside_iff_ord (T : Set (HeightOneSpectrum (π“ž F))) (a : (AdeleRing (π“ž F) F)Λ£) : a ∈ NumberField.AdeleRing.unitIdelesOutside (π“ž F) F T ↔ βˆ€ w, w βˆ‰ T β†’ ord F w a = 0 := by rw [NumberField.AdeleRing.mem_unitIdelesOutside_iff, IsDedekindDomain.FiniteAdeleRing.mem_unitIdelesOutside_iff] refine forall_congr' fun w => imp_congr_right fun _ => ?_ rw [ord_eq_zero_iff] rfl private theorem mem_image_uniformizerIdele_zpow_mul_iff (T' : Set (HeightOneSpectrum (π“ž F))) {v : HeightOneSpectrum (π“ž F)} (hv : v βˆ‰ T') (n : β„€) (a : (AdeleRing (π“ž F) F)Λ£) : a ∈ (fun b : (AdeleRing (π“ž F) F)Λ£ => AutomorphicForm.uniformizerIdele F v ^ n * b) '' (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F T' : Set (AdeleRing (π“ž F) F)Λ£) ↔ a ∈ (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (insert v T') : Set (AdeleRing (π“ž F) F)Λ£) ∧ ord F v a = n := by constructor Β· rintro ⟨b, hb, rfl⟩ rw [SetLike.mem_coe, mem_unitIdelesOutside_iff_ord] at hb refine ⟨?_, ?_⟩ Β· rw [SetLike.mem_coe, mem_unitIdelesOutside_iff_ord] intro w hw rw [Set.mem_insert_iff, not_or] at hw rw [ord_mul, ord_zpow, ord_uniformizerIdele_of_ne F hw.1, mul_zero, zero_add, hb w hw.2] Β· rw [ord_mul, ord_zpow, ord_uniformizerIdele_self, mul_one, hb v hv, add_zero] Β· rintro ⟨ha, hn⟩ rw [SetLike.mem_coe, mem_unitIdelesOutside_iff_ord] at ha refine ⟨AutomorphicForm.uniformizerIdele F v ^ (-n) * a, ?_, ?_⟩ Β· rw [SetLike.mem_coe, mem_unitIdelesOutside_iff_ord] intro w hw by_cases hwv : w = v Β· rw [hwv, ord_mul, ord_zpow, ord_uniformizerIdele_self, mul_one, hn, neg_add_cancel] Β· rw [ord_mul, ord_zpow, ord_uniformizerIdele_of_ne F hwv, mul_zero, zero_add] exact ha w fun h => (Set.mem_insert_iff.mp h).elim hwv hw Β· show AutomorphicForm.uniformizerIdele F v ^ n * (AutomorphicForm.uniformizerIdele F v ^ (-n) * a) = a rw [← mul_assoc, ← zpow_add, add_neg_cancel, zpow_zero, one_mul] private theorem iUnion_image_uniformizerIdele_zpow_mul (T' : Set (HeightOneSpectrum (π“ž F))) {v : HeightOneSpectrum (π“ž F)} (hv : v βˆ‰ T') : (⋃ n : β„€, (fun b : (AdeleRing (π“ž F) F)Λ£ => AutomorphicForm.uniformizerIdele F v ^ n * b) '' (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F T' : Set (AdeleRing (π“ž F) F)Λ£)) = (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (insert v T') : Set (AdeleRing (π“ž F) F)Λ£) := by ext a rw [Set.mem_iUnion] constructor Β· rintro ⟨n, h⟩ exact ((mem_image_uniformizerIdele_zpow_mul_iff F T' hv n a).mp h).1 Β· intro h exact ⟨ord F v a, (mem_image_uniformizerIdele_zpow_mul_iff F T' hv _ a).mpr ⟨h, rfl⟩⟩ private theorem pairwise_disjoint_image_uniformizerIdele_zpow_mul (T' : Set (HeightOneSpectrum (π“ž F))) {v : HeightOneSpectrum (π“ž F)} (hv : v βˆ‰ T') : Pairwise (Function.onFun Disjoint fun n : β„€ => (fun b : (AdeleRing (π“ž F) F)Λ£ => AutomorphicForm.uniformizerIdele F v ^ n * b) '' (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F T' : Set (AdeleRing (π“ž F) F)Λ£)) := by intro m n hmn refine Set.disjoint_left.mpr fun a ham han => hmn ?_ exact ((mem_image_uniformizerIdele_zpow_mul_iff F T' hv m a).mp ham).2.symm.trans ((mem_image_uniformizerIdele_zpow_mul_iff F T' hv n a).mp han).2 private theorem integrableOn_and_integral_eq (S : Finset (HeightOneSpectrum (π“ž F))) (f : (AdeleRing (π“ž F) F)Λ£ β†’ β„‚) (Ο† : HeightOneSpectrum (π“ž F) β†’ β„€ β†’ β„‚) (hf : Integrable f (sPartMeasure F S)) : βˆ€ (L : List (HeightOneSpectrum (π“ž F))), (βˆ€ v ∈ L, v βˆ‰ S) β†’ L.Nodup β†’ (βˆ€ v ∈ L, Summable fun m : β„€ => β€–Ο† v mβ€–) β†’ IntegrableOn (fun a => f (partAt F S a) * (L.map fun v => Ο† v (ord F v a)).prod) (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {v | v ∈ L}) : Set (AdeleRing (π“ž F) F)Λ£) (idelicHaar F) ∧ (∫ a in (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {v | v ∈ L}) : Set (AdeleRing (π“ž F) F)Λ£), f (partAt F S a) * (L.map fun v => Ο† v (ord F v a)).prod βˆ‚(idelicHaar F)) = (∫ a, f a βˆ‚(sPartMeasure F S)) * (L.map fun v => βˆ‘' m : β„€, Ο† v m).prod := by intro L induction L with | nil => intro _ _ _ have hT : (↑S βˆͺ {v | v ∈ ([] : List (HeightOneSpectrum (π“ž F)))} : Set (HeightOneSpectrum (π“ž F))) = ↑S := by ext w simp only [Set.mem_union, Set.mem_setOf_eq, List.not_mem_nil, or_false] simp only [List.map_nil, List.prod_nil, mul_one, hT] have hΟ†m : AEMeasurable (partAt F S) ((idelicHaar F).restrict (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S) : Set (AdeleRing (π“ž F) F)Λ£)) := (measurable_partAt F S).aemeasurable rw [sPartMeasure] at hf ⊒ exact ⟨(integrable_map_measure hf.aestronglyMeasurable hΟ†m).mp hf, (integral_map hΟ†m hf.aestronglyMeasurable).symm⟩ | cons v L' IH => intro hLS hL hΟ† have hvS : v βˆ‰ S := hLS v (List.mem_cons.mpr (Or.inl rfl)) have hLS' : βˆ€ w ∈ L', w βˆ‰ S := fun w hw => hLS w (List.mem_cons.mpr (Or.inr hw)) have hvL' : v βˆ‰ L' := (List.nodup_cons.mp hL).1 have hL' : L'.Nodup := (List.nodup_cons.mp hL).2 have hΟ†v : Summable fun m : β„€ => β€–Ο† v mβ€– := hΟ† v (List.mem_cons.mpr (Or.inl rfl)) have hΟ†' : βˆ€ w ∈ L', Summable fun m : β„€ => β€–Ο† w mβ€– := fun w hw => hΟ† w (List.mem_cons.mpr (Or.inr hw)) obtain ⟨IHi, IHe⟩ := IH hLS' hL' hΟ†' have hv' : v βˆ‰ (↑S βˆͺ {w | w ∈ L'} : Set (HeightOneSpectrum (π“ž F))) := by rintro (h | h) Β· exact hvS (Finset.mem_coe.mp h) Β· exact hvL' h have hT : (↑S βˆͺ {w | w ∈ v :: L'} : Set (HeightOneSpectrum (π“ž F))) = insert v (↑S βˆͺ {w | w ∈ L'}) := by ext w simp only [Set.mem_union, Set.mem_setOf_eq, List.mem_cons, Set.mem_insert_iff, Finset.mem_coe] tauto rw [hT, ← iUnion_image_uniformizerIdele_zpow_mul F _ hv'] have hkey : βˆ€ (n : β„€) (b : (AdeleRing (π“ž F) F)Λ£), b ∈ (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {w | w ∈ L'}) : Set (AdeleRing (π“ž F) F)Λ£) β†’ f (partAt F S (AutomorphicForm.uniformizerIdele F v ^ n * b)) * ((v :: L').map fun w => Ο† w (ord F w (AutomorphicForm.uniformizerIdele F v ^ n * b))).prod = Ο† v n * (f (partAt F S b) * (L'.map fun w => Ο† w (ord F w b)).prod) := by intro n b hb rw [SetLike.mem_coe, mem_unitIdelesOutside_iff_ord] at hb have h1 : partAt F S (AutomorphicForm.uniformizerIdele F v ^ n * b) = partAt F S b := by rw [map_mul, map_zpow, partAt_uniformizerIdele_of_not_mem F S hvS, one_zpow, one_mul] have h2 : ord F v (AutomorphicForm.uniformizerIdele F v ^ n * b) = n := by rw [ord_mul, ord_zpow, ord_uniformizerIdele_self, mul_one, hb v hv', add_zero] have h3 : ((L'.map fun w => Ο† w (ord F w (AutomorphicForm.uniformizerIdele F v ^ n * b))) : List β„‚) = L'.map fun w => Ο† w (ord F w b) := by refine List.map_congr_left fun w hw => ?_ have hwv : w β‰  v := fun h => hvL' (h β–Έ hw) rw [ord_mul, ord_zpow, ord_uniformizerIdele_of_ne F hwv, mul_zero, zero_add] rw [List.map_cons, List.prod_cons, h1, h2, h3] ring have hmp : βˆ€ n : β„€, MeasurePreserving (fun b : (AdeleRing (π“ž F) F)Λ£ => AutomorphicForm.uniformizerIdele F v ^ n * b) (idelicHaar F) (idelicHaar F) := fun n => measurePreserving_mul_left (idelicHaar F) _ have hme : βˆ€ n : β„€, MeasurableEmbedding fun b : (AdeleRing (π“ž F) F)Λ£ => AutomorphicForm.uniformizerIdele F v ^ n * b := fun n => (MeasurableEquiv.mulLeft (AutomorphicForm.uniformizerIdele F v ^ n)).measurableEmbedding have hU' : MeasurableSet (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {w | w ∈ L'}) : Set (AdeleRing (π“ž F) F)Λ£) := (isOpen_unitIdelesOutside F _).measurableSet have hmeas : βˆ€ n : β„€, MeasurableSet ((fun b : (AdeleRing (π“ž F) F)Λ£ => AutomorphicForm.uniformizerIdele F v ^ n * b) '' (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {w | w ∈ L'}) : Set (AdeleRing (π“ž F) F)Λ£)) := fun n => (hme n).measurableSet_image.mpr hU' have hpi : βˆ€ n : β„€, IntegrableOn (fun a => f (partAt F S a) * ((v :: L').map fun w => Ο† w (ord F w a)).prod) ((fun b : (AdeleRing (π“ž F) F)Λ£ => AutomorphicForm.uniformizerIdele F v ^ n * b) '' (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {w | w ∈ L'}) : Set (AdeleRing (π“ž F) F)Λ£)) (idelicHaar F) := by intro n have hc0 : IntegrableOn (fun b => Ο† v n * (f (partAt F S b) * (L'.map fun w => Ο† w (ord F w b)).prod)) (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {w | w ∈ L'}) : Set (AdeleRing (π“ž F) F)Λ£) (idelicHaar F) := Integrable.const_mul IHi (Ο† v n) have hc : IntegrableOn (fun b => f (partAt F S (AutomorphicForm.uniformizerIdele F v ^ n * b)) * ((v :: L').map fun w => Ο† w (ord F w (AutomorphicForm.uniformizerIdele F v ^ n * b))).prod) (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {w | w ∈ L'}) : Set (AdeleRing (π“ž F) F)Λ£) (idelicHaar F) := hc0.congr_fun (fun b hb => (hkey n b hb).symm) hU' exact (((hmp n).restrict_image_emb (hme n) _).integrable_comp_emb (hme n) (g := fun a => f (partAt F S a) * ((v :: L').map fun w => Ο† w (ord F w a)).prod)).mp hc have hnorm : βˆ€ n : β„€, (∫ a in (fun b : (AdeleRing (π“ž F) F)Λ£ => AutomorphicForm.uniformizerIdele F v ^ n * b) '' (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {w | w ∈ L'}) : Set (AdeleRing (π“ž F) F)Λ£), β€–f (partAt F S a) * ((v :: L').map fun w => Ο† w (ord F w a)).prodβ€– βˆ‚(idelicHaar F)) = β€–Ο† v nβ€– * ∫ b in (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {w | w ∈ L'}) : Set (AdeleRing (π“ž F) F)Λ£), β€–f (partAt F S b) * (L'.map fun w => Ο† w (ord F w b)).prodβ€– βˆ‚(idelicHaar F) := by intro n rw [(hmp n).setIntegral_image_emb (hme n), ← integral_const_mul] refine setIntegral_congr_fun hU' fun b hb => ?_ show β€–f (partAt F S (AutomorphicForm.uniformizerIdele F v ^ n * b)) * ((v :: L').map fun w => Ο† w (ord F w (AutomorphicForm.uniformizerIdele F v ^ n * b))).prodβ€– = β€–Ο† v nβ€– * β€–f (partAt F S b) * (L'.map fun w => Ο† w (ord F w b)).prodβ€– rw [hkey n b hb, norm_mul] have hsum : Summable fun n : β„€ => ∫ a in (fun b : (AdeleRing (π“ž F) F)Λ£ => AutomorphicForm.uniformizerIdele F v ^ n * b) '' (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {w | w ∈ L'}) : Set (AdeleRing (π“ž F) F)Λ£), β€–f (partAt F S a) * ((v :: L').map fun w => Ο† w (ord F w a)).prodβ€– βˆ‚(idelicHaar F) := by simp_rw [hnorm] exact hΟ†v.mul_right _ have hint := integrableOn_iUnion_of_summable_integral_norm hpi hsum refine ⟨hint, ?_⟩ rw [integral_iUnion hmeas (pairwise_disjoint_image_uniformizerIdele_zpow_mul F _ hv') hint] have hval : βˆ€ n : β„€, (∫ a in (fun b : (AdeleRing (π“ž F) F)Λ£ => AutomorphicForm.uniformizerIdele F v ^ n * b) '' (NumberField.AdeleRing.unitIdelesOutside (π“ž F) F (↑S βˆͺ {w | w ∈ L'}) : Set (AdeleRing (π“ž F) F)Λ£), f (partAt F S a) * ((v :: L').map fun w => Ο† w (ord F w a)).prod βˆ‚(idelicHaar F)) = Ο† v n * ((∫ a, f a βˆ‚(sPartMeasure F S)) * (L'.map fun w => βˆ‘' m : β„€, Ο† w m).prod) := by intro n rw [(hmp n).setIntegral_image_emb (hme n), ← IHe, ← integral_const_mul] exact setIntegral_congr_fun hU' fun b hb => hkey n b hb simp_rw [hval] rw [tsum_mul_right, List.map_cons, List.prod_cons] ring def productMeasureData (S : Finset (HeightOneSpectrum (π“ž F))) : @UnramifiedWhittaker.ProductMeasureData F _ _ (ideleBorel F) S (idelicHaar F) where c := 1 c_pos := one_pos Ξ½S := sPartMeasure F S projS := partAt F S ord := ord F projS_off a _ hv := partAt_snd_of_not_mem F S a hv decomp L hLS hL a ha := ⟨unitPart F S a, unitPart_fst F S a, unitPart_snd_of_mem F S a, finitePartUnits_unitPart_mem_unitIdeles F S a, eq_partAt_mul_prod_mul_unitPart F S L hLS hL a ha⟩ tonelli L hLS hL f Ο† hf hΟ† := by obtain ⟨h1, h2⟩ := integrableOn_and_integral_eq F S f Ο† hf L hLS hL hΟ† exact ⟨h1, by rw [h2, Complex.ofReal_one, one_mul]⟩ measurableSet L _ _ := (isOpen_unitIdelesOutside F _).measurableSet end NumberField.Idele