Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 15a64f5

Browse files
kbuzzarderic-wieser
andcommitted
feat(algebra/module/projective): add projective module (#6813)
Definition and universal property of projective modules; free modules are projective. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
1 parent 272e2d2 commit 15a64f5

File tree

1 file changed

+150
-0
lines changed

1 file changed

+150
-0
lines changed

src/algebra/module/projective.lean

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
/-
2+
Copyright (c) 2021 Kevin Buzzard. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Kevin Buzzard
5+
-/
6+
7+
import algebra.module.basic
8+
import linear_algebra.finsupp
9+
import linear_algebra.basis
10+
11+
/-!
12+
13+
# Projective modules
14+
15+
This file contains a definition of a projective module, the proof that
16+
our definition is equivalent to a lifting property, and the
17+
proof that all free modules are projective.
18+
19+
## Main definitions
20+
21+
Let `R` be a ring (or a semiring) and let `M` be an `R`-module (or a semimodule).
22+
23+
* `is_projective R M` : the proposition saying that `M` is a projective `R`-module.
24+
25+
## Main theorems
26+
27+
* `is_projective.lifting_property` : a map from a projective module can be lifted along
28+
a surjection.
29+
30+
* `is_projective.of_lifting_property` : If for all R-module surjections `A →ₗ B`, all
31+
maps `M →ₗ B` lift to `M →ₗ A`, then `M` is projective.
32+
33+
* `is_projective.of_free` : Free modules are projective
34+
35+
## Implementation notes
36+
37+
The actual definition of projective we use is that the natural R-module map
38+
from the free R-module on the type M down to M splits. This is more convenient
39+
than certain other definitions which involve quantifying over universes,
40+
and also universe-polymorphic (the ring and module can be in different universes).
41+
42+
Everything works for semirings and semimodules except that apparently
43+
we don't have free semimodules, so here we stick to rings.
44+
45+
## References
46+
47+
https://en.wikipedia.org/wiki/Projective_module
48+
49+
## TODO
50+
51+
- Direct sum of two projective modules is projective.
52+
- Arbitrary sum of projective modules is projective.
53+
- Any module admits a surjection from a projective module.
54+
55+
All of these should be relatively straightforward.
56+
57+
## Tags
58+
59+
projective module
60+
61+
-/
62+
63+
universes u v
64+
65+
/- The actual implementation we choose: `P` is projective if the natural surjection
66+
from the free `R`-module on `P` to `P` splits. -/
67+
/-- An R-module is projective if it is a direct summand of a free module, or equivalently
68+
if maps from the module lift along surjections. There are several other equivalent
69+
definitions. -/
70+
def is_projective
71+
(R : Type u) [semiring R] (P : Type v) [add_comm_monoid P] [semimodule R P] : Prop :=
72+
∃ s : P →ₗ[R] (P →₀ R), function.left_inverse (finsupp.total P P R id) s
73+
74+
namespace is_projective
75+
76+
section semiring
77+
78+
variables {R : Type u} [semiring R] {P : Type v} [add_comm_monoid P] [semimodule R P]
79+
{M : Type*} [add_comm_group M] [semimodule R M] {N : Type*} [add_comm_group N] [semimodule R N]
80+
81+
/-- A projective R-module has the property that maps from it lift along surjections. -/
82+
theorem lifting_property (h : is_projective R P) (f : M →ₗ[R] N) (g : P →ₗ[R] N)
83+
(hf : function.surjective f) : ∃ (h : P →ₗ[R] M), f.comp h = g :=
84+
begin
85+
/-
86+
Here's the first step of the proof.
87+
Recall that `X →₀ R` is Lean's way of talking about the free `R`-module
88+
on a type `X`. The universal property `finsupp.total` says that to a map
89+
`X → N` from a type to an `R`-module, we get an associated R-module map
90+
`(X →₀ R) →ₗ N`. Apply this to a (noncomputable) map `P → M` coming from the map
91+
`P →ₗ N` and a random splitting of the surjection `M →ₗ N`, and we get
92+
a map `φ : (P →₀ R) →ₗ M`.
93+
-/
94+
let φ : (P →₀ R) →ₗ[R] M := finsupp.total _ _ _ (λ p, function.surj_inv hf (g p)),
95+
-- By projectivity we have a map `P →ₗ (P →₀ R)`;
96+
cases h with s hs,
97+
-- Compose to get `P →ₗ M`. This works.
98+
use φ.comp s,
99+
ext p,
100+
conv_rhs {rw ← hs p},
101+
simp [φ, finsupp.total_apply, function.surj_inv_eq hf],
102+
end
103+
104+
/-- A module which satisfies the universal property is projective. Note that the universe variables
105+
in `huniv` are somewhat restricted. -/
106+
theorem of_lifting_property {R : Type u} [semiring R]
107+
{P : Type v} [add_comm_monoid P] [semimodule R P]
108+
-- If for all surjections of `R`-modules `M →ₗ N`, all maps `P →ₗ N` lift to `P →ₗ M`,
109+
(huniv : ∀ {M : Type (max v u)} {N : Type v} [add_comm_monoid M] [add_comm_monoid N],
110+
by exactI
111+
∀ [semimodule R M] [semimodule R N],
112+
by exactI
113+
∀ (f : M →ₗ[R] N) (g : P →ₗ[R] N),
114+
function.surjective f → ∃ (h : P →ₗ[R] M), f.comp h = g) :
115+
-- then `P` is projective.
116+
is_projective R P :=
117+
begin
118+
-- let `s` be the universal map `(P →₀ R) →ₗ P` coming from the identity map `P →ₗ P`.
119+
obtain ⟨s, hs⟩ : ∃ (s : P →ₗ[R] P →₀ R),
120+
(finsupp.total P P R id).comp s = linear_map.id :=
121+
huniv (finsupp.total P P R (id : P → P)) (linear_map.id : P →ₗ[R] P) _,
122+
-- This `s` works.
123+
{ use s,
124+
rwa linear_map.ext_iff at hs },
125+
{ intro p,
126+
use finsupp.single p 1,
127+
simp },
128+
end
129+
130+
end semiring
131+
132+
section ring
133+
134+
variables {R : Type u} [ring R] {P : Type v} [add_comm_group P] [module R P]
135+
136+
/-- Free modules are projective. -/
137+
theorem of_free {ι : Type*} {b : ι → P} (hb : is_basis R b) : is_projective R P :=
138+
begin
139+
-- need P →ₗ (P →₀ R) for definition of projective.
140+
-- get it from `ι → (P →₀ R)` coming from `b`.
141+
use hb.constr (λ i, finsupp.single (b i) 1),
142+
intro m,
143+
simp only [hb.constr_apply, mul_one, id.def, finsupp.smul_single', finsupp.total_single,
144+
linear_map.map_finsupp_sum],
145+
exact hb.total_repr m,
146+
end
147+
148+
end ring
149+
150+
end is_projective

0 commit comments

Comments
 (0)