File size: 19,740 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
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
import Mathlib
import OAI.Algebra.FrobeniusObstruction.GraphPotential
import OAI.Algebra.FrobeniusObstruction.GlobalForms

namespace OAI

noncomputable section
open scoped BigOperators

noncomputable section
open scoped BigOperators TensorProduct

namespace BoundaryOnly.FormalObstruction.Frobenius
open MixedForms
variable {ι k : Type*} [Fintype ι] [DecidableEq ι] [CommRing k]
variable (ell : ℕ) [CharP k ell]

                                                                                     
def normalCoordinateList
    (e : Ring (ι := ι) (k := k) ell ≃ₐ[k] Ring (ι := ι) (k := k) ell)
    (s : Finset ι) : List (Ring (ι := ι) (k := k) ell) :=
  s.toList.map (fun i => e (coordinate ell i))

omit [Fintype ι] [DecidableEq ι] [CharP k ell] in
theorem normalCoordinateList_span
    (e : Ring (ι := ι) (k := k) ell ≃ₐ[k] Ring (ι := ι) (k := k) ell)
    (s : Finset ι) : Ideal.span {u | u ∈ normalCoordinateList ell e s} =
      chartNormalIdeal ell e s := by
  congr 1
  ext u
  simp only [normalCoordinateList, List.mem_map, Finset.mem_toList,
    Set.mem_ofPred_eq, Set.mem_image, Finset.mem_coe]

omit [Fintype ι] [DecidableEq ι] [CharP k ell] in
theorem normalCoordinateList_pow (hell : 0 < ell)
    (e : Ring (ι := ι) (k := k) ell ≃ₐ[k] Ring (ι := ι) (k := k) ell)
    (s : Finset ι) (u : Ring (ι := ι) (k := k) ell)
    (hu : u ∈ normalCoordinateList ell e s) : u ^ (ell-1+1) = 0 := by
  obtain ⟨i, _, rfl⟩ := List.mem_map.mp hu
  rw [Nat.sub_add_cancel hell, ← map_pow, coordinate_pow, map_zero]

def chartNormal
    (e : Ring (ι := ι) (k := k) ell ≃ₐ[k] Ring (ι := ι) (k := k) ell)
    (s : Finset ι) : Forms (k := k) (A := Ring (ι := ι) (k := k) ell) (ι := ι) :=
  normal (partialDeriv ell) (ell-1) (normalCoordinateList ell e s)

theorem chartNormal_d
    (e : Ring (ι := ι) (k := k) ell ≃ₐ[k] Ring (ι := ι) (k := k) ell)
    (s : Finset ι) : d (partialDeriv ell) (chartNormal ell e s) = 0 :=
  d_normal _ (partial_commute ell) _ _

theorem chartNormal_annihilate (hell : 0 < ell)
    (e : Ring (ι := ι) (k := k) ell ≃ₐ[k] Ring (ι := ι) (k := k) ell)
    (s : Finset ι) (g : Ring (ι := ι) (k := k) ell)
    (hg : g ∈ chartNormalIdeal ell e s) : coeff g * chartNormal ell e s = 0 :=
  coeff_mul_normal_ideal _ _ _ (normalCoordinateList_pow ell hell e s) g
    (by rwa [normalCoordinateList_span])

theorem chartNormal_delta (hell : 0 < ell)
    (e : Ring (ι := ι) (k := k) ell ≃ₐ[k] Ring (ι := ι) (k := k) ell)
    (s : Finset ι) (F : Ring (ι := ι) (k := k) ell)
    (hF : F ∈ chartNormalIdeal ell e s) :
    delta (partialDeriv ell) F (chartNormal ell e s) = 0 :=
  delta_normal _ _ _ (normalCoordinateList_pow ell hell e s) F
    (by rwa [normalCoordinateList_span])

theorem chartNormal_primitive (hell : 0 < ell)
    (e : Ring (ι := ι) (k := k) ell ≃ₐ[k] Ring (ι := ι) (k := k) ell)
    (s : Finset ι) (F g : Ring (ι := ι) (k := k) ell)
    (h : ι → Ring (ι := ι) (k := k) ell)
    (hF : F ∈ chartNormalIdeal ell e s)
    (hg : g - ∑ i, h i * partialDeriv ell i F ∈ chartNormalIdeal ell e s) :
    coeff g * chartNormal ell e s = delta (partialDeriv ell) F
      (∑ i, coeff (h i) * contract i (chartNormal ell e s)) :=
  normal_primitive _ _ _ (normalCoordinateList_pow ell hell e s) F g h
    (by rwa [normalCoordinateList_span]) (by rwa [normalCoordinateList_span])

end BoundaryOnly.FormalObstruction.Frobenius

namespace BoundaryOnly.FormalObstruction
open Frobenius MixedForms
variable {k : Type*} [Field k] {d : ℕ} {n : Fin d → ℕ}
variable (ell : ℕ) (htwo : 1 < ell) [CharP k ell] [Fact ell.Prime]

                                                                                  
                                                                              
abbrev ParameterForms := Forms (k := k)
  (A := ParameterScalar (n := n) (k := k) ell) (ι := InternalVar n)

def parameterPartial (i : InternalVar n) :
    Derivation k (ParameterScalar (n := n) (k := k) ell)
      (ParameterScalar (n := n) (k := k) ell) :=
  (partialDeriv (k := ThreeParameters.Ring k) ell i).restrictScalars k

omit [Fact ell.Prime] in
@[simp] theorem parameterPartial_apply (i : InternalVar n)
    (x : ParameterScalar (n := n) (k := k) ell) :
    parameterPartial ell i x = partialDeriv ell i x := rfl

omit [Fact ell.Prime] in
theorem parameterPartial_commute (i j : InternalVar n)
    (x : ParameterScalar (n := n) (k := k) ell) :
    parameterPartial ell i (parameterPartial ell j x) =
    parameterPartial ell j (parameterPartial ell i x) := partial_commute ell i j x

def movingNormal (D : FormalData (k := k) n)
    (a : SlopeVar d → ThreeParameters.Ring k)
    (ha : ∀ i, ThreeParameters.augmentation k (a i) = 0) :
    ParameterForms (n := n) (k := k) ell :=
  normal (parameterPartial ell) (ell-1)
    (normalCoordinateList ell (movingChartEquiv ell htwo D a ha).symm normalIndices)

theorem movingNormal_d (D : FormalData (k := k) n)
    (a : SlopeVar d → ThreeParameters.Ring k)
    (ha : ∀ i, ThreeParameters.augmentation k (a i) = 0) :
    MixedForms.d (parameterPartial ell) (movingNormal ell htwo D a ha) = 0 :=
  d_normal _ (parameterPartial_commute ell) _ _

theorem movingNormal_delta (D : FormalData (k := k) n)
    (a : SlopeVar d → ThreeParameters.Ring k)
    (ha : ∀ i, ThreeParameters.augmentation k (a i) = 0) :
    delta (parameterPartial ell) (movingPotential ell D a ha)
      (movingNormal ell htwo D a ha) = 0 :=
  delta_normal _ _ _ (normalCoordinateList_pow ell (Nat.Prime.pos Fact.out) _ _)
    _ (by rw [normalCoordinateList_span]; exact movingPotential_mem_normalIdeal ell htwo D a ha)

theorem movingNormal_annihilate (D : FormalData (k := k) n)
    (a : SlopeVar d → ThreeParameters.Ring k)
    (ha : ∀ i, ThreeParameters.augmentation k (a i) = 0)
    (g : ParameterScalar (n := n) (k := k) ell)
    (hg : g ∈ chartNormalIdeal ell (movingChartEquiv ell htwo D a ha).symm normalIndices) :
    coeff g * movingNormal ell htwo D a ha = 0 :=
  coeff_mul_normal_ideal _ _ _ (normalCoordinateList_pow ell (Nat.Prime.pos Fact.out) _ _)
    g (by rwa [normalCoordinateList_span])

                                                                                 
theorem movingNormal_primitive (D : FormalData (k := k) n)
    (a : SlopeVar d → ThreeParameters.Ring k)
    (ha : ∀ i, ThreeParameters.augmentation k (a i) = 0)
    (g : MvPowerSeries (GraphVar n) k) (hg : g ∈ gradientIdeal n D.P D.Y) :
    ∃ eta : ParameterForms (n := n) (k := k) ell,
      delta (parameterPartial ell) (movingPotential ell D a ha) eta =
        coeff ((movingChartEquiv ell htwo D a ha).symm
          (movingGraphSlot ell a ha false (Ideal.Quotient.mk _ g))) *
            movingNormal ell htwo D a ha := by
  obtain ⟨h, hh⟩ := graphIdeal_ambient_discrepancy ell htwo D a ha g hg
  refine ⟨∑ i, coeff (h i) * contract i (movingNormal ell htwo D a ha), ?_⟩
  apply Eq.symm
  apply normal_primitive _ _ _ (normalCoordinateList_pow ell (Nat.Prime.pos Fact.out) _ _) _ _ h
  · rw [normalCoordinateList_span]; exact movingPotential_mem_normalIdeal ell htwo D a ha
  · rw [normalCoordinateList_span]; exact hh

                                                                           
theorem movingNormal_cubic_primitive (D : FormalData (k := k) n)
    (a : SlopeVar d → ThreeParameters.Ring k)
    (ha : ∀ i, ThreeParameters.augmentation k (a i) = 0) (i j l : Fin d) :
    ∃ eta : ParameterForms (n := n) (k := k) ell,
      delta (parameterPartial ell) (movingPotential ell D a ha) eta =
        coeff (@algebraMap (ThreeParameters.Ring k) (ParameterScalar (n := n) (k := k) ell)
          inferInstance inferInstance inferInstance (a (i,0) * a (j,0) * a (l,0))) *
            movingNormal ell htwo D a ha := by
  obtain ⟨eta, he⟩ := movingNormal_primitive ell htwo D a ha
    (slope n i * slope n j * slope n l) (D.positive_cubic i j l)
  have hs : (movingChartEquiv ell htwo D a ha).symm
      (movingGraphSlot ell a ha false
        (Ideal.Quotient.mk _ (slope n i * slope n j * slope n l))) =
      @algebraMap (ThreeParameters.Ring k) (ParameterScalar (n := n) (k := k) ell)
        inferInstance inferInstance inferInstance (a (i,0) * a (j,0) * a (l,0)) := by
    simp only [map_mul, slope]
    change (movingChartEquiv ell htwo D a ha).symm
      (movingGraphSlot ell a ha false (coordinate ell (.inl (i,0)))) *
        (movingChartEquiv ell htwo D a ha).symm
          (movingGraphSlot ell a ha false (coordinate ell (.inl (j,0)))) *
        (movingChartEquiv ell htwo D a ha).symm
          (movingGraphSlot ell a ha false (coordinate ell (.inl (l,0)))) = _
    simp only [movingGraphSlot_coordinate, movingGraphCoordinates, AlgEquiv.commutes]
  rw [hs] at he
  exact ⟨eta, he⟩

end BoundaryOnly.FormalObstruction

namespace BoundaryOnly.FormalObstruction.Frobenius
variable {ι k l : Type*} [Fintype ι] [DecidableEq ι] [CommRing k] [CommRing l]
variable (ell : ℕ) [CharP k ell] [CharP l ell]

omit [Fintype ι] [DecidableEq ι] [CharP k ell] [CharP l ell] in
theorem series_pderiv_map (f : k →+* l) (i : ι) (x : Series (ι := ι) (k := k)) :
    MvPowerSeries.map f (MvPowerSeries.pderiv i x) =
      MvPowerSeries.pderiv i (MvPowerSeries.map f x) := by
  ext e
  simp only [MvPowerSeries.coeff_map, MvPowerSeries.coeff_pderiv, map_mul, map_add, map_natCast, map_one]

omit [DecidableEq ι] in
theorem mapCoefficients_partial (f : k →+* l) (i : ι)
    (x : Ring (ι := ι) (k := k) ell) :
    mapCoefficients ell f (partialDeriv ell i x) =
      partialDeriv ell i (mapCoefficients ell f x) := by
  obtain ⟨p,rfl⟩ := Ideal.Quotient.mk_surjective x
  simp only [partial_mk, mapCoefficients_mk, series_pderiv_map]

variable [Algebra k l]
omit [DecidableEq ι] in
theorem baseChange_partial (i : ι)
    (x : Ring (ι := ι) (k := k) ell) :
    baseChange (l := l) ell (partialDeriv ell i x) =
      partialDeriv ell i (baseChange (l := l) ell x) :=
  mapCoefficients_partial ell (algebraMap k l) i x

end BoundaryOnly.FormalObstruction.Frobenius

namespace BoundaryOnly.FormalObstruction.MixedForms
open scoped TensorProduct
variable {k A B ι : Type*} [CommRing k] [CommRing A] [CommRing B]
  [Algebra k A] [Algebra k B] [Fintype ι] [DecidableEq ι]

                                                         
def coefficientMap (f : A →ₐ[k] B) :
    Forms (k := k) (A := A) (ι := ι) →ₐ[k] Forms (k := k) (A := B) (ι := ι) :=
  Algebra.TensorProduct.map f (AlgHom.id k _)

omit [Fintype ι] [DecidableEq ι] in
@[simp] theorem coefficientMap_tmul (f : A →ₐ[k] B)
    (a : A) (e : Ext (k := k) (ι := ι)) :
    coefficientMap f (a ⊗ₜ[k] e) = f a ⊗ₜ[k] e := rfl

omit [Fintype ι] [DecidableEq ι] in
@[simp] theorem coefficientMap_coeff (f : A →ₐ[k] B) (a : A) :
    coefficientMap (ι := ι) f (coeff a) = coeff (f a) := rfl

 theorem coefficientMap_d (f : A →ₐ[k] B)
    (pA : ι → Derivation k A A) (pB : ι → Derivation k B B)
    (hp : ∀ i a, f (pA i a) = pB i (f a))
    (x : Forms (k := k) (A := A) (ι := ι)) :
    coefficientMap f (d pA x) = d pB (coefficientMap f x) := by
  induction x using TensorProduct.inductionOn with
  | add x y hx hy => simp only [map_add, hx, hy]
  | tmul a e => simp only [d_tmul, coefficientMap_tmul, map_sum, hp]

 theorem coefficientMap_gradient (f : A →ₐ[k] B)
    (pA : ι → Derivation k A A) (pB : ι → Derivation k B B)
    (hp : ∀ i a, f (pA i a) = pB i (f a)) (F : A) :
    coefficientMap f (gradient pA F) = gradient pB (f F) := by
  exact coefficientMap_d f pA pB hp (coeff F)

 theorem coefficientMap_delta (f : A →ₐ[k] B)
    (pA : ι → Derivation k A A) (pB : ι → Derivation k B B)
    (hp : ∀ i a, f (pA i a) = pB i (f a)) (F : A)
    (x : Forms (k := k) (A := A) (ι := ι)) :
    coefficientMap f (delta pA F x) = delta pB (f F) (coefficientMap f x) := by
  simp only [delta_apply, map_mul, coefficientMap_gradient f pA pB hp]

 theorem coefficientMap_cartier (f : A →ₐ[k] B)
    (pA : ι → Derivation k A A) (pB : ι → Derivation k B B)
    (hp : ∀ i a, f (pA i a) = pB i (f a)) (e : ℕ) (u : A) :
    coefficientMap f (cartier pA e u) = cartier pB e (f u) := by
  simp only [cartier, map_mul, coefficientMap_coeff, map_pow,
    coefficientMap_gradient f pA pB hp]

 theorem coefficientMap_normal (f : A →ₐ[k] B)
    (pA : ι → Derivation k A A) (pB : ι → Derivation k B B)
    (hp : ∀ i a, f (pA i a) = pB i (f a)) (e : ℕ) (us : List A) :
    coefficientMap f (normal pA e us) = normal pB e (us.map f) := by
  induction us with
  | nil => simp only [normal, List.map_nil, List.prod_nil, map_one]
  | cons u us ih =>
      simpa only [normal, List.map_cons, List.prod_cons, map_mul,
        coefficientMap_cartier f pA pB hp] using congrArg
        (fun x => cartier pB e (f u) * x) ih

end BoundaryOnly.FormalObstruction.MixedForms

namespace BoundaryOnly.FormalObstruction
open Frobenius MixedForms
variable {k : Type*} [Field k] {d : ℕ} {n : Fin d → ℕ}
variable (ell : ℕ) (htwo : 1 < ell) [CharP k ell] [Fact ell.Prime]

theorem movingChart_inverse_specialFiber (D : FormalData (k := k) n)
    (a : SlopeVar d → ThreeParameters.Ring k)
    (ha : ∀ i, ThreeParameters.augmentation k (a i) = 0)
    (x : ParameterScalar (n := n) (k := k) ell) :
    reduction ell ((movingChartEquiv ell htwo D a ha).symm x) =
      (specialChartEquiv ell htwo D).symm (reduction ell x) := by
  apply (specialChartEquiv ell htwo D).injective
  rw [AlgEquiv.apply_symm_apply]
  change specialChart ell D (reduction ell ((movingChartEquiv ell htwo D a ha).symm x)) = _
  rw [← movingChart_specialFiber ell D a ha]
  change reduction ell ((movingChartEquiv ell htwo D a ha)
    ((movingChartEquiv ell htwo D a ha).symm x)) = _
  rw [AlgEquiv.apply_symm_apply]

def specialNormal (D : FormalData (k := k) n) :
    Forms (k := k) (A := Frobenius.Ring (ι := InternalVar n) (k := k) ell)
      (ι := InternalVar n) :=
  chartNormal ell (specialChartEquiv ell htwo D).symm normalIndices

theorem reduce_normalList (D : FormalData (k := k) n)
    (a : SlopeVar d → ThreeParameters.Ring k)
    (ha : ∀ i, ThreeParameters.augmentation k (a i) = 0) :
    (normalCoordinateList ell (movingChartEquiv ell htwo D a ha).symm normalIndices).map
      (reduction ell) = normalCoordinateList ell (specialChartEquiv ell htwo D).symm normalIndices := by
  simp only [normalCoordinateList, List.map_map]
  apply List.map_congr_left
  intro i hi
  simp only [Function.comp_apply, movingChart_inverse_specialFiber, reduction_coordinate]

theorem reduce_movingNormal (D : FormalData (k := k) n)
    (a : SlopeVar d → ThreeParameters.Ring k)
    (ha : ∀ i, ThreeParameters.augmentation k (a i) = 0) :
    coefficientMap (reduction ell) (movingNormal ell htwo D a ha) =
      specialNormal ell htwo D := by
  have hp (i : InternalVar n) (x : ParameterScalar (n := n) (k := k) ell) :
      reduction ell (parameterPartial ell i x) = partialDeriv ell i (reduction ell x) :=
    mapCoefficients_partial ell (ThreeParameters.augmentation k) i x
  have hn := coefficientMap_normal (reduction (ι := InternalVar n) (k := k) ell)
    (parameterPartial ell) (partialDeriv ell) hp (ell-1)
    (normalCoordinateList ell (movingChartEquiv ell htwo D a ha).symm normalIndices)
  rw [reduce_normalList ell htwo D a ha] at hn
  exact hn

end BoundaryOnly.FormalObstruction

namespace BoundaryOnly.FormalObstruction
open Frobenius MixedForms
variable {k : Type*} [Field k] {d : ℕ} {n : Fin d → ℕ}
variable (ell : ℕ) (htwo : 1 < ell) [CharP k ell] [Fact ell.Prime]

def specialAmbient : Frobenius.Ring (ι := AmbientVar n) (k := k) ell →ₐ[k]
    Frobenius.Ring (ι := InternalVar n) (k := k) ell :=
  eval ell (Sum.elim (fun _ => 0) (coordinate ell)) (by
    intro v
    cases v with
    | inl _ => exact zero_pow (Nat.Prime.ne_zero Fact.out)
    | inr c => exact coordinate_pow ell c)

omit [CharP k ell] in
@[simp] theorem specialAmbient_slope (i : SlopeVar d) :
    specialAmbient (n := n) (k := k) ell (coordinate ell (.inl i)) = 0 :=
  eval_coordinate _ _ _ _

omit [CharP k ell] in
@[simp] theorem specialAmbient_internal (i : InternalVar n) :
    specialAmbient (n := n) (k := k) ell (coordinate ell (.inr i)) = coordinate ell i :=
  eval_coordinate _ _ _ _

 theorem reduce_ambientSlot (a : SlopeVar d → ThreeParameters.Ring k)
    (ha : ∀ i, ThreeParameters.augmentation k (a i) = 0)
    (x : Frobenius.Ring (ι := AmbientVar n) (k := k) ell) :
    reduction ell (ambientSlot ell a ha x) = specialAmbient ell x := by
  have h : (reduction ell).comp (ambientSlot ell a ha) =
      specialAmbient (n := n) (k := k) ell := by
    apply algHom_ext
    intro v
    simp only [AlgHom.comp_apply, ambientSlot_coordinate]
    cases v with
    | inl i => simp only [ambientCoordinates, reduction_base, ha, map_zero, specialAmbient_slope]
    | inr c => simp only [ambientCoordinates, reduction_coordinate, specialAmbient_internal]
  exact AlgHom.congr_fun h x

def specialPotential (D : FormalData (k := k) n) :
    Frobenius.Ring (ι := InternalVar n) (k := k) ell :=
  specialAmbient ell (Ideal.Quotient.mk _ (potential n D.P))

 theorem reduce_movingPotential (D : FormalData (k := k) n)
    (a : SlopeVar d → ThreeParameters.Ring k)
    (ha : ∀ i, ThreeParameters.augmentation k (a i) = 0) :
    reduction ell (movingPotential ell D a ha) = specialPotential ell D :=
  reduce_ambientSlot ell a ha _

 theorem specialNormal_d (D : FormalData (k := k) n) :
    MixedForms.d (partialDeriv ell) (specialNormal ell htwo D) = 0 :=
  chartNormal_d ell _ _

omit [Fact ell.Prime] in
theorem parameter_reduction_partial (i : InternalVar n)
    (x : ParameterScalar (n := n) (k := k) ell) :
    reduction ell (parameterPartial ell i x) = partialDeriv ell i (reduction ell x) :=
  mapCoefficients_partial ell (ThreeParameters.augmentation k) i x

 theorem specialNormal_delta (D : FormalData (k := k) n) :
    delta (partialDeriv ell) (specialPotential ell D) (specialNormal ell htwo D) = 0 := by
  let a : SlopeVar d → ThreeParameters.Ring k := fun _ => 0
  have ha : ∀ i, ThreeParameters.augmentation k (a i) = 0 := fun _ => map_zero _
  have h := congrArg (coefficientMap (reduction ell)) (movingNormal_delta ell htwo D a ha)
  rw [coefficientMap_delta _ _ _ (parameter_reduction_partial ell),
    reduce_movingPotential, reduce_movingNormal, map_zero] at h
  exact h

                                                                                
theorem specialNormal_primitive (D : FormalData (k := k) n)
    (g : MvPowerSeries (GraphVar n) k) (hg : g ∈ gradientIdeal n D.P D.Y) :
    ∃ eta : Forms (k := k) (A := Frobenius.Ring (ι := InternalVar n) (k := k) ell)
        (ι := InternalVar n),
      delta (partialDeriv ell) (specialPotential ell D) eta =
        coeff ((specialChartEquiv ell htwo D).symm
          (graphSlot ell false (Ideal.Quotient.mk _ g))) * specialNormal ell htwo D := by
  let a : SlopeVar d → ThreeParameters.Ring k := fun _ => 0
  have ha : ∀ i, ThreeParameters.augmentation k (a i) = 0 := fun _ => map_zero _
  obtain ⟨eta, he⟩ := movingNormal_primitive ell htwo D a ha g hg
  refine ⟨coefficientMap (reduction ell) eta, ?_⟩
  have h := congrArg (coefficientMap (reduction ell)) he
  rw [coefficientMap_delta _ _ _ (parameter_reduction_partial ell),
    reduce_movingPotential, map_mul, coefficientMap_coeff,
    movingChart_inverse_specialFiber, reduce_movingNormal] at h
  have hr := AlgHom.congr_fun (reduce_movingGraphSlot ell a ha false)
    (Ideal.Quotient.mk _ g)
  change reduction ell (movingGraphSlot ell a ha false (Ideal.Quotient.mk _ g)) = _ at hr
  rw [hr] at h
  exact h

end BoundaryOnly.FormalObstruction

end
end

end OAI