Erdős #530 in Lean (427/428 plan, 5/8): prove interpolate_grid
New file ErdosSwarm/Erdos530Gap428/WindowInterpolation.lean (imports only Erdos530Gap428.Data; no dependency on Plan), imported from ErdosSwarm.lean. It proves, with the exact statement from the task and Plan.lean:
theorem interpolate_grid {t : ℝ} (ht : t ∈ Set.Icc (0 : ℝ) 135) : ∃ i : Cell, i.val = ⌈28 * min t (135 - t)⌉₊ ∧ ∀ (a : Node → ℤ) (c : ℚ), (∀ j, c ≤ ordinate i j + gridPotential a j) → ∀ y ∈ Set.Icc (0 : ℝ) 135, y ≠ t → (c : ℝ) ≤ (s : ℝ) * localScore t y + potential a (shifted t i y)
Proof (all Lean-checked, no sorry):
- Reflection: cdf (135 − u) = 1 − cdf u, so localScore (135 − t) (135 − y) = localScore t y; the case t > 135/2 reduces to the left half, where shifted t i y = i/28 + (y − t) and i = ⌈28t⌉ (so t ≤ i/28 < t + 1/28, i ≤ 1890).
- Cells: for m : ℕ and 0 ≤ l ≤ 1 each tent max(1 − 28|v|/d, 0) with d a positive integer is affine in l at v = (m + l)/28, hence so are both directional weights and W (list induction over the eight windows). The envelope is an infimum of affine functions of the weight, so g is concave on each cell; W and g are even; g ≥ 0.
- Potential: potential a ((j + l)/28) = (1 − l)·potential a (j/28) + l·potential a ((j+1)/28), and gridPotential a j cast to ℝ is potential a (j/28).
- Ordinates: roundDown x ≤ x and the coefficients are in [0, 1], so ordinate i k cast to ℝ is at most the unrounded right expression when i ≤ k and the unrounded left expression when k ≤ i (the minimum at k = i serves both).
- Coefficients: for a witness y > t in the cell [j, j+1] (j = i + ⌊28(y − t)⌋ ≤ 3780, which uses the extra node up to 135 + 1/28), cdf(i/28 − 1/28) ≤ cdf t ≤ cdf(i/28) and cdf y ≤ cdf(j/28 + 1/28) ≤ cdf((j+1)/28 + 1/28); for y < t (cell found with ⌈28(t − y)⌉), cdf y ≥ cdf((j+1)/28 − 2/28) ≥ cdf(j/28 − 2/28). With concavity of g and g ≥ 0 this gives s·localScore t y ≥ the interpolation of the two unrounded ordinates; adding the affine potential and the two nodal hypotheses gives the claim.
How to check:
- scripts/check.sh, rc=0 in my clone on head c4926c8. Last lines: ✔ [9173/9174] Built ErdosSwarm (6.0s) Build completed successfully (9174 jobs). 1935 theorems use only propext, Classical.choice and Quot.sound; none of the 2416 constants under ErdosSwarm uses sorry
- An exact-statement
examplethroughimport ErdosSwarm(open ErdosSwarm.Erdos530Gap ErdosSwarm.Erdos530Gap428) closes withinterpolate_grid ht;#print axioms ErdosSwarm.Erdos530Gap428.interpolate_gridgives [propext, Classical.choice, Quot.sound].
Plan.lean is not changed here: its admitted block for step 5 sits directly below the tent_dual block that my pending step 4/8 (t-91d98dbe35) removes, so editing it here would make the two changes conflict. I tested the swap locally instead (Plan importing WindowInterpolation with its admitted interpolate_grid deleted): lake build ErdosSwarm.Erdos530Gap428.Plan succeeds with 5 sorry warnings (6 at this head), so the plan's conditional proof type-checks against the proved statement. Plan still carries admitted copies of steps 5 and 8 under the same names; whoever assembles should replace them by imports. The import line in ErdosSwarm.lean is placed three lines away from the one step 4/8 adds.
Status: Lean-checked supporting lemma for the 427/428 port; not the open problem. Steps 2, 3, 7 remain open or claimed; 4 is in review.