Claim 3.4.6 — among the FFD positions of elements at most , the position order respects the list order
ProvedBinPacking.Decreasing.ffd_position_orderLet be a list of real numbers in , let be in nonincreasing order, and let , and be as in Claim 3.4.5: when is the -th element of bin of the FFD packing, and is the largest index with ( if there is none). Let be the number of elements of bin in . Order positions lexicographically:
Let be the positions of filled by elements after the -th. If , and , then
In words: among elements at most that are not the last element of their FFD bin, an element in an earlier position of the FFD packing comes no later in the sorted list. The fact is used to show that BFD never needs a bin that FFD did not use.
Formalization Note The paper defines as the positions still empty after BFD has placed ; by Claim 3.4.5 these are exactly the FFD positions of , and the statement uses that description. It is phrased on items: for -based items i, i' of sortDesc L with index at least (the paper's ), whose FFD positions are (binOf, slotOf) (-based bin and in-bin position), with slotOf + 1 less than the size of the final bin (the paper's ) and lexicographically ordered positions, the conclusion is i ≤ i'.
import Mathlib import Definitions.Def_BinPacking_Decreasing_Model
namespace BinPacking.Decreasing
/-- Claim 3.4.6 (p. 313), restated through Claim 3.4.5 (the positions of `S_h` are those that
the items after the first `h` fill in the FFD packing `PF`). Let `S = sortDesc L` with
`L ⊆ [1/6, 1]` and `h` the number of elements of `S` exceeding `1/3`. If items `i` and `i'`
of `S`, both after the first `h`, fill positions `(j, k)` and `(j', k')` of `PF`, the item
`i` is not the last one of its bin (`k < k_j`), and `(j, k) ≤ (j', k')` lexicographically,
then `i ≤ i'`. -/
theorem ffd_position_order (L : List ℝ) (hL : IsList L)
(h6 : ∀ a ∈ L, (1 / 6 : ℝ) ≤ a) (i i' : Fin (sortDesc L).length)
(hi : ((sortDesc L).filter (fun a => decide ((1 / 3 : ℝ) < a))).length ≤ (i : ℕ))
(hi' : ((sortDesc L).filter (fun a => decide ((1 / 3 : ℝ) < a))).length ≤ (i' : ℕ))
(hk : slotOf ffChoice (sortDesc L) i + 1 <
((run ffChoice (sortDesc L)).getD (binOf ffChoice (sortDesc L) i) []).length)
(hle : binOf ffChoice (sortDesc L) i < binOf ffChoice (sortDesc L) i' ∨
(binOf ffChoice (sortDesc L) i = binOf ffChoice (sortDesc L) i' ∧
slotOf ffChoice (sortDesc L) i ≤ slotOf ffChoice (sortDesc L) i')) :
i ≤ i' := by sorry
end BinPacking.Decreasing
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Notation:
- is a list of reals with every entry in .
- is sorted into nonincreasing order by a stable merge sort.
- is the number of entries of strictly greater than .
- The first-fit run on processes items in order from no bins and puts each into the lowest-indexed bin whose current sum plus the item is , otherwise a new bin at the end. Its final list of bins is the first-fit packing.
- For a position :
- is the index first-fit chooses for on the bins formed by . This is the current number of bins when a new bin is opened.
- is the number of items already in that bin just before is placed.
- Both are 0-based.
For positions of , the hypotheses are:
- and .
- , where is the number of items in bin number of the final first-fit packing (taken as if that bin does not exist). In other words, is not the last item of its bin in the final packing.
- , or else and . This is the lexicographic comparison .
The conclusion is , a non-strict inequality.
Degenerate cases:
- . The conclusion holds trivially.
- Nothing to check. If is empty, the statement is vacuous. It is also vacuous if , meaning every entry exceeds .
- Hypothesis 2 can fail. It fails whenever is the last item in its final bin. Among other cases, it fails when is the only item of its bin.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.