File size: 10,256 Bytes
2f887db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Computability.PerfectCompleteness.Construction.SourceLocalOddLists
import OAI.Computability.PerfectCompleteness.Foundations.CutSlotAssembly

namespace OAI

section

namespace PerfectCompleteness.CutNativeForms

noncomputable section

open scoped Classical
open RecursiveSpaces DescendantSpaces TreeSourceSpaces HierarchicalArrays PointwiseSpaces

variable {branch : Nat → Nat} {n k t : Nat}

theorem nodeSlots_fill (lower : Nodes branch n)
    (outside : Slots branch n → Fin t → MixedSupport.Slot)
    (inside : Slots branch (Nodes.height lower) → Fin t → MixedSupport.Slot) :
    nodeSlots (CutSlotAssembly.fill (Nodes.path lower) outside inside) lower = inside := by
  funext s
  exact CutSlotAssembly.fill_at_cut (Nodes.path lower) outside inside s

theorem nodeSlots_fill_of_agree (lower : Nodes branch n)
    (p : Path branch n (Nodes.height lower))
    (outside : Slots branch n → Fin t → MixedSupport.Slot)
    (inside : Slots branch (Nodes.height lower) → Fin t → MixedSupport.Slot)
    (hag : ∀ s, p.slotEmbedding s = (Nodes.path lower).slotEmbedding s) :
    nodeSlots (CutSlotAssembly.fill p outside inside) lower = inside := by
  funext s
  change CutSlotAssembly.fill p outside inside ((Nodes.path lower).slotEmbedding s) = inside s
  rw [← hag s]
  exact CutSlotAssembly.fill_at_cut p outside inside s

section Equality

variable {a b c d : Slots branch k → Fin t → MixedSupport.Slot}

def spaceCast (hab : a = b) : H a ≃ₗ[F2] H b := by
  cases hab
  exact LinearEquiv.refl F2 (H a)

def squareCast (hab : a = b) : squareSpace (H a) ≃ₗ[F2] squareSpace (H b) := by
  cases hab
  exact LinearEquiv.refl F2 (squareSpace (H a))

def dualCast (hab : a = b) (z : Module.Dual F2 (squareSpace (H a))) :
    Module.Dual F2 (squareSpace (H b)) := by
  cases hab
  exact z

def formCast (hab : a = b) (F : SourceLocalOddLists.Form a) : SourceLocalOddLists.Form b := by
  cases hab
  exact F

@[simp] theorem dualCast_apply (hab : a = b)
    (z : Module.Dual F2 (squareSpace (H a))) (f : squareSpace (H a)) :
    dualCast hab z (squareCast hab f) = z f := by
  cases hab
  rfl

@[simp] theorem formCast_apply (hab : a = b) (F : SourceLocalOddLists.Form a)
    (f g : H a) : formCast hab F (spaceCast hab f) (spaceCast hab g) = F f g := by
  cases hab
  rfl

theorem squareCast_product (hab : a = b) (f g : H a) :
    squareCast hab (OddListExtraction.productElement (H a) f g) =
      OddListExtraction.productElement (H b) (spaceCast hab f) (spaceCast hab g) := by
  cases hab
  rfl

theorem formCast_multiplication (hab : a = b)
    (z : Module.Dual F2 (squareSpace (H a))) :
    formCast hab (OddListExtraction.multiplicationForm (H a) z) =
      OddListExtraction.multiplicationForm (H b) (dualCast hab z) := by
  cases hab
  rfl

theorem formRank_formCast (hab : a = b) (F : SourceLocalOddLists.Form a) :
    OddListExtraction.formRank (H b) (formCast hab F) =
      OddListExtraction.formRank (H a) F := by
  cases hab
  rfl

theorem squareCast_one (hab : a = b)
    (ha : (1 : Domain a → F2) ∈ squareSpace (H a))
    (hb : (1 : Domain b → F2) ∈ squareSpace (H b)) :
    squareCast hab ⟨1, ha⟩ = ⟨1, hb⟩ := by
  cases hab
  rfl

theorem dualCast_one (hab : a = b) (z : Module.Dual F2 (squareSpace (H a)))
    (ha : (1 : Domain a → F2) ∈ squareSpace (H a))
    (hb : (1 : Domain b → F2) ∈ squareSpace (H b)) :
    dualCast hab z ⟨1, hb⟩ = z ⟨1, ha⟩ := by
  cases hab
  rfl

def oneElement (slots : Slots branch k → Fin t → MixedSupport.Slot)
    (hbranch : ∀ j < k, 0 < branch j) : squareSpace (H slots) :=
  ⟨(1 : Domain slots → F2), TreeSourceSpaces.one_mem_squareSpace slots hbranch⟩

theorem dualCast_normalized (hab : a = b) (hbranch : ∀ j < k, 0 < branch j)
    (z : Module.Dual F2 (squareSpace (H a)))
    (hnorm : z (oneElement a hbranch) = 1) :
    dualCast hab z (oneElement b hbranch) = 1 := by
  cases hab
  exact hnorm

def projectionCast (hab : a = b) (hcd : c = d)
    (p : ∀ s j, MixedSupport.Projection (a s j) (c s j)) :
    ∀ s j, MixedSupport.Projection (b s j) (d s j) := by
  cases hab
  cases hcd
  exact p

theorem spaceCast_HPullback (hab : a = b) (hcd : c = d)
    (p : ∀ s j, MixedSupport.Projection (a s j) (c s j)) (f : H c) :
    spaceCast hab (HPullback p f) =
      HPullback (projectionCast hab hcd p) (spaceCast hcd f) := by
  cases hab
  cases hcd
  rfl

theorem formCast_projection_agreement (hab : a = b) (hcd : c = d)
    (p : ∀ s j, MixedSupport.Projection (a s j) (c s j))
    (F : SourceLocalOddLists.Form a) (G : SourceLocalOddLists.Form c)
    (hagree : ∀ f g, G f g = F (HPullback p f) (HPullback p g)) :
    ∀ f g, formCast hcd G f g = formCast hab F
      (HPullback (projectionCast hab hcd p) f)
      (HPullback (projectionCast hab hcd p) g) := by
  cases hab
  cases hcd
  exact hagree

theorem dualCast_projection_agreement (hab : a = b) (hcd : c = d)
    (p : ∀ s j, MixedSupport.Projection (a s j) (c s j))
    (z : Module.Dual F2 (squareSpace (H a))) (G : SourceLocalOddLists.Form c)
    (hagree : ∀ f g, G f g = OddListExtraction.multiplicationForm (H a) z
      (HPullback p f) (HPullback p g)) :
    ∀ f g, formCast hcd G f g =
      OddListExtraction.multiplicationForm (H b) (dualCast hab z)
        (HPullback (projectionCast hab hcd p) f)
        (HPullback (projectionCast hab hcd p) g) := by
  cases hab
  cases hcd
  exact hagree

end Equality

section Native

variable (lower : Nodes branch n) (p : Path branch n (Nodes.height lower))
  (outside : Slots branch n → Fin t → MixedSupport.Slot)
  (inside : Slots branch (Nodes.height lower) → Fin t → MixedSupport.Slot)
  (hag : ∀ s, p.slotEmbedding s = (Nodes.path lower).slotEmbedding s)

def nativeDual
    (z : Module.Dual F2 (squareSpace (H (nodeSlots (CutSlotAssembly.fill p outside inside) lower)))) :
    Module.Dual F2 (squareSpace (H inside)) :=
  dualCast (nodeSlots_fill_of_agree lower p outside inside hag) z

def nativeForm
    (F : SourceLocalOddLists.Form (nodeSlots (CutSlotAssembly.fill p outside inside) lower)) :
    SourceLocalOddLists.Form inside :=
  formCast (nodeSlots_fill_of_agree lower p outside inside hag) F

theorem nativeForm_multiplication
    (z : Module.Dual F2 (squareSpace (H (nodeSlots (CutSlotAssembly.fill p outside inside) lower)))) :
    nativeForm lower p outside inside hag
      (OddListExtraction.multiplicationForm
        (H (nodeSlots (CutSlotAssembly.fill p outside inside) lower)) z) =
      OddListExtraction.multiplicationForm (H inside) (nativeDual lower p outside inside hag z) :=
  formCast_multiplication (nodeSlots_fill_of_agree lower p outside inside hag) z

theorem nativeForm_rank
    (F : SourceLocalOddLists.Form (nodeSlots (CutSlotAssembly.fill p outside inside) lower)) :
    OddListExtraction.formRank (H inside) (nativeForm lower p outside inside hag F) =
      OddListExtraction.formRank (H (nodeSlots (CutSlotAssembly.fill p outside inside) lower)) F :=
  formRank_formCast (nodeSlots_fill_of_agree lower p outside inside hag) F

theorem nativeDual_normalized (hbranch : ∀ j < Nodes.height lower, 0 < branch j)
    (z : Module.Dual F2 (squareSpace (H (nodeSlots (CutSlotAssembly.fill p outside inside) lower))))
    (hnorm : z (oneElement
      (nodeSlots (CutSlotAssembly.fill p outside inside) lower) hbranch) = 1) :
    nativeDual lower p outside inside hag z (oneElement inside hbranch) = 1 :=
  dualCast_normalized (nodeSlots_fill_of_agree lower p outside inside hag) hbranch z hnorm

variable (outside' : Slots branch n → Fin t → MixedSupport.Slot)
  (inside' : Slots branch (Nodes.height lower) → Fin t → MixedSupport.Slot)

def nativeProjection
    (projection : ∀ s j, MixedSupport.Projection
      (nodeSlots (CutSlotAssembly.fill p outside inside) lower s j)
      (nodeSlots (CutSlotAssembly.fill p outside' inside') lower s j)) :
    ∀ s j, MixedSupport.Projection (inside s j) (inside' s j) :=
  projectionCast (nodeSlots_fill_of_agree lower p outside inside hag)
    (nodeSlots_fill_of_agree lower p outside' inside' hag) projection

theorem nativeForm_projection_agreement
    (projection : ∀ s j, MixedSupport.Projection
      (nodeSlots (CutSlotAssembly.fill p outside inside) lower s j)
      (nodeSlots (CutSlotAssembly.fill p outside' inside') lower s j))
    (F : SourceLocalOddLists.Form (nodeSlots (CutSlotAssembly.fill p outside inside) lower))
    (G : SourceLocalOddLists.Form (nodeSlots (CutSlotAssembly.fill p outside' inside') lower))
    (hagree : ∀ f g, G f g = F (HPullback projection f) (HPullback projection g)) :
    ∀ f g, nativeForm lower p outside' inside' hag G f g =
      nativeForm lower p outside inside hag F
        (HPullback (nativeProjection lower p outside inside hag outside' inside' projection) f)
        (HPullback (nativeProjection lower p outside inside hag outside' inside' projection) g) :=
  formCast_projection_agreement (nodeSlots_fill_of_agree lower p outside inside hag)
    (nodeSlots_fill_of_agree lower p outside' inside' hag) projection F G hagree

theorem nativeDual_projection_agreement
    (projection : ∀ s j, MixedSupport.Projection
      (nodeSlots (CutSlotAssembly.fill p outside inside) lower s j)
      (nodeSlots (CutSlotAssembly.fill p outside' inside') lower s j))
    (z : Module.Dual F2 (squareSpace (H (nodeSlots (CutSlotAssembly.fill p outside inside) lower))))
    (G : SourceLocalOddLists.Form (nodeSlots (CutSlotAssembly.fill p outside' inside') lower))
    (hagree : ∀ f g, G f g = OddListExtraction.multiplicationForm
      (H (nodeSlots (CutSlotAssembly.fill p outside inside) lower)) z
        (HPullback projection f) (HPullback projection g)) :
    ∀ f g, nativeForm lower p outside' inside' hag G f g =
      OddListExtraction.multiplicationForm (H inside) (nativeDual lower p outside inside hag z)
        (HPullback (nativeProjection lower p outside inside hag outside' inside' projection) f)
        (HPullback (nativeProjection lower p outside inside hag outside' inside' projection) g) :=
  dualCast_projection_agreement (nodeSlots_fill_of_agree lower p outside inside hag)
    (nodeSlots_fill_of_agree lower p outside' inside' hag) projection z G hagree

end Native

end
end PerfectCompleteness.CutNativeForms

end

end OAI