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
/
Copy pathadjunction_general.lean
479 lines (410 loc) Β· 19.2 KB
/
adjunction_general.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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
import algebra.category.Module.basic
import linear_algebra.tensor_product
import linear_algebra.finsupp
import category_theory.adjunction.limits
import category_theory.limits.preserves.limits
-- import .hom
open_locale tensor_product
open tensor_product
universes u u' v
variables (R : Type u) (S : Type u') [comm_ring R] [comm_ring S]
variables (X : Type v) [add_comm_group X] [module R X] [module S X]
class bimodule :=
(smul_comm' [] : β (r : R) (s : S) (x : X), r β’ s β’ x = s β’ r β’ x)
section bimodule
variables {R S X}
lemma bimodule.smul_comm [bimodule R S X] (r : R) (s : S) (x : X) :
r β’ s β’ x = s β’ r β’ x :=
bimodule.smul_comm' r s x
instance bimodule.int (X' : Type v) [add_comm_group X'] [module R X'] :
bimodule R β€ X' :=
{ smul_comm' := Ξ» r z x',
begin
induction z using int.induction_on with n hn n hn,
{ simp, },
{ simpa [add_smul, smul_add] using hn, },
{ simpa [sub_smul, smul_sub] using hn, },
end }
instance bimodule.symm [bimodule R S X] : bimodule S R X :=
{ smul_comm' := Ξ» s r x, (bimodule.smul_comm r s x).symm }
end bimodule
section tensor_bimodule
variable [bimodule R S X]
variables (Y : Type v) [add_comm_group Y] [module R Y]
@[simps]
def tensor_bimodule.smul_aux (s : S) : Y ββ[R] X ββ[R] Y β[R] X :=
{ to_fun := Ξ» y,
{ to_fun := Ξ» x, y ββ (s β’ x),
map_add' := Ξ» x x', by rw [smul_add, tmul_add],
map_smul' := Ξ» r x, by rw [ring_hom.id_apply, smul_tmul', smul_tmul,
bimodule.smul_comm] },
map_add' := Ξ» y y', linear_map.ext $ Ξ» x, by simp [linear_map.add_apply,
add_tmul],
map_smul' := Ξ» r y, linear_map.ext $ Ξ» x, by simp [smul_tmul, tmul_smul] }
@[simps]
def tensor_bimodule.smul (s : S) : (Y β[R] X) ββ[R] (Y β[R] X) :=
tensor_product.lift $ tensor_bimodule.smul_aux _ _ _ _ s
instance tensor_product.bimodule.has_smul : has_smul S (Y β[R] X) :=
{ smul := Ξ» s, tensor_bimodule.smul R S X Y s }
section
variables {R S X Y}
lemma tensor_bimodule.smul_def (s : S) (z : Y β[R] X) :
s β’ z = tensor_bimodule.smul _ _ _ _ s z := rfl
lemma tensor_bimodule.smul_tmul (s : S) (y : Y) (x : X) :
s β’ (y ββ x : _ β[R] _) = y ββ (s β’ x) := rfl
end
@[priority 100]
instance tensor_product.bimodule : module S (Y β[R] X) :=
{ smul := (β’),
one_smul := Ξ» z,
begin
induction z using tensor_product.induction_on with _ _ a b ha hb,
{ rw [tensor_bimodule.smul_def, map_zero], },
{ rw [tensor_bimodule.smul_tmul, one_smul], },
{ rw [tensor_bimodule.smul_def] at ha hb β’,
rw [map_add, ha, hb], },
end,
mul_smul := Ξ» s s' z,
begin
induction z using tensor_product.induction_on with y x a b ha hb,
{ simp only [tensor_bimodule.smul_def, map_zero], },
{ repeat { rw [tensor_bimodule.smul_tmul] },
rw [mul_smul] },
{ repeat { rw [tensor_bimodule.smul_def] at ha hb β’ },
rw [map_add, ha, hb, map_add, map_add], },
end,
smul_zero := Ξ» s, by { rw [tensor_bimodule.smul_def, map_zero] },
smul_add := Ξ» _ _ _, by { simp only [tensor_bimodule.smul_def, map_add] },
add_smul := Ξ» s s' z,
begin
induction z using tensor_product.induction_on with y x a b ha hb,
{ simp only [tensor_bimodule.smul_def, map_zero, zero_add], },
{ repeat { rw [tensor_bimodule.smul_tmul] },
rw [add_smul, tmul_add], },
{ repeat { rw [tensor_bimodule.smul_def] at ha hb β’, },
simp only [map_add, ha, hb],
abel, },
end,
zero_smul := Ξ» z,
begin
induction z using tensor_product.induction_on with y x a b ha hb,
{ simp only [tensor_bimodule.smul_def, map_zero], },
{ repeat { rw [tensor_bimodule.smul_tmul] },
rw [zero_smul, tmul_zero], },
{ repeat { rw [tensor_bimodule.smul_def] at ha hb β’, },
simp only [map_add, ha, hb, add_zero], },
end }
end tensor_bimodule
section bimodule_hom
variable [bimodule R S X]
variables (Z : Type v) [add_comm_group Z] [module S Z]
section
variables {R S X Z}
@[simps] def bimodule_hom.smul (r : R) (l : X ββ[S] Z) : X ββ[S] Z :=
{ to_fun := Ξ» x, l (r β’ x),
map_add' := Ξ» _ _, by rw [smul_add, map_add],
map_smul' := Ξ» s x, by rw [bimodule.smul_comm, map_smul,
ring_hom.id_apply] }
end
instance bimodule_hom.has_smul : has_smul R (X ββ[S] Z) :=
{ smul := bimodule_hom.smul }
lemma bimodule_hom.smul_def (r : R) (l : X ββ[S] Z) :
r β’ l = bimodule_hom.smul r l := rfl
instance bimodule_hom : module R (X ββ[S] Z) :=
{ smul := (β’),
one_smul := Ξ» l, linear_map.ext $ Ξ» x,
by simp only [bimodule_hom.smul_def, bimodule_hom.smul_apply, one_smul],
mul_smul := Ξ» r r' l, linear_map.ext $ Ξ» x,
begin
simp only [bimodule_hom.smul_def, bimodule_hom.smul_apply, one_smul, mul_smul],
rw smul_comm,
end,
smul_zero := Ξ» r, linear_map.ext $ Ξ» x,
by simp only [bimodule_hom.smul_def, bimodule_hom.smul_apply, linear_map.zero_apply],
smul_add := Ξ» r l l', linear_map.ext $ Ξ» x,
by simp only [bimodule_hom.smul_def, bimodule_hom.smul_apply, linear_map.add_apply],
add_smul := Ξ» r r' l, linear_map.ext $ Ξ» x,
by simp only [bimodule_hom.smul_def, bimodule_hom.smul_apply, add_smul, map_add,
linear_map.add_apply],
zero_smul := Ξ» l, linear_map.ext $ Ξ» x,
by simp only [bimodule_hom.smul_def, bimodule_hom.smul_apply, linear_map.zero_apply,
zero_smul, map_zero], }
end bimodule_hom
namespace Module
@[simps]
def tensor_functor [bimodule R S X] : Module.{v} R β₯€ Module.{v} S :=
{ obj := Ξ» Y, Module.of S (Y β[R] X),
map := Ξ» Y Y' l,
{ to_fun := tensor_product.map l linear_map.id,
map_add' := Ξ» z z', by rw [map_add],
map_smul' := Ξ» s (z : Y β[R] X),
begin
induction z using tensor_product.induction_on with y x a b ha hb,
{ rw [smul_zero, map_zero, smul_zero], },
{ rw [tensor_bimodule.smul_tmul, map_tmul, linear_map.id_apply, map_tmul, ring_hom.id_apply,
linear_map.id_apply, tensor_bimodule.smul_tmul], },
{ rw [smul_add, map_add, ha, hb, map_add, smul_add], },
end },
map_id' := Ξ» Y, linear_map.ext $ Ξ» z,
begin
simp only [linear_map.coe_mk, id_apply],
erw [map_id, linear_map.id_apply],
end,
map_comp' := Ξ» Y Y' Y'' l l', linear_map.ext $ Ξ» z,
begin
simp only [linear_map.coe_mk, coe_comp, function.comp_app],
induction z using tensor_product.induction_on with _ _ a b ha hb,
{ simp only [map_zero], },
{ simp only [tensor_product.map_tmul, linear_map.id_apply, category_theory.comp_apply] },
{ rw [map_add, ha, hb, map_add, map_add], }
end }
@[simps]
def hom_functor [bimodule R S X] : Module.{v} S β₯€ Module R :=
{ obj := Ξ» Z, Module.of R $ X ββ[S] Z,
map := Ξ» Z Z' (l : Z ββ[S] Z'),
{ to_fun := l.comp,
map_add' := Ξ» z z', by rw linear_map.comp_add,
map_smul' := Ξ» r f, linear_map.ext $ Ξ» x, rfl },
map_id' := Ξ» Z,
by { ext l x, simp only [linear_map.coe_mk, linear_map.comp_apply, id_apply] },
map_comp' := Ξ» Z Z' Z'' (l : Z ββ[S] Z') (l' : Z' ββ[S] Z''),
linear_map.ext $ Ξ» (l'' : X ββ[S] Z), linear_map.ext $ Ξ» x, by simp, }
end Module
namespace Module
variables (R' : Type u) (S' : Type u') [comm_ring R'] [comm_ring S']
variables (X' : Type v) [add_comm_group X'] [module R' X'] [module S' X'] [bimodule R' S' X']
namespace tensor_hom_adjunction
@[simps]
def hom_equiv.to_fun' {Y : Module.{v} R'} {Z : Module.{v} S'} (l : Y β[R'] X' ββ[S'] Z) :
(Y βΆ (hom_functor R' S' X').obj Z) :=
{ to_fun := Ξ» y,
{ to_fun := Ξ» x, l (y ββ x),
map_add' := Ξ» x x', by rw [tmul_add, map_add],
map_smul' := Ξ» s x, by rw [ring_hom.id_apply, βmap_smul, tensor_bimodule.smul_tmul] },
map_add' := Ξ» y y', linear_map.ext $ Ξ» x, by simp [add_tmul, map_add],
map_smul' := Ξ» r y, linear_map.ext $ Ξ» x,by simp [bimodule_hom.smul_def,
bimodule_hom.smul_apply, smul_tmul], }
@[simps]
def hom_equiv.inv_fun' {Y : Module.{v} R'} {Z : Module.{v} S'} (l : Y ββ[R'] (X' ββ[S'] Z)) :
((tensor_functor R' S' X').obj Y βΆ Z) :=
{ to_fun := (add_con_gen _).lift (free_add_monoid.lift $ show Y Γ X' β Z, from Ξ» p, l p.1 p.2) $
add_con.add_con_gen_le $ Ξ» p p' (h : eqv R' Y X' p p'),
show (free_add_monoid.lift $ show Y Γ X' β Z, from Ξ» p, l p.1 p.2) p
= (free_add_monoid.lift $ show Y Γ X' β Z, from Ξ» p, l p.1 p.2) p',
from match p, p', h with
| _, _, (eqv.of_zero_left n) := by simp only [free_add_monoid.lift_eval_of, map_zero,
linear_map.zero_apply]
| _, _, (eqv.of_zero_right m) := by simp only [free_add_monoid.lift_eval_of, map_zero]
| _, _, (eqv.of_add_left mβ mβ n) := by simp only [map_add, free_add_monoid.lift_eval_of,
linear_map.add_apply]
| _, _, (eqv.of_add_right m nβ nβ) := by simp only [map_add, free_add_monoid.lift_eval_of]
| _, _, (eqv.of_smul r m n) := by simp only [free_add_monoid.lift_eval_of, map_smul,
bimodule_hom.smul_def, bimodule_hom.smul_apply]
| _, _, (eqv.add_comm x y) := by simpa only [map_add, free_add_monoid.lift_eval_of]
using add_comm _ _
end,
map_add' := Ξ» _ _, by rw map_add,
map_smul' := Ξ» s (z : Y β[R'] X'),
begin
induction z using tensor_product.induction_on with y x a b ha hb,
{ rw [smul_zero, map_zero, smul_zero], },
{ rw [tensor_bimodule.smul_tmul, tmul, add_con.coe_mk', add_con.lift_coe,
free_add_monoid.lift_eval_of, ring_hom.id_apply, tmul, add_con.coe_mk', add_con.lift_coe,
free_add_monoid.lift_eval_of],
simp only [map_smul], },
{ rw [smul_add, map_add, ha, hb, map_add, smul_add], }
end }
@[simps]
def hom_equiv (Y : Module.{v} R') (Z : Module.{v} S') :
((tensor_functor R' S' X').obj Y βΆ Z) β (Y βΆ (hom_functor R' S' X').obj Z) :=
{ to_fun := hom_equiv.to_fun' R' S' X',
inv_fun := hom_equiv.inv_fun' R' S' X',
left_inv := Ξ» l, linear_map.ext $ Ξ» (p : Y β[R'] X'),
begin
simp only [hom_equiv.to_fun'_apply_apply, hom_equiv.inv_fun'_apply],
induction p using tensor_product.induction_on with y x a b ha hb,
{ rw [map_zero, map_zero], },
{ conv_lhs { rw [tmul, add_con.coe_mk', add_con.lift_coe, free_add_monoid.lift_eval_of] }, },
{ conv_lhs { rw [map_add, ha, hb, βmap_add], } }
end,
right_inv := Ξ» (l : Y ββ[R'] (X'ββ[S'] Z)), linear_map.ext $ Ξ» y, linear_map.ext $ Ξ» x,
begin
simp only [hom_equiv.to_fun'_apply_apply, hom_equiv.inv_fun'_apply],
conv_lhs { rw [tmul, add_con.coe_mk', add_con.lift_coe, free_add_monoid.lift_eval_of] },
end }
@[simps]
def unit : π (Module R') βΆ tensor_functor R' S' X' β hom_functor R' S' X' :=
{ app := Ξ» Y, show Y ββ[R'] (X' ββ[S'] (Y β[R'] X')), from
{ to_fun := Ξ» y,
{ to_fun := Ξ» x, y ββ x,
map_add' := Ξ» x x', by rw tmul_add,
map_smul' := Ξ» s x, by rw [ring_hom.id_apply]; refl },
map_add' := Ξ» y y', linear_map.ext $ Ξ» x, by simp only [linear_map.coe_mk, add_tmul,
linear_map.add_apply],
map_smul' := Ξ» r y, linear_map.ext $ Ξ» x, by simp only [linear_map.coe_mk, linear_map.smul_apply,
bimodule_hom.smul_def, bimodule_hom.smul_apply, ring_hom.id_apply, smul_tmul], },
naturality' := Ξ» Y Y' (l : Y ββ[R'] Y'), linear_map.ext $ Ξ» (y : Y), linear_map.ext $ Ξ» x,
begin
simp only [category_theory.comp_apply, linear_map.coe_mk, category_theory.functor.id_map,
category_theory.functor.comp_map, hom_functor_map_apply, linear_map.comp_apply,
tensor_functor_map_apply, map_tmul, linear_map.id_coe, id.def],
end }
@[simps] def counit : hom_functor R' S' X' β tensor_functor R' S' X' βΆ π (Module S') :=
{ app := Ξ» Z, show ((X' ββ[S'] Z) β[R'] X') ββ[S'] Z, from
{ to_fun := (add_con_gen _).lift (free_add_monoid.lift $ Ξ» (p : (X' ββ[S'] β₯Z) Γ X'), p.1 p.2) $
add_con.add_con_gen_le $ Ξ» p p' (h : eqv R' (X' ββ[S'] Z) X' p p'),
show (free_add_monoid.lift $ Ξ» (p : (X' ββ[S'] β₯Z) Γ X'), p.1 p.2) p =
(free_add_monoid.lift $ Ξ» (p : (X' ββ[S'] β₯Z) Γ X'), p.1 p.2) p',
from match p, p', h with
| _, _, (eqv.of_zero_left n) := by simp only [free_add_monoid.lift_eval_of, map_zero,
linear_map.zero_apply]
| _, _, (eqv.of_zero_right m) := by simp only [free_add_monoid.lift_eval_of, map_zero]
| _, _, (eqv.of_add_left mβ mβ n) := by simp only [map_add, free_add_monoid.lift_eval_of,
linear_map.add_apply]
| _, _, (eqv.of_add_right m nβ nβ) := by simp only [map_add, free_add_monoid.lift_eval_of]
| _, _, (eqv.of_smul r m n) := by simp only [free_add_monoid.lift_eval_of, map_smul,
bimodule_hom.smul_def, bimodule_hom.smul_apply]
| _, _, (eqv.add_comm x y) := by simpa only [map_add, free_add_monoid.lift_eval_of]
using add_comm _ _
end,
map_add' := Ξ» p p', by rw map_add,
map_smul' :=
begin
rintros s p,
induction p using tensor_product.induction_on with l x a b ha hb,
{ simp only [map_zero, smul_zero], },
{ rw [tensor_bimodule.smul_tmul, tmul, add_con.coe_mk', add_con.lift_coe,
free_add_monoid.lift_eval_of, ring_hom.id_apply, tmul, add_con.coe_mk', add_con.lift_coe,
free_add_monoid.lift_eval_of, linear_map.map_smul], },
{ rw [smul_add, map_add, ha, hb, map_add, smul_add] }
end },
naturality' := Ξ» Z Z' (l : Z ββ[S'] Z'), linear_map.ext $ Ξ» (p : (X' ββ[S'] Z) β[R'] X'),
begin
induction p using tensor_product.induction_on with l' x a b ha hb,
{ simp only [map_zero] },
{ simp only [category_theory.comp_apply, linear_map.coe_mk, category_theory.functor.comp_map,
hom_functor_map_apply, tensor_functor_map_apply, tensor_product.map_tmul,
category_theory.functor.id_map, linear_map.id_apply],
simp only [tmul, add_con.coe_mk', add_con.lift_coe, free_add_monoid.lift_eval_of,
linear_map.comp_apply], },
{ rw [map_add, ha, hb, map_add], },
end }
lemma hom_equiv_unit (Y : Module.{v} R') (Z : Module.{v} S') (f) :
hom_equiv R' S' X' Y Z f =
(unit R' S' X').app Y β« (hom_functor R' S' X').map f :=
linear_map.ext $ Ξ» y, linear_map.ext $ Ξ» x, rfl
lemma hom_equiv_counit (Y : Module.{v} R') (Z : Module.{v} S') (g) :
(hom_equiv R' S' X' Y Z).symm g =
(tensor_functor _ _ _).map g β« (counit R' S' X').app Z :=
linear_map.ext $ Ξ» z,
begin
induction z using tensor_product.induction_on with y x a b ha hb,
{ simp only [map_zero] },
{ conv_lhs { rw [hom_equiv_symm_apply, hom_equiv.inv_fun'_apply, tmul, add_con.coe_mk',
add_con.lift_coe, free_add_monoid.lift_eval_of] },
conv_rhs { rw [category_theory.comp_apply, tensor_functor_map_apply, tensor_product.map_tmul,
linear_map.id_apply, counit_app_apply, tmul, add_con.coe_mk', add_con.lift_coe,
free_add_monoid.lift_eval_of] }, },
{ rw [map_add, ha, hb, map_add] },
end
end tensor_hom_adjunction
@[simps]
def tensor_hom_adjunction : (tensor_functor R' S' X') β£ (hom_functor R' S' X') :=
{ hom_equiv := tensor_hom_adjunction.hom_equiv _ _ _,
unit := tensor_hom_adjunction.unit _ _ _,
counit := tensor_hom_adjunction.counit _ _ _,
hom_equiv_unit' := tensor_hom_adjunction.hom_equiv_unit _ _ _,
hom_equiv_counit' := tensor_hom_adjunction.hom_equiv_counit _ _ _ }
section
instance : category_theory.is_left_adjoint (tensor_functor R' S' X') :=
β¨_, tensor_hom_adjunction _ _ _β©
instance : category_theory.is_right_adjoint (hom_functor R' S' X') :=
β¨_, tensor_hom_adjunction _ _ _β©
instance : category_theory.limits.preserves_colimits (tensor_functor R' S' X') :=
category_theory.adjunction.left_adjoint_preserves_colimits (tensor_hom_adjunction R' S' X')
instance : category_theory.limits.preserves_limits (hom_functor R' S' X') :=
category_theory.adjunction.right_adjoint_preserves_limits (tensor_hom_adjunction R' S' X')
instance : category_theory.functor.preserves_epimorphisms (tensor_functor R' S' X') :=
infer_instance
end
end Module
namespace tensor_product
variables (R' : Type u) [comm_ring R']
variables {M N : Type v} [add_comm_group M] [add_comm_group N]
variables [module R' M] [module R' N]
@[simps]
def to_add_comm_group {C : Type v} [add_comm_group C]
(b : M β+ (N β+ C)) (hb : β (r : R') (m : M) (n : N), b (r β’ m) n = b m (r β’ n)) :
(M β[R'] N) β+ C :=
(((@Module.tensor_hom_adjunction R' β€ _ _ N _ _ _ (bimodule.int _)).hom_equiv
(Module.of R' M) (Module.of _ C)).symm
{ to_fun := Ξ» (m : M), add_monoid_hom.to_int_linear_map $ b m,
map_add' := Ξ» (m m' : M), by rw [map_add]; refl,
map_smul' := Ξ» r (m : M), linear_map.ext $ Ξ» n,
by simpa only [add_monoid_hom.coe_to_int_linear_map, ring_hom.id_apply, hb] }).to_add_monoid_hom
lemma to_add_comm_group.apply_tmul {C : Type v} [add_comm_group C]
(b : M β+ (N β+ C)) (hb : β (r : R') (m : M) (n : N), b (r β’ m) n = b m (r β’ n))
(m : M) (n : N) : to_add_comm_group R' b hb (m ββ n) = b m n :=
by rw [to_add_comm_group_apply, tmul, add_con.coe_mk', add_con.lift_coe,
free_add_monoid.lift_eval_of]
lemma to_add_comm_group.uniq {C : Type v} [add_comm_group C]
(b : M β+ (N β+ C)) (hb : β (r : R') (m : M) (n : N), b (r β’ m) n = b m (r β’ n))
(l : (M β[R'] N) β+ C) (hl : β β¦m : Mβ¦ β¦n : Nβ¦, l (m ββ n) = b m n) :
to_add_comm_group R' b hb = l := add_monoid_hom.ext $ Ξ» z,
begin
induction z using tensor_product.induction_on with m n x y hx hy,
{ simp only [map_zero] },
{ rw [to_add_comm_group.apply_tmul, hl], },
{ rw [map_add, hx, hy, map_add] },
end
@[reducible]
def to_add_comm_group' {C : Type v} [add_comm_group C]
(b : M Γ N β C)
(hN0 : β (n : N), b (0, n) = 0)
(hM0 : β (m : M), b (m, 0) = 0)
(hMadd : β (n : N) (m m' : M), b (m + m', n) = b (m, n) + b (m', n))
(hNadd : β (m : M) (n n' : N), b (m, n + n') = b (m, n) + b (m, n'))
(hb : β (r : R') (m : M) (n : N), b ((r β’ m), n) = b (m, (r β’ n))) :
(M β[R'] N) β+ C :=
to_add_comm_group R'
{ to_fun := Ξ» m,
{ to_fun := Ξ» n, b (m, n),
map_zero' := hM0 _,
map_add' := hNadd _ },
map_zero' := add_monoid_hom.ext $ Ξ» n, show b (0, n) = 0, from hN0 _,
map_add' := Ξ» m m', add_monoid_hom.ext $ Ξ» n, show b (m + m', n) = b (m, n) + b (m', n),
from hMadd _ _ _ } $ Ξ» r m n,
show b (r β’ m, n) = b (m, r β’ n), from hb _ _ _
lemma to_add_comm_group'.apply_tmul {C : Type v} [add_comm_group C]
(b : M Γ N β C)
(hN0 : β (n : N), b (0, n) = 0)
(hM0 : β (m : M), b (m, 0) = 0)
(hMadd : β (n : N) (m m' : M), b (m + m', n) = b (m, n) + b (m', n))
(hNadd : β (m : M) (n n' : N), b (m, n + n') = b (m, n) + b (m, n'))
(hb : β (r : R') (m : M) (n : N), b ((r β’ m), n) = b (m, (r β’ n)))
(m : M) (n : N) : to_add_comm_group' R' b hN0 hM0 hMadd hNadd hb (m ββ n) = b (m, n) :=
by rw [to_add_comm_group.apply_tmul]; refl
open_locale big_operators
lemma exists_rep (z : M β[R'] N) :
β {ΞΉ : Type v} (ms : ΞΉ β M) (ns : ΞΉ β N) (s : finset ΞΉ),
z = β i in s, ms i ββ ns i :=
begin
classical,
have EQ := span_tmul_eq_top R' M N,
have mem1 : z β β€ := submodule.mem_top,
rw βEQ at mem1,
rw mem_span_set at mem1,
obtain β¨c, hc1, rflβ© := mem1,
choose m n hm using hc1,
refine β¨M β[R'] N, Ξ» i, if hi : i β c.support then c i β’ m hi else 0,
Ξ» i, if hi : i β c.support then n hi else 0, c.support, _β©,
rw finsupp.sum,
refine finset.sum_congr rfl (Ξ» i hi, _),
split_ifs,
{ specialize hm h,
rw βsmul_tmul',
congr' 1,
exact hm.symm, },
exact false.elim (h hi),
end
end tensor_product