File size: 9,177 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
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
import Mathlib.RingTheory.TensorProduct.Maps
import Mathlib.LinearAlgebra.TensorProduct.Basis
import Mathlib.Algebra.Module.Projective
import Mathlib.LinearAlgebra.FiniteDimensional.Basic

namespace OAI
open scoped TensorProduct


noncomputable section
namespace ExternalTensor

variable (k B M N : Type*) [Field k] [Ring B] [Algebra k B]
  [AddCommGroup M] [Module k M] [Module B M] [IsScalarTower k B M]
  [AddCommGroup N] [Module k N] [Module Bᡐᡒᡖ N] [IsScalarTower k Bᡐᡒᡖ N]

def leftAction : B →ₐ[k] Module.End k (M βŠ—[k] N) :=
  (Module.End.rTensorAlgHom k M N).comp (Algebra.lsmul k k M)

def rightAction : Bᡐᡒᡖ →ₐ[k] Module.End k (M βŠ—[k] N) :=
  (Module.End.lTensorAlgHom k N M).comp (Algebra.lsmul k k N)

omit [Module Bᡐᡒᡖ N] [IsScalarTower k Bᡐᡒᡖ N] in
@[simp] theorem leftAction_tmul (b : B) (m : M) (n : N) :
    leftAction k B M N b (m βŠ—β‚œ[k] n) = (b β€’ m) βŠ—β‚œ[k] n := rfl

omit [Module B M] [IsScalarTower k B M] in
@[simp] theorem rightAction_tmul (b : Bᡐᡒᡖ) (m : M) (n : N) :
    rightAction k B M N b (m βŠ—β‚œ[k] n) = m βŠ—β‚œ[k] (b β€’ n) := rfl

theorem actions_commute (b : B) (c : Bᡐᡒᡖ) :
    Commute (leftAction k B M N b) (rightAction k B M N c) := by
  apply TensorProduct.ext
  ext m n
  rfl

/-- The genuine enveloping algebra representation; the right action is encoded by Bᡐᡒᡖ. -/
def action : (B βŠ—[k] Bᡐᡒᡖ) →ₐ[k] Module.End k (M βŠ—[k] N) :=
  Algebra.TensorProduct.lift (leftAction k B M N) (rightAction k B M N)
    (actions_commute k B M N)

@[instance_reducible] def bimodule : Module (B βŠ—[k] Bᡐᡒᡖ) (M βŠ—[k] N) :=
  Module.compHom (M βŠ—[k] N) (action k B M N).toRingHom

@[instance_reducible] def rightModule : Module Bᡐᡒᡖ (M βŠ—[k] N) :=
  Module.compHom (M βŠ—[k] N) (rightAction k B M N).toRingHom

attribute [local instance] bimodule rightModule

@[simp] theorem smul_tmul (b : B) (c : Bᡐᡒᡖ) (m : M) (n : N) :
    (b βŠ—β‚œ[k] c) β€’ (m βŠ—β‚œ[k] n) = (b β€’ m) βŠ—β‚œ[k] (c β€’ n) := rfl

omit [Module B M] [IsScalarTower k B M] in
@[simp] theorem right_smul_tmul (c : Bᡐᡒᡖ) (m : M) (n : N) :
    c β€’ (m βŠ—β‚œ[k] n) = m βŠ—β‚œ[k] (c β€’ n) := rfl


/-- Factor swap, with the external right action on the source. -/
def rightSwap : (M βŠ—[k] N) ≃ₗ[Bᡐᡒᡖ] (N βŠ—[k] M) where
  __ := (TensorProduct.comm k M N).toAddEquiv
  map_smul' c x := by
    induction x using TensorProduct.inductionOn with
    | tmul m n => simp [right_smul_tmul, TensorProduct.smul_tmul']
    | add x y hx hy => simp_all [smul_add]

omit [Module B M] [IsScalarTower k B M] in
/-- In fact no dimension restriction on M is needed for right projectivity. -/
theorem projective_right [Module.Projective Bᡐᡒᡖ N] :
    Module.Projective Bᡐᡒᡖ (M βŠ—[k] N) :=
  Module.Projective.of_equiv (rightSwap k B M N).symm

theorem finiteDimensional [FiniteDimensional k M] [FiniteDimensional k N] :
    FiniteDimensional k (M βŠ—[k] N) :=
  Module.Finite.equiv
    (TensorProduct.equivFinsuppOfBasisLeft (Module.finBasis k M)).symm


/-- A k-basis of the left factor gives an actual right-module direct-sum decomposition. -/
def rightBasisEquiv {ΞΉ : Type*} [DecidableEq ΞΉ] (v : Module.Basis ΞΉ k M) :
    (M βŠ—[k] N) ≃ₗ[Bᡐᡒᡖ] (ΞΉ β†’β‚€ N) where
  __ := (TensorProduct.equivFinsuppOfBasisLeft v).toAddEquiv
  map_smul' c x := by
    induction x using TensorProduct.inductionOn with
    | tmul m n =>
      ext i
      change (TensorProduct.equivFinsuppOfBasisLeft v)
        (c β€’ (m βŠ—β‚œ[k] n)) i = c β€’ (TensorProduct.equivFinsuppOfBasisLeft v) (m βŠ—β‚œ[k] n) i
      rw [right_smul_tmul, TensorProduct.equivFinsuppOfBasisLeft_apply_tmul_apply,
        TensorProduct.equivFinsuppOfBasisLeft_apply_tmul_apply]
      exact smul_comm (v.repr m i) c n
    | add x y hx hy => simp_all [smul_add]

omit [Module B M] [IsScalarTower k B M] in
@[simp] theorem rightBasisEquiv_tmul {ΞΉ : Type*} [DecidableEq ΞΉ]
    (v : Module.Basis ΞΉ k M) (m : M) (n : N) (i : ΞΉ) :
    rightBasisEquiv k B M N v (m βŠ—β‚œ[k] n) i = v.repr m i β€’ n :=
  TensorProduct.equivFinsuppOfBasisLeft_apply_tmul_apply v m n i

omit [Module B M] [IsScalarTower k B M] in
theorem finite_right [FiniteDimensional k M] [Module.Finite Bᡐᡒᡖ N] :
    Module.Finite Bᡐᡒᡖ (M βŠ—[k] N) :=
  Module.Finite.equiv (rightBasisEquiv k B M N (Module.finBasis k M)).symm


/-- The chosen right action is the restriction of the enveloping action. -/
theorem right_eq_enveloping (c : Bᡐᡒᡖ) (x : M βŠ—[k] N) :
    c β€’ x = (1 βŠ—β‚œ[k] c : B βŠ—[k] Bᡐᡒᡖ) β€’ x := by
  induction x using TensorProduct.inductionOn with
  | tmul m n => simp
  | add x y hx hy => simp_all [smul_add]

/-- The usual left action on the first tensor factor is the other restriction. -/
theorem left_eq_enveloping (b : B) (x : M βŠ—[k] N) :
    b β€’ x = (b βŠ—β‚œ[k] (1 : Bᡐᡒᡖ)) β€’ x := by
  induction x using TensorProduct.inductionOn with
  | tmul m n => simp [TensorProduct.smul_tmul']
  | add x y hx hy => simp_all [smul_add]

instance commutingActions : SMulCommClass B Bᡐᡒᡖ (M βŠ—[k] N) where
  smul_comm b c x := by
    induction x using TensorProduct.inductionOn with
    | tmul m n => simp [TensorProduct.smul_tmul']
    | add x y hx hy => simp_all [smul_add]

instance rightScalarTower : IsScalarTower k Bᡐᡒᡖ (M βŠ—[k] N) where
  smul_assoc r c x := by
    change rightAction k B M N (r β€’ c) x = r β€’ rightAction k B M N c x
    rw [map_smul]
    rfl

instance envelopingScalarTower : IsScalarTower k (B βŠ—[k] Bᡐᡒᡖ) (M βŠ—[k] N) where
  smul_assoc r a x := by
    change action k B M N (r β€’ a) x = r β€’ action k B M N a x
    rw [map_smul]
    rfl

variable {k B M N}
variable {M' N' : Type*}
  [AddCommGroup M'] [Module k M'] [Module B M'] [IsScalarTower k B M']
  [AddCommGroup N'] [Module k N'] [Module Bᡐᡒᡖ N'] [IsScalarTower k Bᡐᡒᡖ N']

/-- Tensor of a left-module map and a right-module map is enveloping-linear. -/
def map (f : M β†’β‚—[B] M') (g : N β†’β‚—[Bᡐᡒᡖ] N') :
    (M βŠ—[k] N) β†’β‚—[B βŠ—[k] Bᡐᡒᡖ] (M' βŠ—[k] N') where
  __ := (TensorProduct.map (f.restrictScalars k) (g.restrictScalars k)).toAddMonoidHom
  map_smul' a x := by
    induction a using TensorProduct.inductionOn with
    | tmul b c =>
      induction x using TensorProduct.inductionOn with
      | tmul m n => simp [smul_tmul]
      | add x y hx hy => simp_all [smul_add]
    | add a b ha hb => simp_all [add_smul]

@[simp] theorem map_tmul (f : M β†’β‚—[B] M') (g : N β†’β‚—[Bᡐᡒᡖ] N') (m : M) (n : N) :
    map (k := k) f g (m βŠ—β‚œ[k] n) = f m βŠ—β‚œ[k] g n := rfl

@[simp] theorem map_id :
    map (k := k) (LinearMap.id : M β†’β‚—[B] M) (LinearMap.id : N β†’β‚—[Bᡐᡒᡖ] N) =
      LinearMap.id := by
  ext x
  induction x using TensorProduct.inductionOn with
  | tmul m n => rfl
  | add x y hx hy => simp_all

variable {M'' N'' : Type*}
  [AddCommGroup M''] [Module k M''] [Module B M''] [IsScalarTower k B M'']
  [AddCommGroup N''] [Module k N''] [Module Bᡐᡒᡖ N''] [IsScalarTower k Bᡐᡒᡖ N'']

theorem map_comp (f : M β†’β‚—[B] M') (f' : M' β†’β‚—[B] M'')
    (g : N β†’β‚—[Bᡐᡒᡖ] N') (g' : N' β†’β‚—[Bᡐᡒᡖ] N'') :
    map (k := k) (f'.comp f) (g'.comp g) = (map (k := k) f' g').comp (map (k := k) f g) := by
  ext x
  induction x using TensorProduct.inductionOn with
  | tmul m n => rfl
  | add x y hx hy => simp_all


theorem map_add_left (f f' : M β†’β‚—[B] M') (g : N β†’β‚—[Bᡐᡒᡖ] N') :
    map (k := k) (f + f') g = map (k := k) f g + map (k := k) f' g := by
  ext x
  induction x using TensorProduct.inductionOn with
  | tmul m n => simp [TensorProduct.add_tmul]
  | add x y hx hy => simp_all [add_add_add_comm]

theorem map_add_right (f : M β†’β‚—[B] M') (g g' : N β†’β‚—[Bᡐᡒᡖ] N') :
    map (k := k) f (g + g') = map (k := k) f g + map (k := k) f g' := by
  ext x
  induction x using TensorProduct.inductionOn with
  | tmul m n => simp [TensorProduct.tmul_add]
  | add x y hx hy => simp_all [add_add_add_comm]


theorem map_smul_left (r : k) (f : M β†’β‚—[B] M') (g : N β†’β‚—[Bᡐᡒᡖ] N') :
    map (k := k) (r β€’ f) g = r β€’ map (k := k) f g := by
  ext x
  induction x using TensorProduct.inductionOn with
  | tmul m n => simp [TensorProduct.smul_tmul']
  | add x y hx hy => simp_all [smul_add]

theorem map_smul_right (r : k) (f : M β†’β‚—[B] M') (g : N β†’β‚—[Bᡐᡒᡖ] N') :
    map (k := k) f (r β€’ g) = r β€’ map (k := k) f g := by
  ext x
  induction x using TensorProduct.inductionOn with
  | tmul m n => simp [TensorProduct.tmul_smul]
  | add x y hx hy => simp_all [smul_add]

/-- The same tensor map as a map of right B-modules. -/
def rightMap (f : M β†’β‚—[B] M') (g : N β†’β‚—[Bᡐᡒᡖ] N') :
    (M βŠ—[k] N) β†’β‚—[Bᡐᡒᡖ] (M' βŠ—[k] N') where
  __ := (map (k := k) f g).toAddMonoidHom
  map_smul' c x := by
    change map (k := k) f g (c β€’ x) = c β€’ map (k := k) f g x
    rw [right_eq_enveloping, right_eq_enveloping, LinearMap.map_smul]

@[simp] theorem rightMap_tmul (f : M β†’β‚—[B] M') (g : N β†’β‚—[Bᡐᡒᡖ] N') (m : M) (n : N) :
    rightMap (k := k) f g (m βŠ—β‚œ[k] n) = f m βŠ—β‚œ[k] g n := rfl
end ExternalTensor

end

end OAI