module public import Lib.ClassField.GaloisCohomology.TameSelmerCocycles public import Lib.ClassField.GreenbergWiles.SelmerLevels public import New.Congruences.Selmer.AuxiliaryPrimes import Lib.ClassField.Global.AlbertBrauerHasseNoether import Lib.General.NumberTheory.CoefficientRings import TauCeti.RepresentationTheory.Homological.GroupCohomology.Sah /-! # Selmer data, tied Selmer groups and classes as functions A lattice `T` is given by matrices `ρ g` over `O`, and `W = (O / a) ^ n` is its reduction modulo `a`. The datum includes an element `γ_*` of the Galois group that acts on `T` by a scalar `ζ_*` with `ζ_* ^ 2 - 1` a unit. A class in `H¹(E, W)` is identified with its cocycle that vanishes at `γ_*`. * `New.Selmer.finite_selmerModule`: for finite `S` and `ρ` locally constant modulo `ℓ ^ M`, the Selmer module with coefficients in a finite `O / a`, `a ∣ ℓ ^ M`, is finite. * `New.Selmer.SelmerDatum`: a lattice with modules `Z_w` of local cocycles above `ℓ`; `New.Selmer.SelmerDatum.β` is the sum of a global term and local terms. * `New.Selmer.SelmerDatum.localRelations`, `New.Selmer.SelmerDatum.length_localCocycles_le_finrank_mul`: the linear relations that hold on the `Z_w`, and the length of the local cocycles that obey them. * `New.Selmer.SelmerDatum.tiedSelmer`: the classes with ties at auxiliary primes. * `New.Selmer.IsNewAuxiliaryPrime`: the primes that may be added. * `New.Selmer.SelmerDatum.sahGroup`, `New.Selmer.SelmerDatum.span_image_sahGroup_eq_top`: the group `H` generated by commutators with `γ_*` and `γ_*^c`, on which classes are detected. * `New.Selmer.congruenceTerm_le`: a bound for the global term from one element that acts by scalars. Notions from other files: * `New.Selmer.IsTiedPrimes`: a set `J` of auxiliary primes ("tied primes") with places, Frobenius elements `φ`, tame generators `γ`, characters to `ℤ / ℓ ^ N` and slopes, and a first prime `P₀ ∈ J`. * `New.IsAuxPrimeDataAt`: for auxiliary data at a prime `P`, says that they consist of a place over `P`, a Frobenius, the tame generator `γ` and a character with value `1` at `γ` that is unramified outside `P` and its conjugate and kills the decomposition groups above a given set. * `New.idOrConjInv`: `g` if `b` is true, and `g^{-c} = (conjGal g)⁻¹` if `b` is false. ## Relation to the literature Known result: Sah's lemma, by which cocycles vanishing at an element that acts by a scalar `ζ` with `ζ - 1` a unit are detected on commutators. See `New.Congruences.Selmer.Descent` for related work. -/ @[expose] public section noncomputable section namespace New.Selmer section Finite open Module Matrix.Module variable {E n O : Type} [Field E] [EmbeddedNumberField E] [Fintype n] [DecidableEq n] [CommRing O] {ℓ M : ℕ} {ρ : Gal(Ω/E) →* Matrix n n O} {S : Set (FinPlace E)} /-- Let `E` be a number field embedded in the algebraic closure `Ω` of `ℚ`, let `ρ` be a representation of `Gal(Ω/E)` by matrices over `O` that is locally constant modulo `ℓ ^ M`, and let `S` be a finite set of primes of `E`. Let `a ∣ ℓ ^ M` with `QuotSpan a = O / a` finite, and let `L` be a set of relations `∑ γ, f γ • c γ = 0` on functions `c`. Then the Selmer module of `ρ` with coefficients in `O / a` is finite. -/ theorem finite_selmerModule {a : O} [Finite (QuotSpan a)] (ha : a ∣ ℓ ^ M) (hρ : IsLocallyConstant (reduceModPow ℓ M ρ)) (hS : S.Finite) (L : Set (Gal(Ω/E) →₀ Matrix n n O)) : Finite (selmerModule ρ S L (QuotSpan a)) := by let : TopologicalSpace (QuotSpan a) := ⊥ have : DiscreteTopology (QuotSpan a) := ⟨rfl⟩ -- The ring `O / ℓ ^ M` acts on `O / a`, so `ρ` acts through its reduction, hence continuously. let : Module (QuotSpan (ℓ ^ M : O)) (QuotSpan a) := Module.IsTorsionBy.module (smul_quot_eq_zero_of_dvd ha) have h_cont (b : n → QuotSpan a) : IsLocallyConstant fun g : Gal(Ω/E) ↦ ρ g • b := hρ.comp fun m : Matrix n n (QuotSpan (ℓ ^ M : O)) ↦ m • b let V : DiscreteModule O Gal(Ω/E) := .of (actionRep O (n → QuotSpan a) ρ) (continuous_prod_of_discrete_right.2 fun b ↦ (h_cont b).continuous) -- The Selmer module lies in the finite set of cocycles in `V` unramified outside `S`. change (selmerModule ρ S L (QuotSpan a) : Set (Gal(Ω/E) → n → QuotSpan a)).Finite refine (finite_cocycles_unramified_outside V hS).subset fun z hz ↦ ?_ obtain ⟨h_cocycle, h_unr, -, h_const⟩ := mem_selmerModule_iff.1 hz exact ⟨⟨h_const.continuous, h_cocycle⟩, fun v hv A hA g hg ↦ h_unr g ⟨v, hv, A, hA, hg⟩⟩ end Finite section Data /-! ### Selmer data and tied Selmer groups -/ open IsDiscreteValuationRing Module Matrix.Module variable (ℓ : ℕ) [ThePrime ℓ] {E : Type} [Field E] [EmbeddedNumberField E] [NumberField.IsCMField E] section Terms variable {O n : Type} [CommRing O] [PadicIntegerRing O ℓ] [Fintype n] [DecidableEq n] (ρ : Gal(Ω/E) →* Matrix n n O) /-- The module `Hom_G(W, W^{*c})` for `G = Gal(Ω/E)` acting on `W = (O / a) ^ n` by the matrices `ρ g`. The dual `W^*` is the character module of `W`, on which `g` acts by `y ↦ cyc(g) · y ∘ g⁻¹` for the `ℓ`-adic cyclotomic character `cyc`; on `W^{*c}` the element `g` acts as its conjugate `g^c = conjGal g` under complex conjugation. -/ def conjDualHom (a : O) : Submodule O ((n → QuotSpan a) →ₗ[O] CharacterModule (n → QuotSpan a)) where carrier := {η : (n → QuotSpan a) →ₗ[O] CharacterModule (n → QuotSpan a) | ∀ (g : Gal(Ω/E)) (u m : n → QuotSpan a), η (ρ g • u) m = η u ((cyclotomicCharIn O Ω ℓ (conjGal g) : O) • ρ (conjGal g)⁻¹ • m)} zero_mem' _ _ _ := rfl add_mem' {η η'} hη hη' g u m := by change η (ρ g • u) m + η' (ρ g • u) m = η u _ + η' u _ rw [hη g u m, hη' g u m] smul_mem' t η hη g u m := by simpa [smul_comm t] using hη g u (t • m) /-- The global term of the lattice `O ^ n` with the action `ρ` of `G = Gal(Ω/E)`: the supremum over `a ≠ 0` of the lengths of the modules `Hom_G(W, W^{*c})` for `W = (O / a) ^ n` (`conjDualHom`). -/ def congruenceTerm : ℕ∞ := ⨆ (a : O) (_ : a ≠ 0), length O (conjDualHom ℓ ρ a) /-- The local term at a place `v` (used for `v` prime to `ℓ`): the supremum over `a ≠ 0` of the excess of the length of `localCocycles` (restrictions to the decomposition group of global cocycles, with no condition) over the length of `W = (O / a) ^ n`. For all cocycles of the decomposition group the excess is the length of `H⁰(E_v, W^*)`, by the local Euler characteristic formula and local duality. -/ def localTerm (v : FinPlace E) : ℕ∞ := ⨆ (a : O) (_ : a ≠ 0), length O (localCocycles ρ ∅ (placeOver v) (QuotSpan a)) - length O (n → QuotSpan a) open scoped Classical in /-- The sum of the local terms `localTerm ρ v` over the places `v` of `S` prime to `ℓ`. -/ def placeTerms (S : Finset (FinPlace E)) : ℕ∞ := ∑ v ∈ S with v ∉ placesDividing E ℓ, localTerm ρ v /-- The sum of `v(det(ρ g - 1))` over `g = g₀` and `g = g₀^{-c} = (conjGal g₀)⁻¹`, where `v` is the valuation of `O`. -/ def firstPrimeTerms (g₀ : Gal(Ω/E)) : ℕ∞ := ∑ b : Bool, addVal O (ρ (idOrConjInv b g₀) - 1).det end Terms /-- A Selmer datum for the set `S₀` of places and the element `g₀`: an action `ρ` on the lattice `T = O ^ n`, a set `S = places` of places outside which `T` is unramified, a module `Z_w` of local maps for each `w ∣ ℓ`, and an element `γ_*` that acts by a scalar. The set `S` lies in `S₀`, and `g₀` enters only through the local terms `v(det(ρ g - 1))` for `g = g₀, g₀^{-c}`, which are finite. -/ structure SelmerDatum (S₀ : Finset (FinPlace E)) (g₀ : Gal(Ω/E)) (O : Type) [CommRing O] [PadicIntegerRing O ℓ] (n : Type) [Fintype n] [DecidableEq n] where /-- The rank of `T` is at least `1`. -/ nonempty : Nonempty n /-- The action on the lattice `T = O ^ n`. -/ ρ : Gal(Ω/E) →* Matrix n n O /-- The action is continuous: its reductions modulo powers of `ℓ` are locally constant. -/ isLocallyConstant (M : ℕ) : IsLocallyConstant (reduceModPow ℓ M ρ) /-- The set `S` of places where `T` may ramify. -/ places : Finset (FinPlace E) /-- `S` lies in `S₀`. -/ subset : places ⊆ S₀ /-- `S` contains the places above `ℓ`. -/ placesDividing_subset : placesDividing E ℓ ⊆ places /-- `T` is unramified outside `S`. -/ unramified : ∀ g ∈ inertiaAbove placesᶜ, ρ g = 1 /-- The module `Z_w` of maps from the decomposition group at `w ∣ ℓ` to `T`. -/ Z (w : placesDividing E ℓ) : Submodule O (decompGroup Gal(Ω/E) (placeOver w.val) → n → O) /-- `Z_w` is finitely generated. -/ finite_Z (w : placesDividing E ℓ) : Module.Finite O (Z w) /-- `Z_w` contains the coboundaries. -/ coboundary_mem_Z (w : placesDividing E ℓ) (b : n → O) : (fun g : decompGroup Gal(Ω/E) (placeOver w.val) ↦ ρ g • b - b) ∈ Z w /-- `T / ϖ` is absolutely irreducible, in Burnside's form: the matrices `ρ g` span all matrices. -/ span_range_eq_top : Submodule.span O (Set.range ρ) = ⊤ /-- `∑ (rk Z_w - r') ≤ f r'`, summed over `w ∣ ℓ`, where `r'` is the rank of `T` and `f` is the number of infinite places. -/ sum_finrank_Z_le : ∑ w : placesDividing E ℓ, finrank O (Z w) ≤ (Fintype.card (placesDividing E ℓ) + Core.numInfPlaces E) * Fintype.card n /-- The global term is finite. -/ congruenceTerm_ne_top : congruenceTerm ℓ ρ ≠ ⊤ /-- The sum of the local terms is finite. -/ localTerms_ne_top : placeTerms ℓ ρ places + firstPrimeTerms ℓ ρ g₀ ≠ ⊤ /-- The element `γ_*`. -/ γ : Gal(Ω/E) /-- The scalar `ζ_*`. -/ ζ : O /-- `γ_*` is inertial at a place of `S` prime to `ℓ`. -/ γ_mem_inertiaAbove : γ ∈ inertiaAbove (places \ placesDividing E ℓ) /-- `γ_*` and `γ_*^{-c}` act on `T` by the scalar `ζ_*`. -/ ρ_eq_smul_one (b : Bool) : ρ (idOrConjInv b γ) = ζ • 1 /-- `ζ_* ^ 2 - 1` is a unit. -/ isUnit_sq_sub_one : IsUnit (ζ ^ 2 - 1) end Data namespace SelmerDatum open IsDiscreteValuationRing Module Matrix.Module 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) /-- The global term of the datum `T`: the supremum over `a ≠ 0` of the lengths of `Hom_G(W, W^{*c})` for `W = (O / a) ^ n` with the action `T.ρ`. -/ abbrev globalTerm : ℕ∞ := congruenceTerm ℓ T.ρ /-- The sum of the local terms of the datum `T` at the places of `T.places` prime to `ℓ`. -/ abbrev placesTerm : ℕ∞ := placeTerms ℓ T.ρ T.places /-- The sum of the valuations of `det(T.ρ g - 1)` over `g = g₀` and `g = g₀^{-c}`. -/ abbrev firstPrimeTerm : ℕ∞ := firstPrimeTerms ℓ T.ρ g₀ /-- The sum of all local terms of the datum `T`: those at places and those from `g₀`. -/ abbrev localTerms : ℕ∞ := T.placesTerm + T.firstPrimeTerm /-- The number `β_T`: the global term of the datum `T` plus all its local terms. -/ def β : ℕ∞ := T.globalTerm + T.localTerms lemma β_ne_top : T.β ≠ ⊤ := WithTop.add_ne_top.2 ⟨T.congruenceTerm_ne_top, T.localTerms_ne_top⟩ lemma isUnit_ζ_sub_one : IsUnit (T.ζ - 1) := isUnit_of_mul_isUnit_right (x := T.ζ + 1) (by simpa [sq, mul_self_sub_one] using T.isUnit_sq_sub_one) /-- The local conditions of the datum `T` as linear equations that do not depend on the coefficients: the relations `∑ j, a j • z (g j) = 0`, with matrices `a j` and with `g j` in the decomposition group at some `w ∣ ℓ`, that hold for all `z` in `Z_w = T.Z w`. -/ def localRelations : Set (Gal(Ω/E) →₀ Matrix n n O) := ⋃ w : placesDividing E ℓ, Finsupp.mapDomain Subtype.val '' relationsOn (T.Z w) /-- A function `c` with values in `B ^ n` obeys a relation `f`, a finitely supported function to matrices over `O`, if `∑ g, f g • c g = 0`, where a matrix multiplies a column vector. It obeys the local conditions `T.localRelations` if and only if, at each `w ∣ ℓ`, its restriction to the decomposition group obeys all the relations that the members of `Z_w = T.Z w` obey (`relationsOn`). -/ lemma mem_obeying_localRelations_iff {B : Type} [AddCommGroup B] [Module O B] {c : Gal(Ω/E) → n → B} : c ∈ obeying T.localRelations B ↔ ∀ w : placesDividing E ℓ, (fun g : decompGroup Gal(Ω/E) (placeOver w.val) ↦ c g) ∈ obeying (relationsOn (T.Z w)) B := by -- A relation pushed forward by `Finsupp.mapDomain` is evaluated on the restriction of `c`. simp [localRelations, obeying, forall_comm (α := _ →₀ _), Function.comp_def] /-- Let the Galois group act on `(O / a) ^ n` by the matrices `T.ρ g` of the Selmer datum `T`. The coboundary `g ↦ g b - b` of a vector `b` obeys the local conditions `T.localRelations`, the linear relations that hold on the modules `Z_w = T.Z w` of local cocycles at `w ∣ ℓ`: it lifts to a coboundary with values in `O ^ n`, which lies in each `Z_w`. -/ lemma coboundary_mem_obeying_localRelations (a : O) (b : n → QuotSpan a) : (fun g : Gal(Ω/E) ↦ T.ρ g • b - b) ∈ obeying (O := O) T.localRelations (QuotSpan a) := by refine T.mem_obeying_localRelations_iff.2 fun w ↦ ?_ have h_lift (k : n) : ∃ c : O, Ideal.Quotient.mk _ c = b k := Ideal.Quotient.mk_surjective _ choose c hc using h_lift have h_red (g : decompGroup Gal(Ω/E) (placeOver w.val)) : T.ρ g • b - b = fun k : n ↦ (Ideal.span {a}).mkQ ((T.ρ g • c - c) k) := by ext k simp [Matrix.Module.smul_apply, hc, Algebra.smul_def] simpa only [h_red] using mkQ_mem_obeying_relationsOn _ (T.coboundary_mem_Z w c) /-- Let `T` be a Selmer datum and `w ∣ ℓ` a place. The restrictions to the decomposition group at `w` of the cocycles for `T.ρ` with values in `(O / a) ^ n` that obey the local conditions `T.localRelations` form a module of length at most `rk (T.Z w) · len (O / a)`. -/ lemma length_localCocycles_le_finrank_mul (a : O) (w : placesDividing E ℓ) : length O (localCocycles T.ρ T.localRelations (placeOver w.val) (QuotSpan a)) ≤ finrank O (T.Z w) * length O (QuotSpan a) := by have : Module.Finite O (T.Z w) := T.finite_Z w have : Nonempty n := T.nonempty refine (length_mono ?_).trans (length_obeying_relationsOn_le (Z := T.Z w)) -- A local cocycle that obeys `T.localRelations` obeys the relations that hold on `Z_w`. rintro _ ⟨z, hz, rfl⟩ obtain ⟨-, -, h_obey, -⟩ := mem_selmerModule_iff.1 hz exact T.mem_obeying_localRelations_iff.1 h_obey w /-- The local conditions of `T` together with vanishing at `γ_* = T.γ`, which picks one cocycle in each cohomology class. -/ def classRelations : Set (Gal(Ω/E) →₀ Matrix n n O) := T.localRelations ∪ {Finsupp.single T.γ 1} /-- The tied Selmer group modulo `a`: the locally constant cocycles `z` with values in `(O / a) ^ n` that vanish at `γ_*`, are unramified outside `T.places ∪ R ∪ R̄`, obey the local conditions `T.localRelations`, and satisfy the ties `z(γ_v) = s • z(φ_v)` and `z(γ_v^{-c}) = s • z(φ_v^{-c})` for `v ∈ J` (`tieRelations`). Here `γ_v` and `φ_v` are the tame generator and the Frobenius element in the data `(x v).1`, which also hold a character to `ℤ / q`, and `s = (x v).2 i` is the slope of datum `i`. It is used for `R = J`, and for `R = J ∪ {P}`, where there is no condition at `P` and `P̄`. -/ def tiedSelmer {ι : Type} {q : ℕ} (R J : Finset (FinPlace E)) (x : FinPlace E → AuxPrimeData E q × (ι → O)) (i : ι) (a : O) : Submodule O (Gal(Ω/E) → n → QuotSpan a) := selmerModule T.ρ (unionWithConj T.places R) (T.classRelations ∪ tieRelations J x i) (QuotSpan a) /-- The members of a tied Selmer group, which are cocycles with values in `(O / a) ^ n`, vanish at the element `γ_*` of `T`: this is one of the defining relations. -/ lemma apply_γ_eq_zero {ι : Type} {q : ℕ} {R J : Finset (FinPlace E)} {x : FinPlace E → AuxPrimeData E q × (ι → O)} {i : ι} {a : O} {z : Gal(Ω/E) → n → QuotSpan a} (hz : z ∈ T.tiedSelmer R J x i a) : z T.γ = 0 := by obtain ⟨-, -, h_obey, -⟩ := mem_selmerModule_iff.1 hz simpa using mem_obeying.1 h_obey (Finsupp.single T.γ 1) (by simp [classRelations]) end SelmerDatum section Values /-! ### Values at conjugate elements, and Selmer cocycles -/ open Matrix.Module variable {E n O B : Type} [Field E] [EmbeddedNumberField E] [NumberField.IsCMField E] [CommRing O] [CommRing B] [Algebra O B] /-- The values of a function at `g` (coordinates `(true, i)`) and at `g^{-c} = (conjGal g)⁻¹` (coordinates `(false, i)`). -/ def evalConjPair (g : Gal(Ω/E)) : (Gal(Ω/E) → n → B) →ₗ[O] Bool × n → B where toFun z p := z (idOrConjInv p.1 g) p.2 map_add' _ _ := rfl map_smul' _ _ := rfl lemma evalConjPair_apply (g : Gal(Ω/E)) (z : Gal(Ω/E) → n → B) (p : Bool × n) : evalConjPair (O := O) g z p = z (idOrConjInv p.1 g) p.2 := rfl /-- Let `z ∈ selmerModule ρ S L B`: a locally constant cocycle that is unramified outside `S` and obeys the relations `L`. If `S ⊆ P ∪ Q` and `K ⊆ L`, then `z` is a Selmer cocycle (`New.selmerZ1`) for the following conditions: unramified outside `P ∪ Q`, and for each `v ∈ P` the restriction to the decomposition group at the chosen place `A v` is that of a cocycle obeying `K` (`localCocycles`). -/ lemma mem_selmerZ1_of_mem_selmerModule {E n O B : Type} [Field E] [EmbeddedNumberField E] [NumberField.IsCMField E] [Fintype n] [CommRing O] [CommRing B] [Algebra O B] [DecidableEq n] [TopologicalSpace B] [DiscreteTopology B] {ρ : Gal(Ω/E) →* Matrix n n O} {S P Q : Set (FinPlace E)} {K L : Set (Gal(Ω/E) →₀ Matrix n n O)} {z : Gal(Ω/E) → n → B} {A : FinPlace E → ClosurePlace} {hρ : Continuous (Function.uncurry fun (g : Gal(Ω/E)) (b : n → B) ↦ actionRep O (n → B) ρ g b)} (hz : z ∈ selmerModule ρ S L B) (hKL : K ⊆ L) (hS : S ⊆ P ∪ Q) : z ∈ selmerZ1 (.of (actionRep O (n → B) ρ) hρ) P A (fun v : FinPlace E ↦ localCocycles ρ K (A v) B) Q := by -- `z` is unramified outside `S`, hence outside `P ∪ Q`. obtain ⟨h_cocycle, h_unram, -, h_const⟩ := mem_selmerModule_iff.1 (mem_selmerModule_of_subset hz .rfl hS) refine ⟨⟨⟨h_const.continuous, h_cocycle⟩, h_unram⟩, fun v _ ↦ ?_, fun g hg ↦ ?_⟩ · exact ⟨z, mem_selmerModule_of_subset hz hKL (Set.subset_univ S), rfl⟩ · -- `E` is totally complex, so there is no complex conjugation in `Gal(Ω/E)`. exact (IsComplexConj.false_of_isTotallyComplex hg).elim end Values section Eligible /-! ### New auxiliary primes -/ open Matrix Module Set variable {ℓ : ℕ} {E ι O : Type} [Field E] [EmbeddedNumberField E] [NumberField.IsCMField E] [CommRing O] {V : ι → Gal(Ω/E) → Prop} {W : Set Gal(Ω/E)} {S₀ J : Finset (FinPlace E)} {N : ℕ} {P₀ : FinPlace E} {x : FinPlace E → AuxPrimeData E (ℓ ^ N) × (ι → O)} open scoped Classical in variable (ℓ S₀ V P₀ J x) in /-- The prime `P`, with the place, Frobenius element, tame generator and character to `ℤ / ℓ ^ N` given by `l`, is a new auxiliary prime for datum `i` and the primes `J` chosen so far, of which `P₀` is the first: it may be added to them with a nonzero slope for datum `i`. Here `(x v).1` are the data of `v ∈ J`, `S₀` is the set of places to avoid, and `V i` is the property asked of the Frobenius elements at the primes where datum `i` has a nonzero slope. -/ structure IsNewAuxiliaryPrime (i : ι) (P : FinPlace E) (l : AuxPrimeData E (ℓ ^ N)) : Prop where /-- `P` has degree one: its absolute norm `P.q` is a prime number. -/ prime_norm : P.q.Prime /-- `P` is a new prime. -/ notMem : P ∉ J /-- The conjugate of `P` is a new prime. -/ star_notMem : star P ∉ J /-- `P` lies outside `S₀`. -/ notMem_bad : P ∉ S₀ /-- The conjugate of `P` lies outside `S₀`. -/ star_notMem_bad : star P ∉ S₀ /-- `P` does not divide the absolute norm `P₀.q` of the first prime. -/ notMem_placesDividing : P ∉ placesDividing E P₀.q /-- The data `l` are auxiliary prime data at `P` (`IsAuxPrimeDataAt`) relative to every set of places above `ℓ` and primes of `J` other than `P₀`; so the character of `P` vanishes on their decomposition groups. -/ anticyclotomic : ∀ X : Set (FinPlace E), X ⊆ ↑(J.erase P₀) ∪ placesDividing E ℓ → IsAuxPrimeDataAt X P l /-- The character of `P` vanishes at the Frobenius element of `P`. -/ char_frob_eq_one : l.character l.frob = 1 /-- The Frobenius element has value `1` under the character of `P₀` and `0` under the others. -/ char_frob_eq_ite : ∀ v ∈ J, (x v).1.character l.frob = if v = P₀ then Multiplicative.ofAdd 1 else 1 /-- `V i` holds at the Frobenius element `φ` and at `φ^{-c}`. -/ apply_idOrConjInv_frob (b : Bool) : V i (idOrConjInv b l.frob) open scoped Classical in /-- Let `J` be a set of tied primes (`IsTiedPrimes`): primes of `E` outside `S₀`, no one of them conjugate to another or to itself. Then for `v, w ∈ J` the character of `w` takes the value `1 ∈ ℤ / ℓ ^ N` at the tame generator of `v` if `w = v`, and the value `0` otherwise. -/ lemma IsTiedPrimes.character_tameGenerator_eq_ite (hJ : IsTiedPrimes ℓ S₀ V W N P₀ J x) {v : FinPlace E} (hv : v ∈ J) (w : FinPlace E) (hw : w ∈ J) : (x w).1.character (x v).1.tameGenerator = if w = v then Multiplicative.ofAdd 1 else 1 := by obtain ⟨h_inertia, h_char, -⟩ := (hJ.isAuxPrimeDataAt v hv).tame_gen split_ifs with h_eq · rw [h_eq, h_char] · -- The character of `w` is unramified at `v`, as `v` is neither `w` nor its conjugate. have h_notMem : v ∈ (Set.conjClosure ({w} : Set (FinPlace E)))ᶜ := by grind [IsAuxiliary, star_star, hJ.auxiliary] exact (hJ.isAuxPrimeDataAt w hw).eq_one_of_mem_inertiaAbove _ ⟨v, h_notMem, (x v).1.place, (hJ.isAuxPrimeDataAt v hv).isPlaceOver, h_inertia⟩ open scoped Classical in /-- A new auxiliary prime `P` with data `l` may be added to a set `J` of tied primes, with slope `t` for datum `i` and slope `0` for the other data: the result is again a set of tied primes with first prime `P₀`. -/ lemma IsTiedPrimes.insert_of_isNewAuxiliaryPrime [DecidableEq ι] (hp : IsTiedPrimes ℓ S₀ V W N P₀ J x) {i : ι} {P : FinPlace E} {l : AuxPrimeData E (ℓ ^ N)} (hl : IsNewAuxiliaryPrime ℓ V S₀ J P₀ x i P l) (t : O) : IsTiedPrimes ℓ S₀ V W N P₀ (insert P J) (Function.update x P (l, Pi.single i t)) := by have h_old (v : FinPlace E) (hv : v ∈ J) : Function.update x P (l, Pi.single i t) v = x v := Function.update_of_ne (ne_of_mem_of_not_mem hv hl.notMem) _ _ -- The new character kills the decomposition groups at the old primes other than `P₀`. have h_split (v : FinPlace E) (hv : v ∈ J) (hv' : v ≠ P₀) : l.character (x v).1.frob = 1 := (hl.anticyclotomic (J.erase P₀) subset_union_left).eq_one_of_mem_decompGroup (by simp [hv, hv']) (hp.isAuxPrimeDataAt v hv).isPlaceOver (hp.isAuxPrimeDataAt v hv).isFrob.mem_decompGroup have hP : P ≠ P₀ := (ne_of_mem_of_not_mem hp.first_mem hl.notMem).symm constructor case auxiliary => have h_star : star P ≠ P := (hl.anticyclotomic _ Set.subset_union_right).star_ne grind [star_star, IsNewAuxiliaryPrime, IsAuxiliary, hp.auxiliary] case first_mem => exact Finset.mem_insert_of_mem hp.first_mem case isAuxPrimeDataAt => refine (Finset.forall_mem_insert ..).2 ⟨?_, fun v hv ↦ ?_⟩ · simpa using hl.anticyclotomic _ Set.subset_union_right · simpa [h_old v hv] using hp.isAuxPrimeDataAt v hv case char_frob_eq_ite => intro v hv hvP₀ w hw rcases Finset.mem_insert.1 hv with rfl | hv' <;> rcases Finset.mem_insert.1 hw with rfl | hw' · simp [hP, hl.char_frob_eq_one] · simp [h_old w hw', hl.char_frob_eq_ite w hw'] · simp [h_old v hv', hP, h_split v hv' hvP₀] · simp [h_old v hv', h_old w hw', hp.char_frob_eq_ite v hv' hvP₀ w hw'] case first_frob_mem => simpa [h_old P₀ hp.first_mem] using hp.first_frob_mem case first_slope => simpa [h_old P₀ hp.first_mem] using hp.first_slope case notMem_placesDividing => grind [hp.notMem_placesDividing, hl.notMem_placesDividing] case frob_of_slope_ne_zero => refine (Finset.forall_mem_insert ..).2 ⟨fun j hj ↦ ?_, fun v hv j hj ↦ ?_⟩ · -- At the new prime the slope is nonzero for datum `i` only. obtain rfl : j = i := of_not_not fun h_ne ↦ by simp [h_ne] at hj simpa [idOrConjInv] using And.intro (hl.apply_idOrConjInv_frob true) (hl.apply_idOrConjInv_frob false) · simpa [h_old v hv] using hp.frob_of_slope_ne_zero v hv j (by simpa [h_old v hv] using hj) end Eligible section Sah /-! ### Classes as functions on the group `H` generated by commutators -/ open Matrix.Module Subgroup commutatorElement /-- If a matrix maps a set of vectors into its span, it maps the span into itself. -/ lemma smul_mem_span_of_forall_smul_mem {O n B : Type} [CommRing O] [Fintype n] [DecidableEq n] [AddCommGroup B] [Module O B] (A : Matrix n n O) {s : Set (n → B)} (h : ∀ u ∈ s, A • u ∈ Submodule.span O s) {u : n → B} (hu : u ∈ Submodule.span O s) : A • u ∈ Submodule.span O s := (Submodule.span_le (p := (Submodule.span O s).comap (DistribSMul.toLinearMap O _ A))).2 h hu /-- Let `X` be a submodule of `(O / a) ^ n` that is stable under a set of matrices which spans all matrices over `O`. If `X` contains a vector with a unit coordinate, it is the whole module. -/ lemma eq_top_of_stable_of_isUnit {O n : Type} [CommRing O] [Fintype n] [DecidableEq n] {a : O} {s : Set (Matrix n n O)} (hs : Submodule.span O s = ⊤) {X : Submodule O (n → QuotSpan a)} (h_stable : ∀ B ∈ s, ∀ u ∈ X, B • u ∈ X) {u : n → QuotSpan a} (hu : u ∈ X) {j : n} (hu_unit : IsUnit (u j)) : X = ⊤ := by refine Submodule.eq_top_iff'.2 fun m ↦ ?_ obtain ⟨w, hw⟩ := hu_unit.exists_left_inv choose c hc using fun k ↦ Ideal.Quotient.mk_surjective (m k * w) -- The matrix whose only nonzero column, the `j`-th, lifts `m / u j` takes `u` to `m`. convert Submodule.span_induction (p := fun B _ ↦ B • u ∈ X) (fun B hB ↦ h_stable B hB u hu) (by simp) (fun _ _ _ _ hB hC ↦ by simpa only [add_smul] using X.add_mem hB hC) (fun t _ _ hB ↦ by simpa only [smul_assoc] using X.smul_mem t hB) (Submodule.eq_top_iff'.1 hs (Matrix.of fun k k' ↦ if k' = j then c k else 0)) ext k simp [Matrix.Module.smul_apply, ite_smul, Algebra.smul_def (c k), hc, mul_assoc, hw] namespace SelmerDatum 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) /-- The element `γ_* = T.γ` acts on `T` by the scalar `ζ_* = T.ζ`. -/ lemma ρ_γ : T.ρ T.γ = T.ζ • 1 := by simpa [idOrConjInv] using T.ρ_eq_smul_one true /-- The element `γ_*^{-c} = (conjGal T.γ)⁻¹` acts on `T` by the scalar `ζ_* = T.ζ`. -/ lemma ρ_conjGal_γ_inv : T.ρ (conjGal T.γ)⁻¹ = T.ζ • 1 := by simpa [idOrConjInv] using T.ρ_eq_smul_one false /-- The `ℓ`-adic cyclotomic character is `1` at `γ_* = T.γ`, which lies in an inertia group at a place prime to `ℓ`. -/ lemma cyclotomicChar_γ : cyclotomicChar Ω ℓ T.γ = 1 := by obtain ⟨v, ⟨-, hvℓ⟩, A, hA, hγ⟩ := T.γ_mem_inertiaAbove exact cyclotomicChar_eq_one_of_mem_inertiaAbove ⟨v, hvℓ, A, hA, hγ⟩ /-- The group `H` generated, as an abstract group, by the commutators `[g, γ_*]` and `[g, γ_*^c]`, where `γ_* = T.γ` is the element of the datum that acts by a scalar and `γ_*^c = conjGal T.γ` is its conjugate. -/ def sahGroup : Subgroup Gal(Ω/E) := closure (Set.range (fun g : Gal(Ω/E) ↦ ⁅g, T.γ⁆) ∪ Set.range fun g : Gal(Ω/E) ↦ ⁅g, conjGal T.γ⁆) lemma commutator_γ_mem (g : Gal(Ω/E)) : ⁅g, T.γ⁆ ∈ T.sahGroup := subset_closure (.inl ⟨g, rfl⟩) lemma commutator_conjGal_γ_mem (g : Gal(Ω/E)) : ⁅g, conjGal T.γ⁆ ∈ T.sahGroup := subset_closure (.inr ⟨g, rfl⟩) /-- A subgroup that contains all commutators with `γ_* = T.γ` and with `γ_*^c = conjGal T.γ` contains the group `T.sahGroup` that they generate. -/ lemma sahGroup_le {K : Subgroup Gal(Ω/E)} (hγ : ∀ g : Gal(Ω/E), ⁅g, T.γ⁆ ∈ K) (hγ' : ∀ g : Gal(Ω/E), ⁅g, conjGal T.γ⁆ ∈ K) : T.sahGroup ≤ K := (closure_le K).2 (Set.union_subset (Set.range_subset_iff.2 hγ) (Set.range_subset_iff.2 hγ')) /-- The group `H = T.sahGroup` is normal, as `g' [g, δ] g'⁻¹ = [g' g, δ] [g', δ]⁻¹`. -/ instance : T.sahGroup.Normal where conj_mem h hh g' := by have h_conj (g δ : Gal(Ω/E)) : MulAut.conj g' ⁅g, δ⁆ = ⁅g' * g, δ⁆ * ⁅g', δ⁆⁻¹ := by simp [commutatorElement_def, mul_assoc] refine T.sahGroup_le (K := T.sahGroup.comap (MulAut.conj g').toMonoidHom) (fun g ↦ ?_) (fun g ↦ ?_) hh all_goals simp only [mem_comap, MulEquiv.coe_toMonoidHom, h_conj] · exact mul_mem (T.commutator_γ_mem _) (inv_mem (T.commutator_γ_mem g')) · exact mul_mem (T.commutator_conjGal_γ_mem _) (inv_mem (T.commutator_conjGal_γ_mem g')) variable {T} /-- The group `T.sahGroup`, generated by the commutators with `T.γ` and its conjugate, is stable under the conjugation `conjGal` by complex conjugation. -/ lemma conjGal_mem_sahGroup {h : Gal(Ω/E)} (hh : h ∈ T.sahGroup) : conjGal h ∈ T.sahGroup := by refine T.sahGroup_le (K := T.sahGroup.comap conjGal) ?_ ?_ hh <;> simp [map_commutatorElement, commutator_γ_mem, commutator_conjGal_γ_mem] /-- Homomorphisms to commutative groups are trivial on `H = T.sahGroup`, which is generated by commutators. -/ lemma map_eq_one_of_mem_sahGroup {C : Type*} [CommGroup C] (χ : Gal(Ω/E) →* C) {h : Gal(Ω/E)} (hh : h ∈ T.sahGroup) : χ h = 1 := by refine T.sahGroup_le (K := χ.ker) ?_ ?_ hh <;> simp [map_commutatorElement, commutatorElement_eq_one_iff_mul_comm, mul_comm] /-- The group `H = T.sahGroup`, generated by commutators with `γ_* = T.γ` and its conjugate `γ_*^c`, acts trivially through `T.ρ`, because `γ_*` and `γ_*^c` act by scalars. -/ lemma ρ_eq_one_of_mem_sahGroup {h : Gal(Ω/E)} (hh : h ∈ T.sahGroup) : T.ρ h = 1 := by have h_comm {δ : Gal(Ω/E)} (hδ : T.ρ δ = T.ζ • 1) (g : Gal(Ω/E)) : Commute (T.ρ.toHomUnits g) (T.ρ.toHomUnits δ) := Units.ext (by simp [hδ]) suffices h ∈ T.ρ.toHomUnits.ker by simpa [Units.ext_iff] using this refine T.sahGroup_le (fun g ↦ ?_) (fun g ↦ ?_) hh <;> rw [MonoidHom.mem_ker, map_commutatorElement, commutatorElement_eq_one_iff_commute] · exact h_comm T.ρ_γ g · exact (h_comm T.ρ_conjGal_γ_inv g).inv_right /-- Let `R` contain the places of `T.places` prime to `ℓ` and their conjugates. Then `T.sahGroup`, the group generated by the commutators with `γ_*` and with its complex conjugate `γ_*^c = conjGal T.γ`, lies in the normal subgroup generated by `inertiaAbove R`, the union of the inertia groups at places above `R`. -/ lemma sahGroup_le_normalClosure {T : SelmerDatum ℓ S₀ g₀ O n} {R : Set (FinPlace E)} (hR : ∀ v ∈ T.places, v ∉ placesDividing E ℓ → v ∈ R ∧ star v ∈ R) : T.sahGroup ≤ normalClosure (inertiaAbove R) := by obtain ⟨v, ⟨hv, hvℓ⟩, B, hB, hγ⟩ := T.γ_mem_inertiaAbove -- Both `γ_*` and `γ_*^c` lie in this normal subgroup. have h_mem (b : Bool) : idOrConjInv b T.γ ∈ normalClosure (inertiaAbove R) := subset_normalClosure (idOrConjInv_mem_inertiaAbove hB hγ (hR v hv hvℓ) b) have h_comm {δ : Gal(Ω/E)} (hδ : δ ∈ normalClosure (inertiaAbove R)) (g : Gal(Ω/E)) : ⁅g, δ⁆ ∈ normalClosure (inertiaAbove R) := mul_mem (normalClosure_normal.conj_mem δ hδ g) (inv_mem hδ) exact T.sahGroup_le (h_comm (by simpa [idOrConjInv] using h_mem true)) (h_comm (by simpa [idOrConjInv] using h_mem false)) section Cocycles variable {B : Type} [AddCommGroup B] [Module O B] /-- The map `b ↦ T.ρ T.γ • b - b` is bijective on `n → B`, since `γ_* = T.γ` acts by the scalar `ζ_* = T.ζ` and `ζ_* - 1` is a unit. -/ lemma bijective_γ_smul_sub (T : SelmerDatum ℓ S₀ g₀ O n) {B : Type} [AddCommGroup B] [Module O B] : Function.Bijective fun b : n → B ↦ T.ρ T.γ • b - b := by simpa [T.ρ_γ, sub_smul] using T.isUnit_ζ_sub_one.smul_bijective (β := n → B) /-- A cocycle `z` with values in `B ^ n` that vanishes at `γ_* = T.γ` and on the group `H = T.sahGroup` is zero, by Sah's identity. -/ lemma cocycle_eq_zero_of_sahGroup {z : Gal(Ω/E) → n → B} (hz : ∀ g h : Gal(Ω/E), z (g * h) = z g + T.ρ g • z h) (hγ : z T.γ = 0) (hH : ∀ h ∈ T.sahGroup, z h = 0) : z = 0 := by -- Use the Galois action through `T.ρ` to view `z` as a cocycle in TauCeti. let := DistribMulAction.compHom (n → B) T.ρ have h_cocycle : groupCohomology.IsCocycle₁ z := fun g h ↦ (hz g h).trans (add_comm _ _) funext g -- The commutator in TauCeti’s identity is conjugate to `[g, γ_*]`. have h_mem : (T.γ * g)⁻¹ * (g * T.γ) ∈ T.sahGroup := by convert Normal.conj_mem _ (T.commutator_γ_mem g) (T.γ * g)⁻¹ using 1 simp [commutatorElement_def, mul_assoc] apply (T.bijective_γ_smul_sub (B := B)).injective change T.γ • z g - z g = T.γ • (0 : n → B) - 0 simpa [hγ] using h_cocycle.smul_apply_sub_apply_eq (hH _ h_mem) end Cocycles /-- Let `O` be the integer ring of a finite extension of `ℚ_ℓ`, and let `O / a` be nonzero. Let `z` be a cocycle for `T.ρ` with values in `(O / a) ^ n` that vanishes at `γ_*`. If some value of `z` has a unit coordinate, then so does some value on `H = T.sahGroup`, the group generated by the commutators with `γ_*` and with its conjugate `conjGal T.γ`. -/ lemma exists_mem_sahGroup_isUnit_apply {T : SelmerDatum ℓ S₀ g₀ O n} {a : O} [Nontrivial (QuotSpan a)] {z : Gal(Ω/E) → n → QuotSpan a} (hz : ∀ g h : Gal(Ω/E), z (g * h) = z g + T.ρ g • z h) (hγ : z T.γ = 0) (hz_unit : ∃ (g : Gal(Ω/E)) (j : n), IsUnit (z g j)) : ∃ h ∈ T.sahGroup, ∃ j : n, IsUnit (z h j) := by have : IsLocalRing (QuotSpan a) := .of_surjective' (Ideal.Quotient.mk _) Ideal.Quotient.mk_surjective let z₀ : Gal(Ω/E) → n → IsLocalRing.ResidueField (QuotSpan a) := fun g j ↦ IsLocalRing.residue _ (z g j) have hz₀ (g h : Gal(Ω/E)) : z₀ (g * h) = z₀ g + T.ρ g • z₀ h := by funext j simp [z₀, hz, Matrix.Module.smul_apply, Algebra.smul_def, IsScalarTower.algebraMap_apply O (QuotSpan a) (IsLocalRing.ResidueField (QuotSpan a))] by_contra! h_nonunit have h_zero : z₀ = 0 := by refine cocycle_eq_zero_of_sahGroup hz₀ (funext fun j ↦ by simp [z₀, hγ]) fun h hh ↦ ?_ exact funext fun j ↦ (IsLocalRing.residue_eq_zero_iff _).2 (h_nonunit h hh j) obtain ⟨g, j, hj⟩ := hz_unit exact (IsLocalRing.residue_ne_zero_iff_isUnit _).2 hj (congrFun₂ h_zero g j) /-- Let `z` be a cocycle for `T.ρ` with values in `W = (O / a) ^ n` that vanishes at `γ_*`. Suppose some value of `z` has a unit coordinate. Then `z(H)` spans `W`, where `H = T.sahGroup` is the group generated by the commutators with `γ_*` and with its conjugate `γ_*^c = conjGal T.γ`. -/ lemma span_image_sahGroup_eq_top {T : SelmerDatum ℓ S₀ g₀ O n} {a : O} {z : Gal(Ω/E) → n → QuotSpan a} (hz : ∀ g h : Gal(Ω/E), z (g * h) = z g + T.ρ g • z h) (hγ : z T.γ = 0) (hz_unit : ∃ (g : Gal(Ω/E)) (j : n), IsUnit (z g j)) : Submodule.span O (z '' T.sahGroup) = ⊤ := by nontriviality QuotSpan a set X : Submodule O (n → QuotSpan a) := Submodule.span O (z '' T.sahGroup) have h_mem {h : Gal(Ω/E)} (hh : h ∈ T.sahGroup) : z h ∈ X := Submodule.subset_span (Set.mem_image_of_mem z hh) -- The span is stable under `G`, as `g z(h) = z (g h g⁻¹)` and `H` is normal. have h_stable (g : Gal(Ω/E)) : ∀ u ∈ X, T.ρ g • u ∈ X := by refine fun _ ↦ smul_mem_span_of_forall_smul_mem (T.ρ g) ?_ rintro _ ⟨h, hh, rfl⟩ rw [← cocycle_conj_eq_smul hz (γ := g) (g := h) (by simp [ρ_eq_one_of_mem_sahGroup hh])] exact h_mem (Normal.conj_mem h hh g) -- It contains a vector with a unit coordinate. obtain ⟨h, hh, j, h_unit⟩ := exists_mem_sahGroup_isUnit_apply hz hγ hz_unit exact eq_top_of_stable_of_isUnit T.span_range_eq_top (Set.forall_mem_range.2 h_stable) (h_mem hh) h_unit end SelmerDatum end Sah section Global /-! ### A bound for the global term by an element that acts by scalars -/ open IsDiscreteValuationRing Module Matrix.Module Submodule variable {O n : Type} [CommRing O] [Fintype n] [DecidableEq n] /-- Over a discrete valuation ring `O`, the `ε`-torsion of `(O / a) ^ n` has length at most `#n · v(ε)`, for the valuation `v` of `O`. -/ lemma length_torsionBy_pi_quot_le [DVR O] (a ε : O) : length O (torsionBy O (n → QuotSpan a) ε) ≤ Fintype.card n * addVal O ε := calc _ ≤ length O (LinearMap.ker ((ε • 1 : Matrix n n O) • 1 : Module.End O (n → QuotSpan a))) := length_mono fun b hb ↦ by simpa using hb _ ≤ addVal O (ε • 1 : Matrix n n O).det := length_ker_le_addVal_det _ a _ = Fintype.card n * addVal O ε := by simp /-- If the matrices `ρ g` span all matrices, the translates of a basis vector span `(O / a) ^ n`. -/ lemma span_range_smul_single_eq_top {G : Type} [Monoid G] {ρ : G →* Matrix n n O} (hρ : span O (Set.range ρ) = ⊤) (a : O) (i : n) : span O (Set.range fun g : G ↦ ρ g • (Pi.single i 1 : n → QuotSpan a)) = ⊤ := by set X : Submodule O (n → QuotSpan a) := span O (Set.range fun g : G ↦ ρ g • Pi.single i 1) have h_stable (g : G) : ∀ u ∈ X, ρ g • u ∈ X := by refine fun _ ↦ smul_mem_span_of_forall_smul_mem (ρ g) ?_ rintro _ ⟨k, rfl⟩ exact subset_span ⟨g * k, by simp only [map_mul, mul_smul]⟩ exact eq_top_of_stable_of_isUnit hρ (Set.forall_mem_range.2 h_stable) (subset_span ⟨1, by simp⟩ : Pi.single i 1 ∈ X) (j := i) (by simp) /-- Over a ring of `ℓ`-adic integers, the `ε`-torsion of a finite module and the `ε`-torsion of its character module have equal length. The latter is the dual of `X / ε X`. -/ lemma length_torsionBy_characterModule_eq {ℓ : ℕ} [ThePrime ℓ] [PadicIntegerRing O ℓ] {X : Type} [AddCommGroup X] [Module O X] [Finite X] (ε : O) : length O (torsionBy O (CharacterModule X) ε) = length O (torsionBy O X ε) := by let δ : X →ₗ[O] X := LinearMap.lsmul O X ε let pullback := CharacterModule.dual δ.range.mkQ -- Pullback identifies the characters of `X / ε X` with those that vanish on `ε X`. have h_range : torsionBy O (CharacterModule X) ε = LinearMap.range pullback := by ext χ constructor · intro hχ have h_vanish : δ.range.toAddSubgroup ≤ AddMonoidHom.ker χ := by rintro _ ⟨m, rfl⟩ exact (DFunLike.congr_fun ((mem_torsionBy_iff ε χ).1 hχ) m : χ (ε • m) = 0) exact ⟨QuotientAddGroup.lift δ.range.toAddSubgroup χ h_vanish, by ext; rfl⟩ · rintro ⟨χ, rfl⟩ refine (mem_torsionBy_iff ε _).2 (DFunLike.ext _ _ fun x ↦ ?_) change χ ((δ.range.mkQ.comp δ) x) = 0 rw [LinearMap.range_mkQ_comp, LinearMap.zero_apply, map_zero] have h_injective : Function.Injective pullback := CharacterModule.dual_injective_of_surjective _ δ.range.mkQ_surjective -- The dual has the same cardinality as the quotient, which has the cardinality of `X[ε]`. have : Finite (X ⧸ δ.range) := .of_surjective _ δ.range.mkQ_surjective have h_card : Nat.card (torsionBy O (CharacterModule X) ε) = Nat.card (torsionBy O X ε) := by rw [h_range, ← Nat.card_congr (LinearEquiv.ofInjective pullback h_injective).toEquiv] exact (card_hom_QZ _).trans (AddSubgroup.index_range (f := δ.toAddMonoidHom)) exact le_antisymm (length_le_of_card_dvd h_card.dvd) (length_le_of_card_dvd h_card.symm.dvd) variable {ℓ : ℕ} [ThePrime ℓ] [PadicIntegerRing O ℓ] {E : Type} [Field E] [EmbeddedNumberField E] [NumberField.IsCMField E] {ρ : Gal(Ω/E) →* Matrix n n O} /-- Let `g` act on `T = O ^ n` through `ρ` by the scalar `α` and let `g^{-c} = (conjGal g)⁻¹` act by `α'`, so that `g` acts on `T^{*c}` by `cyc(g^c) α'`. The difference `α - cyc(g^c) α'` annihilates every element of `conjDualHom ℓ ρ a`. -/ lemma smul_apply_eq_zero_of_mem_conjDualHom {g : Gal(Ω/E)} {α α' a : O} (hα : ρ g = α • 1) (hα' : ρ (conjGal g)⁻¹ = α' • 1) {η : (n → QuotSpan a) →ₗ[O] CharacterModule (n → QuotSpan a)} (hη : η ∈ conjDualHom ℓ ρ a) (u : n → QuotSpan a) : (α - cyclotomicCharIn O Ω ℓ (conjGal g) * α') • η u = 0 := by ext m have h_comm : η u (α • m) = η u ((cyclotomicCharIn O Ω ℓ (conjGal g) * α') • m) := by simpa only [hα, hα', smul_one_smul, map_smul, CharacterModule.smul_apply, mul_smul] using hη g u m rw [CharacterModule.smul_apply, sub_smul, map_sub, h_comm, sub_self] exact (AddMonoidHom.zero_apply m).symm /-- Let `g` act on `T = O ^ n` through `ρ` by the scalar `α`, and let `g^{-c} = (conjGal g)⁻¹` act by `α'`. Suppose the matrices in the range of `ρ` span all matrices. Then `congruenceTerm ℓ ρ` is at most `#n · addVal O (α - cyclotomicCharIn O Ω ℓ (conjGal g) * α')`. -/ lemma congruenceTerm_le [Nonempty n] (hρ : span O (Set.range ρ) = ⊤) {g : Gal(Ω/E)} {α α' : O} (hα : ρ g = α • 1) (hα' : ρ (conjGal g)⁻¹ = α' • 1) : congruenceTerm ℓ ρ ≤ Fintype.card n * addVal O (α - cyclotomicCharIn O Ω ℓ (conjGal g) * α') := by refine iSup₂_le fun a ha ↦ ?_ have : NeZero a := ⟨ha⟩ obtain ⟨i⟩ : Nonempty n := inferInstance let e : n → QuotSpan a := Pi.single i 1 let ev : ((n → QuotSpan a) →ₗ[O] CharacterModule (n → QuotSpan a)) →ₗ[O] CharacterModule (n → QuotSpan a) := LinearMap.applyₗ e let Δ : O := α - cyclotomicCharIn O Ω ℓ (conjGal g) * α' have h_maps : ∀ η ∈ conjDualHom ℓ ρ a, ev η ∈ torsionBy O _ Δ := fun η hη ↦ (mem_torsionBy_iff Δ (ev η)).2 (smul_apply_eq_zero_of_mem_conjDualHom hα hα' hη e) -- A `G`-map that vanishes at `e` vanishes on the translates of `e`, which span `n → QuotSpan a`. have h_inj : Function.Injective (ev.restrict h_maps) := by refine (injective_iff_map_eq_zero _).mpr fun ⟨η, hη⟩ h_e ↦ Subtype.ext ?_ refine LinearMap.ext_on_range (span_range_smul_single_eq_top hρ a i) fun k ↦ ?_ ext m exact (hη k e m).trans (by rw [show η e = 0 from congrArg Subtype.val h_e]; rfl) calc _ ≤ length O (torsionBy O (CharacterModule (n → QuotSpan a)) Δ) := length_le_of_injective (ev.restrict h_maps) h_inj _ = length O (torsionBy O (n → QuotSpan a) Δ) := length_torsionBy_characterModule_eq (ℓ := ℓ) Δ _ ≤ Fintype.card n * addVal O Δ := length_torsionBy_pi_quot_le a Δ end Global end New.Selmer end