Proof of Theorem 2.3 — every First-Fit bin but the last holds at least m items when no item exceeds 1/m
ProvedBinPacking.BoundedItems.ff_bin_card_geLet be an integer and let be a list of numbers in none of which exceeds . Consider the First-Fit packing of . Then
that is, every bin except possibly the last one contains at least elements.
This is the first step of the paper's proof of the upper bound in Theorem 2.3(ii): it is what guarantees that a lightly filled bin must contain a small element.
Formalization Note The bins are the list ffPack L in the order they were opened; "every bin except the last" is (ffPack L).dropLast, and the number of elements of a bin is the length of its contents list. The step is stated under the proof's own hypothesis "no element exceeding ", which is weaker than with .
import Mathlib import Definitions.Def_BinPacking_BoundedItems_Model
namespace BinPacking.BoundedItems
/-- Johnson et al. 1974, Section 2, proof of Theorem 2.3, p. 308: if no element of `L`
exceeds `1/m` (`m ≥ 1` an integer), then every bin of the First-Fit packing of `L`, except
possibly the last bin, contains at least `m` elements. -/
theorem ff_bin_card_ge (m : ℕ) (hm : 1 ≤ m) (L : List ℝ) (hL : IsList L)
(hLm : ∀ a ∈ L, a ≤ 1 / (m : ℝ)) :
∀ B ∈ (ffPack L).dropLast, m ≤ B.length := by sorry
end BinPacking.BoundedItems
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
The inputs and hypotheses are:
- a natural number ;
- a list of reals whose entries all satisfy and .
Take the First-Fit packing as defined in the model. The items are processed in list order, and each goes into the first existing bin whose level (sum of contents) plus the item is at most ; otherwise it opens a new bin at the end. The statement asserts that every bin other than the last one in this sequence contains at least items:
Here is the number of items in , counted with multiplicity.
Degenerate cases.
- If is empty, there are no bins, and the claim is vacuous.
- If First-Fit uses exactly one bin, the claim is also vacuous.
- The last bin is never constrained.
- For , the claim says only that every non-last bin holds at least one item.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.