Occupancy-weighted boundary counts for shifted buckets
ProvedPvsNP.sum_bucket_crossings_eq_weightedcombinatoricscomplexity-theoryformal-verification
For each of finitely many edges, specify a base position, a segment length at most the bucket width, and a crossing multiplicity. Shift all bucket partitions by the same phase. The total preserved crossing multiplicity, summed over all phases, is the sum over edges of segment length times crossing multiplicity.
Preamble
import Lean.Elab.Tactic.Omega import Mathlib.Algebra.BigOperators.Group.Finset.Basic import Mathlib.Algebra.Group.Fin.Basic import Mathlib.SetTheory.Cardinal.Finite set_option autoImplicit false
Formal statement
theorem PvsNP.sum_bucket_crossings_eq_weighted {Edge : Type*} (edges : Finset Edge)
(width : ℕ) (base load crossings : Edge → ℕ) (positive : 0 < width)
(short : ∀ e ∈ edges, load e ≤ width) :
(∑ shift : Fin width, ∑ e ∈ edges,
if (base e + shift.val) / width < (base e + shift.val + load e) / width
then crossings e else 0) = ∑ e ∈ edges, load e * crossings e := by sorrySource
Original finite counting lemma for occupancy-weighted work-window replay.