module public import Lib.GaloisRep.Main.SelmerModules public import Lib.General.Algebra.BlockFittingBound /-! # Selmer modules with divisible coefficients `O` is a discrete valuation ring and `New.Selmer.DivisibleQuot O` is the module `Frac(O) / O`. For a matrix-valued function `ρ` on the Galois group `Gal(Ω/E)` of `Ω` over the number field `E` (`EmbeddedNumberField E`) with entries in `O` and `a ≠ 0`, the Selmer module with coefficients in `O / a` is identified with the `a`-torsion of the Selmer module with coefficients in `Frac(O) / O`, so it is no longer than the latter. ## Main definitions and results * `New.Selmer.comp_mem_selmerModule_iff`, `New.Selmer.selmerModuleMapOfInjective`: an injective map of coefficient modules preserves and reflects the Selmer conditions, and so maps Selmer modules injectively. * `New.Selmer.length_torsionBy_selmerModule`: if the map identifies `O / a` with the `a`-torsion of the coefficients, the Selmer module with coefficients in `O / a` has the length of the `a`-torsion of the other. * `New.Selmer.divisibleSelmerLength`, `New.Selmer.length_le_divisibleSelmerLength`: the length of the Selmer module with coefficients in `Frac(O) / O` (for an embedded number field `E`), which bounds the lengths of those with coefficients in `O / a`. Notions from other files: * `New.selmerModule ρ S L B`: the locally constant cocycles for `ρ` with values in `B ^ n` that are unramified outside `S` and obey the linear relations `L`. ## Relation to the literature Known. The comparison of Selmer groups with coefficients in `O / a` and in `Frac(O) / O` is standard; here it is immediate, because cocycles are counted and not classes. -/ @[expose] public section noncomputable section namespace New.Selmer section SelmerLevels open Module Submodule Ideal IsDiscreteValuationRing LinearMap variable {O : Type} [CommRing O] {E n : Type} [Field E] [EmbeddedNumberField E] [Fintype n] [DecidableEq n] (ρ : Gal(Ω/E) → Matrix n n O) (S : Set (FinPlace E)) (L : Set (Gal(Ω/E) →₀ Matrix n n O)) {B B' : Type} [AddCommGroup B] [Module O B] [AddCommGroup B'] [Module O B'] /-- An injective map `f` of coefficient modules preserves and reflects the Selmer conditions: `f ∘ z` is in the Selmer module (the locally constant cocycles for `ρ` that are unramified outside the set `S` of finite places and obey the relations `L`) if and only if `z` is. -/ lemma comp_mem_selmerModule_iff {f : B →ₗ[O] B'} (hf : Function.Injective f) {z : Gal(Ω/E) → n → B} : (fun (g : Gal(Ω/E)) (i : n) ↦ f (z g i)) ∈ selmerModule ρ S L B' ↔ z ∈ selmerModule ρ S L B := by have h_locallyConstant : IsLocallyConstant (fun (g : Gal(Ω/E)) (i : n) ↦ f (z g i)) ↔ IsLocallyConstant z := ⟨fun h ↦ IsLocallyConstant.desc z (fun v : n → B ↦ f ∘ v) h hf.comp_left, fun h ↦ h.comp fun v : n → B ↦ f ∘ v⟩ -- The Selmer module is cut out by a set of relations and by local constancy. simp only [selmerModule, Submodule.mem_inf] exact and_congr (comp_mem_obeying_iff_of_injective f hf) h_locallyConstant /-- The map of Selmer modules `z ↦ f ∘ z` induced by an injective map `f` of coefficient modules. -/ def selmerModuleMapOfInjective {f : B →ₗ[O] B'} (hf : Function.Injective f) : selmerModule ρ S L B →ₗ[O] selmerModule ρ S L B' := ((f.compLeft n).compLeft Gal(Ω/E)).restrict fun (_ : Gal(Ω/E) → n → B) hz ↦ (comp_mem_selmerModule_iff ρ S L hf).2 hz /-- An injective map of coefficient modules induces an injective map of Selmer modules. -/ lemma selmerModuleMapOfInjective_injective {f : B →ₗ[O] B'} (hf : Function.Injective f) : Function.Injective (selmerModuleMapOfInjective ρ S L hf) := fun _ _ h ↦ Subtype.ext (hf.comp_left.comp_left (congrArg Subtype.val h)) /-- If `f` identifies `O / a` (that is, `QuotSpan a`) with the `a`-torsion of `B`, then composition with `f` maps the Selmer module (cocycles for `ρ` unramified outside `S` that obey the relations `L`) with coefficients in `O / a` onto the `a`-torsion of the one with coefficients in `B`. -/ lemma range_selmerModuleMapOfInjective {a : O} {f : QuotSpan a →ₗ[O] B} (hf : Function.Injective f) (h_onto : ∀ y : B, a • y = 0 → ∃ x : QuotSpan a, f x = y) : (selmerModuleMapOfInjective ρ S L hf).range = torsionBy O (selmerModule ρ S L B) a := range_restrict_compLeft_eq_torsionBy f h_onto fun _ ↦ comp_mem_selmerModule_iff ρ S L hf /-- If `f` identifies `O / a` (that is, `QuotSpan a`) with the `a`-torsion of `B`, then the Selmer module (cocycles for `ρ` unramified outside `S` that obey the relations `L`, not classes) with coefficients in `O / a` has the length of the `a`-torsion of the one with coefficients in `B`. -/ lemma length_torsionBy_selmerModule {a : O} {f : QuotSpan a →ₗ[O] B} (hf : Function.Injective f) (h_onto : ∀ y : B, a • y = 0 → ∃ x : QuotSpan a, f x = y) : length O (torsionBy O (selmerModule ρ S L B) a) = length O (selmerModule ρ S L (QuotSpan a)) := by rw [← range_selmerModuleMapOfInjective ρ S L hf h_onto, ← (LinearEquiv.ofInjective _ (selmerModuleMapOfInjective_injective ρ S L hf)).length_eq] variable [DVR O] /-- For `a ≠ 0`, the Selmer module (cocycles for `ρ` unramified outside `S` that obey the relations `L`) with coefficients in `O / a` has the length of the `a`-torsion of the Selmer module with coefficients in `DivisibleQuot O = Frac(O) / O`. -/ lemma length_torsionBy_selmerModule_divisibleQuot {a : O} (ha : a ≠ 0) : length O (torsionBy O (selmerModule ρ S L (DivisibleQuot O)) a) = length O (selmerModule ρ S L (QuotSpan a)) := length_torsionBy_selmerModule ρ S L (divQuot_injective ha) fun _ hy ↦ exists_divQuot_eq ha hy /-- For `a ≠ 0`, the Selmer module (cocycles for `ρ` unramified outside `S` that obey the relations `L`) with coefficients in `O / a` is no longer than the one with coefficients in `DivisibleQuot O = Frac(O) / O`, by the injective map on coefficients. -/ lemma length_selmerModule_le_divisibleQuot {a : O} (ha : a ≠ 0) : length O (selmerModule ρ S L (QuotSpan a)) ≤ length O (selmerModule ρ S L (DivisibleQuot O)) := length_le_of_injective _ (selmerModuleMapOfInjective_injective ρ S L (divQuot_injective ha)) end SelmerLevels section DivisibleLength variable {E O n : Type} [Field E] [EmbeddedNumberField E] [CommRing O] [DVR O] [Fintype n] [DecidableEq n] {ρ : Gal(Ω/E) → Matrix n n O} {S : Set (FinPlace E)} {L : Set (Gal(Ω/E) →₀ Matrix n n O)} omit [DVR O] in variable (ρ S L) in /-- For an embedded number field `E`, the length over `O` of the Selmer module with coefficients in `Frac(O) / O`: the locally constant cocycles for `ρ` that are unramified outside `S` and obey the relations `L`. -/ noncomputable def divisibleSelmerLength : ℕ∞ := Module.length O (selmerModule ρ S L (DivisibleQuot O)) /-- Let `E` be an embedded number field and `a ≠ 0`. The Selmer module (cocycles for `ρ` unramified outside `S` that obey the relations `L`) with coefficients in `O / a` has length at most `divisibleSelmerLength ρ S L`, the length of the one with coefficients in `Frac(O) / O`. -/ lemma length_le_divisibleSelmerLength {a : O} (ha : a ≠ 0) : Module.length O (selmerModule ρ S L (QuotSpan a)) ≤ divisibleSelmerLength ρ S L := length_selmerModule_le_divisibleQuot ρ S L ha end DivisibleLength end New.Selmer end