Rounding chips to the ends of a block of unit steps #
Fix one block of N ≥ 1 unit steps carrying integer slopes s 0, …, s (N-1).
Chips sit at interior offsets 1, …, N-1 of the block, indexed by a finite set
chips with offsets off and a rounding side side (true = round the chip to
the right end of the block, false = round it to the left end). The only
hypothesis on the slopes is that they may drop across an offset, by at most the
number of chips sitting there.
Moving a chip from offset off i to an end of the block changes the block total
by N - off i (right end) or by -off i (left end); the sum of those changes is
the correction δ. The two main results bound the corrected block total between
N copies of the first slope (minus the number of chips rounded left) and N
copies of the last slope (plus the number of chips rounded right), and the third
bounds |δ| by the total distance the chips travel.
All of this is finite-sum integer arithmetic; no graph theory is involved.
Counting the indices of Finset.range N on one side of a threshold #
Splitting a chip count off a threshold #
Slope bounds inside the block #
The slope at step t is at least the first slope minus the number of chips at
offsets ≤ t.
The slope at step t is at most the last slope plus the number of chips at
offsets > t.
Double counting the chip totals #
The two main bounds #
Rounding every chip to an end of the block cannot push the block total below N
copies of the first slope, less one for each chip rounded to the left end.
Rounding every chip to an end of the block cannot push the block total above N
copies of the last slope, plus one for each chip rounded to the right end.