Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Knapsack Method, Step (4), p. 867 — the lexicographic predecessor of (α)_m extends (α¹)_s

Proved
CuttingStock63.Knapsack.lex_predecessor

by mikedeng1 · Oct 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

knapsacklexicographic-orderp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let l1,…,lm>0l_1,\dots,l_m>0l1​,…,lm​>0 and let (α)m(\alpha)_m(α)m​ satisfy L≥λ⋅(α)mL\ge\lambda\cdot(\alpha)_mL≥λ⋅(α)m​. Let sss be the largest index with as≠0a_s\ne0as​=0 and let (α1)s(\alpha^1)_s(α1)s​ be (α)s(\alpha)_s(α)s​ with its sss-th coefficient replaced by as−1a_s-1as​−1. Then:

  1. among the vectors (α′)m(\alpha')_m(α′)m​ of nonnegative integers with L≥λ⋅(α′)mL\ge\lambda\cdot(\alpha')_mL≥λ⋅(α′)m​ that are lexicographically smaller than (α)m(\alpha)_m(α)m​ there is a lexicographically largest one;
  2. every such lexicographically largest vector is an extension of (α1)s(\alpha^1)_s(α1)s​.

This is why Step (5) starts by replacing asa_sas​ by as−1a_s-1as​−1: the next candidate in the lexicographic enumeration agrees with (α)m(\alpha)_m(α)m​ before position sss and has as−1a_s-1as​−1 in position sss.

Formalization Note The page says "the lexicographically largest mmm-vector lexicographically smaller than (α)m(\alpha)_m(α)m​"; the mmm-vectors are read as those satisfying the length constraint, as in the sentence defining the sequence of vectors (without the constraint the coordinates after sss are unbounded and no largest vector exists). The paper's 1-based sss is i.val + 1 for the 0-based index i.

Preamble
import Mathlib
import Definitions.Def_CuttingStock63_Knapsack_Problem
Formal statement
namespace CuttingStock63.Knapsack

/-- Step (4), p. 867: let (α)_m satisfy cap ≥ λ·(α)_m and let `i` (the paper's s, 0-based) be the
largest index with a_i ≠ 0. Among the m-vectors satisfying the length constraint and
lexicographically smaller than (α)_m there is a lexicographically largest one, and every such
largest vector is an extension of (α¹)_s, which differs from (α)_s only in having a_s − 1 as its
s-th coefficient. -/
theorem lex_predecessor {m : ℕ} (l : Fin m → ℝ) (hl : ∀ i, 0 < l i) (cap : ℝ)
    (a : Fin m → ℕ) (hfit : Fits l cap a) (i : Fin m) (hi : a i ≠ 0)
    (hmax : ∀ i' : Fin m, i < i' → a i' = 0) :
    (∃ g : Fin m → ℕ, Fits l cap g ∧ toLex g < toLex a ∧
        ∀ a' : Fin m → ℕ, Fits l cap a' → toLex a' < toLex a → toLex a' ≤ toLex g) ∧
      ∀ g : Fin m → ℕ, Fits l cap g → toLex g < toLex a →
        (∀ a' : Fin m → ℕ, Fits l cap a' → toLex a' < toLex a → toLex a' ≤ toLex g) →
          IsExtension (decrAt a (i.val + 1)) g (i.val + 1) := by sorry

end CuttingStock63.Knapsack
Source
Gilmore & Gomory, A linear programming approach to the cutting stock problem—Part II, Opns. Res. 11 (1963), p. 867, Knapsack Method, Step (4)
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

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