Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
File size: 6,840 Bytes
4365a98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/-
Copyright (c) 2021 Kevin Buzzard. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kevin Buzzard
-/

import algebra.module.basic
import linear_algebra.finsupp
import linear_algebra.free_module.basic

/-!

# Projective modules

This file contains a definition of a projective module, the proof that
our definition is equivalent to a lifting property, and the
proof that all free modules are projective.

## Main definitions

Let `R` be a ring (or a semiring) and let `M` be an `R`-module.

* `is_projective R M` : the proposition saying that `M` is a projective `R`-module.

## Main theorems

* `is_projective.lifting_property` : a map from a projective module can be lifted along
  a surjection.

* `is_projective.of_lifting_property` : If for all R-module surjections `A β†’β‚— B`, all
  maps `M β†’β‚— B` lift to `M β†’β‚— A`, then `M` is projective.

* `is_projective.of_free` : Free modules are projective

## Implementation notes

The actual definition of projective we use is that the natural R-module map
from the free R-module on the type M down to M splits. This is more convenient
than certain other definitions which involve quantifying over universes,
and also universe-polymorphic (the ring and module can be in different universes).

We require that the module sits in at least as high a universe as the ring:
without this, free modules don't even exist,
and it's unclear if projective modules are even a useful notion.

## References

https://en.wikipedia.org/wiki/Projective_module

## TODO

- Direct sum of two projective modules is projective.
- Arbitrary sum of projective modules is projective.

All of these should be relatively straightforward.

## Tags

projective module

-/

universes u v

/- The actual implementation we choose: `P` is projective if the natural surjection
   from the free `R`-module on `P` to `P` splits. -/
/-- An R-module is projective if it is a direct summand of a free module, or equivalently
  if maps from the module lift along surjections. There are several other equivalent
  definitions. -/
class module.projective (R : Type u) [semiring R] (P : Type (max u v)) [add_comm_monoid P]
  [module R P] : Prop :=
(out : βˆƒ s : P β†’β‚—[R] (P β†’β‚€ R), function.left_inverse (finsupp.total P P R id) s)

namespace module

lemma projective_def {R : Type u} [semiring R] {P : Type (max u v)} [add_comm_monoid P]
  [module R P] : projective R P ↔
  (βˆƒ s : P β†’β‚—[R] (P β†’β‚€ R), function.left_inverse (finsupp.total P P R id) s) :=
⟨λ h, h.1, λ h, ⟨h⟩⟩

section semiring

variables {R : Type u} [semiring R] {P : Type (max u v)} [add_comm_monoid P] [module R P]
  {M : Type (max u v)} [add_comm_group M] [module R M] {N : Type*} [add_comm_group N] [module R N]

/-- A projective R-module has the property that maps from it lift along surjections. -/
theorem projective_lifting_property [h : projective R P] (f : M β†’β‚—[R] N) (g : P β†’β‚—[R] N)
  (hf : function.surjective f) : βˆƒ (h : P β†’β‚—[R] M), f.comp h = g :=
begin
  /-
  Here's the first step of the proof.
  Recall that `X β†’β‚€ R` is Lean's way of talking about the free `R`-module
  on a type `X`. The universal property `finsupp.total` says that to a map
  `X β†’ N` from a type to an `R`-module, we get an associated R-module map
  `(X β†’β‚€ R) β†’β‚— N`. Apply this to a (noncomputable) map `P β†’ M` coming from the map
  `P β†’β‚— N` and a random splitting of the surjection `M β†’β‚— N`, and we get
  a map `Ο† : (P β†’β‚€ R) β†’β‚— M`.
  -/
  let Ο† : (P β†’β‚€ R) β†’β‚—[R] M := finsupp.total _ _ _ (Ξ» p, function.surj_inv hf (g p)),
  -- By projectivity we have a map `P β†’β‚— (P β†’β‚€ R)`;
  cases h.out with s hs,
  -- Compose to get `P β†’β‚— M`. This works.
  use Ο†.comp s,
  ext p,
  conv_rhs {rw ← hs p},
  simp [Ο†, finsupp.total_apply, function.surj_inv_eq hf],
end

/-- A module which satisfies the universal property is projective. Note that the universe variables
in `huniv` are somewhat restricted. -/
theorem projective_of_lifting_property'
  -- If for all surjections of `R`-modules `M β†’β‚— N`, all maps `P β†’β‚— N` lift to `P β†’β‚— M`,
  (huniv : βˆ€ {M : Type (max v u)} {N : Type (max u v)} [add_comm_monoid M] [add_comm_monoid N],
    by exactI
    βˆ€ [module R M] [module R N],
    by exactI
    βˆ€ (f : M β†’β‚—[R] N) (g : P β†’β‚—[R] N),
  function.surjective f β†’ βˆƒ (h : P β†’β‚—[R] M), f.comp h = g) :
  -- then `P` is projective.
  projective R P :=
begin
  -- let `s` be the universal map `(P β†’β‚€ R) β†’β‚— P` coming from the identity map `P β†’β‚— P`.
  obtain ⟨s, hs⟩ : βˆƒ (s : P β†’β‚—[R] P β†’β‚€ R),
    (finsupp.total P P R id).comp s = linear_map.id :=
    huniv (finsupp.total P P R (id : P β†’ P)) (linear_map.id : P β†’β‚—[R] P) _,
  -- This `s` works.
  { use s,
    rwa linear_map.ext_iff at hs },
  { intro p,
    use finsupp.single p 1,
    simp },
end

end semiring

section ring

variables {R : Type u} [ring R] {P : Type (max u v)} [add_comm_group P] [module R P]

/-- A variant of `of_lifting_property'` when we're working over a `[ring R]`,
which only requires quantifying over modules with an `add_comm_group` instance. -/
theorem projective_of_lifting_property
  -- If for all surjections of `R`-modules `M β†’β‚— N`, all maps `P β†’β‚— N` lift to `P β†’β‚— M`,
  (huniv : βˆ€ {M : Type (max v u)} {N : Type (max u v)} [add_comm_group M] [add_comm_group N],
    by exactI
    βˆ€ [module R M] [module R N],
    by exactI
    βˆ€ (f : M β†’β‚—[R] N) (g : P β†’β‚—[R] N),
  function.surjective f β†’ βˆƒ (h : P β†’β‚—[R] M), f.comp h = g) :
  -- then `P` is projective.
  projective R P :=
-- We could try and prove this *using* `of_lifting_property`,
-- but this quickly leads to typeclass hell,
-- so we just prove it over again.
begin
  -- let `s` be the universal map `(P β†’β‚€ R) β†’β‚— P` coming from the identity map `P β†’β‚— P`.
  obtain ⟨s, hs⟩ : βˆƒ (s : P β†’β‚—[R] P β†’β‚€ R),
    (finsupp.total P P R id).comp s = linear_map.id :=
    huniv (finsupp.total P P R (id : P β†’ P)) (linear_map.id : P β†’β‚—[R] P) _,
  -- This `s` works.
  { use s,
    rwa linear_map.ext_iff at hs },
  { intro p,
    use finsupp.single p 1,
    simp },
end

/-- Free modules are projective. -/
theorem projective_of_basis {ΞΉ : Type*} (b : basis ΞΉ R P) : projective R P :=
begin
  -- need P β†’β‚— (P β†’β‚€ R) for definition of projective.
  -- get it from `ΞΉ β†’ (P β†’β‚€ R)` coming from `b`.
  use b.constr β„• (Ξ» i, finsupp.single (b i) (1 : R)),
  intro m,
  simp only [b.constr_apply, mul_one, id.def, finsupp.smul_single', finsupp.total_single,
    linear_map.map_finsupp_sum],
  exact b.total_repr m,
end

@[priority 100]
instance projective_of_free [module.free R P] : module.projective R P :=
projective_of_basis $ module.free.choose_basis R P

end ring

end module