Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Theorem 2.3 — every First-Fit bin but the last holds at least m items when no item exceeds 1/m

Proved
BinPacking.BoundedItems.ff_bin_card_ge

by mikedeng1 · Sep 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

approximation-algorithmsbin-packingp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let m≥1m\ge 1m≥1 be an integer and let L=(a1,…,an)L=(a_1,\dots,a_n)L=(a1​,…,an​) be a list of numbers in (0,1](0,1](0,1] none of which exceeds 1m\frac1mm1​. Consider the First-Fit packing B1,…,BFF(L)B_1,\dots,B_{FF(L)}B1​,…,BFF(L)​ of LLL. Then

∣Bj∣ ≥ mfor every j<FF(L),|B_j|\ \ge\ m\qquad\text{for every } j<FF(L),∣Bj​∣ ≥ mfor every j<FF(L),

that is, every bin except possibly the last one contains at least mmm 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 1/m1/m1/m", which is weaker than L⊆(0,α]L\subseteq(0,\alpha]L⊆(0,α] with m=⌊α−1⌋m=\lfloor\alpha^{-1}\rfloorm=⌊α−1⌋.

Preamble
import Mathlib
import Definitions.Def_BinPacking_BoundedItems_Model
Formal statement
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
Source
Johnson, Demers, Ullman, Garey, Graham, Worst-Case Performance Bounds for Simple One-Dimensional Packing Algorithms, SIAM J. Comput. 3(4) (1974), p. 308, Section 2, proof of Theorem 2.3
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

The inputs and hypotheses are:

  • a natural number m≥1m \ge 1m≥1;
  • a list LLL of reals whose entries all satisfy 0<a≤10 < a \le 10<a≤1 and a≤1/ma \le 1/ma≤1/m.

Take the First-Fit packing ffPack(L)=(B1,…,Br)\mathrm{ffPack}(L) = (B_1, \dots, B_r)ffPack(L)=(B1​,…,Br​) 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 111; 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 mmm items:

∣Bi∣≥mfor every Bi∈(B1,…,Br−1).|B_i| \ge m \quad \text{for every } B_i \in (B_1, \dots, B_{r-1}).∣Bi​∣≥mfor every Bi​∈(B1​,…,Br−1​).

Here ∣Bi∣|B_i|∣Bi​∣ is the number of items in BiB_iBi​, counted with multiplicity.

Degenerate cases.

  • If LLL 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 BrB_rBr​ is never constrained.
  • For m=1m = 1m=1, the claim says only that every non-last bin holds at least one item.
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me