Skip to content

Commit 608b89f

Browse files
chore: do not depend on CategoryTheory in Module.Injective (#17747)
The category-theoretic results can be split between `Mathlib/Algebra/Category/Grp/Injective.lean` and `Mathlib/Algebra/Category/ModuleCat/Injective.lean` instead, with no changes to downstream proofs. Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
1 parent 5ffbcdc commit 608b89f

File tree

6 files changed

+80
-60
lines changed

6 files changed

+80
-60
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings
100100
import Mathlib.Algebra.Category.ModuleCat.Colimits
101101
import Mathlib.Algebra.Category.ModuleCat.Differentials.Basic
102102
import Mathlib.Algebra.Category.ModuleCat.Differentials.Presheaf
103+
import Mathlib.Algebra.Category.ModuleCat.EnoughInjectives
103104
import Mathlib.Algebra.Category.ModuleCat.EpiMono
104105
import Mathlib.Algebra.Category.ModuleCat.FilteredColimits
105106
import Mathlib.Algebra.Category.ModuleCat.Free

Mathlib/Algebra/Category/Grp/EnoughInjectives.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Authors: Jujian Zhang, Junyan Xu
77
import Mathlib.Algebra.Module.CharacterModule
88
import Mathlib.Algebra.Category.Grp.EquivalenceGroupAddGroup
99
import Mathlib.Algebra.Category.Grp.EpiMono
10+
import Mathlib.Algebra.Category.Grp.Injective
1011

1112
/-!
1213
@@ -17,8 +18,7 @@ injective presentation for `A`, hence category of abelian groups has enough inje
1718
1819
## Implementation notes
1920
20-
This file is split from `Mathlib.Algebra.Grp.Injective` is to prevent import loop.
21-
This file's dependency imports `Mathlib.Algebra.Grp.Injective`.
21+
This file is split from `Mathlib.Algebra.Category.Grp.Injective` to prevent import loops.
2222
-/
2323

2424
open CategoryTheory

Mathlib/Algebra/Category/Grp/Injective.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jujian Zhang
55
-/
6+
import Mathlib.Algebra.Category.ModuleCat.EpiMono
67
import Mathlib.Algebra.Category.Grp.ZModuleEquivalence
78
import Mathlib.Algebra.EuclideanDomain.Int
8-
import Mathlib.Algebra.Module.Injective
9+
import Mathlib.Algebra.Category.ModuleCat.Injective
10+
import Mathlib.CategoryTheory.Preadditive.Injective
911
import Mathlib.RingTheory.PrincipalIdealDomain
1012
import Mathlib.Topology.Instances.AddCircle
1113

@@ -40,7 +42,6 @@ universe u
4042

4143
variable (A : Type u) [AddCommGroup A]
4244

43-
4445
theorem Module.Baer.of_divisible [DivisibleBy A ℤ] : Module.Baer ℤ A := fun I g ↦ by
4546
rcases IsPrincipalIdealRing.principal I with ⟨m, rfl⟩
4647
obtain rfl | h0 := eq_or_ne m 0
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/-
2+
Copyright (c) 2023 Jujian Zhang. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Jujian Zhang
5+
-/
6+
import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings
7+
import Mathlib.Algebra.Category.ModuleCat.Injective
8+
import Mathlib.Algebra.Category.Grp.EnoughInjectives
9+
import Mathlib.Algebra.Category.Grp.ZModuleEquivalence
10+
import Mathlib.Logic.Equiv.TransferInstance
11+
12+
/-!
13+
# Category of $R$-modules has enough injectives
14+
15+
we lift enough injectives of abelian groups to arbitrary $R$-modules by adjoint functors
16+
`restrictScalars ⊣ coextendScalars`
17+
-/
18+
19+
open CategoryTheory
20+
21+
universe v u
22+
variable (R : Type u) [Ring R]
23+
24+
instance : EnoughInjectives (ModuleCat.{v} ℤ) :=
25+
EnoughInjectives.of_equivalence (forget₂ (ModuleCat ℤ) AddCommGrp)
26+
27+
lemma ModuleCat.enoughInjectives : EnoughInjectives (ModuleCat.{max v u} R) :=
28+
EnoughInjectives.of_adjunction (ModuleCat.restrictCoextendScalarsAdj.{max v u} (algebraMap ℤ R))
29+
30+
open ModuleCat in
31+
instance [UnivLE.{u,v}] : EnoughInjectives (ModuleCat.{v} R) :=
32+
letI := (equivShrink.{v} R).symm.ring
33+
letI := enoughInjectives.{v} (Shrink.{v} R)
34+
EnoughInjectives.of_equivalence (restrictScalars (equivShrink R).symm.ringEquiv.toRingHom)

Mathlib/Algebra/Category/ModuleCat/Injective.lean

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,47 @@ Copyright (c) 2023 Jujian Zhang. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jujian Zhang
55
-/
6-
import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings
7-
import Mathlib.Algebra.Category.Grp.EnoughInjectives
8-
import Mathlib.Algebra.Category.Grp.ZModuleEquivalence
9-
import Mathlib.Logic.Equiv.TransferInstance
6+
import Mathlib.Algebra.Module.Injective
7+
import Mathlib.CategoryTheory.Preadditive.Injective
8+
import Mathlib.Algebra.Category.ModuleCat.EpiMono
109

1110
/-!
12-
# Category of $R$-modules has enough injectives
13-
14-
we lift enough injectives of abelian groups to arbitrary $R$-modules by adjoint functors
15-
`restrictScalars ⊣ coextendScalars`
16-
17-
## Implementation notes
18-
This file is not part of `Algebra/Module/Injective.lean` to prevent import loop: enough-injectives
19-
of abelian groups needs `Algebra/Module/Injective.lean` and this file needs enough-injectives of
20-
abelian groups.
11+
# Injective objects in the category of $R$-modules
2112
-/
2213

2314
open CategoryTheory
2415

25-
universe v u
26-
variable (R : Type u) [Ring R]
27-
28-
instance : EnoughInjectives (ModuleCat.{v} ℤ) :=
29-
EnoughInjectives.of_equivalence (forget₂ (ModuleCat ℤ) AddCommGrp)
30-
31-
lemma ModuleCat.enoughInjectives : EnoughInjectives (ModuleCat.{max v u} R) :=
32-
EnoughInjectives.of_adjunction (ModuleCat.restrictCoextendScalarsAdj.{max v u} (algebraMap ℤ R))
33-
34-
open ModuleCat in
35-
instance [UnivLE.{u,v}] : EnoughInjectives (ModuleCat.{v} R) :=
36-
letI := (equivShrink.{v} R).symm.ring
37-
letI := enoughInjectives.{v} (Shrink.{v} R)
38-
EnoughInjectives.of_equivalence (restrictScalars (equivShrink R).symm.ringEquiv.toRingHom)
16+
universe u v
17+
variable (R : Type u) (M : Type v) [Ring R] [AddCommGroup M] [Module R M]
18+
namespace Module
19+
20+
theorem injective_object_of_injective_module [inj : Injective R M] :
21+
CategoryTheory.Injective (ModuleCat.of R M) where
22+
factors g f m :=
23+
have ⟨l, h⟩ := inj.out f ((ModuleCat.mono_iff_injective f).mp m) g
24+
⟨l, LinearMap.ext h⟩
25+
26+
theorem injective_module_of_injective_object
27+
[inj : CategoryTheory.Injective <| ModuleCat.of R M] :
28+
Module.Injective R M where
29+
out X Y _ _ _ _ f hf g := by
30+
have : CategoryTheory.Mono (ModuleCat.asHom f) := (ModuleCat.mono_iff_injective _).mpr hf
31+
obtain ⟨l, rfl⟩ := inj.factors (ModuleCat.asHom g) (ModuleCat.asHom f)
32+
exact ⟨l, fun _ ↦ rfl⟩
33+
34+
theorem injective_iff_injective_object :
35+
Module.Injective R M ↔
36+
CategoryTheory.Injective (ModuleCat.of R M) :=
37+
fun _ => injective_object_of_injective_module R M,
38+
fun _ => injective_module_of_injective_object R M⟩
39+
40+
end Module
41+
42+
43+
instance ModuleCat.ulift_injective_of_injective.{v'}
44+
[Small.{v} R] [AddCommGroup M] [Module R M]
45+
[CategoryTheory.Injective <| ModuleCat.of R M] :
46+
CategoryTheory.Injective <| ModuleCat.of R (ULift.{v'} M) :=
47+
Module.injective_object_of_injective_module
48+
(inj := Module.ulift_injective_of_injective
49+
(inj := Module.injective_module_of_injective_object _ _))

Mathlib/Algebra/Module/Injective.lean

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jujian Zhang
55
-/
6-
import Mathlib.CategoryTheory.Preadditive.Injective
7-
import Mathlib.Algebra.Category.ModuleCat.EpiMono
86
import Mathlib.RingTheory.Ideal.Basic
97
import Mathlib.LinearAlgebra.LinearPMap
108
import Mathlib.Logic.Equiv.TransferInstance
9+
import Mathlib.Logic.Small.Basic
1110

1211
/-!
1312
# Injective modules
@@ -33,6 +32,7 @@ import Mathlib.Logic.Equiv.TransferInstance
3332
3433
-/
3534

35+
assert_not_exists ModuleCat
3636

3737
noncomputable section
3838

@@ -57,26 +57,6 @@ map to `Q`, i.e. in the following diagram, if `f` is injective then there is an
5757
(f : X →ₗ[R] Y) (_ : Function.Injective f) (g : X →ₗ[R] Q),
5858
∃ h : Y →ₗ[R] Q, ∀ x, h (f x) = g x
5959

60-
theorem Module.injective_object_of_injective_module [inj : Module.Injective R Q] :
61-
CategoryTheory.Injective (ModuleCat.of R Q) where
62-
factors g f m :=
63-
have ⟨l, h⟩ := inj.out f ((ModuleCat.mono_iff_injective f).mp m) g
64-
⟨l, LinearMap.ext h⟩
65-
66-
theorem Module.injective_module_of_injective_object
67-
[inj : CategoryTheory.Injective <| ModuleCat.of R Q] :
68-
Module.Injective R Q where
69-
out X Y _ _ _ _ f hf g := by
70-
have : CategoryTheory.Mono (ModuleCat.asHom f) := (ModuleCat.mono_iff_injective _).mpr hf
71-
obtain ⟨l, rfl⟩ := inj.factors (ModuleCat.asHom g) (ModuleCat.asHom f)
72-
exact ⟨l, fun _ ↦ rfl⟩
73-
74-
theorem Module.injective_iff_injective_object :
75-
Module.Injective R Q ↔
76-
CategoryTheory.Injective (ModuleCat.of R Q) :=
77-
fun _ => injective_object_of_injective_module R Q,
78-
fun _ => injective_module_of_injective_object R Q⟩
79-
8060
/-- An `R`-module `Q` satisfies Baer's criterion if any `R`-linear map from an `Ideal R` extends to
8161
an `R`-linear map `R ⟶ Q`-/
8262
def Module.Baer : Prop :=
@@ -440,13 +420,6 @@ lemma Module.injective_iff_ulift_injective :
440420
⟨Module.ulift_injective_of_injective R,
441421
Module.injective_of_ulift_injective R⟩
442422

443-
instance ModuleCat.ulift_injective_of_injective
444-
[inj : CategoryTheory.Injective <| ModuleCat.of R M] :
445-
CategoryTheory.Injective <| ModuleCat.of R (ULift.{v'} M) :=
446-
Module.injective_object_of_injective_module
447-
(inj := Module.ulift_injective_of_injective
448-
(inj := Module.injective_module_of_injective_object (inj := inj)))
449-
450423
end ULift
451424

452425
section lifting_property

0 commit comments

Comments
 (0)