import Mathlib import Definitions.Def_LanglandsTunnell_ArtinFrobenius set_option autoImplicit false noncomputable section open NumberField NumberField.InfinitePlace IsDedekindDomain open scoped Classical namespace ArtinL.Abelian section Finite variable {K M : Type*} [Field K] [NumberField K] [Field M] [NumberField M] [Algebra K M] [IsGalois K M] variable (K M) in def inertiaGroup (v : HeightOneSpectrum (π“ž K)) : Subgroup (M ≃ₐ[K] M) := (LanglandsTunnell.P2.Artin.primeAbove K M v).inertia (M ≃ₐ[K] M) variable (K M) in def ramificationGroup (v : HeightOneSpectrum (π“ž K)) (i : β„•) : Subgroup (M ≃ₐ[K] M) := (LanglandsTunnell.P2.Artin.primeAbove K M v ^ (i + 1)).inertia (M ≃ₐ[K] M) omit [NumberField M] [IsGalois K M] in theorem ramificationGroup_zero (v : HeightOneSpectrum (π“ž K)) : ramificationGroup K M v 0 = inertiaGroup K M v := by rw [ramificationGroup, zero_add, pow_one, inertiaGroup] def IsUnramifiedAt (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (v : HeightOneSpectrum (π“ž K)) : Prop := βˆ€ Οƒ ∈ inertiaGroup K M v, ψ Οƒ = 1 def localValue (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (v : HeightOneSpectrum (π“ž K)) : β„‚ := if IsUnramifiedAt ψ v then ((ψ (LanglandsTunnell.P2.Artin.artinFrob K M v) : β„‚Λ£) : β„‚) else 0 def idealValue (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (I : Ideal (π“ž K)) : β„‚ := ∏ᢠ v : HeightOneSpectrum (π“ž K), localValue ψ v ^ (Associates.mk v.asIdeal).count (Associates.mk I).factors def coeff (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (n : β„•) : β„‚ := if n = 0 then 0 else βˆ‘ I ∈ (Ideal.finite_setOf_absNorm_eq (S := π“ž K) n).toFinset, idealValue ψ I def LSeries (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (s : β„‚) : β„‚ := _root_.LSeries (coeff ψ) s def swanConductor (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (v : HeightOneSpectrum (π“ž K)) : β„š := βˆ‘αΆ  i : β„•, (Nat.card (ramificationGroup K M v (i + 1)) : β„š) / (Nat.card (inertiaGroup K M v) : β„š) * (if βˆ€ Οƒ ∈ ramificationGroup K M v (i + 1), ψ Οƒ = 1 then 0 else 1) def conductorExponent (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (v : HeightOneSpectrum (π“ž K)) : β„• := (if IsUnramifiedAt ψ v then 0 else 1) + ⌈swanConductor ψ vβŒ‰β‚Š def conductor (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) : Ideal (π“ž K) := ∏ᢠ v : HeightOneSpectrum (π“ž K), v.asIdeal ^ conductorExponent ψ v end Finite section Archimedean variable {K M : Type*} [Field K] [NumberField K] [Field M] [NumberField M] [Algebra K M] def IsPlusAt (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (v : InfinitePlace K) : Prop := βˆ€ w : InfinitePlace M, w.comap (algebraMap K M) = v β†’ βˆ€ Οƒ ∈ MulAction.stabilizer (M ≃ₐ[K] M) w, ψ Οƒ = 1 def nPlus (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) : β„• := Nat.card {v : InfinitePlace K // v.IsReal ∧ IsPlusAt ψ v} def nMinus (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) : β„• := nrRealPlaces K - nPlus ψ end Archimedean section Completed variable {K M : Type*} [Field K] [NumberField K] [Field M] [NumberField M] [Algebra K M] [IsGalois K M] def completedLSeries (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (s : β„‚) : β„‚ := ((|(discr K : ℝ)| * (Ideal.absNorm (conductor ψ) : ℝ) : ℝ) : β„‚) ^ (s / 2) * Complex.Gammaℝ s ^ nPlus ψ * Complex.Gammaℝ (s + 1) ^ nMinus ψ * Complex.Gammaβ„‚ s ^ nrComplexPlaces K * LSeries ψ s end Completed section OfSubgroup variable {k F : Type*} [Field k] [Field F] [Algebra k F] [FiniteDimensional k F] def ofSubgroup (H : Subgroup (F ≃ₐ[k] F)) (Ο‡ : H β†’* β„‚Λ£) : (F ≃ₐ[IntermediateField.fixedField H] F) β†’* β„‚Λ£ := Ο‡.comp ((MulEquiv.subgroupCongr (IntermediateField.fixingSubgroup_fixedField H)).toMonoidHom.comp (IntermediateField.fixingSubgroupEquiv (IntermediateField.fixedField H)).symm.toMonoidHom) theorem ofSubgroup_apply (H : Subgroup (F ≃ₐ[k] F)) (Ο‡ : H β†’* β„‚Λ£) (Οƒ : F ≃ₐ[IntermediateField.fixedField H] F) : ofSubgroup H Ο‡ Οƒ = Ο‡ βŸ¨Οƒ.restrictScalars k, (IntermediateField.fixingSubgroup_fixedField H).le (fun x => Οƒ.commutes x)⟩ := rfl omit [FiniteDimensional k F] in theorem restrictScalars_fixingSubgroupEquiv (E : IntermediateField k F) (Οƒ : E.fixingSubgroup) : (IntermediateField.fixingSubgroupEquiv E Οƒ).restrictScalars k = Οƒ := by ext; rfl theorem ofSubgroup_fixingSubgroupEquiv (H : Subgroup (F ≃ₐ[k] F)) (Ο‡ : H β†’* β„‚Λ£) (h : H) : ofSubgroup H Ο‡ (IntermediateField.fixingSubgroupEquiv (IntermediateField.fixedField H) ⟨h, by rw [IntermediateField.fixingSubgroup_fixedField H]; exact h.2⟩) = Ο‡ h := by rw [ofSubgroup, MonoidHom.comp_apply, MonoidHom.comp_apply, MulEquiv.coe_toMonoidHom, MulEquiv.coe_toMonoidHom, MulEquiv.symm_apply_apply] rfl end OfSubgroup section Basic variable {K M : Type*} [Field K] [NumberField K] [Field M] [NumberField M] [Algebra K M] [IsGalois K M] @[simp] theorem coeff_zero (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) : coeff ψ 0 = 0 := by simp [coeff] omit [IsGalois K M] in theorem conductor_ne_bot (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) : conductor ψ β‰  βŠ₯ := by unfold conductor refine finprod_induction (fun I : Ideal (π“ž K) => I β‰  βŠ₯) ?_ (fun I J hI hJ => mul_ne_zero hI hJ) (fun v => pow_ne_zero _ v.ne_bot) exact one_ne_zero omit [IsGalois K M] in theorem absNorm_conductor_pos (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) : 0 < Ideal.absNorm (conductor ψ) := Nat.pos_of_ne_zero fun h => conductor_ne_bot ψ (Ideal.absNorm_eq_zero_iff.1 h) omit [NumberField M] [IsGalois K M] in theorem nPlus_le (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) : nPlus ψ ≀ nrRealPlaces K := by rw [nPlus, nrRealPlaces, ← Nat.card_eq_fintype_card] exact Nat.card_mono (Set.toFinite _) fun v hv => hv.1 omit [NumberField M] [IsGalois K M] in theorem nPlus_add_nMinus (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) : nPlus ψ + nMinus ψ = nrRealPlaces K := by rw [nMinus, Nat.add_sub_cancel' (nPlus_le ψ)] theorem norm_apply (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (Οƒ : M ≃ₐ[K] M) : β€–((ψ Οƒ : β„‚Λ£) : β„‚)β€– = 1 := by have hfin : IsOfFinOrder Οƒ := isOfFinOrder_of_finite Οƒ obtain ⟨n, hn, hΟƒβŸ© := hfin.exists_pow_eq_one have h1 : ((ψ Οƒ : β„‚Λ£) : β„‚) ^ n = 1 := by rw [← Units.val_pow_eq_pow_val, ← map_pow, hΟƒ, map_one, Units.val_one] have h2 : β€–((ψ Οƒ : β„‚Λ£) : β„‚)β€– ^ n = 1 := by rw [← norm_pow, h1, norm_one] exact (pow_eq_one_iff_of_nonneg (norm_nonneg _) hn.ne').1 h2 theorem coe_inv_apply (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (Οƒ : M ≃ₐ[K] M) : ((ψ⁻¹ Οƒ : β„‚Λ£) : β„‚) = starRingEnd β„‚ ((ψ Οƒ : β„‚Λ£) : β„‚) := by rw [MonoidHom.inv_apply, Units.val_inv_eq_inv_val] exact (Complex.inv_eq_conj (norm_apply ψ Οƒ)) omit [NumberField M] [IsGalois K M] in theorem isUnramifiedAt_inv_iff (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (v : HeightOneSpectrum (π“ž K)) : IsUnramifiedAt ψ⁻¹ v ↔ IsUnramifiedAt ψ v := by simp [IsUnramifiedAt] theorem localValue_inv (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (v : HeightOneSpectrum (π“ž K)) : localValue ψ⁻¹ v = starRingEnd β„‚ (localValue ψ v) := by unfold localValue rw [isUnramifiedAt_inv_iff] split_ifs Β· exact coe_inv_apply ψ _ Β· simp theorem idealValue_inv (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (I : Ideal (π“ž K)) : idealValue ψ⁻¹ I = starRingEnd β„‚ (idealValue ψ I) := by unfold idealValue rw [show starRingEnd β„‚ (∏ᢠ v : HeightOneSpectrum (π“ž K), localValue ψ v ^ (Associates.mk v.asIdeal).count (Associates.mk I).factors) = (starRingAut (R := β„‚)).toMulEquiv (∏ᢠ v : HeightOneSpectrum (π“ž K), localValue ψ v ^ (Associates.mk v.asIdeal).count (Associates.mk I).factors) from rfl, MulEquiv.map_finprod] exact finprod_congr fun v => by rw [localValue_inv, map_pow] rfl omit [IsGalois K M] in theorem swanConductor_inv (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (v : HeightOneSpectrum (π“ž K)) : swanConductor ψ⁻¹ v = swanConductor ψ v := by simp [swanConductor] omit [IsGalois K M] in theorem conductorExponent_inv (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (v : HeightOneSpectrum (π“ž K)) : conductorExponent ψ⁻¹ v = conductorExponent ψ v := by rw [conductorExponent, conductorExponent, swanConductor_inv, isUnramifiedAt_inv_iff] omit [IsGalois K M] in theorem conductor_inv (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) : conductor ψ⁻¹ = conductor ψ := by simp [conductor, conductorExponent_inv] omit [NumberField K] [NumberField M] [IsGalois K M] in theorem isPlusAt_inv_iff (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (v : InfinitePlace K) : IsPlusAt ψ⁻¹ v ↔ IsPlusAt ψ v := by simp [IsPlusAt] omit [NumberField M] [IsGalois K M] in theorem nPlus_inv (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) : nPlus ψ⁻¹ = nPlus ψ := by simp [nPlus, isPlusAt_inv_iff] omit [NumberField M] [IsGalois K M] in theorem nMinus_inv (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) : nMinus ψ⁻¹ = nMinus ψ := by rw [nMinus, nMinus, nPlus_inv] theorem coeff_inv (ψ : (M ≃ₐ[K] M) β†’* β„‚Λ£) (n : β„•) : coeff ψ⁻¹ n = starRingEnd β„‚ (coeff ψ n) := by unfold coeff split_ifs Β· simp Β· rw [map_sum] exact Finset.sum_congr rfl fun I _ => idealValue_inv ψ I end Basic end ArtinL.Abelian end