This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ideal_and_fg_ideal.lean
281 lines (243 loc) · 9.65 KB
/
ideal_and_fg_ideal.lean
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
import algebra.direct_limit
import algebra.category.fgModule.basic
import .defs
import .direct_lim
open_locale tensor_product
universes u v
variables {R : Type u} [comm_ring R]
variables (M : Type u) [add_comm_group M] [module R M]
variable (I : ideal R)
@[ext]
structure fg_subideal :=
(to_ideal : ideal R)
(fg : to_ideal.fg)
(le : to_ideal ≤ I)
instance hmmm0 : Π (i : fg_subideal I), add_comm_group $ i.to_ideal ⊗[R] M :=
λ _, infer_instance
instance hmmm1 : Π (i : fg_subideal I), module R (i.to_ideal ⊗[R] M) :=
λ _, tensor_product.left_module
instance : preorder (fg_subideal I) :=
preorder.lift fg_subideal.to_ideal
instance : is_directed (fg_subideal I) (≤) :=
{ directed := λ J J', ⟨⟨J.to_ideal ⊔ J'.to_ideal, submodule.fg.sup J.fg J'.fg,
sup_le_iff.mpr ⟨J.le, J'.le⟩⟩,
⟨@le_sup_left (ideal R) _ J.to_ideal J'.to_ideal,
@le_sup_right (ideal R) _ J.to_ideal J'.to_ideal⟩⟩ }
instance : inhabited (fg_subideal I) :=
⟨⟨⊥, submodule.fg_bot, bot_le⟩⟩
variables {I}
@[simps] def principal_fg_subideal (i : I) : fg_subideal I :=
{ to_ideal := ideal.span {i},
fg := submodule.fg_span_singleton _,
le := submodule.span_le.mpr $ λ x hx, (set.mem_singleton_iff.mp hx).symm ▸ i.2 }
lemma principal_fg_subideal_smul (r : R) (i : I) :
principal_fg_subideal (r • i) ≤ principal_fg_subideal i :=
submodule.span_le.mpr $ λ x hx, (set.mem_singleton_iff.mp hx).symm ▸
submodule.mem_span_singleton.mpr ⟨r, rfl⟩
lemma mem_principal_fg_subideal (i : I) : (i : R) ∈ (principal_fg_subideal i).to_ideal :=
submodule.mem_span_singleton_self _
@[simps] def doubleton_fg_subideal (i j : I) : fg_subideal I :=
{ to_ideal := ideal.span {i, j},
fg := submodule.fg_span $ by simp only [set.finite.insert, set.finite_singleton],
le := submodule.span_le.mpr $ λ x hx,
begin
simp only [set.mem_insert_iff, set.mem_singleton_iff] at hx,
rcases hx with rfl|rfl,
{ exact i.2 },
{ exact j.2 }
end }
lemma mem_left_doubleton_fg_subideal (i j : I) :
(i : R) ∈ (doubleton_fg_subideal i j).to_ideal :=
submodule.subset_span $ by simp
lemma mem_right_doubleton_fg_subideal (i j : I) :
(j : R) ∈ (doubleton_fg_subideal i j).to_ideal :=
submodule.subset_span $ by simp
lemma left_le_doubleton_fg_subideal (i j : I) :
principal_fg_subideal i ≤ doubleton_fg_subideal i j :=
submodule.span_le.mpr $ λ x hx, (set.mem_singleton_iff.mpr hx).symm ▸
submodule.subset_span (by simp)
lemma right_le_doubleton_fg_subideal (i j : I) :
principal_fg_subideal j ≤ doubleton_fg_subideal i j :=
submodule.span_le.mpr $ λ x hx, (set.mem_singleton_iff.mpr hx).symm ▸
submodule.subset_span (by simp)
lemma add_le_doubleton_fg_subideal (i j : I) :
principal_fg_subideal (i + j) ≤ doubleton_fg_subideal i j :=
submodule.span_le.mpr $ λ x hx,
begin
rw set.mem_singleton_iff at hx,
rw hx,
change (i : R) + (j : R) ∈ _,
refine (doubleton_fg_subideal i j).to_ideal.add_mem _ _,
{ apply mem_left_doubleton_fg_subideal, },
{ apply mem_right_doubleton_fg_subideal, },
end
variable (I)
variable [decidable_eq $ fg_subideal I]
namespace ideal
instance : Π (i : fg_subideal I), add_comm_group $ i.to_ideal :=
λ _, infer_instance
@[reducible]
def as_direct_limit :=
module.direct_limit (λ (i : fg_subideal I), i.to_ideal) $ λ i j hij,
(submodule.of_le hij : i.to_ideal →ₗ[R] j.to_ideal)
@[reducible]
def from_as_direct_limit :
I.as_direct_limit →ₗ[R] I :=
module.direct_limit.lift R _ _ _ (λ i, submodule.of_le i.le) $ λ i j hij r, rfl
@[simps]
def to_as_direct_limit :
I →ₗ[R] I.as_direct_limit :=
{ to_fun := λ r, module.direct_limit.of R (fg_subideal I) (λ i, i.to_ideal)
(λ _ _ h, submodule.of_le h) (principal_fg_subideal r) ⟨r, mem_principal_fg_subideal r⟩,
map_add' := λ i i', begin
set ι : fg_subideal I := doubleton_fg_subideal i i' with ι_eq,
rw ←@module.direct_limit.of_f R _ (fg_subideal I) _ _ (λ i, i.to_ideal) _ _
(λ _ _ h, submodule.of_le h) _ _ (add_le_doubleton_fg_subideal i i'),
simp_rw [submodule.of_le_apply, subtype.coe_mk],
erw show (⟨i + i', _⟩ : (doubleton_fg_subideal i i').to_ideal) =
⟨i, mem_left_doubleton_fg_subideal _ _⟩ + ⟨i', mem_right_doubleton_fg_subideal _ _⟩,
from rfl,
rw map_add,
congr' 1,
{ rw ←@module.direct_limit.of_f R _ (fg_subideal I) _ _ (λ i, i.to_ideal) _ _
(λ _ _ h, submodule.of_le h) _ _ (left_le_doubleton_fg_subideal i i'),
refl, },
{ rw ←@module.direct_limit.of_f R _ (fg_subideal I) _ _ (λ i, i.to_ideal) _ _
(λ _ _ h, submodule.of_le h) _ _ (right_le_doubleton_fg_subideal i i'),
refl, },
end,
map_smul' := λ r i,
begin
rw ←@module.direct_limit.of_f R _ (fg_subideal I) _ _ (λ i, i.to_ideal) _ _
(λ _ _ h, submodule.of_le h) _ _ (principal_fg_subideal_smul r i),
simpa only [submodule.of_le_apply, ring_hom.id_apply, ←map_smul],
end }
example : true := trivial
lemma from_to_as_direct_limit :
function.left_inverse I.from_as_direct_limit I.to_as_direct_limit :=
begin
intros z,
rw to_as_direct_limit_apply,
rw module.direct_limit.lift_of,
rw submodule.of_le_apply,
simp_rw subtype.coe_mk,
ext,
rw subtype.coe_mk,
end
lemma to_from_as_direct_limit :
function.right_inverse I.from_as_direct_limit I.to_as_direct_limit :=
begin
intros z,
induction z using module.direct_limit.induction_on with i z,
rw module.direct_limit.lift_of,
rw submodule.of_le_apply,
rw to_as_direct_limit_apply,
simp_rw subtype.coe_mk,
rw ←module.direct_limit.of_f,
work_on_goal 2 { show _ ≤ i, begin
erw submodule.span_le,
intros r hr,
rw set.mem_singleton_iff at hr,
rw subtype.coe_mk at hr,
rw hr,
exact z.2,
end, },
rw submodule.of_le_apply,
simp_rw subtype.coe_mk,
congr' 1,
ext1,
refl,
end
@[simps] def iso_as_direct_limit :
I ≃ₗ[R] I.as_direct_limit :=
{ to_fun := I.to_as_direct_limit,
map_add' := map_add _,
map_smul' := map_smul _,
inv_fun := I.from_as_direct_limit,
left_inv := I.from_to_as_direct_limit,
right_inv := I.to_from_as_direct_limit }
-- instance hmmm2 : module R (I.as_direct_limit ⊗[R] M) := tensor_product.left_module
@[simps] def tensor_iso_direct_limit :
I ⊗[R] M ≃ₗ[R] I.as_direct_limit ⊗[R] M :=
{ inv_fun := (tensor_product.map I.from_as_direct_limit linear_map.id :
I.as_direct_limit ⊗[R] M →ₗ[R] I ⊗[R] M),
left_inv := λ z,
begin
simp only [linear_map.to_fun_eq_coe],
rw ←linear_map.comp_apply,
rw ←tensor_product.map_comp,
rw linear_map.comp_id,
convert linear_map.id_apply _,
convert tensor_product.map_id,
ext1 z,
rw linear_map.comp_apply,
rw I.from_to_as_direct_limit,
rw linear_map.id_apply,
end,
right_inv := λ z,
begin
simp only [linear_map.to_fun_eq_coe],
rw ←linear_map.comp_apply,
rw ←tensor_product.map_comp,
rw linear_map.comp_id,
convert linear_map.id_apply _,
convert tensor_product.map_id,
refine linear_map.ext (λ z, _),
rw linear_map.comp_apply,
rw I.to_from_as_direct_limit,
rw linear_map.id_apply,
end,
..(tensor_product.map I.to_as_direct_limit linear_map.id :
I ⊗[R] M →ₗ[R] I.as_direct_limit ⊗[R] M) }
@[reducible]
def as_direct_limit_tensor :=
module.direct_limit (λ (i : fg_subideal I), i.to_ideal ⊗[R] M)
(λ i j hij, tensor_product.map (submodule.of_le hij) linear_map.id)
@[reducible]
def iso_as_direct_limit_tensor_aux1 :
I.as_direct_limit_tensor M ≃ₗ[R] I.as_direct_limit ⊗[R] M :=
@module.direct_limit_of_tensor_product_iso_tensor_product_with_direct_limit R _
(fg_subideal I) _ _ (λ i, i.to_ideal) _ _ (λ _ _ h, submodule.of_le h) M _ _ _ _
end ideal
@[reducible]
def tensor_embedding' :
module.direct_limit (λ (i : fg_subideal I), (i.to_ideal ⊗[R] M))
(λ i j hij, tensor_product.map (submodule.of_le hij) linear_map.id :
Π (i j : fg_subideal I) (hij : i ≤ j), (i.to_ideal ⊗[R] M) →ₗ[R] (j.to_ideal ⊗[R] M)) →ₗ[R]
R ⊗[R] M :=
module.direct_limit.lift _ _ _ _
(λ i, Module.tensor_embedding M i.to_ideal) $ λ i j hij z,
begin
induction z using tensor_product.induction_on with ii m x y hx hy,
{ simp only [map_zero] },
{ simp only [tensor_product.map_tmul, linear_map.coe_mk, submodule.of_le_apply,
linear_map.id_apply, subtype.coe_mk], },
{ simp only [map_add, hx, hy] },
end
lemma tensor_embedding_eq :
(Module.tensor_embedding M I : I ⊗[R] M →ₗ[R] R ⊗[R] M) =
linear_map.comp (tensor_embedding' M I)
(linear_map.comp (I.iso_as_direct_limit_tensor_aux1 M).symm.to_linear_map
((I.tensor_iso_direct_limit M).to_linear_map)) :=
linear_map.ext $ λ z, begin
induction z using tensor_product.induction_on with i m x y hx hy,
{ simp only [map_zero] },
{ simp only [tensor_product.map_tmul, linear_map.comp_apply, linear_map.coe_mk, id,
linear_equiv.coe_to_linear_map, ideal.tensor_iso_direct_limit_apply,
module.direct_limit_of_tensor_product_iso_tensor_product_with_direct_limit_symm_apply,
linear_map.to_fun_eq_coe, ideal.to_as_direct_limit_apply, module.direct_limit.lift_of,
tensor_product.lift.tmul, linear_map.id_apply, subtype.coe_mk], },
{ simp only [map_add, hx, hy] }
end
lemma tensor_embedding_inj_of_fg_inj
(hinj : ∀ (I : ideal R), I.fg → function.injective (Module.tensor_embedding M I)) :
function.injective $ Module.tensor_embedding M I :=
begin
rw tensor_embedding_eq,
refine function.injective.comp _ (function.injective.comp (function.injective.comp _ _) _),
{ refine module.lift_inj R (fg_subideal I) _ _ _ _ _,
exact λ i, hinj i.to_ideal i.fg, },
{ exact linear_equiv.injective _, },
{ exact linear_equiv.injective _, },
{ exact function.injective_id, },
end