File size: 6,033 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Algebra.Finitistic.Rectification.InducedColumns
import Mathlib.Algebra.Category.ModuleCat.Limits
import Mathlib.Algebra.Homology.Homotopy
import Mathlib.Algebra.Homology.HomologicalComplexLimits

namespace OAI
open CategoryTheory CategoryTheory.Limits HomologicalComplex
open scoped TensorProduct ModuleCat.Algebra
noncomputable section
namespace ExternalTensor.Section4
universe u
variable (k B : Type u) [Field k] [Ring B] [Algebra k B]

instance rightModuleK (N : ModuleCat.{u} Bᡐᡒᡖ) : Module k N :=
  Module.compHom N (algebraMap k Bᡐᡒᡖ)
instance rightModuleTower (N : ModuleCat.{u} Bᡐᡒᡖ) : IsScalarTower k Bᡐᡒᡖ N where
  smul_assoc r b n := by
    change (r β€’ b) β€’ n = (algebraMap k Bᡐᡒᡖ r) β€’ (b β€’ n)
    rw [Algebra.smul_def, mul_smul]
attribute [local instance] ExternalTensor.bimodule ExternalTensor.rightModule

abbrev Enveloping := B βŠ—[k] Bᡐᡒᡖ
abbrev RightComplex := CochainComplex (ModuleCat.{u} Bᡐᡒᡖ) β„€
abbrev BiComplex := CochainComplex (ModuleCat.{u} (Enveloping k B)) β„€

/-- Induction by the actual left ideal Be, on right modules and maps. -/
def columnFunctor (e : B) : ModuleCat.{u} Bᡐᡒᡖ β₯€ ModuleCat.{u} (Enveloping k B) where
  obj N := ModuleCat.of _ (Column k B N e)
  map f := ModuleCat.ofHom (columnMap k e f.hom)
  map_id N := by apply ModuleCat.hom_ext; exact map_id
  map_comp f g := by
    apply ModuleCat.hom_ext
    simpa [columnMap] using (map_comp (k := k) (LinearMap.id) (LinearMap.id) f.hom g.hom)
instance columnFunctor_additive (e : B) : (columnFunctor k B e).Additive where
  map_add := by intros; apply ModuleCat.hom_ext; exact map_add_right _ _ _

instance columnFunctor_linear (e : B) : (columnFunctor k B e).Linear k where
  map_smul f r := by
    apply ModuleCat.hom_ext
    apply LinearMap.ext
    intro x
    change ExternalTensor.map (k := k) LinearMap.id (r β€’ f.hom) x =
      (algebraMap k (Enveloping k B) r) β€’ (columnMap k e f.hom x)
    rw [map_smul_right]
    exact (IsScalarTower.algebraMap_smul (Enveloping k B) r _).symm

abbrev columnComplex (e : B) : RightComplex B β₯€ BiComplex k B :=
  (columnFunctor k B e).mapHomologicalComplex (ComplexShape.up β„€)

/-- Right multiplication on the left tensor factor, natural in the right module. -/
def pathNat (ei ej a : B) (ha : a * ei = a) :
    columnFunctor k B ej ⟢ columnFunctor k B ei where
  app N := ModuleCat.ofHom (columnPath k ei ej a ha)
  naturality {N N'} f := by
    apply ModuleCat.hom_ext
    ext x
    induction x using TensorProduct.inductionOn with
    | tmul c n => rfl
    | add x y hx hy =>
      exact (map_add _ _ _).trans ((congrArgβ‚‚ (Β· + Β·) hx hy).trans (map_add _ _ _).symm)

abbrev path (ei ej a : B) (ha : a * ei = a) (D : RightComplex B) :
    (columnComplex k B ej).obj D ⟢ (columnComplex k B ei).obj D :=
  ((pathNat k B ei ej a ha).mapHomologicalComplex (ComplexShape.up β„€)).app D

@[reassoc] theorem path_naturality (ei ej a : B) (ha : a * ei = a)
    {D E : RightComplex B} (f : D ⟢ E) :
    (columnComplex k B ej).map f ≫ path k B ei ej a ha E =
      path k B ei ej a ha D ≫ (columnComplex k B ei).map f :=
  ((pathNat k B ei ej a ha).mapHomologicalComplex (ComplexShape.up β„€)).naturality f

@[simp] theorem sum_f {C D : BiComplex k B} {I : Type} (s : Finset I)
    (f : I β†’ (C ⟢ D)) (n : β„€) : (βˆ‘ i ∈ s, f i).f n = βˆ‘ i ∈ s, (f i).f n :=
  map_sum (Hom.fAddMonoidHom n) f s

@[simp] theorem sum_hom {S : Type*} [Ring S] {X Y : ModuleCat S}
    {I : Type} (s : Finset I) (f : I β†’ (X ⟢ Y)) :
    (βˆ‘ i ∈ s, f i).hom = βˆ‘ i ∈ s, (f i).hom :=
  map_sum ModuleCat.homAddEquiv f s

private theorem sum_smul_component_apply {R : Type u} [Ring R] [Algebra k R]
    {K L : CochainComplex (ModuleCat.{u} R) β„€} {I J : Type} [Fintype I] [Fintype J]
    (r : I β†’ J β†’ k) (f : I β†’ J β†’ (K ⟢ L)) (n : β„€) (x : K.X n) :
    ((βˆ‘ i, βˆ‘ j, r i j β€’ f i j).f n).hom x =
      βˆ‘ i, βˆ‘ j, algebraMap k R (r i j) β€’ ((f i j).f n).hom x := by
  have eval_sum {I : Type} (s : Finset I) (g : I β†’ (K ⟢ L)) :
      (βˆ‘ i ∈ s, g i).f n = βˆ‘ i ∈ s, (g i).f n :=
    map_sum (Hom.fAddMonoidHom n) g s
  simp only [eval_sum, smul_f_apply, ModuleCat.hom_sum,
    ModuleCat.hom_smul, LinearMap.sum_apply, LinearMap.smul_apply]
  rfl

/-- The vertex-zero component vanishes by the actual quadratic relation in B. -/
theorem paths_relation {A J : Type} [Fintype A] [Fintype J]
    (eβ‚€ e₁ eβ‚‚ : B) (a : A β†’ B) (b : J β†’ B)
    (ha : βˆ€ i, a i * eβ‚€ = a i) (hb : βˆ€ j, b j * e₁ = b j)
    (r : A β†’ J β†’ k) (hr : βˆ‘ i, βˆ‘ j, r i j β€’ (b j * a i) = 0)
    (D : RightComplex B) :
    βˆ‘ i, βˆ‘ j, r i j β€’ (path k B e₁ eβ‚‚ (b j) (hb j) D ≫
      path k B eβ‚€ e₁ (a i) (ha i) D) = 0 := by
  apply Hom.ext
  funext n
  apply ModuleCat.hom_ext
  apply LinearMap.ext
  intro x
  induction x using TensorProduct.inductionOn with
  | add x y hx hy =>
    exact (map_add _ _ _).trans ((congrArgβ‚‚ (Β· + Β·) hx hy).trans (map_add _ _ _).symm)
  | tmul c v =>
    erw [sum_smul_component_apply]
    change (βˆ‘ i, βˆ‘ j, (algebraMap k (Enveloping k B) (r i j)) β€’
      ((pathMap eβ‚€ e₁ (a i) (ha i) (pathMap e₁ eβ‚‚ (b j) (hb j) c)) βŠ—β‚œ[k] v)) = 0
    simp only [IsScalarTower.algebraMap_smul, TensorProduct.smul_tmul',
      ← TensorProduct.sum_tmul]
    have hz : (βˆ‘ i, βˆ‘ j, r i j β€’
        pathMap eβ‚€ e₁ (a i) (ha i) (pathMap e₁ eβ‚‚ (b j) (hb j) c)) = 0 := by
      apply Subtype.ext
      change ((leftIdeal B eβ‚€).subtype.restrictScalars k)
        (βˆ‘ i, βˆ‘ j, r i j β€’ pathMap eβ‚€ e₁ (a i) (ha i)
          (pathMap e₁ eβ‚‚ (b j) (hb j) c)) = 0
      simp only [map_sum, map_smul, LinearMap.restrictScalars_apply,
        Submodule.subtype_apply, pathMap_apply]
      calc
        _ = (c : B) * (βˆ‘ i, βˆ‘ j, r i j β€’ (b j * a i)) := by
          simp only [Finset.mul_sum, Algebra.mul_smul_comm, mul_assoc]
        _ = 0 := by rw [hr, mul_zero]
    rw [hz, TensorProduct.zero_tmul]
end ExternalTensor.Section4

end

end OAI