import Lib.General.Algebra.BlockFittingBound import New.Congruences.LocalLoss.Basic /-! # Modules of functions, Fitting ideals and trace ideals for Ribet's method This file bounds Fitting ideals of modules `R^s / N` over `R = O[X j]`, `O` a discrete valuation ring, through modules of functions, and states the conditions on traces and on common Ribet elements. Each index `j : J` carries two pairs `τ j`, `τ' j` and `φ j`, `φ' j` of elements of `G`. In the application `τ' j` is the inverse of the conjugate of `τ j`, so that `c (τ j) - c (τ' j)` is the value at `τ j` of the sum of a cocycle `c` and its conjugate, an even class; likewise for `φ`. The file also gives the linear algebra for several characters and for the main summand. ## Main definitions and results * `New.Selmer.HasTriangleCost`, `New.Selmer.exists_mul_prod_X_mem_fittingIdeal`: if the module of functions `New.Selmer.formsMod` attached to `N ⊆ R^s`, `R = O[X j]`, satisfies a triangular condition along a finite set `I` of indices and a bound on lengths, then the Fitting ideal of `R^s / N` contains `∏ j ∈ I, X j` times a polynomial whose constant coefficient has bounded valuation. * `New.Selmer.IsTraceIdeal`: an algebra `S` of families of polynomials in variables `X j` holds the characteristic polynomials, and an `S`-submodule `𝒥` holds the traces of given relations. Notions from other files: * `New.Selmer.fittingIdeal N`: the ideal of `R` generated by the determinants of square matrices with all rows in `N ⊆ R^ι`, the zeroth Fitting ideal of `R^ι / N`. * `New.Selmer.formsMod Φ z N p`: the functions `g ↦ Ψ (z g)` on `G`, where `Ψ : O^n → O / p` runs over the `O`-linear maps that vanish on `Φ⁻¹ N`. * `New.Selmer.ribetCocyclesIn u ρ B`: the cocycles `G → B^d` for `ρ` that obey the linear relations among the families `(u x g - 1)_x`. -/ namespace New.Selmer open Submodule Finset IsDiscreteValuationRing fittingIdeal MvPolynomial variable {O G J n : Type} [CommRing O] [DVR O] [LinearOrder J] [Fintype n] {s : Finset G} {Φ : (n → O) →ₗ[O] s → MvPolynomial J O} /-- There is a set `L ⊆ G` with two properties, where `Z₀` denotes the functions of `Z` that vanish on `L`. (a) Let `j ∈ I` and `c ∈ Z₀`. If `c (τ i) = c (τ' i)` for all `i < j`, and `c (φ i) = c (φ' i)` for those `i < j` in `I`, then `C • c (τ j) = C • c (τ' j)`. (b) Let `S ≤ Z₀` be a submodule whose members vanish at all `τ j` and `τ' j` and have `c (φ j) = c (φ' j)` for `j ∈ I`. Then the length of `Z / Z₀` plus the length of `S` modulo its `C`-torsion is at most `b`. Here `relLength S T` is the length of `S / (S ⊓ T)`. -/ def HasTriangleCost {B : Type*} [AddCommGroup B] [Module O B] (Z : Submodule O (G → B)) (τ τ' φ φ' : J → G) (I : Finset J) (C : O) (b : ℕ∞) : Prop := ∃ L : Set G, -- (a) the triangle along `I` (∀ j ∈ I, ∀ c ∈ Z ⊓ Submodule.pi L ⊥, (∀ i < j, c (τ i) = c (τ' i) ∧ (i ∈ I → c (φ i) = c (φ' i))) → C • c (τ j) = C • c (τ' j)) ∧ -- (b) the cost ∀ S ≤ Z ⊓ Submodule.pi L ⊥, (∀ c ∈ S, (∀ j : J, c (τ j) = 0 ∧ c (τ' j) = 0) ∧ ∀ j ∈ I, c (φ j) = c (φ' j)) → relLength Z (Submodule.pi L ⊥) + relLength S (torsionBy O (G → B) C) ≤ b omit [LinearOrder J] in /-- Let `R` be the polynomial ring over `O` in the variables `X j` and `Φ : O^n → R^s`. Suppose `p ≠ 0`, `Φ (p • O^n) ⊆ T`, and that modulo `T` the basis vector of `R^s` at each `g ∈ s` is `Φ (z g)`. Let `T₀` be `T` plus all vectors of polynomials without constant term. Then the Fitting ideal of `R^s / T` contains an element whose constant coefficient has valuation at most `#s * addVal O C` plus the length, modulo `C`-torsion, of the module `formsMod Φ z T₀ p` of the functions `Ψ ∘ z` for linear `Ψ : O^n → O / p` vanishing on `Φ⁻¹ T₀`. -/ lemma exists_mem_fittingIdeal_addVal_constantCoeff_le [DecidableEq G] [Finite J] {z : G → n → O} {T : Submodule (MvPolynomial J O) (s → MvPolynomial J O)} {p : O} (C : O) (hp : p ≠ 0) (hT_smul_p : ∀ v : n → O, Φ (p • v) ∈ T) (h_basis : ∀ g : s, Φ (z g) - Pi.single g (1 : MvPolynomial J O) ∈ T) : ∃ d ∈ fittingIdeal T, addVal O (constantCoeff d) ≤ relLength (formsMod Φ z (T ⊔ RingHom.ker (constantCoeff : MvPolynomial J O →+* O) • ⊤) p) (torsionBy O (G → Unit → QuotSpan p) C) + #s * addVal O C := by -- `K` adds to `T₀` the relations that make the forms `C`-torsion, at the cost `f`; it holds the -- rows of `C • 1`. So `f * C ^ #s` lies in `fittingIdeal T` up to a polynomial `r` without -- constant term. set T₀ : Submodule (MvPolynomial J O) (s → MvPolynomial J O) := T ⊔ RingHom.ker (constantCoeff : MvPolynomial J O →+* O) • ⊤ have hTT₀ : T ≤ T₀ := le_sup_left obtain ⟨f, K, hT₀K, hf, hC, hFittK⟩ : ∃ f : O, ∃ K ≥ T₀, addVal O f ≤ relLength (formsMod Φ z T₀ p) (torsionBy O (G → Unit → QuotSpan p) C) ∧ (∀ ⦃w : n → O⦄, (∀ Ψ : (n → O) →ₗ[O] Unit → QuotSpan p, Ψ ∘ z ∈ torsionBy O (G → Unit → QuotSpan p) C → Ψ w = 0) → Φ w ∈ K) ∧ ∀ d ∈ fittingIdeal K, f • d ∈ fittingIdeal T₀ := fittingIdeal.exists_addVal_le_relLength z hp (fun w ↦ hTT₀ (hT_smul_p w)) _ have h_rows (g : s) : (C • (1 : Matrix s s (MvPolynomial J O))) g ∈ K := by have hCg : Φ (C • z g) ∈ K := hC fun Ψ hΨ ↦ by simpa using congrFun hΨ g have h_row : (C • (1 : Matrix s s (MvPolynomial J O))) g = Φ (C • z g) - C • (Φ (z g) - Pi.single g 1) := by ext1 g' simp [smul_sub, Matrix.one_apply, Pi.single_apply, eq_comm] rw [h_row] exact sub_mem hCg (smul_of_tower_mem K C (hT₀K (hTT₀ (h_basis g)))) have h_det : Matrix.det (C • (1 : Matrix s s (MvPolynomial J O))) ∈ fittingIdeal K := subset_span ⟨C • 1, h_rows, rfl⟩ obtain ⟨d, hd, r, hr, hdr⟩ : ∃ d ∈ fittingIdeal T, ∃ r : MvPolynomial J O, constantCoeff r = 0 ∧ d + r = f • Matrix.det (C • (1 : Matrix s s (MvPolynomial J O))) := mem_sup.1 (fittingIdeal.sup_smul_top_le (hFittK _ h_det)) have hd_coeff : constantCoeff d = f * C ^ #s := by simp [eq_sub_of_add_eq hdr, hr] refine ⟨d, hd, ?_⟩ grw [hd_coeff, addVal_mul, addVal_pow, hf, nsmul_eq_mul] /-- Let `Φ : O^n → R^s` with `R = O[X j]`, `p ≠ 0`, `Φ (p • O^n) ⊆ T`, and put `y g = Φ (z g)`. Suppose that `y (τ i) - y (τ' i) = X i • (y (φ i) - y (φ' i))` modulo `T` for all `i`, and that `X i • (y (φ i) - y (φ' i))` lies in `T` for `i < j`. Suppose that every linear `Ψ : O^n → O / p` that vanishes on `Φ⁻¹ T` and has `Ψ (z (τ i)) = Ψ (z (τ' i))` for `i < j` has `C • Ψ (z (τ j)) = C • Ψ (z (τ' j))`. Then `C X j • (y (φ j) - y (φ' j))` lies in `T`. -/ lemma smul_X_smul_mem_of_forall_form {z : G → n → O} {T : Submodule (MvPolynomial J O) (s → MvPolynomial J O)} {p C : O} {τ τ' φ φ' : J → G} {j : J} (hp : p ≠ 0) (hT_smul_p : ∀ v : n → O, Φ (p • v) ∈ T) (h_tie : ∀ i : J, Φ (z (τ i) - z (τ' i)) - X (R := O) i • Φ (z (φ i) - z (φ' i)) ∈ T) (h_lt : ∀ i < j, X (R := O) i • Φ (z (φ i) - z (φ' i)) ∈ T) (h_form : ∀ Ψ : (n → O) →ₗ[O] Unit → QuotSpan p, (∀ ⦃v : n → O⦄, Φ v ∈ T → Ψ v = 0) → (∀ i < j, Ψ (z (τ i)) = Ψ (z (τ' i))) → C • Ψ (z (τ j)) = C • Ψ (z (τ' j))) : (C • X (R := O) j) • Φ (z (φ j) - z (φ' j)) ∈ T := by have h_rel : Φ (C • (z (τ j) - z (τ' j))) ∈ T := by -- By duality it is enough that every form `Ψ` kills the vector. refine mem_of_forall_form_eq_zero hp hT_smul_p fun Ψ hΨ ↦ ?_ have hΨ_τ (i : J) (hij : i < j) : Ψ (z (τ i)) = Ψ (z (τ' i)) := by rw [← sub_eq_zero, ← map_sub] exact hΨ ((sub_mem_iff_left T (h_lt i hij)).1 (h_tie i)) rw [map_smul, map_sub, smul_sub, h_form Ψ hΨ hΨ_τ, sub_self] simpa [smul_sub] using sub_mem h_rel (smul_of_tower_mem T C (h_tie j)) /-- Let `O` be a discrete valuation ring, `R` the polynomial ring over `O` in the variables `X j`, let `Φ : O^n → R^s` and put `y g = Φ (z g)`. Suppose `p ≠ 0` and `Φ (p • O^n) ⊆ N`. Suppose that modulo `N`, the basis vector of `R^s` at each `g ∈ s` is `y g`, and `y (τ j) = X j • y (φ j)` and `y (τ' j) = X j • y (φ' j)` for every `j`. Suppose that every `i` below a member of `I` lies in `I` or has `X i • R^s ⊆ N`. Let `Z = formsMod Φ z N p` be the module of the functions `Ψ ∘ z` on `G`, for linear `Ψ : O^n → O / p` vanishing on `Φ⁻¹ N`, and suppose `HasTriangleCost` for `Z`: there is a set `A ⊆ G` with two properties, where `Z₀` is the part of `Z` that vanishes on `A`. (a) For `j ∈ I` and `c ∈ Z₀`, if `c (τ i) = c (τ' i)` for all `i < j` and `c (φ i) = c (φ' i)` for those `i < j` in `I`, then `C • c (τ j) = C • c (τ' j)`. (b) The length of `Z / Z₀` plus the length of `Z₁` modulo its `C`-torsion is at most `b`, for every submodule `Z₁ ≤ Z₀` whose members `c` vanish at all `τ j`, `τ' j` and have `c (φ j) = c (φ' j)` for `j ∈ I`. Then the Fitting ideal of `R^s / N` contains `F * ∏ j ∈ I, X j` for some polynomial `F` whose constant coefficient has valuation at most `b + (#I + #s) * addVal O C`. -/ lemma exists_mul_prod_X_mem_fittingIdeal [DecidableEq G] [Finite J] {z : G → n → O} {N : Submodule (MvPolynomial J O) (s → MvPolynomial J O)} {p : O} {τ τ' φ φ' : J → G} {C : O} {I : Finset J} {b : ℕ∞} (hp : p ≠ 0) (h_cost : HasTriangleCost (formsMod Φ z N p) τ τ' φ φ' I C b) (hN_smul_p : ∀ v : n → O, Φ (p • v) ∈ N) (h_basis : ∀ g : s, Φ (z g) - Pi.single g (1 : MvPolynomial J O) ∈ N) (hτ : ∀ j : J, Φ (z (τ j)) - X (R := O) j • Φ (z (φ j)) ∈ N) (hτ' : ∀ j : J, Φ (z (τ' j)) - X (R := O) j • Φ (z (φ' j)) ∈ N) (hI : ∀ j ∈ I, ∀ i < j, i ∈ I ∨ ∀ v : s → MvPolynomial J O, X (R := O) i • v ∈ N) : ∃ F : MvPolynomial J O, addVal O (constantCoeff F) ≤ b + (#I + #s) * addVal O C ∧ F * ∏ j ∈ I, X j ∈ fittingIdeal N := by -- Enlarge `N` in three stages and follow the Fitting ideal back. The first, to `K`, costs a -- length (`fittingIdeal.exists_addVal_le_relLength`). The second, to `T`, is a triangle -- (`fittingIdeal.exists_ge_mul_prod_mem`). In the third, what remains is read at `X j = 0` -- (`exists_mem_fittingIdeal_addVal_constantCoeff_le`). obtain ⟨A, h_tri, h_len⟩ := h_cost -- First stage: `K` adds the relations that make the forms vanish on `A`, at the cost `e`. obtain ⟨e, K, hNK, he, hA, hFittK⟩ : ∃ e : O, ∃ K ≥ N, addVal O e ≤ relLength (formsMod Φ z N p) (.pi A ⊥) ∧ (∀ ⦃w : n → O⦄, (∀ Ψ : (n → O) →ₗ[O] Unit → QuotSpan p, Ψ ∘ z ∈ Submodule.pi A ⊥ → Ψ w = 0) → Φ w ∈ K) ∧ ∀ d ∈ fittingIdeal K, e • d ∈ fittingIdeal N := fittingIdeal.exists_addVal_le_relLength z hp hN_smul_p (.pi A ⊥) have sol_le {K' : Submodule (MvPolynomial J O) (s → MvPolynomial J O)} (hK' : K ≤ K') : formsMod Φ z K' p ≤ formsMod Φ z N p ⊓ .pi A ⊥ := by refine le_inf (formsMod_anti z (hNK.trans hK')) fun f hf g hg ↦ ?_ obtain ⟨Ψ, hΨ, rfl⟩ := mem_formsMod.1 hf exact hΨ (hK' (hA fun _ h ↦ h g hg)) -- Second stage: `T` adds the vectors `v j`, for `j ∈ I` in increasing order. let v : J → s → MvPolynomial J O := fun j ↦ Φ (z (φ j) - z (φ' j)) have h_diff (i : J) : Φ (z (τ i) - z (τ' i)) - X (R := O) i • v i ∈ K := by simpa [v, smul_sub, sub_sub_sub_comm] using hNK (sub_mem (hτ i) (hτ' i)) have h_step (j : J) (hj : j ∈ I) (T : Submodule (MvPolynomial J O) (s → MvPolynomial J O)) (hKT : K ≤ T) (hvT : ↑I ∩ Set.Iio j ⊆ v ⁻¹' T) : (C • X (R := O) j) • v j ∈ T := by have h_lt (i : J) (hij : i < j) : X (R := O) i • v i ∈ T := by rcases hI j hj i hij with hi | hX · exact T.smul_mem (X i) (hvT ⟨hi, hij⟩) · exact hKT (hNK (hX (v i))) refine smul_X_smul_mem_of_forall_form hp (fun w ↦ hKT (hNK (hN_smul_p w))) (fun i ↦ hKT (h_diff i)) h_lt fun Ψ hΨ hΨ_τ ↦ ?_ exact h_tri j hj (Ψ ∘ z) (sol_le hKT (mem_formsMod.2 ⟨Ψ, hΨ, rfl⟩)) fun i hij ↦ ⟨hΨ_τ i hij, fun hi ↦ Ψ.sub_mem_ker_iff.1 (hΨ (hvT ⟨hi, hij⟩))⟩ obtain ⟨T, hKT, hvT, hFittT⟩ : ∃ T ≥ K, ↑I ⊆ v ⁻¹' T ∧ ∀ d ∈ fittingIdeal T, d * ∏ j ∈ I, C • X j ∈ fittingIdeal K := fittingIdeal.exists_ge_mul_prod_mem (fun j ↦ C • X j) h_step -- Third stage: `T₀` adds the vectors of polynomials without constant term. let T₀ : Submodule (MvPolynomial J O) (s → MvPolynomial J O) := T ⊔ RingHom.ker (constantCoeff : MvPolynomial J O →+* O) • ⊤ obtain ⟨d, hd, hd_val⟩ : ∃ d ∈ fittingIdeal T, addVal O (constantCoeff d) ≤ relLength (formsMod Φ z T₀ p) (torsionBy O (G → Unit → QuotSpan p) C) + #s * addVal O C := exists_mem_fittingIdeal_addVal_constantCoeff_le C hp (fun w ↦ hKT (hNK (hN_smul_p w))) fun g ↦ hKT (hNK (h_basis g)) have h_lengths : relLength (formsMod Φ z N p) (.pi A ⊥) + relLength (formsMod Φ z T₀ p) (torsionBy O (G → Unit → QuotSpan p) C) ≤ b := by refine h_len _ (sol_le (le_sup_of_le_left hKT)) fun c hc ↦ ?_ obtain ⟨Ψ, hΨ, rfl⟩ := mem_formsMod.1 hc -- A vector that is `X j • y'` modulo `N` lies in `T₀`. have h_mem {j : J} {y y' : s → MvPolynomial J O} (hy : y - X (R := O) j • y' ∈ N) : y ∈ T₀ := by rw [← sub_add_cancel y (X (R := O) j • y')] exact add_mem_sup (hKT (hNK hy)) (smul_mem_smul (by simp) mem_top) exact ⟨fun j ↦ ⟨hΨ (h_mem (hτ j)), hΨ (h_mem (hτ' j))⟩, fun j hj ↦ Ψ.sub_mem_ker_iff.1 (hΨ (mem_sup_left (hvT hj)))⟩ refine ⟨(e * C ^ #I) • d, ?_, ?_⟩ · calc addVal O (constantCoeff ((e * C ^ #I) • d)) _ = addVal O e + addVal O (constantCoeff d) + #I * addVal O C := by simp [add_right_comm] _ ≤ b + (#I + #s) * addVal O C := by grw [he, hd_val, ← add_assoc, h_lengths, add_assoc, add_mul, add_comm (#s * addVal O C)] · -- From `fittingIdeal T` back to `fittingIdeal K` costs `∏ j ∈ I, C • X j`, and back to -- `fittingIdeal N` costs `e`. simpa [prod_smul, mul_smul] using hFittK _ (hFittT d hd) end New.Selmer section RibetFirstOrder namespace New.Selmer open IsDiscreteValuationRing Matrix Module Submodule Polynomial MonoidAlgebra Finset Sum CompleteLattice open Finsupp (linearCombination) open MvPolynomial hiding X C aeval eval funext comap ext section Definitions variable {O L Y G J σ W : Type} [CommRing O] [CommRing L] [Algebra O L] [Fintype σ] [DecidableEq σ] {S : Subalgebra O (Y → MvPolynomial J L)} /-- Elements of `S` and `𝒥` are families, indexed by `x : Y`, of polynomials over `L` in the variables `X j`. The algebra `S` contains the variables and the coefficients of the characteristic polynomials of `u`. The `S`-module `𝒥` contains `p` times the traces of the `u x g` and, for each relation that ties `τ i` to `φ i`, the traces of its products with the `u x g` on the right. -/ structure IsTraceIdeal (𝒥 : Submodule S (Y → MvPolynomial J L)) {A : Type*} {K : Sort*} [CommRing A] [Algebra O A] [Algebra A L] (u : Y → G → Matrix σ σ A) (p : O) (τ φ : K → G) (k : K → J) (ε : J → O[X]) : Prop where /-- The algebra `S` contains the constant families `X j`. -/ X_mem (j : J) : (fun _ : Y ↦ MvPolynomial.X j) ∈ S /-- The algebra `S` contains the coefficients of the characteristic polynomials of the `u x g`, as families of constants. -/ charpoly_coeff_mem (g : G) (n : ℕ) : (fun x : Y ↦ MvPolynomial.C (algebraMap A L ((u x g).charpoly.coeff n))) ∈ S /-- The `S`-module `𝒥` contains `p` times the trace of `u x g`. -/ smul_trace_mem (g : G) : (fun x : Y ↦ MvPolynomial.C (algebraMap A L (p • (u x g).trace))) ∈ 𝒥 /-- The `S`-module `𝒥` contains the trace of `(τ i - 1 - X (k i) * (φ i - 1) * ε (k i) (φ i)) * g` under `u x`. -/ trace_relation_mem (g : G) (i : K) : (fun x : Y ↦ MvPolynomial.C (algebraMap A L ((u x (τ i) - 1) * u x g).trace) - MvPolynomial.X (k i) * MvPolynomial.C (algebraMap A L (((X - 1) * ε (k i)).aeval (u x (φ i)) * u x g).trace)) ∈ 𝒥 variable [Group G] (u : Y → G →* Matrix σ σ O) (𝒥 : Submodule S (Y → MvPolynomial J L)) /-- The cocycles `c : G → B ^ r` for `ρ` that obey the linear relations among the families `(u x g - 1)_x` (`ribetCocyclesIn u ρ B`) and vanish on the set `T` and at `γ`. -/ noncomputable def ribetCocyclesVanishingOn {r : Type} [Fintype r] [DecidableEq r] (ρ : G →* Matrix r r O) (B : Type) [AddCommGroup B] [Module O B] (T : Set G) (γ : G) : Submodule O (G → r → B) := ribetCocyclesIn u ρ B ⊓ Submodule.pi T ⊥ ⊓ (LinearMap.proj γ).ker /-- Membership in `ribetCocyclesVanishingOn`, clause by clause: `c` lies in `ribetCocyclesVanishingOn u ρ B T γ` iff `c` lies in `ribetCocyclesIn u ρ B`, `c g = 0` for all `g ∈ T`, and `c γ = 0`. -/ lemma mem_ribetCocyclesVanishingOn {r : Type} [Fintype r] [DecidableEq r] {ρ : G →* Matrix r r O} {B : Type} [AddCommGroup B] [Module O B] {T : Set G} {γ : G} {c : G → r → B} : c ∈ ribetCocyclesVanishingOn u ρ B T γ ↔ c ∈ ribetCocyclesIn u ρ B ∧ (∀ g ∈ T, c g = 0) ∧ c γ = 0 := by simp only [ribetCocyclesVanishingOn, Submodule.mem_inf, Submodule.mem_pi, Pi.bot_apply, Submodule.mem_bot, LinearMap.mem_ker, LinearMap.proj_apply, and_assoc] /-- A character `χ` as a representation by `1 × 1` matrices. -/ noncomputable abbrev rankOneRep (χ : G →* O) : G →* Matrix Unit Unit O := (scalar Unit).toMonoidHom.comp χ /-- The function `c : G → O / p` is a cocycle for the character `χ` that obeys the linear relations among the families `(u x g - 1)_x` and vanishes at the `δ v`; if `c γ = 0`, then every `χ g - 1` kills `c a`. -/ def IsCharacterCocycle (χ : G →* O) (δ : W → G) (γ a : G) {p : O} (c : G → Unit → QuotSpan p) : Prop := -- (a) a cocycle for `χ` that obeys the relations c ∈ ribetCocycles u (rankOneRep χ) p ∧ -- (b) zero at the `δ v` (∀ v : W, c (δ v) = 0) ∧ -- (c) if `c γ = 0`, every `χ g - 1` kills `c a` (c γ = 0 → ∀ g : G, (χ g - 1) • c a = 0) /-- The finite set `s` detects the module `Z` of functions: an element of `Z` that vanishes on `s` is zero. -/ def IsDetectedBy {B : Type*} [AddCommGroup B] [Module O B] (Z : Submodule O (G → B)) (s : Finset G) : Prop := ∀ c ∈ Z, (∀ g ∈ s, c g = 0) → c = 0 /-- One Ribet element for a family `β` of functions `β i : Y → L`. Here `S` is an algebra of families, indexed by `x : Y`, of polynomials over `L` in the variables `X j`, and `𝒥` is an `S`-module of such families. Every family of constant polynomials `x ↦ C (β i x)` lies in `S` and vanishes on `𝓧`. One `f : S` multiplies all of them into `𝒥`; for `x ∈ 𝓧`, `f x` has no monomial properly dividing `∏ X j`; and the coefficient of `∏ X j` in `f π` is `c`. -/ def IsCommonRibetElement [Fintype J] {I : Type*} (β : I → Y → L) {𝓧 : Set Y} (π : 𝓧) (c : L) : Prop := (∀ i : I, (fun x : Y ↦ MvPolynomial.C (β i x)) ∈ S) ∧ (∀ (i : I) (x : 𝓧), β i x = 0) ∧ ∃ f : S, -- (a) `f` multiplies every `β i` into `𝒥` (∀ i : I, f.1 * (fun x : Y ↦ MvPolynomial.C (β i x)) ∈ 𝒥) ∧ -- (b) on `𝓧`, `f` has no term below `∏ X j` (∀ x : 𝓧, ∀ d < ∑ j : J, Finsupp.single j 1, (f.1 x).coeff d = 0) ∧ -- (c) the coefficient of `∏ X j` at `π` (f.1 π).coeff (∑ j : J, Finsupp.single j 1) = c end Definitions -- The coefficientwise map makes `MvPolynomial J L` an algebra over `MvPolynomial J O`. attribute [local instance] algebraMvPolynomial section SmallLemmas variable {O L Y G J σ W : Type} [CommRing O] [CommRing L] [Algebra O L] [Fintype σ] [DecidableEq σ] [Group G] (u : Y → G →* Matrix σ σ O) {S : Subalgebra O (Y → MvPolynomial J L)} (𝒥 : Submodule S (Y → MvPolynomial J L)) /-- Let `N` be a module of vectors over `A`, let `η e` be finitely many characters of `A`, and let `c j` be finitely many coordinates. If for each `e` and each `i` some `w ∈ N` has coordinates `w (c j)` that `η e` sends to the unit vector `i`, then for each `i` one `w ∈ N` does so for all `e` at once. -/ lemma exists_common_unit_row {Λ A E ι κ : Type} [CommRing Λ] [Ring A] [Algebra Λ A] [Fintype E] [Fintype κ] [DecidableEq κ] (η : E → A →ₐ[Λ] Λ) (N : Submodule A (ι → A)) (c : κ → ι) (h_unit : ∀ (e : E) (i : κ), ∃ w ∈ N, ∀ j : κ, η e (w (c j)) = if j = i then 1 else 0) (i : κ) : ∃ w ∈ N, ∀ (e : E) (j : κ), η e (w (c j)) = if j = i then 1 else 0 := by classical choose m hm hm_eq using h_unit suffices ∃ w ∈ N, ∀ e ∈ univ, ∀ j : κ, η e (w (c j)) = if j = i then 1 else 0 by simpa -- Correct `w` on one more character `e` without changing it on the earlier ones. induction (univ : Finset E) using Finset.induction_on with | empty => exact ⟨0, by simp⟩ | insert e s _ ih => obtain ⟨w, hw, hw_eq⟩ := ih let w' : ι → A := w + ∑ j : κ, ((if j = i then 1 else 0) - w (c j)) • m e j have hw' : w' ∈ N := add_mem hw (sum_mem fun j _ ↦ N.smul_mem _ (hm e j)) have h_new (j : κ) : η e (w' (c j)) = if j = i then 1 else 0 := by simp [w', hm_eq] have h_old (e' : E) (he' : e' ∈ s) (j : κ) : η e' (w' (c j)) = if j = i then 1 else 0 := by simp [w', hw_eq e' he'] exact ⟨w', hw', (forall_mem_insert ..).2 ⟨h_new, h_old⟩⟩ /-- Let `R` be a `Λ`-algebra with characters `χ e : R →ₐ[Λ] Λ`, and let `π e` have `χ e (π e) = μ e` and `χ e' (π e) = 0` for `e' ≠ e`. Let `N` be a module of relations among generators indexed by `ι₀ ⊕ ι`. Suppose that the generators in `ι` suffice modulo the kernel of each `χ e`: for each `e` and `i : ι₀` some `w ∈ N` is, under `χ e`, the unit vector `i` on `ι₀`. Let each row of `B e` be `χ e` of the `ι`-part of some `w ∈ N` whose `ι₀`-part `χ e` kills. Then there is a square matrix `M` with rows in `N` such that `det (χ e M) = μ e ^ #ι det (B e)` for all `e`. -/ lemma exists_rows_det_eq_pow_mul_det {Λ R E ι₀ ι : Type} [CommRing Λ] [Ring R] [Algebra Λ R] [Fintype E] [DecidableEq E] [Fintype ι₀] [DecidableEq ι₀] [Fintype ι] [DecidableEq ι] (χ : E → R →ₐ[Λ] Λ) {π : E → R} {μ : E → Λ} (hπ : ∀ e e' : E, χ e' (π e) = if e' = e then μ e else 0) (N : Submodule R (ι₀ ⊕ ι → R)) (h_gen : ∀ (e : E) (i : ι₀), ∃ w ∈ N, ∀ j : ι₀, χ e (w (.inl j)) = if j = i then 1 else 0) (B : E → Matrix ι ι Λ) (hB : ∀ (e : E) (l : ι), ∃ w ∈ N, (∀ j : ι₀, χ e (w (.inl j)) = 0) ∧ ∀ i : ι, χ e (w (.inr i)) = B e l i) : ∃ M : Matrix (ι₀ ⊕ ι) (ι₀ ⊕ ι) R, (∀ k : ι₀ ⊕ ι, M k ∈ N) ∧ ∀ e : E, (M.map (χ e)).det = μ e ^ Fintype.card ι * (B e).det := by classical -- The rows of `ι₀`: one relation that is the unit vector on every character at once -- (`exists_common_unit_row`). The rows of `ι`: `∑ e π e w e l` with `w e l` from `hB`, which is -- `μ e` times row `l` of `B e` on `χ e`, and zero on `ι₀`. choose w hw hw_zero hw_eq using hB have unit_row (i : ι₀) : ∃ v ∈ N, ∀ (e : E) (j : ι₀), χ e (v (.inl j)) = if j = i then 1 else 0 := exists_common_unit_row χ N Sum.inl h_gen i choose v hv hv_eq using unit_row let M : Matrix (ι₀ ⊕ ι) (ι₀ ⊕ ι) R := Sum.elim v fun l ↦ ∑ e', π e' • w e' l have h_first (e : E) (i j : ι₀) : χ e (M (.inl i) (.inl j)) = if j = i then 1 else 0 := hv_eq i e j have h_last (e : E) (l : ι) (k : ι₀ ⊕ ι) : χ e (M (.inr l) k) = μ e * χ e (w e l k) := by simp [M, Finset.sum_apply, hπ] refine ⟨M, fun k ↦ ?_, fun e ↦ ?_⟩ · rcases k with i | l · exact hv i · exact sum_mem fun e' _ ↦ N.smul_mem _ (hw e' l) -- On `χ e` the matrix is block triangular, with `1` and `μ e • B e` on the diagonal. have h_blocks : M.map (χ e) = fromBlocks 1 ((M.map (χ e)).toBlocks₁₂) 0 (μ e • B e) := by ext (i | l) (j | j) · simp [h_first, one_apply, eq_comm (a := i)] · rfl · simp [h_last, hw_zero] · simp [h_last, hw_eq] rw [h_blocks, det_fromBlocks_zero₂₁, det_one, one_mul, det_smul] /-- Let `R` be a `Λ`-algebra with characters `χ e : R →ₐ[Λ] Λ`, of kernels `𝔨 e`, let `π e` have `χ e (π e) = μ e` and `χ e' (π e) = 0` for `e' ≠ e`, and let `y` span a left `R`-module `C`. If the `y (inr i)` generate `C` modulo `𝔨 e • C` for every `e`, and each row of `B e` is a relation among them modulo `𝔨 e • C`, then there is a square matrix `M` over `R`, whose rows are relations among the `y k`, such that `det (χ e M) = μ e ^ #ι det (B e)` for all `e`. -/ lemma exists_relations_det_eq_pow_mul_det {Λ R C E ι₀ ι : Type} [CommRing Λ] [Ring R] [Algebra Λ R] [AddCommGroup C] [Module R C] [Fintype E] [DecidableEq E] [Fintype ι₀] [DecidableEq ι₀] [Fintype ι] [DecidableEq ι] (χ : E → R →ₐ[Λ] Λ) {π : E → R} {μ : E → Λ} (hπ : ∀ e e' : E, χ e' (π e) = if e' = e then μ e else 0) {y : ι₀ ⊕ ι → C} (hy : Submodule.span R (Set.range y) = ⊤) (h_gen : ∀ e : E, Submodule.span R (Set.range (y ∘ Sum.inr)) ⊔ RingHom.ker (χ e) • ⊤ = ⊤) (B : E → Matrix ι ι Λ) (hB : ∀ (e : E) (l : ι), ∑ i : ι, algebraMap Λ R (B e l i) • y (.inr i) ∈ RingHom.ker (χ e) • (⊤ : Submodule R C)) : ∃ M : Matrix (ι₀ ⊕ ι) (ι₀ ⊕ ι) R, (∀ l : ι₀ ⊕ ι, ∑ k : ι₀ ⊕ ι, M l k • y k = 0) ∧ ∀ e : E, (M.map (χ e)).det = μ e ^ Fintype.card ι * (B e).det := by -- The relations are the kernel of `f ↦ ∑ f k • y k`; an element of `𝔨 e • C` is such a sum -- with all coefficients in `𝔨 e`, as `y` spans `C`. let N : Submodule R (ι₀ ⊕ ι → R) := LinearMap.ker (Fintype.linearCombination R y) have mem_N (w : ι₀ ⊕ ι → R) : w ∈ N ↔ ∑ k, w k • y k = 0 := by simp [N, Fintype.linearCombination_apply] have h_ker (e : E) {m : C} (hm : m ∈ RingHom.ker (χ e) • (⊤ : Submodule R C)) : ∃ κ : ι₀ ⊕ ι → R, (∀ k, χ e (κ k) = 0) ∧ ∑ k, κ k • y k = m := by rw [← hy] at hm refine Submodule.smul_induction_on (p := fun m ↦ ∃ κ : ι₀ ⊕ ι → R, (∀ k, χ e (κ k) = 0) ∧ ∑ k, κ k • y k = m) hm (fun a ha c hc ↦ ?_) fun m₁ m₂ h₁ h₂ ↦ ?_ · obtain ⟨f, rfl⟩ := (Submodule.mem_span_range_iff_exists_fun R).1 hc refine ⟨fun k ↦ a * f k, fun k ↦ ?_, by simp [Finset.smul_sum, mul_smul]⟩ rw [map_mul, RingHom.mem_ker.1 ha, zero_mul] · obtain ⟨κ₁, hκ₁, rfl⟩ := h₁ obtain ⟨κ₂, hκ₂, rfl⟩ := h₂ exact ⟨κ₁ + κ₂, fun k ↦ by simp [hκ₁, hκ₂], by simp [add_smul, Finset.sum_add_distrib]⟩ suffices h_rows : ∃ M : Matrix (ι₀ ⊕ ι) (ι₀ ⊕ ι) R, (∀ l, M l ∈ N) ∧ ∀ e : E, (M.map (χ e)).det = μ e ^ Fintype.card ι * (B e).det by simpa only [mem_N] using h_rows refine exists_rows_det_eq_pow_mul_det χ hπ N (fun e i ↦ ?_) B fun e l ↦ ?_ · -- `y (inl i)` is a combination of the `y (inr i')` plus an element of `𝔨 e • C`. have h_top : y (.inl i) ∈ Submodule.span R (Set.range (y ∘ Sum.inr)) ⊔ RingHom.ker (χ e) • (⊤ : Submodule R C) := by rw [h_gen e] exact Submodule.mem_top obtain ⟨a, ha, m, hm, h_sum⟩ := Submodule.mem_sup.1 h_top obtain ⟨f, rfl⟩ := (Submodule.mem_span_range_iff_exists_fun R).1 ha obtain ⟨κ, hκ, rfl⟩ := h_ker e hm refine ⟨Pi.single (.inl i) 1 - Sum.elim (fun _ ↦ 0) f - κ, (mem_N _).2 ?_, fun j ↦ ?_⟩ · simp only [Pi.sub_apply, sub_smul, Finset.sum_sub_distrib, Fintype.sum_sum_type, Sum.elim_inl, Sum.elim_inr, zero_smul, Finset.sum_const_zero, zero_add, Function.comp_apply] at h_sum ⊢ simp [Pi.single_apply, ← h_sum] · simp [hκ, Pi.single_apply, eq_comm] · obtain ⟨κ, hκ, h_sum⟩ := h_ker e (hB e l) refine ⟨Sum.elim (fun _ ↦ 0) (fun i ↦ algebraMap Λ R (B e l i)) - κ, (mem_N _).2 ?_, fun j ↦ ?_, fun i ↦ ?_⟩ · simp [sub_smul, Finset.sum_sub_distrib, Fintype.sum_sum_type, h_sum] · simp [hκ] · simp [hκ] /-- If each of finitely many `ψ x` kills an element on which all characters `η e` are `1`, then one such element is killed by all `ψ x`. -/ lemma exists_forall_eq_one_and_forall_eq_zero {Λ A B E I : Type} [CommRing Λ] [Ring A] [Ring B] [Algebra Λ A] [Algebra Λ B] [Fintype I] (η : E → A →ₐ[Λ] Λ) (ψ : I → A →ₐ[Λ] B) (h_each : ∀ x : I, ∃ k : A, (∀ e : E, η e k = 1) ∧ ψ x k = 0) : ∃ k : A, (∀ e : E, η e k = 1) ∧ ∀ x : I, ψ x k = 0 := by classical suffices ∃ k : A, (∀ e : E, η e k = 1) ∧ ∀ x ∈ univ, ψ x k = 0 by simpa -- Multiply the given elements. induction (univ : Finset I) using Finset.induction_on with | empty => exact ⟨1, by simp⟩ | insert x s _ ih => obtain ⟨k, hkη, hkψ⟩ : ∃ k : A, (∀ e : E, η e k = 1) ∧ ∀ x' ∈ s, ψ x' k = 0 := ih obtain ⟨k', hk'η, hk'ψ⟩ : ∃ k' : A, (∀ e : E, η e k' = 1) ∧ ψ x k' = 0 := h_each x exact ⟨k * k', by simp [hkη, hk'η], by simp +contextual [hkψ, hk'ψ]⟩ /-- Let `η k` be finitely many characters of `A` and `a : A`. If `c` is a multiple of the product of the differences `η e a - η k a` over `k ≠ e`, then some element of `A` is `c` on the character `η e` and `0` on the other characters. -/ lemma exists_apply_eq_ite_of_prod_dvd {Λ A E : Type} [CommRing Λ] [Ring A] [Algebra Λ A] [Fintype E] [DecidableEq E] (η : E → A →ₐ[Λ] Λ) (a : A) {e : E} {c : Λ} (hc : ∏ k ∈ ({e}ᶜ : Finset E), (η e a - η k a) ∣ c) : ∃ q : A, ∀ e' : E, η e' q = if e' = e then c else 0 := by obtain ⟨w, rfl⟩ : ∃ w : Λ, c = (∏ k ∈ {e}ᶜ, (η e a - η k a)) * w := hc let P : Λ[X] := ∏ k ∈ {e}ᶜ, (X - Polynomial.C (η k a)) refine ⟨w • aeval a P, fun e' ↦ ?_⟩ have h_value : η e' (w • aeval a P) = w * ∏ k ∈ {e}ᶜ, (η e' a - η k a) := by rw [map_smul, ← aeval_algHom_apply] simp [P] rw [h_value] split_ifs with he · rw [he, mul_comm] · rw [prod_eq_zero (i := e') (by simpa using he) (sub_self _), mul_zero] /-- An element of the Fitting ideal of the image `f N` is a linear combination of determinants of matrices `B i` whose rows are the images of elements `B' i j` of `N`. -/ lemma exists_sum_mul_det_of_mem_fittingIdeal_map {R ι M : Type} [CommRing R] [Fintype ι] [DecidableEq ι] [AddCommGroup M] [Module R M] {N : Submodule R M} {f : M →ₗ[R] ι → R} {d : R} (hd : d ∈ fittingIdeal (N.map f)) : ∃ (l : ℕ) (w : Fin l → R) (B : Fin l → Matrix ι ι R) (B' : Fin l → ι → M), (∀ (i : Fin l) (j : ι), B' i j ∈ N) ∧ (∀ (i : Fin l) (j : ι), f (B' i j) = B i j) ∧ ∑ i : Fin l, w i * (B i).det = d := by rw [fittingIdeal] at hd obtain ⟨l, w, D, hw⟩ : ∃ (l : ℕ) (w : Fin l → R) (D : Fin l → det '' {B : Matrix ι ι R | ∀ j : ι, B j ∈ N.map f}), ∑ i : Fin l, w i • (D i : R) = d := mem_span_set'.1 hd have h_det (i : Fin l) : ∃ B : Matrix ι ι R, (∀ j : ι, ∃ b ∈ N, f b = B j) ∧ B.det = D i := (D i).prop choose B hB hB_det using h_det choose B' hB' hB'_eq using hB exact ⟨l, w, B, B', hB', hB'_eq, by simp [hB_det, ← hw]⟩ /-- The ideal spanned by the monomials that do not divide `∏ X j`. -/ noncomputable abbrev nonDivisorIdeal (O J : Type) [CommRing O] [Fintype J] : Ideal (MvPolynomial J O) := restrictSupportIdeal O (Set.Iic (∑ j : J, Finsupp.single j 1))ᶜ (isLowerSet_Iic _).compl /-- A polynomial lies in `nonDivisorIdeal O J` if and only if none of its monomials divides `∏ X j`. -/ lemma mem_nonDivisorIdeal [Fintype J] {f : MvPolynomial J O} : f ∈ nonDivisorIdeal O J ↔ ∀ d ∈ f.support, ¬d ≤ ∑ j : J, Finsupp.single j 1 := Iff.rfl /-- Let `X j` (`j : J`) be finitely many variables over the commutative ring `O`, each with a type `ty j`. If `ty i < e`, the product of `X i` with `∏ j with ty j < e, X j` is divisible by `X i ^ 2`, so it lies in `nonDivisorIdeal O J`, the ideal spanned by the monomials that do not divide `∏ X j`. -/ lemma X_mem_colon_nonDivisorIdeal [Fintype J] {t : ℕ} {ty : J → Fin t} {i : J} {e : Fin t} (h_lt : ty i < e) : MvPolynomial.X i ∈ (nonDivisorIdeal O J).colon {∏ j : J with ty j < e, MvPolynomial.X j} := by classical let d : J →₀ ℕ := Finsupp.single i 1 + ∑ j : J with ty j < e, Finsupp.single j 1 have h_monomial : MvPolynomial.X i * ∏ j : J with ty j < e, MvPolynomial.X j = monomial d (1 : O) := by simp [d, MvPolynomial.X, ← monomial_sum_one] have h_not_le : ¬d ≤ ∑ j : J, Finsupp.single j 1 := fun h_le ↦ by simpa [d, h_lt, Finsupp.single_apply] using h_le i rw [mem_colon_singleton, smul_eq_mul, h_monomial, mem_nonDivisorIdeal] intro d' hd' rwa [mem_singleton.1 (support_monomial_subset hd')] /-- Let the variables `X j` of polynomials over the commutative ring `O` be indexed by a finite linear order `J`, and let `ty : J →o Fin t` be a monotone map that gives each variable a type. Suppose that `d e` is `Γ e * ∏ j with ty j = e, X j` up to an error `ζ e` that `∏ j with ty j < e, X j` multiplies into `nonDivisorIdeal O J`, the ideal spanned by the monomials that do not divide `∏ X j`. Then `F * ∏ d e` has no monomial properly dividing `∏ X j`, and the coefficient of `∏ X j` is the constant term of `F * ∏ Γ e`. -/ lemma coeff_mul_prod_of_mem_colon [Fintype J] [LinearOrder J] {t : ℕ} (ty : J →o Fin t) {d ζ Γ : Fin t → MvPolynomial J O} (hζ : ∀ e : Fin t, ζ e ∈ (nonDivisorIdeal O J).colon {∏ j : J with ty j < e, MvPolynomial.X j}) (hdζ : ∀ e : Fin t, d e + ζ e = Γ e * ∏ j : J with ty j = e, MvPolynomial.X j) (F : MvPolynomial J O) {i : J →₀ ℕ} (hi : i ≤ ∑ j : J, Finsupp.single j 1) : (F * ∏ e : Fin t, d e).coeff i = if ∑ j : J, Finsupp.single j 1 = i then constantCoeff (F * ∏ e : Fin t, Γ e) else 0 := by set 𝔫 : Ideal (MvPolynomial J O) := nonDivisorIdeal O J let error : MvPolynomial J O := ∑ e : Fin t, ζ e * (∏ k : Fin t with k < e, (d k + ζ k)) * ∏ k : Fin t with e < k, d k -- The factor `∏ k < e, (d k + ζ k)` is a multiple of `∏ j with ty j < e, X j`, which -- multiplies `ζ e` into `𝔫`. have h_dvd (e : Fin t) : ∏ j : J with ty j < e, MvPolynomial.X j ∣ ∏ k : Fin t with k < e, (d k + ζ k) := by simp [hdζ, prod_fiberwise_eq_prod_filter, prod_mul_distrib] have h_error : error ∈ 𝔫 := by refine sum_mem fun e _ ↦ 𝔫.mem_of_dvd ?_ (mem_colon_singleton.1 (hζ e)) exact (mul_dvd_mul_left (ζ e) (h_dvd e)).mul_right _ have h_prod : ∏ e : Fin t, d e = ∏ e : Fin t, (d e + ζ e) - error := eq_sub_of_add_eq (prod_add_ordered univ d ζ).symm have h_zero : (F * error).coeff i = 0 := notMem_support_iff.1 fun h ↦ mem_nonDivisorIdeal.1 (𝔫.mul_mem_left F h_error) i h hi have h_main : F * ∏ e : Fin t, (d e + ζ e) = (F * ∏ e : Fin t, Γ e) * monomial (∑ j : J, Finsupp.single j 1) 1 := by simp [hdζ, sum_fiberwise, MvPolynomial.X, ← mul_assoc, ← monomial_sum_one, prod_mul_distrib] rw [h_prod, mul_sub, MvPolynomial.coeff_sub, h_zero, sub_zero, h_main, coeff_mul_monomial'] simp +contextual [hi.ge_iff_eq', ← constantCoeff_eq] /-- Let `χ x` (`x : Y`) be representations of the group algebra `Λ[G]` by `σ × σ` matrices and `η₀` the augmentation, and let every `g - 1` be, up to elements that every `χ x` kills, in the left ideal spanned by the `y i`. Further let `S` be an algebra of families `Y → L[X j]`, where `L[X j]` is `MvPolynomial J L`, and `𝒥` an `S`-module of such families, and let `b` lie in the left ideal spanned by the `w` with `x ↦ tr (χ x (w g))` in `𝒥` for every `g`. If `η₀ m = 0`, then `b + m ρ₀ = b' + m' ρ₀` with `b'` in that left ideal and `m'` in the left ideal spanned by the `y i`. -/ lemma exists_mem_span_add_mul_eq_add_mul {S : Subalgebra O (Y → MvPolynomial J L)} (𝒥 : Submodule S (Y → MvPolynomial J L)) {Λ ι : Type} [CommRing Λ] [Algebra Λ (MvPolynomial J L)] (χ : Y → Λ[G] →ₐ[Λ] Matrix σ σ Λ) (η₀ : Λ[G] →ₐ[Λ] Λ) (hη₀ : ∀ g : G, η₀ (.single g 1) = 1) (y : ι → Λ[G]) (hy : ∀ g : G, ∃ m ∈ span Λ[G] (Set.range y), ∀ x : Y, χ x (.single g 1) = χ x m + 1) (ρ₀ : Λ[G]) {b m : Λ[G]} (hb : b ∈ span Λ[G] {w : Λ[G] | ∀ g : G, (fun x : Y ↦ algebraMap Λ (MvPolynomial J L) (χ x w * χ x (.single g 1)).trace) ∈ 𝒥}) (hm : η₀ m = 0) : ∃ b' ∈ span Λ[G] {w : Λ[G] | ∀ g : G, (fun x : Y ↦ algebraMap Λ (MvPolynomial J L) (χ x w * χ x (.single g 1)).trace) ∈ 𝒥}, ∃ m' ∈ span Λ[G] (Set.range y), b + m * ρ₀ = b' + m' * ρ₀ := by -- Under every `χ x`, an element `l` is some `l'` in the span plus the scalar `η₀ l`. have h_aug (l : Λ[G]) : ∃ l' ∈ span Λ[G] (Set.range y), ∀ x : Y, χ x l = χ x l' + algebraMap Λ (Matrix σ σ Λ) (η₀ l) := by induction l using MonoidAlgebra.induction_on with | of g => simpa [hη₀] using hy g | add l₁ l₂ ih₁ ih₂ => obtain ⟨l₁', hl₁', hl₁'_eq⟩ := ih₁ obtain ⟨l₂', hl₂', hl₂'_eq⟩ := ih₂ refine ⟨l₁' + l₂', add_mem hl₁' hl₂', fun x ↦ ?_⟩ simp only [map_add, hl₁'_eq, hl₂'_eq] abel | smul c l ih => obtain ⟨l', hl', hl'_eq⟩ := ih refine ⟨c • l', smul_of_tower_mem _ c hl', fun x ↦ ?_⟩ simp only [hl'_eq, map_mul, Algebra.smul_def, mul_add, AlgHom.commutes, Algebra.algebraMap_self_apply] -- As `η₀ m = 0`, the difference `(m - m') ρ₀` is killed by every `χ x`. obtain ⟨m', hm', hm'_eq⟩ : ∃ m' ∈ span Λ[G] (Set.range y), ∀ x : Y, χ x m = χ x m' := by simpa [hm] using h_aug m have h_kill : (m - m') * ρ₀ ∈ span Λ[G] {w : Λ[G] | ∀ g : G, (fun x : Y ↦ algebraMap Λ (MvPolynomial J L) (χ x w * χ x (.single g 1)).trace) ∈ 𝒥} := subset_span fun g ↦ by simp [hm'_eq, ← Pi.zero_def] refine ⟨b + (m - m') * ρ₀, add_mem hb h_kill, m', hm', ?_⟩ rw [sub_mul, add_assoc, sub_add_cancel] /-- Rows with a determinant of bounded valuation under a representation `ρ` whose matrices span. Let `O` be a discrete valuation ring and `u x` (`x : Y`) matrix representations of `G` over `O`. Let `ψ₀` be a representation of `A` by matrices over `O` that is `ρ` on the group elements `ofGroup g`, and let `v` send vectors over `O` to rows over `A`, with `ψ₀ (v m j) = m j • 1`. Let `N` be a module of rows that holds, for the vectors `z g`, the cocycle rule, the equations `z (gen i) = eᵢ`, the linear relations among the families `(u x g - 1)_x`, and, through `ψ₀`, the equations `z (τ k) = 0` and `z γ = 0`. If the cocycles of `ρ` with values in `DivisibleQuot O = Frac(O) / O` that obey those linear relations and vanish at the `τ k` and at `γ` have length at most `b₀`, then for some square matrix `B₀` with rows in `N` the determinant of the block matrix `ψ₀(B₀)` has valuation at most `b₀`. -/ lemma exists_block_rows (u : Y → G →* Matrix σ σ O) [DVR O] {r ι A K : Type} [Fintype r] [DecidableEq r] [Fintype ι] [DecidableEq ι] [Ring A] [Algebra O A] (ρ : G →* Matrix r r O) (hρ_span : span O (Set.range ρ) = ⊤) (ψ₀ : A →ₐ[O] Matrix r r O) (ofGroup : G →* A) (hψ₀ : ∀ g : G, ψ₀ (ofGroup g) = ρ g) (v : (ι → O) →ₗ[O] ι → A) (hψ₀v : ∀ (m : ι → O) (j : ι), ψ₀ (v m j) = m j • 1) (gen : ι → G) (z : G → ι → O) (N : Submodule A (ι → A)) (τ : K → G) (γ : G) {b₀ : ℕ} (hb₀ : length O (ribetCocyclesVanishingOn u ρ (DivisibleQuot O) (Set.range τ) γ) ≤ b₀) (h_cocycle : ∀ g h : G, v (z (g * h) - z g) - ofGroup g • v (z h) ∈ N) (h_gen : ∀ i : ι, v (z (gen i)) - Pi.single i 1 ∈ N) (h_rel : ∀ θ : G →₀ O, linearCombination O (fun (g : G) (x : Y) ↦ u x g - 1) θ = 0 → v (linearCombination O z θ) ∈ N) (h_τ : ∀ k : K, ∃ t ∈ N, ∀ j : ι, ψ₀ (t j) = ψ₀ (v (z (τ k)) j)) (h_γ : ∃ t ∈ N, ∀ j : ι, ψ₀ (t j) = ψ₀ (v (z γ) j)) : ∃ B₀ : Matrix ι ι A, (∀ i : ι, B₀ i ∈ N) ∧ addVal O (Matrix.comp ι ι r r O (B₀.map ψ₀)).det ≤ b₀ := by -- A vector `w` with entries in `Frac(O) / O` that `ψ₀ N` kills is `Ψ ∘ z` on the generators, for -- the form `Ψ` that `w` defines, and `Ψ ∘ z` is a cocycle in the module `V` of `hb₀`. let V : Submodule O (G → r → DivisibleQuot O) := ribetCocyclesVanishingOn u ρ (DivisibleQuot O) (Set.range τ) γ have h_span_le : span O (Set.range ρ) ≤ LinearMap.range ψ₀.toLinearMap := by simp [span_le, ← hψ₀, Set.subset_def] have h_surj : Function.Surjective ψ₀ := ψ₀.toLinearMap.range_eq_top.1 (eq_top_mono h_span_le hρ_span) have h_length : length O (V.map (LinearMap.funLeft O (r → DivisibleQuot O) gen)) ≤ b₀ := (length_le_of_le_map _ V le_rfl).trans hb₀ refine exists_rows_addVal_det_le_of_divisible ψ₀ h_surj N h_length fun w hw ↦ ?_ let Ψ : (ι → O) →ₗ[O] r → DivisibleQuot O := Fintype.linearCombination O w have hΨ (m : ι → O) : ∑ j : ι, ψ₀ (v m j) • w j = Ψ m := by simp [Ψ, hψ₀v, Fintype.linearCombination] -- A row in `N` with the image of `v m` under `ψ₀` gives `Ψ m = 0`. have h_zero (m : ι → O) (h_row : ∃ t ∈ N, ∀ j : ι, ψ₀ (t j) = ψ₀ (v m j)) : Ψ m = 0 := by obtain ⟨t, ht, ht_eq⟩ := h_row simpa [ht_eq, hΨ] using hw t ht have h_coc (g h : G) : Ψ (z (g * h)) = Ψ (z g) + ρ g • Ψ (z h) := by simpa [hΨ, hψ₀, mul_smul, ← smul_sum, sub_smul, sub_eq_iff_eq_add'] using hw _ (h_cocycle g h) have h_gen_eq (i : ι) : Ψ (z (gen i)) = w i := by simpa [hΨ, sub_smul, Pi.single_apply, sub_eq_iff_eq_add'] using hw _ (h_gen i) have h_rel_eq (θ : G →₀ O) (hθ : linearCombination O (fun (g : G) (x : Y) ↦ u x g - 1) θ = 0) : linearCombination O (Ψ ∘ z) θ = 0 := by rw [← Finsupp.apply_linearCombination, ← hΨ] exact hw _ (h_rel θ hθ) have h_obey : Ψ ∘ z ∈ ribetCocyclesIn u ρ (DivisibleQuot O) := ⟨mem_obeying_cocycleRelations.2 h_coc, h_rel_eq⟩ have h_mem : Ψ ∘ z ∈ V := (mem_ribetCocyclesVanishingOn u).2 ⟨h_obey, Set.forall_mem_range.2 fun k ↦ h_zero _ (h_τ k), h_zero _ h_γ⟩ exact mem_map.2 ⟨Ψ ∘ z, h_mem, funext h_gen_eq⟩ /-- The character step. Let `u x` (`x : Y`) be matrix representations of `G` over `O`. Let `Φ` send vectors over `O` to rows, and let `N` hold the images under `Φ` of the cocycle rule of the vectors `z g` for the character `ξ`, of the `z (δ w)`, of the linear relations among the families `(u x g - 1)_x`, and of the multiples `(ξ g - 1) (c₁ z γ + z a)`. Then every `c` in `formsMod Φ z N p`, that is, `c = Ψ ∘ z` for a linear form `Ψ` modulo `p` that vanishes on `Φ⁻¹ N`, is a cocycle for `ξ` that obeys the linear relations and vanishes at the `δ w`; and if `c γ = 0`, then every `ξ g - 1` kills `c a`. -/ lemma isCharacterCocycle_of_mem_formsMod [DVR O] {n ι R : Type} [CommRing R] [Algebra O R] (Φ : (n → O) →ₗ[O] ι → R) (z : G → n → O) (N : Submodule R (ι → R)) {p : O} (ξ : G →* O) (δ : W → G) (a γ : G) (c₁ : O) (h_cocycle : ∀ g h : G, Φ (z (g * h) - z g - ξ g • z h) ∈ N) (h_δ : ∀ w : W, Φ (z (δ w)) ∈ N) (h_rel : ∀ θ : G →₀ O, linearCombination O (fun (g : G) (x : Y) ↦ u x g - 1) θ = 0 → Φ (linearCombination O z θ) ∈ N) (h_fix : ∀ g : G, Φ ((ξ g - 1) • (c₁ • z γ + z a)) ∈ N) : ∀ c ∈ formsMod Φ z N p, IsCharacterCocycle u ξ δ γ a c := by intro c hc obtain ⟨Ψ, hΨ, rfl⟩ := mem_formsMod.1 hc have h_coc (g h : G) : Ψ (z (g * h)) = Ψ (z g) + rankOneRep ξ g • Ψ (z h) := by have h_smul : rankOneRep ξ g • Ψ (z h) = ξ g • Ψ (z h) := by simp rw [h_smul, ← sub_eq_iff_eq_add', ← sub_eq_zero, ← map_sub, ← map_smul, ← map_sub] exact hΨ (h_cocycle g h) have h_rel_eq (θ : G →₀ O) (hθ : linearCombination O (fun (g : G) (x : Y) ↦ u x g - 1) θ = 0) : linearCombination O (Ψ ∘ z) θ = 0 := by rw [← Finsupp.apply_linearCombination] exact hΨ (h_rel θ hθ) have h_obey : Ψ ∘ z ∈ ribetCocycles u (rankOneRep ξ) p := mem_ribetCocycles.2 ⟨h_coc, h_rel_eq⟩ have h_kill (hγ : Ψ (z γ) = 0) (g : G) : (ξ g - 1) • Ψ (z a) = 0 := by have h_fix_eq : Ψ ((ξ g - 1) • (c₁ • z γ + z a)) = 0 := hΨ (h_fix g) rwa [map_smul, map_add, map_smul, hγ, smul_zero, zero_add] at h_fix_eq exact ⟨h_obey, fun w ↦ hΨ (h_δ w), h_kill⟩ /-- Let `η` be a character of `A` and `p ≠ 0`. Let `N` hold `p` times every row and, for each generator `gen i`, the row `v (z (gen i)) - eᵢ`, where `gen` is the identity on `s`. Let `E` read rows under `η` on the `S₀`-coordinates only, and take the linear forms `Ψ` modulo `p` that kill every `m` with `E (v m)` in the image of `N` under `E`. Suppose that every function `Ψ ∘ z` that vanishes on `s` is zero. Then for each `i : S₀` some row in `N` is, under `η`, the unit vector `i` on the `S₀`-coordinates. -/ lemma exists_unit_row {O G : Type} [CommRing O] [DVR O] {Λ A W S₀ : Type} [CommRing Λ] [Algebra O Λ] [Ring A] [Algebra Λ A] [Algebra O A] [IsScalarTower O Λ A] [Fintype W] [DecidableEq W] [Fintype S₀] [DecidableEq S₀] [DecidableEq G] {s : Finset G} (η : A →ₐ[Λ] Λ) (N : Submodule A (W ⊕ S₀ ⊕ s → A)) (v : (W ⊕ S₀ ⊕ s → O) →ₗ[O] W ⊕ S₀ ⊕ s → A) (gen : W ⊕ S₀ ⊕ s → G) (z : G → W ⊕ S₀ ⊕ s → O) {p : O} (hp : p ≠ 0) (h_p : ∀ w : W ⊕ S₀ ⊕ s → A, p • w ∈ N) (h_gen : ∀ i : W ⊕ S₀ ⊕ s, v (z (gen i)) - Pi.single i 1 ∈ N) (h_gen_s : ∀ j : s, gen (inr (inr j)) = j) (E : (W ⊕ S₀ ⊕ s → A) →ₗ[Λ] S₀ → Λ) (hE : ∀ (w : W ⊕ S₀ ⊕ s → A) (j : S₀), E w j = η (w (inr (inl j)))) (h_detect : IsDetectedBy (formsMod (E.restrictScalars O ∘ₗ v) z ((N.restrictScalars Λ).map E) p) s) (i : S₀) : ∃ w ∈ N, ∀ j : S₀, η (w (inr (inl j))) = if j = i then 1 else 0 := by -- By duality (`mem_of_forall_form_eq_zero`), the image of `v (z (gen i))` lies in that of `N`; -- modulo `N` this row is the unit row `eᵢ`. let K : Submodule Λ (S₀ → Λ) := (N.restrictScalars Λ).map E have hK {w : W ⊕ S₀ ⊕ s → A} (hw : w ∈ N) : E w ∈ K := mem_map_of_mem hw have hK_p (m : W ⊕ S₀ ⊕ s → O) : E (v (p • m)) ∈ K := hK (by simpa using h_p (v m)) -- The unit row at `g ∈ s` has no `S₀`-coordinates. have hK_s (g : s) : E (v (z g)) ∈ K := by have h_unit : E (Pi.single (inr (inr g)) 1) = 0 := funext fun j ↦ by simp [hE] simpa [h_gen_s, h_unit] using hK (h_gen (inr (inr g))) have hK_i : E (v (z (gen (inr (inl i))))) ∈ K := by refine mem_of_forall_form_eq_zero (Φ := E.restrictScalars O ∘ₗ v) hp hK_p fun Ψ hΨ ↦ ?_ have h_zero : Ψ ∘ z = 0 := h_detect _ (mem_formsMod.2 ⟨Ψ, hΨ, rfl⟩) fun g hg ↦ hΨ (hK_s ⟨g, hg⟩) exact congrFun h_zero (gen (inr (inl i))) have hK_unit : E (Pi.single (inr (inl i)) 1) ∈ K := by simpa using K.sub_mem hK_i (hK (h_gen (inr (inl i)))) obtain ⟨w, hw, hw_eq⟩ : ∃ w ∈ N, E w = E (Pi.single (inr (inl i)) 1) := mem_map.1 hK_unit exact ⟨w, hw, fun j ↦ by simpa [hE, Pi.single_apply] using congrFun hw_eq j⟩ /-- Clearing the `S₀`-coordinates. Let the rows `ν i ∈ N` be, under the character `η`, the unit vectors on the `S₀`-coordinates. Subtracting multiples of them turns a row `w ∈ N` into a row of `N` that is zero under `η` on the `S₀`-coordinates; on the `S`-coordinates it is the result of eliminating the `S₀`-coordinates of `w` by the `ν i`. -/ lemma exists_row_apply_eq_zero {Λ A W S₀ S : Type} [CommRing Λ] [Ring A] [Algebra Λ A] [Fintype S₀] [DecidableEq S₀] [Fintype S] [DecidableEq S] (η : A →ₐ[Λ] Λ) {N : Submodule A (W ⊕ S₀ ⊕ S → A)} {ν : S₀ → W ⊕ S₀ ⊕ S → A} (hν : ∀ i : S₀, ν i ∈ N) (hν_eq : ∀ i j : S₀, η (ν i (inr (inl j))) = if j = i then 1 else 0) {w : W ⊕ S₀ ⊕ S → A} (hw : w ∈ N) : ∃ w' ∈ N, (∀ i : S₀, η (w' (inr (inl i))) = 0) ∧ (fun j : S ↦ η (w' (inr (inr j)))) = vecMulLinear (fromRows (-of fun (i : S₀) (j : S) ↦ η (ν i (inr (inr j)))) (1 : Matrix S S Λ)) fun l : S₀ ⊕ S ↦ η (w (inr l)) := by refine ⟨w - ∑ i : S₀, w (inr (inl i)) • ν i, sub_mem hw (sum_mem fun i _ ↦ N.smul_mem _ (hν i)), fun i ↦ ?_, funext fun j ↦ ?_⟩ · simp [hν_eq] · simp [vecMul_eq_sum, one_apply, sub_eq_neg_add] end SmallLemmas end New.Selmer end RibetFirstOrder