Skip to content

Commit bb1a852

Browse files
vlad902b-mehta
authored andcommitted
feat(Module/Projective): direct sum of projective modules is projective (leanprover-community#39764)
1 parent 5577337 commit bb1a852

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Mathlib/Algebra/DirectSum/Module.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,14 @@ theorem component.of [DecidableEq ι] (i j : ι) (b : M j) :
213213
component R ι M i ((lof R ι M j) b) = if h : j = i then Eq.recOn h b else 0 :=
214214
DFinsupp.single_apply
215215

216+
lemma component_comp_lof [DecidableEq ι] (i j : ι) :
217+
component R ι M i ∘ₗ lof R ι M j = if h : j = i then h ▸ .id else 0 := by
218+
aesop (add simp component.of)
219+
220+
@[simp]
221+
lemma component_comp_lof_same [DecidableEq ι] (i : ι) : component R ι M i ∘ₗ lof R ι M i = .id := by
222+
simp [component_comp_lof]
223+
216224
section map
217225

218226
variable {R} {N : ι → Type*}

Mathlib/Algebra/Module/Projective.lean

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ projective module
5959
universe w v u
6060

6161
open LinearMap hiding id
62+
open DirectSum hiding id_apply
6263
open Finsupp
6364

6465
/- The actual implementation we choose: `P` is projective if the natural surjection
@@ -287,4 +288,21 @@ theorem Projective.of_lifting_property {R : Type u} [Ring R] {P : Type v} [AddCo
287288

288289
end OfLiftingProperty
289290

291+
section DirectSum
292+
293+
variable {R : Type u} [Semiring R]
294+
variable {ι : Type v} {M : ι → Type w} [(i : ι) → AddCommMonoid (M i)] [(i : ι) → Module R (M i)]
295+
296+
theorem Projective.directSum_iff : Projective R (⨁ i, M i) ↔ ∀ (i : ι), Projective R (M i) := by
297+
classical
298+
refine ⟨fun H i ↦ ?_, fun H ↦ ?_⟩
299+
· exact .of_split (DirectSum.lof ..) (DirectSum.component ..) (by simp)
300+
· let e : (⨁ i, M i) ≃ₗ[R] Π₀ i, M i := .refl ..
301+
exact Projective.of_equiv' e.symm
302+
303+
instance Projective.directSum [∀ (i : ι), Projective R (M i)] : Projective R (⨁ i, M i) :=
304+
directSum_iff.mpr ‹_›
305+
306+
end DirectSum
307+
290308
end Module

0 commit comments

Comments
 (0)