File size: 6,462 Bytes
ae00908
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings
import OAI.Algebra.Finitistic.Rectification.TensorProjection
import OAI.Algebra.Finitistic.Encoding.RelationSequence

namespace OAI
noncomputable section
open scoped TensorProduct
open CategoryTheory
namespace LittleFinitistic.TensorComplex
attribute [local instance] ExternalTensor.rightModule
universe u
variable (k B : Type u) [Field k] [Ring B] [Algebra k B]

abbrev ScalarModule (N : ModuleCat.{u} Bᵐᵒᵖ) :=
  (ModuleCat.restrictScalars (algebraMap k Bᵐᵒᵖ)).obj N

instance scalarTower (N : ModuleCat.{u} Bᵐᵒᵖ) :
    IsScalarTower k Bᵐᵒᵖ (ScalarModule k B N) where
  smul_assoc c b n := by
    change (c • b) • (n : N) = algebraMap k Bᵐᵒᵖ c • (b • (n : N))
    rw [Algebra.smul_def,mul_smul]

variable {k B}
/-- The actual tensor differential, with the original right B-action. -/
def mapRight (M : ModuleCat.{u} k) {N N' : ModuleCat.{u} Bᵐᵒᵖ} (g : N ⟶ N') :
    (M ⊗[k] ScalarModule k B N) →ₗ[Bᵐᵒᵖ] (M ⊗[k] ScalarModule k B N') where
  __ := (TensorProduct.map LinearMap.id
    ((ModuleCat.restrictScalars (algebraMap k Bᵐᵒᵖ)).map g).hom).toAddMonoidHom
  map_smul' c x := by
    induction x using TensorProduct.inductionOn with
    | tmul m n =>
      change TensorProduct.mk k M (ScalarModule k B N') m (g.hom (c • (n : N))) = TensorProduct.mk k M (ScalarModule k B N') m (c • g.hom n)
      exact congrArg (TensorProduct.mk k M (ScalarModule k B N') m) (g.hom.map_smul c (n : N))
    | add x y hx hy => simp_all [smul_add]

@[simp] theorem mapRight_tmul (M : ModuleCat.{u} k) {N N' : ModuleCat.{u} Bᵐᵒᵖ}
    (g : N ⟶ N') (m : M) (n : ScalarModule k B N) :
    mapRight M g (m ⊗ₜ[k] n) = TensorProduct.mk k M (ScalarModule k B N') m (g.hom n) := rfl

variable (D : CochainComplex (ModuleCat.{u} Bᵐᵒᵖ) ℤ)
/-- Tensor a vector space with every term and differential of the given right-module complex. -/
def complex (M : ModuleCat.{u} k) : CochainComplex (ModuleCat.{u} Bᵐᵒᵖ) ℤ where
  X i := ModuleCat.of Bᵐᵒᵖ (M ⊗[k] ScalarModule k B (D.X i))
  d i j := ModuleCat.ofHom (mapRight M (D.d i j))
  shape i j hij := by
    apply ModuleCat.hom_ext
    apply LinearMap.ext
    intro x
    induction x using TensorProduct.inductionOn with
    | tmul m n =>
      have h : (D.d i j).hom (n : D.X i) = 0 := by rw [D.shape i j hij]; rfl
      exact (congrArg (TensorProduct.mk k M (ScalarModule k B (D.X j)) m) h).trans
        (map_zero (TensorProduct.mk k M (ScalarModule k B (D.X j)) m))
    | add x y hx hy =>
      exact (map_add _ _ _).trans ((congrArg₂ (· + ·) hx hy).trans (map_add _ _ _).symm)
  d_comp_d' i j l hij hjl := by
    apply ModuleCat.hom_ext
    apply LinearMap.ext
    intro x
    induction x using TensorProduct.inductionOn with
    | tmul m n =>
      change TensorProduct.mk k M (ScalarModule k B (D.X l)) m ((D.d j l).hom ((D.d i j).hom n)) = 0
      have h := congrArg (fun f : D.X i ⟶ D.X l => f.hom n) (D.d_comp_d i j l)
      change (D.d j l).hom ((D.d i j).hom n) = 0 at h
      exact (congrArg (TensorProduct.mk k M (ScalarModule k B (D.X l)) m) h).trans
        (map_zero (TensorProduct.mk k M (ScalarModule k B (D.X l)) m))
    | add x y hx hy =>
      exact (map_add _ _ _).trans ((congrArg₂ (· + ·) hx hy).trans (map_add _ _ _).symm)

/-- The first-factor tensor map is a chain map. -/
def complexMap {M M' : ModuleCat.{u} k} (f : M ⟶ M') : complex D M ⟶ complex D M' where
  f i := ModuleCat.ofHom (TensorProjection.rightMap (B := B)
    (N := ScalarModule k B (D.X i)) f.hom)
  comm' i j hij := by
    apply ModuleCat.hom_ext
    apply LinearMap.ext
    intro x
    induction x using TensorProduct.inductionOn with
    | tmul m n => rfl
    | add x y hx hy =>
      exact (map_add _ _ _).trans ((congrArg₂ (· + ·) hx hy).trans (map_add _ _ _).symm)

/-- The genuine additive tensor-with-D functor required by the path exact sequence. -/
def tensorFunctor : ModuleCat.{u} k ⥤ CochainComplex (ModuleCat.{u} Bᵐᵒᵖ) ℤ where
  obj := complex D
  map := complexMap D
  map_id M := by
    apply HomologicalComplex.Hom.ext
    funext i
    apply ModuleCat.hom_ext
    apply LinearMap.ext
    intro x
    induction x using TensorProduct.inductionOn with
    | tmul m n => rfl
    | add x y hx hy =>
      exact (map_add _ _ _).trans ((congrArg₂ (· + ·) hx hy).trans (map_add _ _ _).symm)
  map_comp f g := by
    apply HomologicalComplex.Hom.ext
    funext i
    apply ModuleCat.hom_ext
    apply LinearMap.ext
    intro x
    induction x using TensorProduct.inductionOn with
    | tmul m n => rfl
    | add x y hx hy =>
      exact (map_add _ _ _).trans ((congrArg₂ (· + ·) hx hy).trans (map_add _ _ _).symm)

instance tensorFunctor_additive : (tensorFunctor (k := k) D).Additive where
  map_add {M M'} {f g} := by
    apply HomologicalComplex.Hom.ext
    funext i
    apply ModuleCat.hom_ext
    apply LinearMap.ext
    intro x
    induction x using TensorProduct.inductionOn with
    | tmul m n => exact TensorProduct.add_tmul _ _ _
    | add x y hx hy =>
      change TensorProjection.rightMap (B := B) (f.hom + g.hom) (x+y) =
        TensorProjection.rightMap (B := B) f.hom (x+y) + TensorProjection.rightMap (B := B) g.hom (x+y)
      simp only [map_add]
      change TensorProjection.rightMap (B := B) (f.hom + g.hom) x =
        TensorProjection.rightMap (B := B) f.hom x + TensorProjection.rightMap (B := B) g.hom x at hx
      change TensorProjection.rightMap (B := B) (f.hom + g.hom) y =
        TensorProjection.rightMap (B := B) f.hom y + TensorProjection.rightMap (B := B) g.hom y at hy
      rw [hx,hy]
      abel

/-- The adjacent-vertex graded piece is the cone of the path-space identity. -/
theorem adjacent_total_acyclic (M : ModuleCat.{u} k) :
    (CochainComplex.mappingCone (𝟙 (complex D M))).Acyclic :=
  RectificationAcyclic.cone_acyclic _

/-- The source-0 path-relation graded piece is acyclic for the actual tensor functor. -/
theorem relation_total_acyclic {d t : ℕ} (P : QuadraticEncoding.Relations k d t) :
    (RectificationTotal.total ((RelationSequence.sequence P).map (tensorFunctor (k := k) D)).g
      ((RelationSequence.sequence P).map (tensorFunctor (k := k) D)).f
      (Homotopy.ofEq ((RelationSequence.sequence P).map (tensorFunctor (k := k) D)).zero)).Acyclic :=
  RelationSequence.realized_sequence_total_acyclic P (tensorFunctor (k := k) D)
end LittleFinitistic.TensorComplex

end

end OAI