Skip to content

Commit 8fe6e13

Browse files
Thmoas-GuanBergschaf
authored andcommitted
feat(ModuleCat): some lemmas for Ext in ModuleCat (leanprover-community#38466)
We add some lemmas for manipulating `Ext` groups in `ModuleCat`.
1 parent 8a4bcbd commit 8fe6e13

4 files changed

Lines changed: 71 additions & 0 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public import Mathlib.Algebra.Category.ModuleCat.Differentials.Basic
158158
public import Mathlib.Algebra.Category.ModuleCat.Differentials.Presheaf
159159
public import Mathlib.Algebra.Category.ModuleCat.EnoughInjectives
160160
public import Mathlib.Algebra.Category.ModuleCat.EpiMono
161+
public import Mathlib.Algebra.Category.ModuleCat.Ext.Basic
161162
public import Mathlib.Algebra.Category.ModuleCat.Ext.DimensionShifting
162163
public import Mathlib.Algebra.Category.ModuleCat.Ext.Finite
163164
public import Mathlib.Algebra.Category.ModuleCat.Ext.HasExt

Mathlib/Algebra/Category/ModuleCat/Basic.lean

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public import Mathlib.Algebra.Category.ModuleCat.Semi
99
public import Mathlib.Algebra.Category.Grp.Preadditive
1010
public import Mathlib.CategoryTheory.Linear.Basic
1111
public import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor
12+
public import Mathlib.LinearAlgebra.BilinearMap
1213

1314
/-!
1415
# The category of `R`-modules
@@ -386,6 +387,15 @@ lemma isZero_iff_subsingleton : IsZero M ↔ Subsingleton M where
386387
lemma isZero_of_iff_subsingleton {M : Type*} [AddCommGroup M] [Module R M] :
387388
IsZero (of R M) ↔ Subsingleton M := isZero_iff_subsingleton
388389

390+
@[simp]
391+
lemma ofHom_zero {M N : Type v} [AddCommGroup M] [Module R M]
392+
[AddCommGroup N] [Module R N] : ModuleCat.ofHom (0 : M →ₗ[R] N) = 0 := rfl
393+
394+
@[simp]
395+
lemma ofHom_add {M N : Type v} [AddCommGroup M] [Module R M]
396+
[AddCommGroup N] [Module R N] (f g : M →ₗ[R] N) :
397+
ModuleCat.ofHom (f + g) = ModuleCat.ofHom f + ModuleCat.ofHom g := rfl
398+
389399
end AddCommGroup
390400

391401
section SMul
@@ -456,6 +466,9 @@ variable {S : Type u} [CommRing S]
456466

457467
instance : Linear S (ModuleCat.{v} S) := ModuleCat.Algebra.instLinear
458468

469+
lemma lsmul_eq_smul_id (M : ModuleCat.{v} S) (s : S) :
470+
ModuleCat.ofHom (LinearMap.lsmul S M s) = s • 𝟙 M := rfl
471+
459472
variable {X Y X' Y' : ModuleCat.{v} S}
460473

461474
set_option backward.privateInPublic true in
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/-
2+
Copyright (c) 2026 Nailin Guan. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Nailin Guan
5+
-/
6+
7+
module
8+
9+
public import Mathlib.Algebra.Category.Grp.Zero
10+
public import Mathlib.Algebra.Category.ModuleCat.Ext.HasExt
11+
public import Mathlib.Algebra.Homology.DerivedCategory.Ext.Linear
12+
public import Mathlib.RingTheory.Ideal.Maps
13+
14+
/-!
15+
16+
# Some basic lemmas for manipulating `Ext` over `ModuleCat`
17+
18+
-/
19+
20+
@[expose] public section
21+
22+
universe v u
23+
24+
open LinearMap CategoryTheory Limits
25+
26+
variable {R : Type u} [CommRing R]
27+
28+
variable {M N : Type v} [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N]
29+
30+
namespace CategoryTheory.Abelian
31+
32+
variable [Small.{v} R] {M N : ModuleCat.{v} R}
33+
34+
/-- If `r • N = 0`, then `r • 𝟙 M` induces the zero endomorphism on `Ext M N n`. -/
35+
lemma Ext.postcomp_smul_id_eq_zero_of_mem_annihilator {r : R} (mem_ann : r ∈ Module.annihilator R N)
36+
(n : ℕ) : AddCommGrpCat.ofHom ((Ext.mk₀ (r • 𝟙 M)).postcomp N (add_zero n)) = 0 := by
37+
ext h
38+
have : r • 𝟙 N = 0 := by
39+
simp [← ModuleCat.lsmul_eq_smul_id, Module.mem_annihilator_iff_lsmul_eq_zero.mp mem_ann]
40+
have smul_eq : r • h = (Ext.mk₀ (r • 𝟙 N)).comp h (zero_add n) := by simp [Ext.mk₀_smul]
41+
simp [Ext.mk₀_smul, this, smul_eq]
42+
43+
/-- `r • 𝟙 M` induces a monomorphism in `Ext M N n` if and only if scalar multiplication by `r`
44+
is faithful on `Ext M N n`. -/
45+
lemma Ext.postcomp_smul_id_mono_iff (r : R) (i : ℕ) :
46+
Mono (AddCommGrpCat.ofHom ((Ext.mk₀ (r • 𝟙 M)).postcomp N (add_zero i))) ↔
47+
IsSMulRegular (Ext N M i) r := by
48+
simp only [IsSMulRegular, AddCommGrpCat.mono_iff_injective]
49+
congr!
50+
ext
51+
simp [Ext.mk₀_smul]
52+
53+
end CategoryTheory.Abelian

Mathlib/RingTheory/Ideal/Maps.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,10 @@ def Module.annihilator : Ideal R := RingHom.ker (Module.toAddMonoidEnd R M)
843843
theorem Module.mem_annihilator {r} : r ∈ Module.annihilator R M ↔ ∀ m : M, r • m = 0 :=
844844
fun h ↦ (congr($h ·)), (AddMonoidHom.ext ·)⟩
845845

846+
lemma Module.mem_annihilator_iff_lsmul_eq_zero {R : Type*} [CommSemiring R]
847+
[Module R M] {r : R} : r ∈ Module.annihilator R M ↔ LinearMap.lsmul R M r = 0 := by
848+
simp [Module.mem_annihilator, LinearMap.ext_iff]
849+
846850
instance (priority := low) : (Module.annihilator R M).IsTwoSided :=
847851
inferInstanceAs (RingHom.ker _).IsTwoSided
848852

0 commit comments

Comments
 (0)