@@ -10,6 +10,7 @@ public import Mathlib.Algebra.MonoidAlgebra.Module
1010public import Mathlib.LinearAlgebra.Finsupp.LinearCombination
1111public import Mathlib.LinearAlgebra.Quotient.Basic
1212public import Mathlib.RingTheory.Finiteness.Basic
13+ public import Mathlib.Algebra.Exact
1314
1415/-!
1516# Finiteness of (sub)modules and finitely supported functions
@@ -113,11 +114,22 @@ theorem fg_ker_comp (f : M →ₗ[R] N) (g : N →ₗ[R] P)
113114 · rwa [inf_of_le_right (show (LinearMap.ker f) ≤
114115 (LinearMap.ker g).comap f from comap_mono bot_le)]
115116
117+ /-- If $M → N → P → 0$ is exact and $M$ and $P$ are finitely generated then so is $N$.
118+
119+ This is the `Module.Finite` version of `Submodule.fg_of_fg_map_of_fg_inf_ker`. -/
120+ @ [stacks 0519 "(1)" ]
121+ lemma _root_.Module.Finite.of_exact {f : M →ₗ[R] N} {g : N →ₗ[R] P}
122+ (h_exact : Function.Exact f g) (h_surj : Function.Surjective g)
123+ [Module.Finite R M] [Module.Finite R P] : Module.Finite R N := by
124+ refine ⟨(⊤ : Submodule R _).fg_of_fg_map_of_fg_inf_ker g ?_ ?_⟩
125+ · rw [← LinearMap.range_eq_top] at h_surj
126+ rw [Submodule.map_top, h_surj]
127+ exact Module.Finite.fg_top
128+ · simp [LinearMap.exact_iff.1 h_exact]
129+
116130theorem _root_.Module.Finite.of_submodule_quotient (N : Submodule R M) [Module.Finite R N]
117- [Module.Finite R (M ⧸ N)] : Module.Finite R M where
118- fg_top := fg_of_fg_map_of_fg_inf_ker N.mkQ
119- (by simpa only [map_top, range_mkQ] using Module.finite_def.mp ‹_›) <| by
120- simpa only [top_inf_eq, ker_mkQ] using .of_finite
131+ [Module.Finite R (M ⧸ N)] : Module.Finite R M :=
132+ .of_exact (LinearMap.exact_subtype_mkQ N) (Quotient.mk_surjective _)
121133
122134end Submodule
123135
0 commit comments