op_2130_centered_path_potential_right_step
Moving one unit from vertex i to its right neighbor increases the centered weighted path potential by two.
Statement
theorem op_2130_centered_path_potential_right_step (D : ℕ) (hD : 1 ≤ D) (d : Fin (2 * D) → ℤ) (i : Fin (2 * D - 1)) : (∑ v : Fin (2 * D), (2 * (v.val : ℤ) + 1 - 2 * (D : ℤ)) * carpool_step (2 * D) d (⟨i.val, by omega⟩, ⟨i.val + 1, by omega⟩) false v) = (∑ v : Fin (2 * D), (2 * (v.val : ℤ) + 1 - 2 * (D : ℤ)) * d v) + 2
- Source
- OP-2130: exact increment of the centered weighted path potential
- Verified
- 22 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- carpool_stepIn online carpooling on n vertices, given an edge e joining two distinct vertices and an orientation bit b, the discrepancy vector d…
- Used by 2
- op_2130_path_cascade_witnessFor every D ≥ 1 there is an edge sequence on SimpleGraph.pathGraph (2*D) of length at most D^3 and one coin tape whose greedy run reaches…
- op_2130_terminal_path_cascade_witnessFor every positive D, there is a fixed sequence of at most D³ requests on the 2D-vertex path and a fixed coin tape for which the terminal…
The proof, explained
The centered weighted path potential assigns each vertex $v \in \{0, \dots, 2D - 1\}$ the weight $2v + 1 - 2D$. Moving one unit of load from vertex $i$ to its right neighbor $i + 1$ decreases the load at $i$ by 1 and increases the load at $i + 1$ by 1, leaving all other vertices unaffected. The net change in potential is therefore the difference between the weights of $i + 1$ and $i$, which is $(2(i+1) + 1 - 2D) - (2i + 1 - 2D) = 2$.
The edge endpoints $i$ and $i+1$ are valid vertices in $\mathrm{Fin}(2D)$. automation
Because $i \in \mathrm{Fin}(2D - 1)$, we have $i < 2D - 1$. Linear integer arithmetic (`omega`) verifies both $i < 2D$ and $i + 1 < 2D$, ensuring that the endpoints $\langle i, \dots \rangle$ and $\langle i + 1, \dots \rangle$ are well-formed elements of $\mathrm{Fin}(2D)$.
theorem op_2130_centered_path_potential_right_step (D : ℕ) (hD : 1 ≤ D) (d : Fin (2 * D) → ℤ) (i : Fin (2 * D - 1)) : (∑ v : Fin (2 * D), (2 * (v.val : ℤ) + 1 - 2 * (D : ℤ)) * carpool_step (2 * D) d (⟨i.val, by omega⟩, ⟨i.val + 1, by omega⟩) false v) = (∑ v : Fin (2 * D), (2 * (v.val : ℤ) + 1 - 2 * (D : ℤ)) * d v) + 2 := by
Moving one unit from vertex $i$ to $i + 1$ increases the centered path potential by 2.
Unfolding `carpool_step` with orientation `false` shows that the state $d$ decreases by 1 at vertex $i$ and increases by 1 at vertex $i + 1$, remaining unchanged everywhere else. Distributing the vertex weights $2v + 1 - 2D$ and splitting the sum with `Finset.sum_add_distrib`, `mul_add`, and `mul_ite` isolates the change as $-(2i + 1 - 2D) + (2(i + 1) + 1 - 2D)$. Ring arithmetic (`ring`) then simplifies this difference of weights to $+2$.
uses
carpool_step,mul_add,mul_ite,Finset.sum_add_distribsimp [carpool_step, mul_add, mul_ite, Finset.sum_add_distrib] <;> ring
carpool_step- The operation updating a load vector $d$ along a directed edge $e = (u, v)$ by subtracting 1 at $u$ and adding 1 at $v$ when the orientation boolean is false (and the reverse when true), leaving other vertices unchanged.
mul_add- Left distributivity of multiplication over addition: $a(b + c) = ab + ac$.
mul_ite- Distributivity of multiplication over an if-then-else branch: $a \cdot (\text{if } P \text{ then } b \text{ else } c) = \text{if } P \text{ then } ab \text{ else } ac$.
Finset.sum_add_distrib- Distributivity of finite sums over addition: $\sum_{x \in s} (f(x) + g(x)) = \sum_{x \in s} f(x) + \sum_{x \in s} g(x)$.
- The tactic `omega` appears on line 1 within the theorem statement to discharge the proof obligations that the edge endpoints $i$ and $i+1$ satisfy the bounds required to belong to $\mathrm{Fin}(2D)$.
- On line 2, `simp` unfolds the definition of `carpool_step`, distributes the weights, and evaluates the finite sums over the indicator functions for the endpoints $i$ and $i+1$, leaving an algebraic expression that `ring` closes.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem op_2130_centered_path_potential_right_step (D : ℕ) (hD : 1 ≤ D) (d : Fin (2 * D) → ℤ) (i : Fin (2 * D - 1)) : (∑ v : Fin (2 * D), (2 * (v.val : ℤ) + 1 - 2 * (D : ℤ)) * carpool_step (2 * D) d (⟨i.val, by omega⟩, ⟨i.val + 1, by omega⟩) false v) = (∑ v : Fin (2 * D), (2 * (v.val : ℤ) + 1 - 2 * (D : ℤ)) * d v) + 2 := by simp [carpool_step, mul_add, mul_ite, Finset.sum_add_distrib] <;> ring