File size: 9,249 Bytes
2c7d975
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Algebra.AuslanderReiten.Algebras.BaseAlgebra
import Mathlib.Algebra.Module.Projective
import Mathlib.Algebra.CharP.Two
import Mathlib.Algebra.Exact.Basic

namespace OAI

namespace ArExplicit.Resolution

open ArExplicit.Letter ArExplicit.BaseAlgebra

variable {k : Type*} [Field k] (q : k)

local notation "C" => BaseAlgebra k q

def fixedRight (p : C) : Submodule C C where
  carrier := {a | a * p = a}
  zero_mem' := zero_mul p
  add_mem' {a b} ha hb := by
    change a * p = a at ha
    change b * p = b at hb
    change (a + b) * p = a + b
    rw [add_mul, ha, hb]
  smul_mem' c a ha := by
    change (c * a) * p = c * a
    rw [mul_assoc, ha]

def rightMultiply (p : C) : C →ₗ[C] C where
  toFun a := a * p
  map_add' a b := add_mul a b p
  map_smul' c a := mul_assoc c a p

def projection (p : C) (hp : p * p = p) : C →ₗ[C] fixedRight q p where
  toFun a := ⟨a * p, by change (a * p) * p = a * p; rw [mul_assoc, hp]⟩
  map_add' a b := Subtype.ext (add_mul a b p)
  map_smul' c a := Subtype.ext (mul_assoc c a p)

theorem projection_surjective (p : C) (hp : p * p = p) :
    Function.Surjective (projection q p hp) := by
  intro a
  exact ⟨a, Subtype.ext a.property⟩

theorem projective_fixedRight (p : C) (hp : p * p = p) :
    Module.Projective C (fixedRight q p) := by
  apply Module.Projective.of_split (fixedRight q p).subtype (projection q p hp)
  apply LinearMap.ext
  intro a
  exact Subtype.ext a.property

theorem finite_fixedRight (p : C) (hp : p * p = p) :
    Module.Finite k (fixedRight q p) :=
  Module.Finite.of_surjective ((projection q p hp).restrictScalars k)
    (projection_surjective q p hp)

abbrev E : Submodule C C := fixedRight q (basisVector q e)

abbrev F : Submodule C C := fixedRight q (basisVector q f)

instance : Module.Projective C (E q) :=
  projective_fixedRight q _ (by simpa [multiplicationTable] using basis_mul q e e)
instance : Module.Projective C (F q) :=
  projective_fixedRight q _ (by simpa [multiplicationTable] using basis_mul q f f)

instance : Module.Finite k (E q) :=
  finite_fixedRight q _ (by simpa [multiplicationTable] using basis_mul q e e)
instance : Module.Finite k (F q) :=
  finite_fixedRight q _ (by simpa [multiplicationTable] using basis_mul q f f)

def rightBetween (p r z : C) (hz : z * r = z) :
    fixedRight q p →ₗ[C] fixedRight q r where
  toFun a := ⟨(a : C) * z, by change ((a : C) * z) * r = (a : C) * z; rw [mul_assoc, hz]⟩
  map_add' a b := Subtype.ext (add_mul (a : C) (b : C) z)
  map_smul' c a := Subtype.ext (mul_assoc c (a : C) z)

def ell (r : k) : C := basisVector q x + r • basisVector q y

@[simp] theorem ell_right_e (r : k) : ell q r * basisVector q e = ell q r := by
  simp [ell, add_mul, basis_mul, multiplicationTable]

def dU : E q →ₗ[C] F q :=
  rightBetween q _ _ (basisVector q u)
    (by simpa [multiplicationTable] using basis_mul q u f)

def dEll (r : k) : E q →ₗ[C] E q := rightBetween q _ _ (ell q r) (ell_right_e q r)

@[simp] theorem coe_dU (a : E q) : (dU q a : C) = (a : C) * basisVector q u := rfl
@[simp] theorem coe_dEll (r : k) (a : E q) : (dEll q r a : C) = (a : C) * ell q r := rfl

private theorem E_coeff_zero (a : E q) (i : Letter)
    (hi : i = u ∨ i = v ∨ i = f ∨ i = n) : (a : C).coeff i = 0 := by
  have h := congrArg (fun b : C => b.coeff i) a.property
  rcases hi with rfl | rfl | rfl | rfl <;> simpa [product] using h.symm

@[simp] theorem E_coeff_u (a : E q) : (a : C).coeff u = 0 := E_coeff_zero q a u (by simp)
@[simp] theorem E_coeff_v (a : E q) : (a : C).coeff v = 0 := E_coeff_zero q a v (by simp)
@[simp] theorem E_coeff_f (a : E q) : (a : C).coeff f = 0 := E_coeff_zero q a f (by simp)
@[simp] theorem E_coeff_n (a : E q) : (a : C).coeff n = 0 := E_coeff_zero q a n (by simp)

theorem E_expand (a : E q) : (a : C) =
    (a : C).coeff e • basisVector q e + (a : C).coeff x • basisVector q x +
    (a : C).coeff y • basisVector q y + (a : C).coeff z • basisVector q z +
    (a : C).coeff t • basisVector q t + (a : C).coeff j • basisVector q j := by
  ext i
  cases i <;> simp

theorem mul_u_formula (a : E q) : (a : C) * basisVector q u =
    (a : C).coeff e • basisVector q u +
    ((a : C).coeff x + (a : C).coeff y) • basisVector q v +
    ((1 + q) * (a : C).coeff t) • basisVector q n := by
  ext i
  cases i <;> simp [product]

theorem mul_ell_formula (r : k) (a : E q) : (a : C) * ell q r =
    (a : C).coeff e • ell q r +
    (q * r * (a : C).coeff x + (a : C).coeff y) • basisVector q z +
    ((1 + q ^ 2 * r) * (a : C).coeff t) • basisVector q j := by
  ext i
  cases i <;> simp [product, ell] <;> ring

section CharacteristicTwo

variable [CharP k 2]

theorem mul_u_eq_zero_iff (hq : 1 + q ≠ 0) (a : E q) :
    (a : C) * basisVector q u = 0 ↔
      (a : C).coeff e = 0 ∧ (a : C).coeff t = 0 ∧ (a : C).coeff y = (a : C).coeff x := by
  rw [mul_u_formula]
  constructor
  · intro h
    have he := congrArg (fun b : C => b.coeff u) h
    have ht := congrArg (fun b : C => b.coeff n) h
    have hy := congrArg (fun b : C => b.coeff v) h
    simp only [coeff_add, coeff_smul, coeff_basisVector, coeff_zero] at he ht hy
    simp only [reduceCtorEq, ↓reduceIte, mul_zero, mul_one, add_zero, zero_add] at he ht hy
    exact ⟨he, (mul_eq_zero.mp ht).resolve_left hq, (CharTwo.add_eq_zero.mp hy).symm⟩
  · rintro ⟨he, ht, hy⟩
    simp [he, ht, hy, CharTwo.add_self_eq_zero]

theorem mul_ell_eq_zero_iff (r : k) (hr : 1 + q ^ 2 * r ≠ 0) (a : E q) :
    (a : C) * ell q r = 0 ↔
      (a : C).coeff e = 0 ∧ (a : C).coeff t = 0 ∧
      (a : C).coeff y = q * r * (a : C).coeff x := by
  rw [mul_ell_formula]
  constructor
  · intro h
    have he := congrArg (fun b : C => b.coeff x) h
    have ht := congrArg (fun b : C => b.coeff j) h
    have hy := congrArg (fun b : C => b.coeff z) h
    simp [ell] at he ht hy
    exact ⟨he, ht.resolve_left hr, (CharTwo.add_eq_zero.mp hy).symm⟩
  · rintro ⟨he, ht, hy⟩
    simp [he, ht, hy, CharTwo.add_self_eq_zero]

end CharacteristicTwo

def ellPreimage (r α β γ : k) : E q :=
  ⟨α • basisVector q e + β • basisVector q y + (γ / (1 + q ^ 2 * r)) • basisVector q t, by
    change (_ : C) * basisVector q e = _
    simp [add_mul, basis_mul, multiplicationTable]⟩

theorem ellPreimage_spec (r α β γ : k) (hr : 1 + q ^ 2 * r ≠ 0) :
    (ellPreimage q r α β γ : C) * ell q r =
      α • ell q r + β • basisVector q z + γ • basisVector q j := by
  rw [mul_ell_formula]
  have hγ : (1 + q ^ 2 * r) * (γ / (1 + q ^ 2 * r)) = γ := by
    rw [mul_comm, div_mul_cancel₀ γ hr]
  simp [ellPreimage, hγ]

section Exactness

variable [CharP k 2]

theorem uKernel_expand (hq : 1 + q ≠ 0) (a : E q)
    (ha : (a : C) * basisVector q u = 0) :
    (a : C) = (a : C).coeff x • ell q 1 +
      (a : C).coeff z • basisVector q z + (a : C).coeff j • basisVector q j := by
  obtain ⟨he, ht, hy⟩ := (mul_u_eq_zero_iff q hq a).mp ha
  ext i
  cases i <;> simp [ell, he, ht, hy]

theorem ellKernel_expand (r : k) (hr : 1 + q ^ 2 * r ≠ 0) (a : E q)
    (ha : (a : C) * ell q r = 0) :
    (a : C) = (a : C).coeff x • ell q (q * r) +
      (a : C).coeff z • basisVector q z + (a : C).coeff j • basisVector q j := by
  obtain ⟨he, ht, hy⟩ := (mul_ell_eq_zero_iff q r hr a).mp ha
  ext i
  cases i <;> simp [ell, he, ht, hy]
  ring

@[simp] theorem ell_one_mul_u : ell q 1 * basisVector q u = 0 := by
  ext i
  cases i <;> simp [ell, product, CharTwo.add_self_eq_zero]

@[simp] theorem ell_successor_mul (r : k) : ell q (q * r) * ell q r = 0 := by
  ext i
  cases i <;> simp [ell, product, CharTwo.add_self_eq_zero]

theorem dU_comp_dEll_one : (dU q).comp (dEll q 1) = 0 := by
  apply LinearMap.ext
  intro a
  apply Subtype.ext
  change ((a : C) * ell q 1) * basisVector q u = 0
  rw [mul_assoc, ell_one_mul_u, mul_zero]

theorem dEll_comp_successor (r : k) : (dEll q r).comp (dEll q (q * r)) = 0 := by
  apply LinearMap.ext
  intro a
  apply Subtype.ext
  change ((a : C) * ell q (q * r)) * ell q r = 0
  rw [mul_assoc, ell_successor_mul, mul_zero]

theorem exact_dU (hq : 1 + q ≠ 0) (hq2 : 1 + q ^ 2 ≠ 0) :
    Function.Exact (dEll q 1) (dU q) := by
  intro a
  constructor
  · intro ha
    have ha' : (a : C) * basisVector q u = 0 := congrArg Subtype.val ha
    refine ⟨ellPreimage q 1 ((a : C).coeff x) ((a : C).coeff z) ((a : C).coeff j), ?_⟩
    apply Subtype.ext
    change (_ : C) * ell q 1 = (a : C)
    rw [ellPreimage_spec q 1 _ _ _ (by simpa using hq2)]
    exact (uKernel_expand q hq a ha').symm
  · rintro ⟨b, rfl⟩
    exact DFunLike.congr_fun (dU_comp_dEll_one q) b

theorem exact_dEll (r : k) (hr : 1 + q ^ 2 * r ≠ 0)
    (hnext : 1 + q ^ 2 * (q * r) ≠ 0) :
    Function.Exact (dEll q (q * r)) (dEll q r) := by
  intro a
  constructor
  · intro ha
    have ha' : (a : C) * ell q r = 0 := congrArg Subtype.val ha
    refine ⟨ellPreimage q (q * r) ((a : C).coeff x) ((a : C).coeff z) ((a : C).coeff j), ?_⟩
    apply Subtype.ext
    change (_ : C) * ell q (q * r) = (a : C)
    rw [ellPreimage_spec q (q * r) _ _ _ hnext]
    exact (ellKernel_expand q r hr a ha').symm
  · rintro ⟨b, rfl⟩
    exact DFunLike.congr_fun (dEll_comp_successor q r) b

end Exactness

end ArExplicit.Resolution

end OAI