AlgebraicAnalysis/Module/PrincipalKoszulPositivity.lean

AlgebraicAnalysis library · bbbbf3fc358ca8100b158cec4cf47f336ab70163

1 module
2 public import AlgebraicAnalysis.Module.MinimalPrimeFiniteLengthLocalization
3 public import Mathlib.RingTheory.Length
4 public import Mathlib.RingTheory.Noetherian.Defs
5 
6 @[expose] public section
7 
8 /-!
9 # Positivity for a principal Koszul quotient
10 
11 Stable power torsion contributes equally to kernel and cokernel length.
12 After removing it, local Nakayama gives a positive residual cokernel when
13 a support prime avoids the scalar. The proof retains embedded torsion;
14 it does not infer injectivity from minimal-prime avoidance.
15 -/
16 
17 namespace AlgebraicAnalysis.PrincipalKoszulPositivity
18 
19 open scoped Pointwise
20 
21 noncomputable section
22 
23 universe u v
24 
25 variable {R : Type u} {E : Type v}
26 variable [CommRing R]
27 variable [AddCommGroup E] [Module R E]
28 
29 abbrev scalarEnd (x : R) : E →ₗ[R] E := LinearMap.lsmul R E x
30 
31 /--
32 The `x`-power torsion in a Noetherian module is already the kernel of one
33 finite power of `x`.  This is the stabilization step needed before passing to
34 the quotient on which `x` acts injectively; it does not discard embedded
35 torsion.
36 -/
37 theorem exists_stable_kernel_power [IsNoetherian R E] (f : Module.End R E) :
38     ∃ n : ℕ, LinearMap.ker (f ^ n) = LinearMap.ker (f ^ (n + 1)) := by
39   obtain ⟨n, hn⟩ :=
40     (monotone_stabilizes_iff_noetherian.mpr (inferInstance : IsNoetherian R E))
41       f.iterateKer
42   exact ⟨n, hn (n + 1) (Nat.le_add_right n 1)⟩
43 
44 /-- Specialization of kernel stabilization to multiplication by a scalar. -/
45 theorem exists_stable_kernel_power_smul [IsNoetherian R E] (x : R) :
46     ∃ n : ℕ,
47       LinearMap.ker ((scalarEnd (E := E) x) ^ n) =
48         LinearMap.ker ((scalarEnd (E := E) x) ^ (n + 1)) :=
49   exists_stable_kernel_power (scalarEnd (E := E) x)
50 
51 /-- Finite-length coordinate kernel controls all finite power-torsion layers.
52 The Artinian assertion is the nontrivial half; Noetherianity is inherited
53 from the ambient finite module in the applications. -/
54 theorem isArtinian_kernel_power (f : Module.End R E)
55     [IsArtinian R f.ker] (n : ℕ) : IsArtinian R (f ^ n).ker := by
56   induction n with
57   | zero =>
58     rw [pow_zero, Module.End.one_eq_id, LinearMap.ker_id]
59     infer_instance
60   | succ n ih =>
61     let := ih
62     have hle : f.ker ≤ (f ^ (n + 1)).ker := by
63       intro z hz
64       rw [LinearMap.mem_ker, pow_succ, Module.End.mul_apply,
65         LinearMap.mem_ker.mp hz, map_zero]
66     let i : f.ker →ₗ[R] (f ^ (n + 1)).ker := Submodule.inclusion hle
67     let g : (f ^ (n + 1)).ker →ₗ[R] (f ^ n).ker := f.restrict (by
68       intro z hz
69       rw [LinearMap.mem_ker] at hz ⊢
70       simpa [pow_succ, Module.End.mul_apply] using hz)
71     have hexact : i.range = g.ker := by
72       ext z
73       constructor
74       · rintro ⟨w, rfl⟩
75         apply Subtype.ext
76         exact LinearMap.mem_ker.mp w.property
77       · intro hz
78         have hz0 : f z.val = 0 := congrArg Subtype.val (LinearMap.mem_ker.mp hz)
79         exact ⟨⟨z.val, hz0⟩, rfl⟩
80     exact isArtinian_of_range_eq_ker i g hexact
81 
82 /-- Once two consecutive power kernels agree, the induced endomorphism on
83 the quotient by the stabilized kernel is injective. -/
84 theorem quotient_by_stable_kernel_power_injective (f : Module.End R E) (n : ℕ)
85     (hstable : LinearMap.ker (f ^ n) = LinearMap.ker (f ^ (n + 1))) :
86     Function.Injective
87       ((LinearMap.ker (f ^ n)).mapQ (LinearMap.ker (f ^ n)) f (by
88         intro z hz
89         change f z ∈ LinearMap.ker (f ^ n)
90         rw [LinearMap.mem_ker] at hz ⊢
91         rw [← Module.End.mul_apply, (Commute.self_pow f n).eq.symm,
92           Module.End.mul_apply, hz, f.map_zero])) := by
93   rw [← LinearMap.ker_eq_bot, Submodule.ker_mapQ]
94   have hcomap :
95       (LinearMap.ker (f ^ n)).comap f = LinearMap.ker (f ^ n) := by
96     ext z
97     rw [Submodule.mem_comap]
98     change (f ^ n) (f z) = 0 ↔ (f ^ n) z = 0
99     rw [← Module.End.mul_apply, (Commute.self_pow f n).eq.symm,
100       Module.End.mul_apply]
101     simpa [Module.End.pow_apply, Function.iterate_succ_apply'] using
102       congrArg (fun K : Submodule R E ↦ z ∈ K) hstable.symm
103   rw [hcomap]
104   simp
105 
106 /-- Removing a finite-length invariant submodule on which all failure of
107 injectivity is concentrated preserves the principal Koszul Euler length.
108 The hypothesis `T.comap f = T` says precisely that the quotient action is
109 injective; it does not assert injectivity on the original module. -/
110 theorem length_cokernel_eq_kernel_add_regular_quotient
111     (f : Module.End R E) (T : Submodule R E)
112     [IsNoetherian R T] [IsArtinian R T] (hT : T.comap f = T) :
113     Module.length R (E ⧸ f.range) =
114       Module.length R f.ker + Module.length R (E ⧸ (T ⊔ f.range)) := by
115   have hstable : ∀ z ∈ T, f z ∈ T := by
116     intro z hz
117     exact show z ∈ T.comap f from hT.symm ▸ hz
118   let fT : Module.End R T := f.restrict hstable
119   have hpre : f.range.comap T.subtype = fT.range := by
120     ext z
121     constructor
122     · rintro ⟨w, hw⟩
123       have hwT : w ∈ T := by
124         rw [← hT]
125         exact show f w ∈ T from hw ▸ z.property
126       exact ⟨⟨w, hwT⟩, Subtype.ext hw⟩
127     · rintro ⟨w, rfl⟩
128       exact ⟨w.val, rfl⟩
129   let i : (T ⧸ fT.range) →ₗ[R] (E ⧸ f.range) :=
130     fT.range.mapQ f.range T.subtype hpre.ge
131   let j : (E ⧸ f.range) →ₗ[R] (E ⧸ (T ⊔ f.range)) :=
132     f.range.mapQ (T ⊔ f.range) LinearMap.id le_sup_right
133   have hi : Function.Injective i := by
134     rw [← LinearMap.ker_eq_bot]
135     dsimp [i]
136     rw [Submodule.ker_mapQ, hpre, Submodule.mkQ_map_self]
137   have hj : Function.Surjective j := by
138     rw [← LinearMap.range_eq_top]
139     simp [j, Submodule.range_mapQ]
140   have hexact : Function.Exact i j := by
141     rw [LinearMap.exact_iff]
142     simp [i, j, Submodule.range_mapQ, Submodule.ker_mapQ,
143       Submodule.map_sup, Submodule.mkQ_map_self]
144   have hsum := Module.length_eq_add_of_exact i j hi hj hexact
145   have hkerle : f.ker ≤ T := by
146     intro z hz
147     rw [← hT]
148     change f z ∈ T
149     rw [LinearMap.mem_ker.mp hz]
150     exact T.zero_mem
151   have hker : Module.length R fT.ker = Module.length R f.ker := by
152     have hk : fT.ker = f.ker.comap T.subtype := by
153       simp [fT, LinearMap.ker_restrict]
154     rw [hk]
155     exact (Submodule.comapSubtypeEquivOfLe hkerle).length_eq
156   have hsource := Module.length_eq_add_of_exact fT.ker.subtype fT.rangeRestrict
157     (Submodule.subtype_injective _)
158     (LinearMap.range_eq_top.mp (LinearMap.range_rangeRestrict fT))
159     (by rw [LinearMap.exact_iff, Submodule.range_subtype, LinearMap.ker_rangeRestrict])
160   have htarget := Module.length_eq_add_of_exact fT.range.subtype fT.range.mkQ
161     (Submodule.subtype_injective _) (Submodule.mkQ_surjective _)
162     (LinearMap.exact_subtype_mkQ _)
163   have hcancel : Module.length R (T ⧸ fT.range) = Module.length R fT.ker := by
164     have hfinite : Module.length R fT.range ≠ ⊤ := Module.length_ne_top
165     apply ENat.add_left_injective_of_ne_top hfinite
166     change Module.length R (T ⧸ fT.range) + Module.length R fT.range =
167       Module.length R fT.ker + Module.length R fT.range
168     rw [add_comm (Module.length R (T ⧸ fT.range)), ← htarget]
169     exact hsource
170   rw [hcancel, hker] at hsum
171   exact hsum
172 
173 /-- A maximal-ideal scalar has a proper image on a nonzero finite module. -/
174 theorem scalar_range_ne_top_of_mem_maximalIdeal
175     [IsLocalRing R] [Module.Finite R E] [Nontrivial E]
176     {x : R} (hx : x ∈ IsLocalRing.maximalIdeal R) :
177     (scalarEnd (E := E) x).range ≠ (⊤ : Submodule R E) := by
178   have hann : Module.annihilator R E ≠ ⊤ := by
179     intro h
180     exact not_subsingleton_iff_nontrivial.mpr inferInstance
181       (Module.annihilator_eq_top_iff.mp h)
182   have hspan : Ideal.span ({x} : Set R) ≤
183       (Module.annihilator R E).jacobson := by
184     rw [Ideal.span_singleton_le_iff_mem]
185     rw [IsLocalRing.jacobson_eq_maximalIdeal _ hann]
186     exact hx
187   have hsmul : (⊤ : Submodule R E) ≠ Ideal.span ({x} : Set R) • (⊤ : Submodule R E) :=
188     Submodule.top_ne_ideal_smul_of_le_jacobson_annihilator hspan
189   intro hrange
190   apply hsmul
191   have hEq : (scalarEnd (E := E) x).range =
192       Ideal.span ({x} : Set R) • (⊤ : Submodule R E) := by
193     ext y
194     constructor
195     · rintro ⟨z, rfl⟩
196       exact Submodule.smul_mem_smul (Submodule.subset_span (Set.mem_singleton x))
197         (Submodule.mem_top)
198     · intro hy
199       refine Submodule.smul_induction_on hy ?_ (fun a b ha hb => ?_)
200       · intro r hr z hz
201         rcases (Ideal.mem_span_singleton.mp hr) with ⟨c, rfl⟩
202         refine ⟨c • z, ?_⟩
203         simp [scalarEnd, smul_smul, mul_comm]
204       · exact add_mem (by assumption) (by assumption)
205   exact hrange.symm.trans hEq
206 
207 /--
208 If multiplication by `x` is injective on a nonzero finite local module and
209 its cokernel has finite length, then the cokernel has strictly larger length
210 than the kernel.  The quotient is nonzero by Nakayama, so the conclusion is
211 genuine positivity rather than an axiom-shaped length assumption.
212 
213 This is only the regular (torsion-free) specialization of the stabilized
214 `x`-power-torsion cancellation argument.  Minimal-support avoidance alone
215 does not imply its injectivity hypothesis when embedded torsion is present.
216 -/
217 theorem length_cokernel_smul_gt_length_kernel_smul
218     [IsLocalRing R] [Module.Finite R E] [Nontrivial E] {x : R}
219     (hx : x ∈ IsLocalRing.maximalIdeal R)
220     (hinj : Function.Injective (scalarEnd (E := E) x))
221     (_hfinite : IsFiniteLength R (E ⧸ (scalarEnd (E := E) x).range)) :
222     Module.length R (E ⧸ (scalarEnd (E := E) x).range) >
223       Module.length R (scalarEnd (E := E) x).ker := by
224   have hker : (scalarEnd (E := E) x).ker = ⊥ := by
225     apply le_antisymm
226     · intro y hy
227       apply hinj
228       simpa using (LinearMap.mem_ker.mp hy)
229     · exact bot_le
230   have hq : Nontrivial (E ⧸ (scalarEnd (E := E) x).range) :=
231     Submodule.Quotient.nontrivial_iff.mpr
232       (scalar_range_ne_top_of_mem_maximalIdeal hx)
233   rw [hker, Module.length_bot]
234   exact Module.length_pos
235 
236 /-- Embedded scalar-power torsion may be retained: after its finite-length
237 Euler contribution is cancelled, any nonzero regular quotient contributes
238 strictly positively by Nakayama. -/
239 theorem length_cokernel_smul_gt_kernel_of_finite_torsion
240     [IsLocalRing R] [Module.Finite R E]
241     {x : R} (hx : x ∈ IsLocalRing.maximalIdeal R)
242     (T : Submodule R E) [IsNoetherian R T] [IsArtinian R T]
243     (hT : T.comap (scalarEnd (E := E) x) = T) (hproper : T ≠ ⊤) :
244     Module.length R (E ⧸ (scalarEnd (E := E) x).range) >
245       Module.length R (scalarEnd (E := E) x).ker := by
246   let f := scalarEnd (E := E) x
247   have hstable : T ≤ T.comap f := hT.ge
248   let g : Module.End R (E ⧸ T) := T.mapQ T f hstable
249   have hg : g = scalarEnd (E := E ⧸ T) x := by
250     ext z
251     rfl
252   have hrange : g.range = f.range.map T.mkQ := Submodule.range_mapQ _ _ _ _
253   let : Nontrivial (E ⧸ T) := Submodule.Quotient.nontrivial_iff.mpr hproper
254   have hnontop : f.range.map T.mkQ ≠ ⊤ := by
255     rw [← hrange, hg]
256     exact scalar_range_ne_top_of_mem_maximalIdeal hx
257   let : Nontrivial ((E ⧸ T) ⧸ f.range.map T.mkQ) :=
258     Submodule.Quotient.nontrivial_iff.mpr hnontop
259   have hpositive : 0 < Module.length R (E ⧸ (T ⊔ f.range)) := by
260     rw [← (Submodule.quotientQuotientEquivQuotientSup T f.range).length_eq]
261     exact Module.length_pos
262   have hkerle : f.ker ≤ T := by
263     intro z hz
264     rw [← hT]
265     change f z ∈ T
266     rw [LinearMap.mem_ker.mp hz]
267     exact T.zero_mem
268   let : IsNoetherian R f.ker :=
269     isNoetherian_of_injective (Submodule.inclusion hkerle)
270       (Submodule.inclusion_injective hkerle)
271   let : IsArtinian R f.ker :=
272     isArtinian_of_injective (Submodule.inclusion hkerle)
273       (Submodule.inclusion_injective hkerle)
274   rw [length_cokernel_eq_kernel_add_regular_quotient f T hT]
275   simpa [add_comm] using ENat.lt_add_left (Module.length_ne_top (R := R) (M := f.ker)) hpositive
276 
277 /-- Principal Koszul positivity, including embedded torsion. A support prime
278 not containing `x` guarantees a nonzero regular quotient; finite length of
279 the coordinate kernel makes the discarded power torsion finite length. -/
280 theorem length_cokernel_smul_gt_kernel_of_support_prime
281     [IsLocalRing R] [Module.Finite R E] [IsNoetherian R E]
282     {x : R} (hx : x ∈ IsLocalRing.maximalIdeal R)
283     [IsArtinian R (scalarEnd (E := E) x).ker]
284     (P : Ideal R) (hP : P.IsPrime)
285     (hann : Module.annihilator R E ≤ P) (hxP : x ∉ P) :
286     Module.length R (E ⧸ (scalarEnd (E := E) x).range) >
287       Module.length R (scalarEnd (E := E) x).ker := by
288   let f := scalarEnd (E := E) x
289   obtain ⟨n, hn⟩ := exists_stable_kernel_power f
290   let T := (f ^ n).ker
291   let : IsArtinian R T := isArtinian_kernel_power f n
292   have hcomap : T.comap f = T := by
293     ext z
294     rw [Submodule.mem_comap]
295     change (f ^ n) (f z) = 0 ↔ (f ^ n) z = 0
296     rw [← Module.End.mul_apply, (Commute.self_pow f n).eq.symm,
297       Module.End.mul_apply]
298     simpa [Module.End.pow_apply, Function.iterate_succ_apply'] using
299       congrArg (fun K : Submodule R E ↦ z ∈ K) hn.symm
300   have hpower : ∀ m (z : E), (f ^ m) z = x ^ m • z := by
301     intro m
302     induction m with
303     | zero => intro z; simp
304     | succ m ih =>
305       intro z
306       simp [pow_succ, Module.End.mul_apply, ih, f, scalarEnd, smul_smul]
307   have hproper : T ≠ ⊤ := by
308     intro htop
309     apply hxP
310     apply hP.mem_of_pow_mem n
311     apply hann
312     rw [Module.mem_annihilator]
313     intro z
314     rw [← hpower n z]
315     exact LinearMap.mem_ker.mp (show z ∈ T by rw [htop]; trivial)
316   exact length_cokernel_smul_gt_kernel_of_finite_torsion hx T hcomap hproper
317 
318 #print axioms length_cokernel_smul_gt_kernel_of_support_prime
319 
320 end
321 end AlgebraicAnalysis.PrincipalKoszulPositivity
322