Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 4.2 — W(L)≥FFD(L)−N+2W(L) \ge FFD(L) - N + 2W(L)≥FFD(L)−N+2 for L⊆(1/N,1/2]L \subseteq (1/N, 1/2]L⊆(1/N,1/2]

Proved
BinPacking.SmallItems.W_ge_ffd_sub

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

approximation-algorithmsbin-packingp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1weighting-function

Let N≥4N\ge 4N≥4 be an integer and let LLL be a list of real numbers all lying in (1/N,1/2](1/N,1/2](1/N,1/2]. Then the weight of LLL satisfies

W(L)  ≥  FFD(L)−N+2.W(L)\;\ge\; FFD(L)-N+2 .W(L)≥FFD(L)−N+2.

This is the first half of the weighting argument: the total weight of the list falls short of the number of FFD bins by at most a constant depending on NNN. With N=7N=7N=7 it gives FFD(L)−5≤W(L)FFD(L)-5\le W(L)FFD(L)−5≤W(L) for lists in (1/7,1/2](1/7,1/2](1/7,1/2].

Formalization Note WWW is the minimum of w12(π)w_{12}(\pi)w12​(π) over all partitions of LLL into one- and two-element sets, with the elements indexed in nonincreasing order; see the definition file.

Preamble
import Mathlib
import Definitions.Def_BinPacking_SmallItems_Model
import Definitions.Def_BinPacking_SmallItems_Weight
Formal statement
namespace BinPacking.SmallItems

/-- Lemma 4.2 (p. 316): for any integer `N ≥ 4` and `L ⊆ (1/N, 1/2]`, `W(L) ≥ FFD(L) − N + 2`. -/
theorem W_ge_ffd_sub (N : ℕ) (hN : 4 ≤ N) (L : List ℝ) (hL : IsList L)
    (hrange : ∀ a ∈ L, 1 / (N : ℝ) < a ∧ a ≤ 1 / 2) :
    W L ≥ (FFD L : ℝ) - (N : ℝ) + 2 := by sorry

end BinPacking.SmallItems
Source
Johnson, Demers, Ullman, Garey, Graham, Worst-Case Performance Bounds for Simple One-Dimensional Packing Algorithms, SIAM J. Comput. 3(4) (1974), p. 316, Lemma 4.2
Read-back

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

Let NNN be a natural number with N≥4N \ge 4N≥4. Let LLL be a list of reals with 0<a≤10 < a \le 10<a≤1 for every element and 1N<a≤12\frac1N < a \le \frac12N1​<a≤21​ for every element aaa of LLL.

The weight W(L)W(L)W(L) is defined as follows. Let S=(S0,…,Sn−1)S = (S_0,\dots,S_{n-1})S=(S0​,…,Sn−1​) be the nonincreasing rearrangement of LLL. Then

W(L)=min⁡σ(∑i: σ(i)=iw1(Si)+∑i: i<σ(i)w2(Si,Sσ(i))),W(L) = \min_{\sigma}\Big(\sum_{i:\,\sigma(i)=i} w_1(S_i) + \sum_{i:\,i<\sigma(i)} w_2(S_i,S_{\sigma(i)})\Big),W(L)=σmin​(i:σ(i)=i∑​w1​(Si​)+i:i<σ(i)∑​w2​(Si​,Sσ(i)​)),

where:

  • σ\sigmaσ ranges over all permutations of {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1} with σ∘σ=id\sigma\circ\sigma = \mathrm{id}σ∘σ=id;
  • w1(x)=1/⌊1/x⌋w_1(x) = 1/\lfloor 1/x\rfloorw1​(x)=1/⌊1/x⌋;
  • w2(x,y)w_2(x,y)w2​(x,y) is computed with k=⌊1/x⌋k = \lfloor 1/x \rfloork=⌊1/x⌋. It equals w1(x)+k−1kw1(y)w_1(x) + \frac{k-1}{k}w_1(y)w1​(x)+kk−1​w1​(y) when 1k+1<x≤1k\frac1{k+1} < x \le \frac1kk+11​<x≤k1​ and kx+y≤1kx+y \le 1kx+y≤1, and w1(x)+w1(y)w_1(x)+w_1(y)w1​(x)+w1​(y) otherwise.

FFD(L)\mathrm{FFD}(L)FFD(L) is the number of bins used by first-fit on SSS. Each item goes into the lowest-indexed bin whose current sum plus the item is ≤1\le 1≤1, or into a new bin appended at the end.

The statement asserts

W(L)  ≥  FFD(L)−N+2,W(L) \;\ge\; \mathrm{FFD}(L) - N + 2,W(L)≥FFD(L)−N+2,

computed in the reals.

Degenerate cases:

  • Redundant hypothesis. The range hypothesis implies admissibility.
  • Empty LLL. W=0W = 0W=0 and FFD=0\mathrm{FFD} = 0FFD=0, so the claim is 0≥2−N0 \ge 2 - N0≥2−N, which holds since N≥4N \ge 4N≥4.
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