File size: 10,934 Bytes
97c3405
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Combinatorics.CompleteCrossing.Interpolation
import Mathlib.Data.Finset.Prod
import Mathlib.Data.Set.Finite.Basic
import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas

namespace OAI

/-! Even triangular interpolation and unisolvence. -/

section

/-! The even two-triangle set, as actual ordered interpolation coordinates. -/
noncomputable section
namespace Paper170

theorem mem_evenTriangle (s : ℕ) (p q : Fin (2*s)) :
    (p,q) ∈ evenTriangle s ↔
      (p.val < s ∧ q < p) ∨ (s ≤ p.val ∧ p < q) := by
  simp [evenTriangle]

def evenTriangleOffDiagEquiv (s : ℕ) :
    EvenTriangleCoord s ≃ ↥((Finset.univ : Finset (Fin s)).offDiag) where
  toFun pq := by
    obtain ⟨⟨p,q⟩, hpq⟩ := pq
    have hpq := (mem_evenTriangle s p q).mp hpq
    by_cases h : p.val < s
    · exact ⟨(⟨p.val, h⟩, ⟨q.val, by rcases hpq with hq | hq <;> omega⟩), by
        simp only [Finset.mem_offDiag, Finset.mem_univ, true_and, ne_eq, Fin.mk.injEq]
        rcases hpq with hq | hq <;> omega⟩
    · exact ⟨(⟨p.val-s, by omega⟩, ⟨q.val-s, by omega⟩), by
        simp only [Finset.mem_offDiag, Finset.mem_univ, true_and, ne_eq, Fin.mk.injEq]
        rcases hpq with hq | hq <;> omega⟩
  invFun pq := by
    obtain ⟨⟨p,q⟩, hpq⟩ := pq
    have hpq : p ≠ q := (Finset.mem_offDiag.mp hpq).2.2
    by_cases h : q < p
    · exact ⟨(⟨p.val, by omega⟩, ⟨q.val, by omega⟩),
        (mem_evenTriangle s _ _).mpr (Or.inl ⟨p.isLt,h⟩)⟩
    · exact ⟨(⟨p.val+s, by omega⟩, ⟨q.val+s, by omega⟩),
        (mem_evenTriangle s _ _).mpr (Or.inr ⟨by change s ≤ p.val+s; omega,by
          have hpq := Fin.val_ne_of_ne hpq
          change p.val+s < q.val+s
          omega⟩)⟩
  left_inv pq := by
    obtain ⟨⟨p,q⟩, hpq⟩ := pq
    have hpq := (mem_evenTriangle s p q).mp hpq
    apply Subtype.ext
    dsimp
    split_ifs with h h' h'
    · rfl
    · change ¬q.val < p.val at h'
      simp only [Fin.lt_def] at hpq
      omega
    · change q.val-s < p.val-s at h'
      simp only [Fin.lt_def] at hpq
      omega
    · apply Prod.ext <;> apply Fin.ext <;> dsimp <;>
        simp only [Fin.lt_def] at hpq <;> omega
  right_inv pq := by
    obtain ⟨⟨p,q⟩, hpq⟩ := pq
    apply Subtype.ext
    dsimp
    split_ifs with h h' h'
    · rfl
    · change ¬p.val < s at h'
      omega
    · change p.val+s < s at h'
      omega
    · apply Prod.ext <;> apply Fin.ext <;> dsimp <;> omega

theorem even_triangle_card (s : ℕ) : (evenTriangle s).card = s*(s-1) := by
  have hc := Fintype.card_congr (evenTriangleOffDiagEquiv s)
  simp only [EvenTriangleCoord, Fintype.card_coe] at hc
  rw [Finset.offDiag_card, Finset.card_univ, Fintype.card_fin] at hc
  simpa only [Nat.mul_sub_left_distrib, mul_one] using hc

end Paper170

end
end

section

/-! Even-node interpolation by adjoining one fresh node to the checked odd-node theorem. -/
noncomputable section
open PolynomialModule
open Zarankiewicz
namespace Paper170

theorem biBounded_mulRoot {r s : ℕ} {P : BiPoly} (hP : BiBounded r s P) (t : ℝ) :
    BiBounded (r+1) s (mulRoot t P) := by
  refine ⟨bounded_mulRoot t hP.1, ?_⟩
  intro a
  cases a with
  | zero =>
    rw [mulRoot_coeff_zero]
    exact (boundedSpace s).smul_mem _ (hP.2 0)
  | succ a =>
    rw [mulRoot_coeff_succ]
    exact bounded_sub (hP.2 a) ((boundedSpace s).smul_mem _ (hP.2 (a+1)))

theorem insertNode_injective {n : ℕ} (r : Fin (n+1)) (node : Fin n → ℝ)
    (hn : Function.Injective node) (t : ℝ) (ht : ∀i, node i ≠ t) :
    Function.Injective (Fin.insertNth r t node) := by
  intro a b
  refine Fin.succAboveCases r ?_ (fun a => ?_) a
  · refine Fin.succAboveCases r ?_ (fun b => ?_) b
    · intro
      rfl
    · simp only [Fin.insertNth_apply_same, Fin.insertNth_apply_succAbove]
      intro h
      exact (ht b h.symm).elim
  · refine Fin.succAboveCases r ?_ (fun b => ?_) b
    · simp only [Fin.insertNth_apply_same, Fin.insertNth_apply_succAbove]
      intro h
      exact (ht a h).elim
    · simp only [Fin.insertNth_apply_succAbove]
      intro h
      exact congrArg r.succAbove (hn h)

theorem oddTriangle_unisolvent_fin (s : ℕ) (node : Fin (2*s+1) → ℝ)
    (hn : Function.Injective node) (P : BiPoly) (hP : BiBounded s s P)
    (hv : ∀a b : Fin (2*s+1),
      (b < a ∧ a.val ≤ s) ∨ (s < a.val ∧ a < b) → biEval (node a) (node b) P = 0) :
    P = 0 := by
  let x : ℕ → ℝ := fun k => if h : 1 ≤ k ∧ k ≤ 2*s+1 then node ⟨k-1,by omega⟩ else 0
  have hx : Set.InjOn x (Set.Icc 1 (2*s+1)) := by
    intro a ha b hb he
    simp only [Set.mem_Icc] at ha hb
    simp only [x, dite_eq_left ha, dite_eq_left hb] at he
    have := congrArg Fin.val (hn he)
    dsimp at this
    omega
  apply twoTriangle_unisolvent s x hx P hP
  intro a b hab
  rw [mem_twoTriangle] at hab
  have ha : 1 ≤ a ∧ a ≤ 2*s+1 := by omega
  have hb : 1 ≤ b ∧ b ≤ 2*s+1 := by omega
  simp only [x, dite_eq_left ha, dite_eq_left hb]
  apply hv
  change (b-1 < a-1 ∧ a-1 ≤ s) ∨ (s < a-1 ∧ a-1 < b-1)
  omega

theorem evenTriangle_unisolvent_first (s : ℕ) (hs : 2 ≤ s)
    (node : Fin (2*s) → ℝ) (hn : Function.Injective node)
    (P : BiPoly) (hP : BiBounded s (s-1) P)
    (hv : ∀a b, (a,b) ∈ evenTriangle s → biEval (node a) (node b) P = 0) : P = 0 := by
  obtain ⟨t,ht⟩ := (Set.finite_range node).exists_notMem
  have hnt : ∀i, node i ≠ t := fun i h => ht ⟨i,h⟩
  let x : Fin (2*s+1) → ℝ := Fin.insertNth (0 : Fin (2*s+1)) t node
  let Q := swapBi (mulRoot t (swapBi P))
  have hQ : BiBounded s s Q := by
    have hb := biBounded_swap (biBounded_mulRoot (biBounded_swap hP) t)
    simpa only [Nat.sub_add_cancel (by omega : 1 ≤ s)] using hb
  have hev (u v : ℝ) : biEval u v Q = (v-t)*biEval u v P := by
    simp only [Q, biEval_swap, biEval_mulRoot]
  have hzero : Q = 0 := by
    apply oddTriangle_unisolvent_fin s x (insertNode_injective _ node hn t hnt) Q hQ
    intro a b
    refine Fin.succAboveCases (0 : Fin (2*s+1)) ?_ (fun a => ?_) a
    · intro h
      have : False := by simp only [Fin.lt_def, Fin.val_zero] at h; omega
      exact this.elim
    · refine Fin.succAboveCases (0 : Fin (2*s+1)) ?_ (fun b => ?_) b
      · intro _
        simp only [hev, x, Fin.insertNth_apply_same, sub_self, zero_mul]
      · intro hab
        simp only [x, Fin.insertNth_apply_succAbove, hev]
        rw [hv a b]
        · exact mul_zero _
        · rw [mem_evenTriangle]
          simp only [Fin.succAbove_zero, Fin.val_succ, Fin.lt_def] at hab
          simp only [Fin.lt_def]
          omega
  have hroot : mulRoot t (swapBi P) = 0 := by
    apply swapBi.injective
    simpa only [map_zero] using hzero
  have hpzero := eq_zero_of_mulRoot_eq_zero t (s-1) (swapBi P) (biBounded_swap hP).1 hroot
  apply swapBi.injective
  simpa only [map_zero] using hpzero

theorem evenTriangle_unisolvent_second (s : ℕ) (hs : 2 ≤ s)
    (node : Fin (2*s) → ℝ) (hn : Function.Injective node)
    (P : BiPoly) (hP : BiBounded (s-1) s P)
    (hv : ∀a b, (a,b) ∈ evenTriangle s → biEval (node a) (node b) P = 0) : P = 0 := by
  obtain ⟨t,ht⟩ := (Set.finite_range node).exists_notMem
  have hnt : ∀i, node i ≠ t := fun i h => ht ⟨i,h⟩
  let r : Fin (2*s+1) := ⟨s,by omega⟩
  let x : Fin (2*s+1) → ℝ := Fin.insertNth r t node
  have hQ : BiBounded s s (mulRoot t P) := by
    simpa only [Nat.sub_add_cancel (by omega : 1 ≤ s)] using biBounded_mulRoot hP t
  apply eq_zero_of_mulRoot_eq_zero t (s-1) P hP.1
  apply oddTriangle_unisolvent_fin s x (insertNode_injective r node hn t hnt) _ hQ
  intro a b
  refine Fin.succAboveCases r ?_ (fun a => ?_) a
  · intro _
    simp only [biEval_mulRoot, x, Fin.insertNth_apply_same, sub_self, zero_mul]
  · refine Fin.succAboveCases r ?_ (fun b => ?_) b
    · intro hab
      have : False := by
        simp only [Fin.lt_def, r] at hab
        omega
      exact this.elim
    · intro hab
      simp only [x, Fin.insertNth_apply_succAbove, biEval_mulRoot]
      rw [hv a b]
      · exact mul_zero _
      · rw [mem_evenTriangle]
        simp only [Fin.lt_def, r, Fin.succAbove, Fin.val_castSucc] at hab
        simp only [Fin.lt_def]
        split_ifs at hab <;> simp only [Fin.val_castSucc, Fin.val_succ] at hab <;> omega

end Paper170

end
end

section

/-! Bijective interpolation on both even-node degree rectangles. -/
noncomputable section
namespace Paper170

theorem evenTriangle_vanish_first (s : ℕ) (hs : 2 ≤ s)
    (node : Fin (2*s) → ℝ) (hn : Function.Injective node)
    (P : Poly2) (hP : P ∈ rectangle (s-1) (s-2))
    (hv : ∀a b, (a,b) ∈ evenTriangle s → evalTwo (node a) (node b) P = 0) : P = 0 := by
  apply toBiPolynomial.injective
  rw [map_zero]
  apply evenTriangle_unisolvent_first s hs node hn (toBiPolynomial P)
  · convert toBiPolynomial_bounded (s-1) (s-2) P hP using 1 <;> omega
  · intro a b hab
    rw [toBiPolynomial_eval]
    exact hv a b hab

theorem evenTriangle_vanish_second (s : ℕ) (hs : 2 ≤ s)
    (node : Fin (2*s) → ℝ) (hn : Function.Injective node)
    (P : Poly2) (hP : P ∈ rectangle (s-2) (s-1))
    (hv : ∀a b, (a,b) ∈ evenTriangle s → evalTwo (node a) (node b) P = 0) : P = 0 := by
  apply toBiPolynomial.injective
  rw [map_zero]
  apply evenTriangle_unisolvent_second s hs node hn (toBiPolynomial P)
  · convert toBiPolynomial_bounded (s-2) (s-1) P hP using 1 <;> omega
  · intro a b hab
    rw [toBiPolynomial_eval]
    exact hv a b hab

theorem triangleEvaluation_bijective_of_unisolvent (s a b : ℕ) (node : Fin (2*s) → ℝ)
    (hdim : (a+1)*(b+1) = s*(s-1))
    (hv : ∀P ∈ rectangle a b,
      (∀i j, (i,j) ∈ evenTriangle s → evalTwo (node i) (node j) P = 0) → P=0) :
    Function.Bijective (triangleEvaluation s a b node) := by
  let := rectangle_finite a b
  have hi : Function.Injective (triangleEvaluation s a b node) := by
    rw [← LinearMap.ker_eq_bot, LinearMap.ker_eq_bot']
    intro P hP
    apply Subtype.ext
    apply hv P.val P.property
    intro i j hij
    exact congrFun hP ⟨(i,j),hij⟩
  refine ⟨hi, (LinearMap.injective_iff_surjective_of_finrank_eq_finrank ?_).mp hi⟩
  rw [rectangle_dimension, Module.finrank_fintype_fun_eq_card]
  have hc : Fintype.card (EvenTriangleCoord s) = s*(s-1) := by
    rw [Fintype.card_coe, even_triangle_card]
  rw [hc,hdim]

theorem two_triangle_interpolation (s : ℕ) (hs : 2 ≤ s)
    (node : Fin (2*s) → ℝ) (hn : Function.Injective node) :
    Function.Bijective (triangleEvaluation s (s-1) (s-2) node) ∧
      Function.Bijective (triangleEvaluation s (s-2) (s-1) node) := by
  constructor
  · apply triangleEvaluation_bijective_of_unisolvent
    · congr 1 <;> omega
    · exact evenTriangle_vanish_first s hs node hn
  · apply triangleEvaluation_bijective_of_unisolvent
    · rw [Nat.mul_comm]
      congr 1 <;> omega
    · exact evenTriangle_vanish_second s hs node hn

end Paper170

end
end

end OAI