forked from leanprover-community/mathlib4
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOpposite.lean
More file actions
484 lines (392 loc) · 18.1 KB
/
Copy pathOpposite.lean
File metadata and controls
484 lines (392 loc) · 18.1 KB
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
480
481
482
483
484
/-
Copyright (c) 2022 Amelia Livingston. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin, Amelia Livingston, Joël Riou
-/
module
public import Mathlib.CategoryTheory.Abelian.Opposite
public import Mathlib.Algebra.Homology.Additive
public import Mathlib.Algebra.Homology.ImageToKernel
public import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex
public import Mathlib.Algebra.Homology.QuasiIso
/-!
# Opposite categories of complexes
Given a preadditive category `V`, the opposite of its category of chain complexes is equivalent to
the category of cochain complexes of objects in `Vᵒᵖ`. We define this equivalence, and another
analogous equivalence (for a general category of homological complexes with a general
complex shape).
We then show that when `V` is abelian, if `C` is a homological complex, then the homology of
`op(C)` is isomorphic to `op` of the homology of `C` (and the analogous result for `unop`).
## Implementation notes
It is convenient to define both `op` and `opSymm`; this is because given a complex shape `c`,
`c.symm.symm` is not defeq to `c`.
## Tags
opposite, chain complex, cochain complex, homology, cohomology, homological complex
-/
@[expose] public section
noncomputable section
open Opposite CategoryTheory CategoryTheory.Limits
section
variable {V : Type*} [Category* V] [Abelian V]
theorem imageToKernel_op {X Y Z : V} (f : X ⟶ Y) (g : Y ⟶ Z) (w : f ≫ g = 0) :
imageToKernel g.op f.op (by rw [← op_comp, w, op_zero]) =
(imageSubobjectIso _ ≪≫ (imageOpOp _).symm).hom ≫
(cokernel.desc f (factorThruImage g)
(by rw [← cancel_mono (image.ι g), Category.assoc, image.fac, w, zero_comp])).op ≫
(kernelSubobjectIso _ ≪≫ kernelOpOp _).inv := by
ext
simp only [Iso.trans_hom, Iso.symm_hom, Iso.trans_inv, kernelOpOp_inv, Category.assoc,
imageToKernel_arrow, kernelSubobject_arrow', kernel.lift_ι, ← op_comp, cokernel.π_desc,
← imageSubobject_arrow, ← imageUnopOp_inv_comp_op_factorThruImage g.op]
rfl
theorem imageToKernel_unop {X Y Z : Vᵒᵖ} (f : X ⟶ Y) (g : Y ⟶ Z) (w : f ≫ g = 0) :
imageToKernel g.unop f.unop (by rw [← unop_comp, w, unop_zero]) =
(imageSubobjectIso _ ≪≫ (imageUnopUnop _).symm).hom ≫
(cokernel.desc f (factorThruImage g)
(by rw [← cancel_mono (image.ι g), Category.assoc, image.fac, w, zero_comp])).unop ≫
(kernelSubobjectIso _ ≪≫ kernelUnopUnop _).inv := by
ext
dsimp only [imageUnopUnop]
simp only [Iso.trans_hom, Iso.symm_hom, Iso.trans_inv, kernelUnopUnop_inv, Category.assoc,
imageToKernel_arrow, kernelSubobject_arrow', kernel.lift_ι, cokernel.π_desc, Iso.unop_inv,
← unop_comp, factorThruImage_comp_imageUnopOp_inv, Quiver.Hom.unop_op, imageSubobject_arrow]
end
namespace HomologicalComplex
variable {ι V : Type*} [Category* V] {c : ComplexShape ι}
section
variable [HasZeroMorphisms V]
/-- Sends a complex `X` with objects in `V` to the corresponding complex with objects in `Vᵒᵖ`. -/
@[simps]
protected def op (X : HomologicalComplex V c) : HomologicalComplex Vᵒᵖ c.symm where
X i := op (X.X i)
d i j := (X.d j i).op
shape i j hij := by rw [X.shape j i hij, op_zero]
d_comp_d' _ _ _ _ _ := by rw [← op_comp, X.d_comp_d, op_zero]
/-- Sends a complex `X` with objects in `V` to the corresponding complex with objects in `Vᵒᵖ`. -/
@[simps]
protected def opSymm (X : HomologicalComplex V c.symm) : HomologicalComplex Vᵒᵖ c where
X i := op (X.X i)
d i j := (X.d j i).op
shape i j hij := by rw [X.shape j i hij, op_zero]
d_comp_d' _ _ _ _ _ := by rw [← op_comp, X.d_comp_d, op_zero]
/-- Sends a complex `X` with objects in `Vᵒᵖ` to the corresponding complex with objects in `V`. -/
@[simps]
protected def unop (X : HomologicalComplex Vᵒᵖ c) : HomologicalComplex V c.symm where
X i := unop (X.X i)
d i j := (X.d j i).unop
shape i j hij := by rw [X.shape j i hij, unop_zero]
d_comp_d' _ _ _ _ _ := by rw [← unop_comp, X.d_comp_d, unop_zero]
/-- Sends a complex `X` with objects in `Vᵒᵖ` to the corresponding complex with objects in `V`. -/
@[simps]
protected def unopSymm (X : HomologicalComplex Vᵒᵖ c.symm) : HomologicalComplex V c where
X i := unop (X.X i)
d i j := (X.d j i).unop
shape i j hij := by rw [X.shape j i hij, unop_zero]
d_comp_d' _ _ _ _ _ := by rw [← unop_comp, X.d_comp_d, unop_zero]
variable (V c)
set_option backward.isDefEq.respectTransparency false in
/-- Auxiliary definition for `opEquivalence`. -/
@[simps]
def opFunctor : (HomologicalComplex V c)ᵒᵖ ⥤ HomologicalComplex Vᵒᵖ c.symm where
obj X := (unop X).op
map f :=
{ f := fun i => (f.unop.f i).op
comm' := fun i j _ => by simp only [op_d, ← op_comp, f.unop.comm] }
set_option backward.isDefEq.respectTransparency false in
/-- Auxiliary definition for `opEquivalence`. -/
@[simps]
def opInverse : HomologicalComplex Vᵒᵖ c.symm ⥤ (HomologicalComplex V c)ᵒᵖ where
obj X := op X.unopSymm
map f := Quiver.Hom.op
{ f := fun i => (f.f i).unop
comm' := fun i j _ => by simp only [unopSymm_d, ← unop_comp, f.comm] }
set_option backward.defeqAttrib.useBackward true in
set_option backward.isDefEq.respectTransparency false in
/-- Auxiliary definition for `opEquivalence`. -/
def opUnitIso : 𝟭 (HomologicalComplex V c)ᵒᵖ ≅ opFunctor V c ⋙ opInverse V c :=
NatIso.ofComponents
(fun X =>
(HomologicalComplex.Hom.isoOfComponents (fun _ => Iso.refl _) fun i j _ => by
simp only [Iso.refl_hom, Category.id_comp, unopSymm_d, op_d, Quiver.Hom.unop_op,
Category.comp_id] :
(Opposite.unop X).op.unopSymm ≅ unop X).op)
(by
intro X Y f
refine Quiver.Hom.unop_inj ?_
ext x
simp)
set_option backward.defeqAttrib.useBackward true in
/-- Auxiliary definition for `opEquivalence`. -/
def opCounitIso : opInverse V c ⋙ opFunctor V c ≅ 𝟭 (HomologicalComplex Vᵒᵖ c.symm) :=
NatIso.ofComponents
fun X => HomologicalComplex.Hom.isoOfComponents fun _ => Iso.refl _
/-- Given a category of complexes with objects in `V`, there is a natural equivalence between its
opposite category and a category of complexes with objects in `Vᵒᵖ`. -/
@[simps]
def opEquivalence : (HomologicalComplex V c)ᵒᵖ ≌ HomologicalComplex Vᵒᵖ c.symm where
functor := opFunctor V c
inverse := opInverse V c
unitIso := opUnitIso V c
counitIso := opCounitIso V c
functor_unitIso_comp X := by
ext
simp only [opUnitIso, opCounitIso, NatIso.ofComponents_hom_app, Iso.op_hom, comp_f,
opFunctor_map_f, Hom.isoOfComponents_hom_f]
exact Category.comp_id _
instance : (opFunctor V c).IsEquivalence := (opEquivalence V c).isEquivalence_functor
instance : (opInverse V c).IsEquivalence := (opEquivalence V c).isEquivalence_inverse
set_option backward.isDefEq.respectTransparency false in
/-- Auxiliary definition for `unopEquivalence`. -/
@[simps]
def unopFunctor : (HomologicalComplex Vᵒᵖ c)ᵒᵖ ⥤ HomologicalComplex V c.symm where
obj X := (unop X).unop
map f :=
{ f := fun i => (f.unop.f i).unop
comm' := fun i j _ => by simp only [unop_d, ← unop_comp, f.unop.comm] }
set_option backward.isDefEq.respectTransparency false in
/-- Auxiliary definition for `unopEquivalence`. -/
@[simps]
def unopInverse : HomologicalComplex V c.symm ⥤ (HomologicalComplex Vᵒᵖ c)ᵒᵖ where
obj X := op X.opSymm
map f := Quiver.Hom.op
{ f := fun i => (f.f i).op
comm' := fun i j _ => by simp only [opSymm_d, ← op_comp, f.comm] }
set_option backward.defeqAttrib.useBackward true in
set_option backward.isDefEq.respectTransparency false in
/-- Auxiliary definition for `unopEquivalence`. -/
def unopUnitIso : 𝟭 (HomologicalComplex Vᵒᵖ c)ᵒᵖ ≅ unopFunctor V c ⋙ unopInverse V c :=
NatIso.ofComponents
(fun X =>
(HomologicalComplex.Hom.isoOfComponents (fun _ => Iso.refl _) fun i j _ => by
simp only [Iso.refl_hom, Category.id_comp, unopSymm_d, op_d, Quiver.Hom.unop_op,
Category.comp_id] :
(Opposite.unop X).op.unopSymm ≅ unop X).op)
(by
intro X Y f
refine Quiver.Hom.unop_inj ?_
ext x
simp)
set_option backward.defeqAttrib.useBackward true in
/-- Auxiliary definition for `unopEquivalence`. -/
def unopCounitIso : unopInverse V c ⋙ unopFunctor V c ≅ 𝟭 (HomologicalComplex V c.symm) :=
NatIso.ofComponents
fun X => HomologicalComplex.Hom.isoOfComponents fun _ => Iso.refl _
/-- Given a category of complexes with objects in `Vᵒᵖ`, there is a natural equivalence between its
opposite category and a category of complexes with objects in `V`. -/
@[simps]
def unopEquivalence : (HomologicalComplex Vᵒᵖ c)ᵒᵖ ≌ HomologicalComplex V c.symm where
functor := unopFunctor V c
inverse := unopInverse V c
unitIso := unopUnitIso V c
counitIso := unopCounitIso V c
functor_unitIso_comp X := by
ext
simp only [comp_f]
exact Category.comp_id _
instance : (unopFunctor V c).IsEquivalence := (unopEquivalence V c).isEquivalence_functor
instance : (unopInverse V c).IsEquivalence := (unopEquivalence V c).isEquivalence_inverse
instance (K : HomologicalComplex V c) (i : ι) [K.HasHomology i] :
K.op.HasHomology i :=
inferInstanceAs <| (K.sc i).op.HasHomology
instance (K : HomologicalComplex Vᵒᵖ c) (i : ι) [K.HasHomology i] :
K.unop.HasHomology i :=
inferInstanceAs <| (K.sc i).unop.HasHomology
set_option backward.defeqAttrib.useBackward true in
instance (K : HomologicalComplex V c) (i : ι) [K.HasHomology i] :
((opFunctor _ _).obj (op K)).HasHomology i := by
dsimp
infer_instance
set_option backward.defeqAttrib.useBackward true in
instance (K : HomologicalComplex Vᵒᵖ c) (i : ι) [K.HasHomology i] :
((unopFunctor _ _).obj (op K)).HasHomology i := by
dsimp
infer_instance
variable {V c}
@[simp]
lemma quasiIsoAt_opFunctor_map_iff
{K L : HomologicalComplex V c} (φ : K ⟶ L) (i : ι)
[K.HasHomology i] [L.HasHomology i] :
QuasiIsoAt ((opFunctor _ _).map φ.op) i ↔ QuasiIsoAt φ i := by
simp only [quasiIsoAt_iff]
exact ShortComplex.quasiIso_opMap_iff ((shortComplexFunctor V c i).map φ)
@[simp]
lemma quasiIsoAt_unopFunctor_map_iff
{K L : HomologicalComplex Vᵒᵖ c} (φ : K ⟶ L) (i : ι)
[K.HasHomology i] [L.HasHomology i] :
QuasiIsoAt ((unopFunctor _ _).map φ.op) i ↔ QuasiIsoAt φ i := by
rw [← quasiIsoAt_opFunctor_map_iff]
rfl
instance {K L : HomologicalComplex V c} (φ : K ⟶ L) (i : ι)
[K.HasHomology i] [L.HasHomology i] [QuasiIsoAt φ i] :
QuasiIsoAt ((opFunctor _ _).map φ.op) i := by
rw [quasiIsoAt_opFunctor_map_iff]
infer_instance
instance {K L : HomologicalComplex Vᵒᵖ c} (φ : K ⟶ L) (i : ι)
[K.HasHomology i] [L.HasHomology i] [QuasiIsoAt φ i] :
QuasiIsoAt ((unopFunctor _ _).map φ.op) i := by
rw [quasiIsoAt_unopFunctor_map_iff]
infer_instance
@[simp]
lemma quasiIso_opFunctor_map_iff
{K L : HomologicalComplex V c} (φ : K ⟶ L)
[∀ i, K.HasHomology i] [∀ i, L.HasHomology i] :
QuasiIso ((opFunctor _ _).map φ.op) ↔ QuasiIso φ := by
simp only [quasiIso_iff, quasiIsoAt_opFunctor_map_iff]
@[simp]
lemma quasiIso_unopFunctor_map_iff
{K L : HomologicalComplex Vᵒᵖ c} (φ : K ⟶ L)
[∀ i, K.HasHomology i] [∀ i, L.HasHomology i] :
QuasiIso ((unopFunctor _ _).map φ.op) ↔ QuasiIso φ := by
simp only [quasiIso_iff, quasiIsoAt_unopFunctor_map_iff]
instance {K L : HomologicalComplex V c} (φ : K ⟶ L)
[∀ i, K.HasHomology i] [∀ i, L.HasHomology i] [QuasiIso φ] :
QuasiIso ((opFunctor _ _).map φ.op) := by
rw [quasiIso_opFunctor_map_iff]
infer_instance
instance {K L : HomologicalComplex Vᵒᵖ c} (φ : K ⟶ L)
[∀ i, K.HasHomology i] [∀ i, L.HasHomology i] [QuasiIso φ] :
QuasiIso ((unopFunctor _ _).map φ.op) := by
rw [quasiIso_unopFunctor_map_iff]
infer_instance
lemma ExactAt.op {K : HomologicalComplex V c} {i : ι} (h : K.ExactAt i) :
K.op.ExactAt i :=
ShortComplex.Exact.op h
lemma ExactAt.unop {K : HomologicalComplex Vᵒᵖ c} {i : ι} (h : K.ExactAt i) :
K.unop.ExactAt i :=
ShortComplex.Exact.unop h
@[simp]
lemma exactAt_op_iff (K : HomologicalComplex V c) {i : ι} :
K.op.ExactAt i ↔ K.ExactAt i :=
⟨fun h ↦ h.unop, fun h ↦ h.op⟩
lemma Acyclic.op {K : HomologicalComplex V c} (h : K.Acyclic) :
K.op.Acyclic :=
fun i ↦ (h i).op
lemma Acyclic.unop {K : HomologicalComplex Vᵒᵖ c} (h : K.Acyclic) :
K.unop.Acyclic :=
fun i ↦ (h i).unop
@[simp]
lemma acyclic_op_iff (K : HomologicalComplex V c) :
K.op.Acyclic ↔ K.Acyclic :=
⟨fun h ↦ h.unop, fun h ↦ h.op⟩
/-- If `K` is a homological complex, then the homology of `K.op` identifies to
the opposite of the homology of `K`. -/
def homologyOp (K : HomologicalComplex V c) (i : ι) [K.HasHomology i] :
K.op.homology i ≅ op (K.homology i) :=
(K.sc i).homologyOpIso
/-- If `K` is a homological complex in the opposite category,
then the homology of `K.unop` identifies to the opposite of the homology of `K`. -/
def homologyUnop (K : HomologicalComplex Vᵒᵖ c) (i : ι) [K.HasHomology i] :
K.unop.homology i ≅ unop (K.homology i) :=
(K.unop.homologyOp i).unop
section
variable (K : HomologicalComplex V c) (i : ι) [K.HasHomology i]
/-- The canonical isomorphism `K.op.cycles i ≅ op (K.opcycles i)`. -/
def cyclesOpIso : K.op.cycles i ≅ op (K.opcycles i) :=
(K.sc i).cyclesOpIso
/-- The canonical isomorphism `K.op.opcycles i ≅ op (K.cycles i)`. -/
def opcyclesOpIso : K.op.opcycles i ≅ op (K.cycles i) :=
(K.sc i).opcyclesOpIso
variable (j : ι)
set_option backward.isDefEq.respectTransparency false in
@[reassoc (attr := simp)]
lemma opcyclesOpIso_hom_toCycles_op :
(K.opcyclesOpIso i).hom ≫ (K.toCycles j i).op = K.op.fromOpcycles i j := by
by_cases hij : c.Rel j i
· obtain rfl := c.prev_eq' hij
exact (K.sc i).opcyclesOpIso_hom_toCycles_op
· rw [K.toCycles_eq_zero hij, K.op.fromOpcycles_eq_zero hij, op_zero, comp_zero]
set_option backward.isDefEq.respectTransparency false in
@[reassoc (attr := simp)]
lemma fromOpcycles_op_cyclesOpIso_inv :
(K.fromOpcycles i j).op ≫ (K.cyclesOpIso i).inv = K.op.toCycles j i := by
by_cases hij : c.Rel i j
· obtain rfl := c.next_eq' hij
exact (K.sc i).fromOpcycles_op_cyclesOpIso_inv
· rw [K.op.toCycles_eq_zero hij, K.fromOpcycles_eq_zero hij, op_zero, zero_comp]
end
section
variable {K L : HomologicalComplex V c} (φ : K ⟶ L) (i : ι)
[K.HasHomology i] [L.HasHomology i]
@[reassoc]
lemma homologyOp_hom_naturality :
homologyMap ((opFunctor _ _).map φ.op) _ ≫ (K.homologyOp i).hom =
(L.homologyOp i).hom ≫ (homologyMap φ i).op :=
ShortComplex.homologyOpIso_hom_naturality ((shortComplexFunctor V c i).map φ)
@[reassoc]
lemma opcyclesOpIso_hom_naturality :
opcyclesMap ((opFunctor _ _).map φ.op) _ ≫ (K.opcyclesOpIso i).hom =
(L.opcyclesOpIso i).hom ≫ (cyclesMap φ i).op :=
ShortComplex.opcyclesOpIso_hom_naturality ((shortComplexFunctor V c i).map φ)
set_option backward.isDefEq.respectTransparency false in -- This is needed in Algebra/Homology/Embedding/TruncLE.lean
@[reassoc]
lemma opcyclesOpIso_inv_naturality :
(cyclesMap φ i).op ≫ (K.opcyclesOpIso i).inv =
(L.opcyclesOpIso i).inv ≫ opcyclesMap ((opFunctor _ _).map φ.op) _ :=
ShortComplex.opcyclesOpIso_inv_naturality ((shortComplexFunctor V c i).map φ)
@[reassoc]
lemma cyclesOpIso_hom_naturality :
cyclesMap ((opFunctor _ _).map φ.op) _ ≫ (K.cyclesOpIso i).hom =
(L.cyclesOpIso i).hom ≫ (opcyclesMap φ i).op :=
ShortComplex.cyclesOpIso_hom_naturality ((shortComplexFunctor V c i).map φ)
@[reassoc]
lemma cyclesOpIso_inv_naturality :
(opcyclesMap φ i).op ≫ (K.cyclesOpIso i).inv =
(L.cyclesOpIso i).inv ≫ cyclesMap ((opFunctor _ _).map φ.op) _ :=
ShortComplex.cyclesOpIso_inv_naturality ((shortComplexFunctor V c i).map φ)
end
section
variable (V c) [CategoryWithHomology V] (i : ι)
/-- The natural isomorphism `K.op.cycles i ≅ op (K.opcycles i)`. -/
@[simps!]
def cyclesOpNatIso :
opFunctor V c ⋙ cyclesFunctor Vᵒᵖ c.symm i ≅ (opcyclesFunctor V c i).op :=
NatIso.ofComponents (fun K ↦ (unop K).cyclesOpIso i)
(fun _ ↦ cyclesOpIso_hom_naturality _ _)
/-- The natural isomorphism `K.op.opcycles i ≅ op (K.cycles i)`. -/
def opcyclesOpNatIso :
opFunctor V c ⋙ opcyclesFunctor Vᵒᵖ c.symm i ≅ (cyclesFunctor V c i).op :=
NatIso.ofComponents (fun K ↦ (unop K).opcyclesOpIso i)
(fun _ ↦ opcyclesOpIso_hom_naturality _ _)
/-- The natural isomorphism `K.op.homology i ≅ op (K.homology i)`. -/
def homologyOpNatIso :
opFunctor V c ⋙ homologyFunctor Vᵒᵖ c.symm i ≅ (homologyFunctor V c i).op :=
NatIso.ofComponents (fun K ↦ (unop K).homologyOp i)
(fun _ ↦ homologyOp_hom_naturality _ _)
end
end
section
variable [Preadditive V]
example : Preadditive (HomologicalComplex Vᵒᵖ c) := inferInstance
instance opFunctor_additive : (@opFunctor ι V _ c _).Additive where
instance unopFunctor_additive : (@unopFunctor ι V _ c _).Additive where
end
end HomologicalComplex
namespace Homotopy
open HomologicalComplex
variable {V : Type*} [Category* V] {ι : Type*} {c : ComplexShape ι} [Preadditive V]
set_option backward.defeqAttrib.useBackward true in
/-- The opposite of a homotopy between morphisms of homological complexes. -/
@[simps]
def op {F G : HomologicalComplex V c} {φ₁ φ₂ : F ⟶ G} (h : Homotopy φ₁ φ₂) :
Homotopy ((opFunctor V c).map φ₁.op) ((opFunctor V c).map φ₂.op) where
hom i j := (h.hom j i).op
zero i j hij := Quiver.Hom.unop_inj (h.zero _ _ hij)
comm n := Quiver.Hom.unop_inj (by
dsimp
rw [h.comm n]
nth_rw 2 [add_comm]
rfl)
set_option backward.defeqAttrib.useBackward true in
/-- The homotopy between morphisms of homological complexes that is deduced
from a homotopy in the opposite category. -/
@[simps]
def unop {F G : HomologicalComplex Vᵒᵖ c} {φ₁ φ₂ : F ⟶ G} (h : Homotopy φ₁ φ₂) :
Homotopy ((unopFunctor V c).map φ₁.op) ((unopFunctor V c).map φ₂.op) where
hom i j := (h.hom j i).unop
zero i j hij := Quiver.Hom.op_inj (h.zero _ _ hij)
comm n := Quiver.Hom.op_inj (by
dsimp
rw [h.comm n]
nth_rw 2 [add_comm]
rfl)
end Homotopy