Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Analysis of ALGORITHM 2 — the packing after Step 3 has at most ∑iXi+t[2k(2+ln⁡1g)]+2+21−1/kln⁡1g\sum_i X_i + t[2k(2+\ln\frac1g)] + 2 + \frac{2}{1-1/k}\ln\frac1g∑i​Xi​+t[2k(2+lng1​)]+2+1−1/k2​lng1​ bins

Proved
KKBinPacking.GeometricGrouping.alg2_step3_card_le

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

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

Consider any run of ALGORITHM 2 with an integer parameter k≥2k \ge 2k≥2 and a real parameter g>0g > 0g>0 on an instance III, whose while loop is executed ttt times, and let XiX_iXi​ be the number of bins created from the linear programming solution in the iii-th execution. The bins produced up to the end of Step 3 (the bins created from the solutions, the bins packing the instances Ji′J'_iJi′​, and the Step 3 bins) form a packing of the pieces of III of size >g> g>g, and their number is at most

∑i=1tXi+t[2k(2+ln⁡1g)]+2+21−1kln⁡1g.\sum_{i=1}^{t} X_i + t\Bigl[2k\Bigl(2 + \ln\frac1g\Bigr)\Bigr] + 2 + \frac{2}{1-\frac1k}\ln\frac1g .i=1∑t​Xi​+t[2k(2+lng1​)]+2+1−k1​2​lng1​.

This is the cost of the packing before the small pieces are reinserted.

Formalization Note The packing property (every bin has load at most 111 and the bins hold exactly the pieces of size >g> g>g) is stated together with the count; it holds because every real piece placed in a principal bin is no larger than the rounded size it replaces.

Preamble
import Mathlib
import Definitions.Def_KKBinPacking_GeometricGrouping_Instance
import Definitions.Def_KKBinPacking_Shared_ConfigLP
import Definitions.Def_KKBinPacking_Shared_AnyFit
import Definitions.Def_KKBinPacking_GeometricGrouping_GeomGroup
import Definitions.Def_KKBinPacking_GeometricGrouping_Algorithm2
open KKBinPacking.Shared
Formal statement
namespace KKBinPacking.GeometricGrouping
theorem alg2_step3_card_le (k : ℕ) (hk : 2 ≤ k) (g : ℝ) (hg0 : 0 < g)
    (I : Multiset ℝ) (hI : IsInstance I) (tr : Alg2Trace k g I) :
    IsPacking (I.filter (fun p => g < p)) (alg2Step3Bins tr.t tr.Bp tr.PJ' tr.P3) ∧
    (Multiset.card (alg2Step3Bins tr.t tr.Bp tr.PJ' tr.P3) : ℝ) ≤
      ((∑ i ∈ Finset.range tr.t, principalCount (tr.x i) : ℕ) : ℝ) +
        tr.t * (2 * (k : ℝ) * (2 + Real.log (1 / g))) +
        2 + (2 / (1 - 1 / (k : ℝ))) * Real.log (1 / g) := by sorry
end KKBinPacking.GeometricGrouping
Source
Karmarkar, Karp, An Efficient Approximation Scheme for the One-Dimensional Bin-Packing Problem, Proc. 23rd FOCS, 1982, p. 317, "The number of bins in the packing produced after Step 3 is" (left column, first display)
Human review
  • Endorsed by Shuze Chen · Oct 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 1, 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