Distance-weighted co-location under shifted grids
ProvedPvsNP.sum_bucket_colocations_eq_weightedcombinatoricscomplexity-theoryformal-verification
Take finitely many pairs of locations on the natural-number line, each with a weight. Partition the line into equal buckets and sum the weight of pairs in one bucket over all common grid shifts. Each pair contributes its weight times the bucket width minus its distance, truncated at zero.
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_colocations_eq_weighted {Event : Type*} (events : Finset Event)
(width : ℕ) (base distance weight : Event → ℕ) (positive : 0 < width) :
(∑ shift : Fin width, ∑ e ∈ events,
if (base e + shift.val) / width = (base e + shift.val + distance e) / width
then weight e else 0) = ∑ e ∈ events, (width - distance e) * weight e := by sorrySource
Original distance-weighted calculation for live work-tape windows.