module public import Lib.ClassField.GreenbergWiles.Relations public import New.Congruences.Selmer.SelmerData import Lib.ClassField.Global.AlbertBrauerHasseNoether import Lib.Cyclotomic.Voronoi import Lib.General.NumberTheory.CoefficientRings /-! # The dual of a tied Selmer group and the count The dual group is a module of relations at split primes, and the count is the Greenberg–Wiles inequality with the local terms estimated above `ℓ`, at the other places of `S`, and at the ties. * `New.Selmer.SelmerDatum.dualSelmer`: the dual of the tied Selmer group. * `New.Selmer.SelmerDatum.exists_length_tiedSelmer_le`: the tied group is no longer than its dual, up to the local terms at the places of `S` prime to `ℓ`. Notions from other files: * `New.Selmer.SelmerDatum`: a lattice `T = O ^ n` with Galois action `T.ρ`, unramified outside the finite set `S = T.places ⊆ S₀`, a module `Z_w = T.Z w` of local cocycles for each `w ∣ ℓ`, and an element `γ_* = T.γ` that acts by a scalar. The local conditions `T.localRelations` are the linear relations that hold on the modules `Z_w`. The module `T / a` is `n → QuotSpan a`. * `New.Selmer.SelmerDatum.tiedSelmer T R J x i a`: the cocycles with values in `T / a` that are unramified outside `S ∪ R ∪ R̄` and obey `T.classRelations` (the local conditions `T.localRelations` and vanishing at `γ_*`) and the ties of index `i` on `J`. * `New.Selmer.IsTiedPrimes ℓ S₀ V W N P₀ J x`: a set `J` of auxiliary primes, which with their conjugates lie outside `S₀`. Here `(x v).1` holds a tame generator `γ_v` and a Frobenius element `φ_v` at `v ∈ J`, and `(x v).2 i` is the slope at `v` for the index `i`. The first prime `P₀ ∈ J` has slope `0` and `φ_{P₀} ∈ W`. Where the slope for `i` is not zero, `φ_v` and `φ_v^{-c}` satisfy the condition `V i`. * `New.Selmer.tieRelations`: the ties `z(γ_w) = s • z(φ_w)` with slope `s` at the primes `w` of `J` and of `J̄`; `New.Selmer.unionWithConj S J` is the set `S ∪ J ∪ J̄`. * `New.Selmer.localCocycles`: the restrictions to a decomposition group of the cocycles that obey given relations. * `New.RelationSetting`: a finite Galois module with local conditions; `New.RelationSetting.relations` is the module of relations at split primes, in place of dual cocycles. ## Relation to the literature See `New.Congruences.Selmer.Descent` for related work. -/ @[expose] public section noncomputable section namespace New.Selmer.SelmerDatum open Module Matrix.Module Finset commutatorElement variable {ℓ : ℕ} [ThePrime ℓ] {E : Type} [Field E] [EmbeddedNumberField E] [NumberField.IsCMField E] {S₀ : Finset (FinPlace E)} {g₀ : Gal(Ω/E)} {O n ι : Type} [CommRing O] [PadicIntegerRing O ℓ] [Fintype n] [DecidableEq n] (T : SelmerDatum ℓ S₀ g₀ O n) {M N : ℕ} {a : O} /-- An element that acts trivially on `T / ℓ ^ M` fixes `T / a` for `a ∣ ℓ ^ M`. -/ lemma smul_eq_self_of_reduceModPow_eq_one (ha : a ∣ ℓ ^ M) {g : Gal(Ω/E)} (hg : reduceModPow ℓ M T.ρ g = 1) (b : n → QuotSpan a) : T.ρ g • b = b := by let : Module (QuotSpan (ℓ ^ M : O)) (QuotSpan a) := IsTorsionBy.module (smul_quot_eq_zero_of_dvd ha) change reduceModPow ℓ M T.ρ g • b = b rw [hg, one_smul] /-- For `a ∣ ℓ ^ M` the orbit map `g ↦ g • b` of a vector `b` of `T / a` is locally constant, as it factors through the action on `T / ℓ ^ M`. -/ lemma isLocallyConstant_smul (ha : a ∣ ℓ ^ M) (b : n → QuotSpan a) : IsLocallyConstant fun g : Gal(Ω/E) ↦ T.ρ g • b := by let : Module (QuotSpan (ℓ ^ M : O)) (QuotSpan a) := IsTorsionBy.module (smul_quot_eq_zero_of_dvd ha) change IsLocallyConstant fun g : Gal(Ω/E) ↦ reduceModPow ℓ M T.ρ g • b exact (T.isLocallyConstant M).comp fun B ↦ B • b /-- The discrete Galois module `T / a`, for `a ∣ ℓ ^ M`. -/ abbrev reductionModule (ha : a ∣ ℓ ^ M) : DiscreteModule O Gal(Ω/E) := letI : TopologicalSpace (QuotSpan a) := ⊥ haveI : DiscreteTopology (QuotSpan a) := ⟨rfl⟩ .of (actionRep O (n → QuotSpan a) T.ρ) (continuous_prod_of_discrete_right.2 fun b ↦ (T.isLocallyConstant_smul ha b).continuous) /-- The kernel `U` of the action on `T / ℓ ^ M` and on the roots of unity of order `ℓ ^ N`. -/ def reductionKer (M N : ℕ) : OpenNormalSubgroup Gal(Ω/E) where toSubgroup := (reduceModPow ℓ M T.ρ).ker ⊓ (cyclotomicCharMod Ω (ℓ ^ N)).ker isOpen' := .inter (T.isLocallyConstant M {1}) isOpen_ker_cyclotomicCharMod.out isNormal' := inferInstanceAs (Subgroup.Normal (_ ⊓ _)) lemma mem_reductionKer {g : Gal(Ω/E)} : g ∈ T.reductionKer M N ↔ reduceModPow ℓ M T.ρ g = 1 ∧ cyclotomicCharMod Ω (ℓ ^ N) g = 1 := Iff.rfl /-- For `a ∣ ℓ ^ M`, every `g` in the group `T.reductionKer M N` acts trivially through `T.ρ` on `n → QuotSpan a`, the reduction `T / a` with coordinates in `O / aO`. -/ lemma smul_eq_self_of_mem_reductionKer (ha : a ∣ ℓ ^ M) {g : Gal(Ω/E)} (hg : g ∈ T.reductionKer M N) (b : n → QuotSpan a) : T.ρ g • b = b := T.smul_eq_self_of_reduceModPow_eq_one ha (T.mem_reductionKer.1 hg).1 b /-- The group `T.sahGroup` generated by the commutators `[g, γ_*]` and `[g, γ_*^c]` acts trivially on `T / ℓ ^ M` and on the roots of unity of order `ℓ ^ N`. -/ lemma mem_reductionKer_of_mem_sahGroup {h : Gal(Ω/E)} (hh : h ∈ T.sahGroup) : h ∈ T.reductionKer M N := T.mem_reductionKer.2 ⟨by simp [reduceModPow, ρ_eq_one_of_mem_sahGroup hh], map_eq_one_of_mem_sahGroup _ hh⟩ /-- Inertia at a prime outside `T.places` acts trivially on `T / ℓ ^ M` and on the roots of unity of order `ℓ ^ N`. -/ lemma mem_reductionKer_of_mem_inertiaAbove {g : Gal(Ω/E)} (hg : g ∈ inertiaAbove (T.places : Set (FinPlace E))ᶜ) : g ∈ T.reductionKer M N := by have h_cyc : cyclotomicChar Ω ℓ g = 1 := cyclotomicChar_eq_one_of_mem_inertiaAbove (hg.imp fun _ hv ↦ ⟨fun h ↦ hv.1 (T.placesDividing_subset h), hv.2⟩) exact ⟨by simp [reduceModPow, T.unramified g hg], by simp [cyclotomicCharMod_prime_pow_eq, h_cyc]⟩ variable {V : ι → Gal(Ω/E) → Prop} {W : Set Gal(Ω/E)} {P₀ : FinPlace E} {J : Finset (FinPlace E)} {x : FinPlace E → AuxPrimeData E (ℓ ^ N) × (ι → O)} {i : ι} /-- A function `c` obeys the ties of index `i` on `J` if and only if `c(γ_v) = s_v • c(φ_v)` and `c(γ_v^{-c}) = s_v • c(φ_v^{-c})` for all `v ∈ J`. Here `γ_v` is `(x v).1.tameGenerator`, `φ_v` is `(x v).1.frob`, `s_v = (x v).2 i` is the slope, and `g^{-c}` means `(conjGal g)⁻¹`, the case `side = false` of `idOrConjInv side g`. -/ lemma mem_obeying_tieRelations_iff {q : ℕ} {x : FinPlace E → AuxPrimeData E q × (ι → O)} {c : Gal(Ω/E) → n → QuotSpan a} : c ∈ obeying (tieRelations J x i) (QuotSpan a) ↔ ∀ v ∈ J, ∀ side : Bool, c (idOrConjInv side (x v).1.tameGenerator) = (x v).2 i • c (idOrConjInv side (x v).1.frob) := by rw [mem_obeying, tieRelations, Set.forall_mem_range] simp [sub_eq_zero] /-- Let `J` be a set of tied primes, where each `g` with `V i g` acts trivially on `T / ℓ ^ M`, and let `a ∣ ℓ ^ M`. Then the coboundary of `b ∈ T / a` obeys the ties on `J`: the tame generators `γ_v` fix `T / a`, and so do the Frobenius elements `φ_v` at the primes whose slope `s_v` is not zero. -/ lemma coboundary_mem_obeying_tieRelations (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (hV : ∀ g : Gal(Ω/E), V i g → reduceModPow ℓ M T.ρ g = 1) (ha : a ∣ ℓ ^ M) (b : n → QuotSpan a) : (fun g : Gal(Ω/E) ↦ T.ρ g • b - b) ∈ obeying (tieRelations J x i) (QuotSpan a) := by refine mem_obeying_tieRelations_iff.2 fun v hvJ side ↦ ?_ obtain ⟨hv : v ∉ S₀, -, -, hv_conj : star v ∉ S₀⟩ := hp.auxiliary v hvJ have h_aux : IsAuxPrimeDataAt (placesDividing E ℓ) v (x v).1 := hp.isAuxPrimeDataAt v hvJ have h_mem : idOrConjInv side (x v).1.tameGenerator ∈ inertiaAbove (T.places : Set (FinPlace E))ᶜ := idOrConjInv_mem_inertiaAbove (S := (T.places : Set (FinPlace E))ᶜ) h_aux.isPlaceOver h_aux.tame_gen.1 ⟨fun h ↦ hv (T.subset h), fun h ↦ hv_conj (T.subset h)⟩ side have hγ : T.ρ (idOrConjInv side (x v).1.tameGenerator) = 1 := T.unramified _ h_mem by_cases h_slope : (x v).2 i = 0 · simp [hγ, h_slope] · have hφ : T.ρ (idOrConjInv side (x v).1.frob) • b = b := T.smul_eq_self_of_reduceModPow_eq_one ha (hV _ (hp.apply_idOrConjInv_of_slope_ne_zero hvJ h_slope side)) b simp [hγ, hφ] /-- Let `J` be a set of tied primes, where each `g` with `V i g` acts trivially on `T / ℓ ^ M`, and let `a ∣ ℓ ^ M`. Then the coboundary of `b ∈ T / a` is a cocycle unramified outside `T.places` that obeys the local conditions `T.localRelations` and the ties on `J`. -/ lemma coboundary_mem_selmerModule (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (hV : ∀ g : Gal(Ω/E), V i g → reduceModPow ℓ M T.ρ g = 1) (ha : a ∣ ℓ ^ M) (b : n → QuotSpan a) : (fun g : Gal(Ω/E) ↦ T.ρ g • b - b) ∈ selmerModule T.ρ T.places (T.localRelations ∪ tieRelations J x i) (QuotSpan a) := by refine mem_selmerModule_iff.2 ⟨fun g h ↦ by simp [mul_smul, smul_sub], fun g hg ↦ by simp [T.unramified g hg], mem_obeying.2 ?_, (T.isLocallyConstant_smul ha b).sub (.const b)⟩ rintro f (hf | hf) · exact mem_obeying.1 (T.coboundary_mem_obeying_localRelations a b) f hf · exact mem_obeying.1 (T.coboundary_mem_obeying_tieRelations hp hV ha b) f hf /-- Let `J` be a set of tied primes with first prime `P₀`, and let `z` be in the Selmer group modulo `a` that may ramify at `T.places ∪ R ∪ R̄` and obeys the ties on `J`. Then `z` vanishes at the tame generator `γ_{P₀}` (`side = true`) and at `γ_{P₀}^{-c}` (`side = false`), as `s_{P₀} = 0`. -/ lemma apply_first_tameGenerator_eq_zero_of_mem_tiedSelmer (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) {R : Finset (FinPlace E)} {z : Gal(Ω/E) → n → QuotSpan a} (hz : z ∈ T.tiedSelmer R J x i a) (side : Bool) : z (idOrConjInv side (x P₀).1.tameGenerator) = 0 := by obtain ⟨-, -, h_obeys, -⟩ := mem_selmerModule_iff.1 hz simpa [hp.first_slope] using mem_obeying.1 h_obeys _ (.inr ⟨(⟨P₀, hp.first_mem⟩, side), rfl⟩) open scoped Classical in /-- Let `J` be a set of tied primes with first prime `P₀`, let `a ∣ ℓ ^ M`, and let `z` be in the Selmer group modulo `a` that may ramify at `S ∪ R ∪ R̄`, for `S = T.places`, and obeys the ties on `J`. Then `P₀` can be removed from `R`: the cocycle `z` is unramified outside `S ∪ I ∪ Ī`, where `I = R \ {P₀}`, and obeys the same relations, namely the ties and `T.classRelations` (the local conditions `T.localRelations` and vanishing at `γ_* = T.γ`). -/ lemma mem_selmerModule_erase (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (ha : a ∣ ℓ ^ M) {R : Finset (FinPlace E)} {z : Gal(Ω/E) → n → QuotSpan a} (hz : z ∈ T.tiedSelmer R J x i a) : z ∈ selmerModule T.ρ (unionWithConj T.places (R.erase P₀)) (T.classRelations ∪ tieRelations J x i) (QuotSpan a) := by refine mem_selmerModule_of_eq_zero_on_inertiaAbove hz .rfl fun v hv ↦ ?_ obtain ⟨hvS, hv₀⟩ : v ∉ T.places ∧ (v = P₀ ∨ v = star P₀) := by grind only [unionWithConj, = mem_union, = mem_image, = mem_erase, = Set.mem_sdiff, = mem_coe] have h_aux : IsAuxPrimeDataAt (placesDividing E ℓ) P₀ (x P₀).1 := hp.isAuxPrimeDataAt P₀ hp.first_mem have h_unr : ∀ g ∈ inertiaAbove {v}, T.ρ g = 1 := fun g ⟨u, hu, h_inertia⟩ ↦ T.unramified g ⟨u, by simp_all, h_inertia⟩ obtain ⟨-, -, h_tame : h_aux.isPlaceOver.tameGenerator = (x P₀).1.tameGenerator⟩ := h_aux.tame_gen obtain ⟨side, B, -, h_side⟩ := exists_conj_side_detects (nsmul_quot_eq_zero ha) h_aux.isPlaceOver h_aux.notMem h_unr hv₀ rw [h_tame] at h_side exact (h_side z hz (T.apply_first_tameGenerator_eq_zero_of_mem_tiedSelmer hp hz side)).1 open scoped Classical in /-- The setting of global duality for the tied Selmer group modulo `a`: the module `T / a`, the primes `T.places ∪ I ∪ Ī` with `I = J \ {P₀}` and the places `A v` above them, and the kernel `U` of the action on `T / ℓ ^ M` and on the `ℓ ^ N`-th roots of unity. The allowed local cocycles at `v` are the restrictions of the global cocycles that obey the local conditions `T.localRelations` and the ties on `J`. That `J` is a set of tied primes (`hp`) means: `J` is a finite set of primes of `E` that lie, with their conjugates, outside the finite set `S₀ ⊇ T.places`. At `v ∈ J`, `(x v).1` holds a tame generator `γ_v` of inertia, a Frobenius element `φ_v` and a character to `ℤ / ℓ ^ N`, and `s_v = (x v).2 i` in `O` is the slope for the index `i`. The first prime `P₀ ∈ J` has slope `0` and `φ_{P₀} ∈ W`, and `V i` holds at `φ_v` and `φ_v^{-c}` if `s_v ≠ 0`, where `g^{-c} = (c g c)⁻¹` for complex conjugation `c`. The ties on `J` are the relations `z(γ_v) = s_v • z(φ_v)` and `z(γ_v^{-c}) = s_v • z(φ_v^{-c})` for `v ∈ J`. -/ def tiedSetting (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (hV : ∀ g : Gal(Ω/E), V i g ↔ reduceModPow ℓ M T.ρ g = 1) (hN : M < N) (ha : a ∣ ℓ ^ M) (A : ∀ v : FinPlace E, {A : ClosurePlace // IsPlaceOver A v}) : RelationSetting (T.reductionModule ha) (ℓ ^ N) where nsmul_eq_zero := nsmul_pi_quot_eq_zero (ha.trans (pow_dvd_pow _ hN.le)) subgroup := T.reductionKer M N apply_eq_of_mem _ hg := T.smul_eq_self_of_mem_reductionKer ha hg cyclotomicCharMod_eq_one _ hg := (T.mem_reductionKer.1 hg).2 notMem_of_isComplexConj hc := hc.false_of_isTotallyComplex.elim ρ_eq_one_of_isComplexConj hc := hc.false_of_isTotallyComplex.elim localPrimes := unionWithConj T.places (J.erase P₀) unramified g := fun ⟨v, hv, h_inertia⟩ ↦ LinearMap.ext fun b ↦ by change T.ρ g • b = b rw [T.unramified g ⟨v, fun h ↦ hv (mem_union_left _ h), h_inertia⟩, one_smul] place v := A v isPlaceOver v := (A v).property allowed v := localCocycles T.ρ (T.localRelations ∪ tieRelations J x i) (A v) (QuotSpan a) coboundary_le := by rintro v - z ⟨b, hb⟩ exact ⟨fun g ↦ T.ρ g • b - b, mem_selmerModule_of_subset (T.coboundary_mem_selmerModule hp (fun g ↦ (hV g).mp) ha b) .rfl (Set.subset_univ _), hb⟩ open scoped Classical in /-- Let `J` be a set of tied primes with first prime `P₀`, where `V i g` says that `g` acts trivially on `T / ℓ ^ M`, let `M < N` and `a ∣ ℓ ^ M`, and let `A v` be a place over each prime `v`. Put `S' = T.places ∪ I ∪ Ī` with `I = J \ {P₀}`. Let `c` be a locally constant cocycle with values in `T / a` that is unramified outside a set `S ⊆ S' ∪ P` and obeys relations `K` containing the local conditions `T.localRelations` and the ties on `J`. Then `c` lies in the group `Z(P)` of `T.tiedSetting`: the cocycles unramified outside `S' ∪ P` that agree on the decomposition group at `A v`, for each `v ∈ S'`, with a cocycle that obeys the local conditions and the ties. -/ lemma mem_cocycles_tiedSetting (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (hV : ∀ g : Gal(Ω/E), V i g ↔ reduceModPow ℓ M T.ρ g = 1) (hN : M < N) (ha : a ∣ ℓ ^ M) (A : ∀ v : FinPlace E, {A : ClosurePlace // IsPlaceOver A v}) {S P : Set (FinPlace E)} {K : Set (Gal(Ω/E) →₀ Matrix n n O)} {c : Gal(Ω/E) → n → QuotSpan a} (hc : c ∈ selmerModule T.ρ S K (QuotSpan a)) (hK : T.localRelations ∪ tieRelations J x i ⊆ K) (hS : S ⊆ unionWithConj T.places (J.erase P₀) ∪ P) : c ∈ (T.tiedSetting hp hV hN ha A).cocycles P := letI : TopologicalSpace (QuotSpan a) := ⊥ haveI : DiscreteTopology (QuotSpan a) := ⟨rfl⟩ mem_selmerZ1_of_mem_selmerModule hc hK hS /-- Let `J` be a set of tied primes with first prime `P₀`, where `V i g` says that `g` acts trivially on `T / ℓ ^ M`, let `M < N` and `a ∣ ℓ ^ M`, and let `A v` be a place over each prime `v`. Then the absolute norm `q = P₀.q` of the prime `P₀` can be avoided in the setting `T.tiedSetting`: it is prime to `ℓ ^ N`, no prime of `T.places ∪ I ∪ Ī` with `I = J \ {P₀}` divides it, and the inertia groups above the primes of `E` that divide it lie in the kernel `T.reductionKer M N` of the action on `T / ℓ ^ M` and on the `ℓ ^ N`-th roots of unity. -/ lemma tiedSetting_avoids (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (hV : ∀ g : Gal(Ω/E), V i g ↔ reduceModPow ℓ M T.ρ g = 1) (hN : M < N) (ha : a ∣ ℓ ^ M) (A : ∀ v : FinPlace E, {A : ClosurePlace // IsPlaceOver A v}) : (T.tiedSetting hp hV hN ha A).Avoids P₀.q := by classical have h_places_notMem {v : FinPlace E} (hv : v ∈ T.places) : v ∉ placesDividing E P₀.q := hp.notMem_placesDividing v (.inl (T.subset hv)) have h_later {v : FinPlace E} (hv : v ∈ J.erase P₀) : v ∉ placesDividing E P₀.q := hp.notMem_placesDividing v (.inr (mem_erase.1 hv).symm) refine ⟨(hp.isAuxPrimeDataAt P₀ hp.first_mem).norm_modEq.coprime_of_modEq_one.symm, fun v (hv : v ∈ unionWithConj T.places (J.erase P₀)) ↦ ?_, fun v hv B hB g hg ↦ T.mem_reductionKer_of_mem_inertiaAbove ⟨v, fun h ↦ h_places_notMem h hv, B, hB, hg⟩⟩ simp only [unionWithConj, mem_union, mem_image] at hv obtain hv | hv | ⟨w, hw, rfl⟩ := hv exacts [h_places_notMem hv, h_later hv, mt star_mem_placesDividing.1 (h_later hw)] open scoped Classical in /-- The dual `Sel^*(J)` of the tied Selmer group modulo `a`, given as the module of relations off `R \ {P₀, P̄₀}`, for a finite set `R` of primes. These are the equivariant homomorphisms from `U = T.reductionKer M N` to the character module of `T / a` that are unramified outside that set, so at `P₀` and `P̄₀`, and satisfy the reciprocity law at split primes outside it. -/ abbrev dualSelmer (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (hV : ∀ g : Gal(Ω/E), V i g ↔ reduceModPow ℓ M T.ρ g = 1) (hN : M < N) (ha : a ∣ ℓ ^ M) (A : ∀ v : FinPlace E, {A : ClosurePlace // IsPlaceOver A v}) (R : Finset (FinPlace E)) : Submodule O (Gal(Ω/E) → CharacterModule (n → QuotSpan a)) := (T.tiedSetting hp hV hN ha A).relations (R \ {P₀, star P₀}) /-- Let `J` be a set of tied primes, let `a ∣ ℓ ^ M`, and let `v ∉ T.places` be a prime of `J` or the conjugate of one. At a suitable place `B` over `v`, the module of local cocycles that obey the local conditions `T.localRelations` and the ties on `J` is no longer than `T / a`: such a cocycle is determined by its value at `φ_v` if `v ∈ J`, or at `φ_w^{-c}` if `v = w̄` with `w ∈ J`. -/ lemma exists_length_localCocycles_tied_le (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (ha : a ∣ ℓ ^ M) {v : FinPlace E} (hv : v ∈ unionWithConj T.places J) (hvS : v ∉ T.places) : ∃ B : ClosurePlace, IsPlaceOver B v ∧ length O (localCocycles T.ρ (T.localRelations ∪ tieRelations J x i) B (QuotSpan a)) ≤ length O (n → QuotSpan a) := by classical obtain ⟨w, hw, hvw⟩ : ∃ w ∈ J, v = w ∨ v = star w := by grind only [unionWithConj, = mem_union, = mem_image] have h_unr : ∀ g ∈ inertiaAbove {v}, T.ρ g = 1 := fun g ⟨u, hu, h_inertia⟩ ↦ T.unramified g ⟨u, by simp_all, h_inertia⟩ have h_aux : IsAuxPrimeDataAt (placesDividing E ℓ) w (x w).1 := hp.isAuxPrimeDataAt w hw obtain ⟨-, -, h_tame : h_aux.isPlaceOver.tameGenerator = (x w).1.tameGenerator⟩ := h_aux.tame_gen obtain ⟨side, B, hB, h_side⟩ := exists_conj_side_detects (nsmul_quot_eq_zero ha) h_aux.isPlaceOver h_aux.notMem h_unr hvw rw [h_tame] at h_side let Z : Submodule O (Gal(Ω/E) → n → QuotSpan a) := selmerModule T.ρ .univ (T.localRelations ∪ tieRelations J x i) (QuotSpan a) -- A tied cocycle that vanishes at the Frobenius element vanishes at the tame generator, so on -- the whole decomposition group. have h_detects : ∀ c ∈ Z, c (idOrConjInv side (x w).1.frob) = 0 → ∀ g : decompGroup Gal(Ω/E) B, c g = 0 := by intro c hc hφ obtain ⟨-, -, h_obeys : c ∈ obeying (tieRelations J x i) (QuotSpan a), -⟩ := mem_selmerModule_iff.1 (mem_selmerModule_of_subset hc Set.subset_union_right .rfl) have hγ : c (idOrConjInv side (x w).1.tameGenerator) = 0 := by rw [mem_obeying_tieRelations_iff.1 h_obeys w hw side, hφ, smul_zero] exact (h_side c hc hγ).2 _ h_aux.isFrob hφ refine ⟨B, hB, ?_⟩ let res : (Gal(Ω/E) → n → QuotSpan a) →ₗ[O] decompGroup Gal(Ω/E) B → n → QuotSpan a := .funLeft O _ (decompGroup Gal(Ω/E) B).subtype calc length O (Z.map res) = relLength Z (LinearMap.ker res) := (relLength_ker Z res).symm _ ≤ relLength (⊤ : Submodule O (n → QuotSpan a)) ⊥ := relLength_le_of_mapsTo (.proj (idOrConjInv side (x w).1.frob)) (fun _ _ ↦ Submodule.mem_top) fun c hc hφ ↦ funext (h_detects c hc hφ) _ = length O (n → QuotSpan a) := by rw [relLength_bot, length_top] /-- Let `J` be a set of tied primes, where `V i g` says that `g` acts trivially on `T / ℓ ^ M`, and let `M < N` and `a ∣ ℓ ^ M`. Put `S = T.places`. Let `Sel(J) = T.tiedSelmer J J x i a` be the module of cocycles with values in `T / a` that are unramified outside `S ∪ J ∪ J̄`, vanish at `γ_* = T.γ` and obey the local conditions `T.localRelations` and the ties on `J`. Let `Z(∅) = (T.tiedSetting hp hV hN ha A).cocycles ∅`. Then `len (T / a) + len Sel(J) ≤ len Z(∅)`. -/ lemma length_add_length_tiedSelmer_le (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (hV : ∀ g : Gal(Ω/E), V i g ↔ reduceModPow ℓ M T.ρ g = 1) (hN : M < N) (ha : a ∣ ℓ ^ M) (A : ∀ v : FinPlace E, {A : ClosurePlace // IsPlaceOver A v}) : length O (n → QuotSpan a) + length O (T.tiedSelmer J J x i a) ≤ length O ((T.tiedSetting hp hV hN ha A).cocycles ∅) := by classical let Z : Submodule O (Gal(Ω/E) → n → QuotSpan a) := (T.tiedSetting hp hV hN ha A).cocycles ∅ let ev : (Gal(Ω/E) → n → QuotSpan a) →ₗ[O] n → QuotSpan a := .proj T.γ have h_onto : Z.map ev = ⊤ := by refine Submodule.eq_top_iff'.2 fun y ↦ ?_ obtain ⟨b, rfl⟩ := T.bijective_γ_smul_sub.surjective y exact Submodule.mem_map_of_mem (f := ev) <| T.mem_cocycles_tiedSetting hp hV hN ha A (T.coboundary_mem_selmerModule hp (fun g ↦ (hV g).mp) ha b) .rfl fun _ hv ↦ .inl (mem_union_left _ hv) -- A tied class is unramified at the first prime and its conjugate. have h_ker : T.tiedSelmer J J x i a ≤ Z ⊓ LinearMap.ker ev := fun c hc ↦ ⟨T.mem_cocycles_tiedSetting hp hV hN ha A (T.mem_selmerModule_erase hp ha hc) (Set.union_subset_union_left _ Set.subset_union_left) Set.subset_union_left, T.apply_γ_eq_zero hc⟩ rw [← length_map_add_length_inf_ker Z ev, h_onto, length_top] exact add_le_add_right (length_mono h_ker) _ open scoped Classical in /-- A case of the Greenberg–Wiles inequality. Let `J` be a set of tied primes, where `V i g` says that `g` acts trivially on `T / ℓ ^ M`, let `M < N` and `a ∣ ℓ ^ M`, and let `A v` be a place over each prime `v`. Put `S' = T.places ∪ I ∪ Ī` with `I = J \ {P₀}`. For a suitable finite set `R` of primes, `len Z(∅) + (#S' + f) len (T / a) ≤ len Sel^* + len (T / a) + ∑_{v ∈ S'} len L_v`. Here `L_v` is the module of restrictions to the decomposition group at `A v` of the cocycles that obey the local conditions `T.localRelations` and the ties on `J`, and `Z(∅)` is the module of cocycles with values in `T / a`, unramified outside `S'`, whose restriction at `A v` lies in `L_v` for all `v ∈ S'`. Further, `f` is the number of infinite places of `E` and `Sel^*` is the dual Selmer module `T.dualSelmer` of relations off `R \ {P₀, P̄₀}`. -/ lemma exists_length_cocycles_le (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (hV : ∀ g : Gal(Ω/E), V i g ↔ reduceModPow ℓ M T.ρ g = 1) (hN : M < N) (ha : a ∣ ℓ ^ M) (A : ∀ v : FinPlace E, {A : ClosurePlace // IsPlaceOver A v}) : ∃ R : Finset (FinPlace E), length O ((T.tiedSetting hp hV hN ha A).cocycles ∅) + (#(unionWithConj T.places (J.erase P₀)) + Core.numInfPlaces E) • length O (n → QuotSpan a) ≤ length O (T.dualSelmer hp hV hN ha A R) + length O (n → QuotSpan a) + ∑ v ∈ unionWithConj T.places (J.erase P₀), length O (localCocycles T.ρ (T.localRelations ∪ tieRelations J x i) (A v) (QuotSpan a)) := by have : NeZero a := ⟨ne_zero_of_dvd_ne_zero (NeZero.ne _) ha⟩ let D : RelationSetting (T.reductionModule ha) (ℓ ^ N) := T.tiedSetting hp hV hN ha A let d : ℕ := #(unionWithConj T.places (J.erase P₀)) + Core.numInfPlaces E -- The element `γ_*` fixes the roots of unity, is central modulo `D.subgroup` and fixes no nonzero -- vector. have h_comm (g : Gal(Ω/E)) : ⁅T.γ, g⁆ ∈ D.subgroup := by rw [← commutatorElement_inv] exact inv_mem (T.mem_reductionKer_of_mem_sahGroup (T.commutator_γ_mem g)) have h_fix (b : n → QuotSpan a) (hb : T.ρ T.γ • b = b) : b = 0 := T.bijective_γ_smul_sub.injective (by simp [hb]) have : NeZero P₀.q := ⟨P₀.one_lt_q.ne_bot⟩ obtain ⟨R, -, h_avoid, h_card : Nat.card (D.cocycles ∅) * Nat.card (n → QuotSpan a) ^ d ≤ Nat.card (D.relations R) * Nat.card (n → QuotSpan a) * ∏ v ∈ D.localPrimes, Nat.card (D.localCocycles v)⟩ := D.exists_card_cocycles_le hN.ne_bot T.cyclotomicChar_γ h_comm h_fix (T.tiedSetting_avoids hp hV hN ha A) have hP₀ : P₀ ∈ placesDividing E P₀.q := P₀.asIdeal.absNorm_mem have hR : R \ {P₀, star P₀} = R := by simpa using And.intro (mt (h_avoid _) (not_not.2 hP₀)) (mt (h_avoid _) (not_not.2 (star_mem_placesDividing.2 hP₀))) refine ⟨R, ?_⟩ rw [dualSelmer, hR] -- Write both sides as orders of modules and pass to lengths. have h_prod : Nat.card (D.cocycles ∅ × (Fin d → n → QuotSpan a)) ≤ Nat.card ((D.relations R × (n → QuotSpan a)) × ∀ v : D.localPrimes, D.localCocycles v) := by rwa [Nat.card_prod, Nat.card_prod, Nat.card_prod, Nat.card_fun, Nat.card_fin, Nat.card_pi (α := D.localPrimes), prod_coe_sort D.localPrimes fun v ↦ Nat.card (D.localCocycles v)] have : Finite (D.cocycles ∅) := (selmerZ1.finite_unramified_cocycles (T.reductionModule ha) (D.localPrimes.finite_toSet.union Set.finite_empty)).subset inf_le_left calc length O (D.cocycles ∅) + d • length O (n → QuotSpan a) = length O (D.cocycles ∅ × (Fin d → n → QuotSpan a)) := by simp [length_prod] _ ≤ length O ((D.relations R × (n → QuotSpan a)) × ∀ v : D.localPrimes, D.localCocycles v) := length_le_of_card_le h_prod _ = length O (D.relations R) + length O (n → QuotSpan a) + ∑ v ∈ D.localPrimes, length O (D.localCocycles v) := by rw [length_prod, length_prod, length_pi_of_fintype O (ι := D.localPrimes), sum_coe_sort D.localPrimes fun v ↦ length O (D.localCocycles v)] _ ≤ _ := add_le_add_right (sum_le_sum fun v _ ↦ length_mono inf_le_left) _ /-- The modules of local cocycles with values in `T / a` that obey the local conditions, at the places above `ℓ`, have total length at most `(#{w ∣ ℓ} + f) len (T / a)`, where `f` is the number of infinite places. Indeed, the module at `w` has length at most `rk Z_w · len (O / a)` for the module `Z_w = T.Z w` of the datum, and the datum has `∑_w rk Z_w ≤ (#{w ∣ ℓ} + f) rk T`. -/ lemma sum_length_localCocycles_placesDividing_le (a : O) : ∑ w : placesDividing E ℓ, length O (localCocycles T.ρ T.localRelations (placeOver w.val) (QuotSpan a)) ≤ (Fintype.card (placesDividing E ℓ) + Core.numInfPlaces E) • length O (n → QuotSpan a) := calc ∑ w : placesDividing E ℓ, length O (localCocycles T.ρ T.localRelations (placeOver w.val) (QuotSpan a)) ≤ ∑ w : placesDividing E ℓ, finrank O (T.Z w) * length O (QuotSpan a) := sum_le_sum fun w _ ↦ T.length_localCocycles_le_finrank_mul a w _ ≤ ((Fintype.card (placesDividing E ℓ) + Core.numInfPlaces E) * Fintype.card n : ℕ) * length O (QuotSpan a) := by rw [← sum_mul, ← Nat.cast_sum] exact mul_le_mul_left (Nat.cast_le.2 T.sum_finrank_Z_le) _ _ = (Fintype.card (placesDividing E ℓ) + Core.numInfPlaces E) • length O (n → QuotSpan a) := by rw [length_pi_of_fintype, sum_const, card_univ, smul_smul, nsmul_eq_mul] /-- Imposing more relations shrinks the local cocycle module. -/ private lemma localCocycles_le_of_relations_subset {A : ClosurePlace} {K L : Set (Gal(Ω/E) →₀ Matrix n n O)} (hKL : K ⊆ L) : localCocycles T.ρ L A (QuotSpan a) ≤ localCocycles T.ρ K A (QuotSpan a) := Submodule.map_mono fun _ hc ↦ mem_selmerModule_of_subset hc hKL .rfl /-- For `a ≠ 0`, the modules of local cocycles with values in `T / a` that obey the local conditions, at the fixed places above the primes of `S = T.places`, have total length at most `(#S + f) len (T / a) + lt_S(T)`. Here `f` is the number of infinite places and `lt_S(T) = T.placesTerm` is the sum over the places of `S` prime to `ℓ` of the local terms, the largest excess of the length of the local cocycles over that of `T / a` as `a ≠ 0` varies. -/ lemma sum_length_localCocycles_placeOver_le (ha : a ≠ 0) : ∑ v ∈ T.places, length O (localCocycles T.ρ T.localRelations (placeOver v) (QuotSpan a)) ≤ (#T.places + Core.numInfPlaces E) • length O (n → QuotSpan a) + T.placesTerm := by classical rw [← sum_filter_add_sum_filter_not T.places (· ∈ placesDividing E ℓ), ← card_filter_add_card_filter_not (s := T.places) (· ∈ placesDividing E ℓ), add_right_comm _ _ (Core.numInfPlaces E), add_nsmul, add_assoc] refine add_le_add ?_ ?_ · have hSℓ (v : FinPlace E) : v ∈ {v ∈ T.places | v ∈ placesDividing E ℓ} ↔ v ∈ placesDividing E ℓ := mem_filter.trans (and_iff_right_of_imp fun hv ↦ T.placesDividing_subset hv) rw [sum_subtype _ hSℓ, ← Fintype.card_of_subtype _ hSℓ] exact T.sum_length_localCocycles_placesDividing_le a · -- At a place prime to `ℓ` all classes are allowed, and the local term bounds their excess. rw [← sum_const, placesTerm, placeTerms, ← sum_add_distrib] refine sum_le_sum fun v _ ↦ (length_mono (T.localCocycles_le_of_relations_subset (Set.empty_subset _))).trans (tsub_le_iff_left.1 (le_iSup₂_of_le a ha le_rfl)) open scoped Classical in /-- Let `J` be a set of tied primes with first prime `P₀` and let `a ∣ ℓ ^ M`. Put `S' = S ∪ I ∪ Ī` with `S = T.places` and `I = J \ {P₀}`. For suitable places `A v` over the primes `v`, the modules at `A v`, for `v ∈ S'`, of local cocycles that obey the local conditions `T.localRelations` and the ties on `J` have total length at most `(#S' + f) len (T / a) + lt_S(T)`. Here `f` is the number of infinite places of `E` and `lt_S(T) = T.placesTerm` is the sum of the local terms at the places of `S` prime to `ℓ`. -/ lemma exists_sum_length_localCocycles_tied_le (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (ha : a ∣ ℓ ^ M) : ∃ A : ∀ v : FinPlace E, {A : ClosurePlace // IsPlaceOver A v}, ∑ v ∈ unionWithConj T.places (J.erase P₀), length O (localCocycles T.ρ (T.localRelations ∪ tieRelations J x i) (A v) (QuotSpan a)) ≤ (#(unionWithConj T.places (J.erase P₀)) + Core.numInfPlaces E) • length O (n → QuotSpan a) + T.placesTerm := by let lenQuot : ℕ∞ := length O (n → QuotSpan a) let lenLocal (B : ClosurePlace) : ℕ∞ := length O (localCocycles T.ρ (T.localRelations ∪ tieRelations J x i) B (QuotSpan a)) let S' : Finset (FinPlace E) := unionWithConj T.places (J.erase P₀) -- Above `S` take the fixed places, and above `I ∪ Ī` the places of the ties. have h_places (v : FinPlace E) : ∃ B : {B : ClosurePlace // IsPlaceOver B v}, (v ∈ T.places → B = placeOver v) ∧ (v ∈ S' \ T.places → lenLocal B ≤ lenQuot) := by by_cases hv : v ∈ S' \ T.places · obtain ⟨B, hB, h_le⟩ := T.exists_length_localCocycles_tied_le (x := x) (i := i) hp ha (v := v) (by grind) (mem_sdiff.1 hv).2 exact ⟨⟨B, hB⟩, by aesop, fun _ ↦ h_le⟩ · exact ⟨⟨placeOver v, v.isPlaceOver_placeOver⟩, by grind⟩ choose A hA h_tied using h_places refine ⟨A, ?_⟩ -- On `S` the ties only shrink the modules of local cocycles. have h_shrink (v : FinPlace E) (hv : v ∈ T.places) : lenLocal (A v) ≤ length O (localCocycles T.ρ T.localRelations (placeOver v) (QuotSpan a)) := by rw [hA v hv] exact length_mono (T.localCocycles_le_of_relations_subset Set.subset_union_left) have h_S : ∑ v ∈ T.places, lenLocal (A v) ≤ (#T.places + Core.numInfPlaces E) • lenQuot + T.placesTerm := (sum_le_sum h_shrink).trans (T.sum_length_localCocycles_placeOver_le (ne_zero_of_dvd_ne_zero (NeZero.ne _) ha)) have h_sub : T.places ⊆ S' := subset_union_left calc ∑ v ∈ S', lenLocal (A v) = ∑ v ∈ S' \ T.places, lenLocal (A v) + ∑ v ∈ T.places, lenLocal (A v) := (sum_sdiff h_sub).symm _ ≤ #(S' \ T.places) • lenQuot + ((#T.places + Core.numInfPlaces E) • lenQuot + T.placesTerm) := add_le_add ((sum_le_sum h_tied).trans_eq (sum_const lenQuot)) h_S _ = (#S' + Core.numInfPlaces E) • lenQuot + T.placesTerm := by simp only [← card_sdiff_add_card_eq_card h_sub, add_nsmul, add_assoc] /-- Let `J` be a set of tied primes, where `V i g` says that `g` acts trivially on `T / ℓ ^ M`, and let `M < N` and `a ∣ ℓ ^ M`. Put `S = T.places`. Let `Sel(J) = T.tiedSelmer J J x i a` be the module of cocycles with values in `T / a` that are unramified outside `S ∪ J ∪ J̄` (first argument `J`), vanish at `γ_* = T.γ` and obey the local conditions `T.localRelations` and the ties on `J` (second argument `J`). For suitable places `A v` of `Ω` over the primes `v` and a finite set `R` of primes, `Sel(J)` is no longer than its dual `T.dualSelmer`, up to the sum `T.placesTerm` of the local terms at the places of `S` prime to `ℓ`. -/ theorem exists_length_tiedSelmer_le (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) (hV : ∀ g : Gal(Ω/E), V i g ↔ reduceModPow ℓ M T.ρ g = 1) (hN : M < N) (ha : a ∣ ℓ ^ M) : ∃ (A : ∀ v : FinPlace E, {A : ClosurePlace // IsPlaceOver A v}) (R : Finset (FinPlace E)), length O (T.tiedSelmer J J x i a) ≤ length O (T.dualSelmer hp hV hN ha A R) + T.placesTerm := by classical -- Bound the local modules in the Greenberg–Wiles inequality and pass from cocycles to classes. have : NeZero a := ⟨ne_zero_of_dvd_ne_zero (NeZero.ne _) ha⟩ let lenQuot : ℕ∞ := length O (n → QuotSpan a) let S' : Finset (FinPlace E) := unionWithConj T.places (J.erase P₀) let d : ℕ := #S' + Core.numInfPlaces E let lenLocal (B : ClosurePlace) : ℕ∞ := length O (localCocycles T.ρ (T.localRelations ∪ tieRelations J x i) B (QuotSpan a)) obtain ⟨A, h_local : ∑ v ∈ S', lenLocal (A v) ≤ d • lenQuot + T.placesTerm⟩ := T.exists_sum_length_localCocycles_tied_le hp ha obtain ⟨R, h_formula⟩ := T.exists_length_cocycles_le hp hV hN ha A refine ⟨A, R, ?_⟩ -- Cancel the finite length of `(T / a) ^ (1 + d)`. have h_fin : lenQuot + d • lenQuot ≠ ⊤ := by rw [← succ_nsmul', nsmul_eq_mul] exact WithTop.mul_ne_top (ENat.natCast_ne_top _) length_ne_top refine (ENat.add_le_add_iff_left h_fin).1 ?_ calc lenQuot + d • lenQuot + length O (T.tiedSelmer J J x i a) = lenQuot + length O (T.tiedSelmer J J x i a) + d • lenQuot := by abel _ ≤ length O ((T.tiedSetting hp hV hN ha A).cocycles ∅) + d • lenQuot := add_le_add_left (T.length_add_length_tiedSelmer_le hp hV hN ha A) _ _ ≤ length O (T.dualSelmer hp hV hN ha A R) + lenQuot + ∑ v ∈ S', lenLocal (A v) := h_formula _ ≤ length O (T.dualSelmer hp hV hN ha A R) + lenQuot + (d • lenQuot + T.placesTerm) := add_le_add_right h_local _ _ = lenQuot + d • lenQuot + (length O (T.dualSelmer hp hV hN ha A R) + T.placesTerm) := by abel end New.Selmer.SelmerDatum end