@@ -48,6 +48,8 @@ For finitely presented algebras, see `Algebra.FinitePresentation`
48
48
in file `Mathlib.RingTheory.FinitePresentation`.
49
49
-/
50
50
51
+ open Finsupp
52
+
51
53
section Semiring
52
54
variable (R M) [Semiring R] [AddCommMonoid M] [Module R M]
53
55
@@ -57,7 +59,7 @@ and the kernel of the presentation `Rˢ → M` is also finitely generated.
57
59
-/
58
60
class Module.FinitePresentation : Prop where
59
61
out : ∃ (s : Finset M), Submodule.span R (s : Set M) = ⊤ ∧
60
- (LinearMap.ker (Finsupp.total R ((↑) : s → M))).FG
62
+ (LinearMap.ker (Finsupp.linearCombination R ((↑) : s → M))).FG
61
63
62
64
instance (priority := 100 ) [h : Module.FinitePresentation R M] : Module.Finite R M := by
63
65
obtain ⟨s, hs₁, _⟩ := h
@@ -78,10 +80,10 @@ theorem Module.FinitePresentation.equiv_quotient [fp : Module.FinitePresentation
78
80
Module.Free R L ∧ Module.Finite R L ∧ K.FG := by
79
81
obtain ⟨ι, ⟨hι₁, hι₂⟩⟩ := fp
80
82
use ι →₀ R, inferInstance, inferInstance
81
- use LinearMap.ker (Finsupp.total R Subtype.val)
83
+ use LinearMap.ker (Finsupp.linearCombination R Subtype.val)
82
84
refine ⟨(LinearMap.quotKerEquivOfSurjective _ ?_).symm, inferInstance, inferInstance, hι₂⟩
83
85
apply LinearMap.range_eq_top.mp
84
- simpa only [Finsupp.range_total , Subtype.range_coe_subtype, Finset.setOf_mem]
86
+ simpa only [Finsupp.range_linearCombination , Subtype.range_coe_subtype, Finset.setOf_mem]
85
87
86
88
-- Ideally this should be an instance but it makes mathlib much slower.
87
89
lemma Module.finitePresentation_of_finite [IsNoetherianRing R] [h : Module.Finite R M] :
@@ -119,12 +121,12 @@ lemma Module.finitePresentation_of_free_of_surjective [Module.Free R M] [Module.
119
121
constructor
120
122
· intro hx
121
123
refine ⟨b.repr.symm (x.mapDomain σ), ?_, ?_⟩
122
- · simp [Finsupp.apply_total , hσ₂, hx]
124
+ · simp [Finsupp.apply_linearCombination , hσ₂, hx]
123
125
· simp only [f, LinearMap.comp_apply, b.repr.apply_symm_apply,
124
126
LinearEquiv.coe_toLinearMap, Finsupp.lmapDomain_apply]
125
127
rw [← Finsupp.mapDomain_comp, hσ₁, Finsupp.mapDomain_id]
126
128
· rintro ⟨y, hy, rfl⟩
127
- simp [f, hπ, ← Finsupp.apply_total , hy]
129
+ simp [f, hπ, ← Finsupp.apply_linearCombination , hy]
128
130
129
131
-- Ideally this should be an instance but it makes mathlib much slower.
130
132
variable (R M) in
@@ -145,12 +147,12 @@ lemma Module.finitePresentation_of_surjective [h : Module.FinitePresentation R M
145
147
classical
146
148
obtain ⟨s, hs, hs'⟩ := h
147
149
obtain ⟨t, ht⟩ := hl'
148
- have H : Function.Surjective (Finsupp.total R ((↑) : s → M)) :=
149
- LinearMap.range_eq_top.mp (by rw [Finsupp.range_total , Subtype.range_val, ← hs]; rfl)
150
- apply Module.finitePresentation_of_free_of_surjective (l ∘ₗ Finsupp.total R Subtype.val)
150
+ have H : Function.Surjective (Finsupp.linearCombination R ((↑) : s → M)) :=
151
+ LinearMap.range_eq_top.mp (by rw [range_linearCombination , Subtype.range_val, ← hs]; rfl)
152
+ apply Module.finitePresentation_of_free_of_surjective (l ∘ₗ linearCombination R Subtype.val)
151
153
(hl.comp H)
152
154
choose σ hσ using (show _ from H)
153
- have : Finsupp.total R Subtype.val '' (σ '' t) = t := by
155
+ have : Finsupp.linearCombination R Subtype.val '' (σ '' t) = t := by
154
156
simp only [Set.image_image, hσ, Set.image_id']
155
157
rw [LinearMap.ker_comp, ← ht, ← this, ← Submodule.map_span, Submodule.comap_map_eq,
156
158
← Finset.coe_image]
@@ -161,11 +163,11 @@ lemma Module.FinitePresentation.fg_ker [Module.Finite R M]
161
163
(LinearMap.ker l).FG := by
162
164
classical
163
165
obtain ⟨s, hs, hs'⟩ := h
164
- have H : Function.Surjective (Finsupp.total R ((↑) : s → N)) :=
165
- LinearMap.range_eq_top.mp (by rw [Finsupp.range_total , Subtype.range_val, ← hs]; rfl)
166
- obtain ⟨f, hf⟩ : ∃ f : (s →₀ R) →ₗ[R] M, l ∘ₗ f = (Finsupp.total R Subtype.val) := by
166
+ have H : Function.Surjective (Finsupp.linearCombination R ((↑) : s → N)) :=
167
+ LinearMap.range_eq_top.mp (by rw [range_linearCombination , Subtype.range_val, ← hs]; rfl)
168
+ obtain ⟨f, hf⟩ : ∃ f : (s →₀ R) →ₗ[R] M, l ∘ₗ f = (Finsupp.linearCombination R Subtype.val) := by
167
169
choose f hf using show _ from hl
168
- exact ⟨Finsupp.total R (fun i ↦ f i), by ext; simp [hf]⟩
170
+ exact ⟨Finsupp.linearCombination R (fun i ↦ f i), by ext; simp [hf]⟩
169
171
have : (LinearMap.ker l).map (LinearMap.range f).mkQ = ⊤ := by
170
172
rw [← top_le_iff]
171
173
rintro x -
@@ -192,9 +194,9 @@ lemma Module.finitePresentation_of_ker [Module.FinitePresentation R N]
192
194
· rw [Submodule.map_top, LinearMap.range_eq_top.mpr hl]; exact Module.Finite.out
193
195
· rw [top_inf_eq, ← Submodule.fg_top]; exact Module.Finite.out
194
196
refine ⟨s, hs, ?_⟩
195
- let π := Finsupp.total R ((↑) : s → M)
197
+ let π := Finsupp.linearCombination R ((↑) : s → M)
196
198
have H : Function.Surjective π :=
197
- LinearMap.range_eq_top.mp (by rw [Finsupp.range_total , Subtype.range_val, ← hs]; rfl)
199
+ LinearMap.range_eq_top.mp (by rw [range_linearCombination , Subtype.range_val, ← hs]; rfl)
198
200
have inst : Module.Finite R (LinearMap.ker (l ∘ₗ π)) := by
199
201
constructor
200
202
rw [Submodule.fg_top]; exact Module.FinitePresentation.fg_ker _ (hl.comp H)
@@ -227,23 +229,24 @@ lemma Module.FinitePresentation.exists_lift_of_isLocalizedModule
227
229
[h : Module.FinitePresentation R M] (g : M →ₗ[R] N') :
228
230
∃ (h : M →ₗ[R] N) (s : S), f ∘ₗ h = s • g := by
229
231
obtain ⟨σ, hσ, τ, hτ⟩ := h
230
- let π := Finsupp.total R ((↑) : σ → M)
232
+ let π := Finsupp.linearCombination R ((↑) : σ → M)
231
233
have hπ : Function.Surjective π :=
232
- LinearMap.range_eq_top.mp (by rw [Finsupp.range_total , Subtype.range_val, ← hσ]; rfl)
234
+ LinearMap.range_eq_top.mp (by rw [range_linearCombination , Subtype.range_val, ← hσ]; rfl)
233
235
classical
234
236
choose s hs using IsLocalizedModule.surj S f
235
237
let i : σ → N :=
236
238
fun x ↦ (∏ j ∈ σ.erase x.1 , (s (g j)).2 ) • (s (g x)).1
237
239
let s₀ := ∏ j ∈ σ, (s (g j)).2
238
- have hi : f ∘ₗ Finsupp.total R i = (s₀ • g) ∘ₗ π := by
240
+ have hi : f ∘ₗ Finsupp.linearCombination R i = (s₀ • g) ∘ₗ π := by
239
241
ext j
240
- simp only [LinearMap.coe_comp, Function.comp_apply, Finsupp.lsingle_apply, Finsupp.total_single,
241
- one_smul, LinearMap.map_smul_of_tower, ← hs, LinearMap.smul_apply, i, s₀, π]
242
+ simp only [LinearMap.coe_comp, Function.comp_apply, Finsupp.lsingle_apply,
243
+ linearCombination_single, one_smul, LinearMap.map_smul_of_tower, ← hs, LinearMap.smul_apply,
244
+ i, s₀, π]
242
245
rw [← mul_smul, Finset.prod_erase_mul]
243
246
exact j.prop
244
- have : ∀ x : τ, ∃ s : S, s • (Finsupp.total R i x) = 0 := by
247
+ have : ∀ x : τ, ∃ s : S, s • (Finsupp.linearCombination R i x) = 0 := by
245
248
intros x
246
- convert_to ∃ s : S, s • (Finsupp.total R i x) = s • 0
249
+ convert_to ∃ s : S, s • (Finsupp.linearCombination R i x) = s • 0
247
250
· simp only [smul_zero]
248
251
apply IsLocalizedModule.exists_of_eq (S := S) (f := f)
249
252
rw [← LinearMap.comp_apply, map_zero, hi, LinearMap.comp_apply]
@@ -252,7 +255,7 @@ lemma Module.FinitePresentation.exists_lift_of_isLocalizedModule
252
255
exact Submodule.subset_span x.prop
253
256
choose s' hs' using this
254
257
let s₁ := ∏ i : τ, s' i
255
- have : LinearMap.ker π ≤ LinearMap.ker (s₁ • Finsupp.total R i) := by
258
+ have : LinearMap.ker π ≤ LinearMap.ker (s₁ • Finsupp.linearCombination R i) := by
256
259
rw [← hτ, Submodule.span_le]
257
260
intro x hxσ
258
261
simp only [s₁]
0 commit comments