Claim 2.2.4 — a bin with weight deficit β > 0 has level at most 1 − α − (5/9)β
ProvedBinPacking.FirstFit.weight_deficit_boundLet be a list of reals in and consider the completed First-Fit packing (respectively Best-Fit packing) of . Let a bin of coarseness be filled with , and suppose
Then either
- and , or
- .
The statement consists of the First-Fit and the Best-Fit version. It converts a weight deficit of a bin into an increase of the coarseness of all later bins, which is what bounds the number of bins of weight less than .
Formalization Note The paper prints alternative (i) as " and ". That version is false: First-Fit on the list puts alone in the second bin, whose coarseness is and whose weight is , so ; neither nor holds. The paper's proof only excludes ("If and , it is impossible that "), and the main proof only uses that such a bin contains no element exceeding . The statement here therefore uses . The bin is bin number of the completed run; " and " is written as "the bin is for some ".
import Mathlib import Definitions.Def_BinPacking_FirstFit_Model import Definitions.Def_BinPacking_FirstFit_W
namespace BinPacking.FirstFit
/-- Claim 2.2.4 (p. 306), with alternative (i) read as `b₁ ≤ 1/2` (the printed `b₁ < 1/2` is a
misprint: FF on `(0.6, 0.5)` is a counterexample): in the completed FF packing (resp. BF
packing) of `L`, if bin `j` has coarseness `α < 1/2` and its `W`-weights sum to `1 − β` with
`β > 0`, then either the bin holds a single item `b₁ ≤ 1/2`, or its level is at most
`1 − α − (5/9)β`. -/
theorem weight_deficit_bound (L : List ℝ) (hL : IsList L) :
(∀ (j : ℕ) (hj : j < (ffPack L).length) (β : ℝ), coarseness (ffPack L) j < 1 / 2 →
0 < β → (((ffPack L)[j]).map W).sum = 1 - β →
(∃ b : ℝ, (ffPack L)[j] = [b] ∧ b ≤ 1 / 2) ∨
((ffPack L)[j]).sum ≤ 1 - coarseness (ffPack L) j - 5 / 9 * β) ∧
(∀ (j : ℕ) (hj : j < (bfPack L).length) (β : ℝ), coarseness (bfPack L) j < 1 / 2 →
0 < β → (((bfPack L)[j]).map W).sum = 1 - β →
(∃ b : ℝ, (bfPack L)[j] = [b] ∧ b ≤ 1 / 2) ∨
((bfPack L)[j]).sum ≤ 1 - coarseness (bfPack L) j - 5 / 9 * β) := by sorry
end BinPacking.FirstFit
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let be any finite list of reals with . Let be the completed packing produced by one of these rules:
- First fit (FF): each item in turn goes into the lowest-indexed bin where it fits (level plus item at most ), or opens a new bin at the end.
- Best fit (BF): each item in turn goes into the lowest-indexed bin among those where it fits whose level is maximal among all bins where it fits, or opens a new bin at the end.
With the sum of a bin's items, the coarseness of bin is
so . is the piecewise-linear function
Assertion. The statement asserts, separately for the FF packing and for the BF packing: for every bin index and every real such that
at least one of the following holds:
- bin consists of exactly one item , and ;
- .
This is a non-exclusive "or", and alternative 1 allows equality . For each bin, is forced to equal . So in effect, the claim concerns bins with whose weight sum is strictly below .
Degenerate cases. For the empty list there are no bins and the claim is vacuous. For bin we have , and alternative 2 reads . A bin whose weight sum is at least admits no valid , so for that bin the claim is vacuous.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.