Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Lemma 9 — sorted prefix sums are smallest, ∑j≤kLij≥∑j≤kLj\sum_{j\le k}L_{i_j}\ge\sum_{j\le k}L_j∑j≤k​Lij​​≥∑j≤k​Lj​

Proved
FlowJobShop.SPT.sorted_prefix_le

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

combinatoricsp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1schedulingsorting

Let L0,…,Ln−1L_0,\dots,L_{n-1}L0​,…,Ln−1​ be real numbers and let σ\sigmaσ be a bijection of {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1} that lists them in nondecreasing order, Lσ(0)≤Lσ(1)≤⋯≤Lσ(n−1)L_{\sigma(0)}\le L_{\sigma(1)}\le\cdots\le L_{\sigma(n-1)}Lσ(0)​≤Lσ(1)​≤⋯≤Lσ(n−1)​. Then for every bijection ρ\rhoρ of {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1} and every kkk,

∑j=0kLσ(j) ≤ ∑j=0kLρ(j).\sum_{j=0}^{k} L_{\sigma(j)}\ \le\ \sum_{j=0}^{k} L_{\rho(j)} .j=0∑k​Lσ(j)​ ≤ j=0∑k​Lρ(j)​.

The sum of any k+1k+1k+1 of the numbers is at least the sum of the k+1k+1k+1 smallest. In the proof of Lemma 9 (with the jobs renumbered so that L1≤⋯≤LnL_1\le\cdots\le L_nL1​≤⋯≤Ln​) this is the step ∑j=1kLij/m≥∑j=1kLj/m\sum_{j=1}^k L_{i_j}/m\ge\sum_{j=1}^k L_j/m∑j=1k​Lij​​/m≥∑j=1k​Lj​/m.

Formalization Note Positions are 0-based; the statement is purely combinatorial and is not tied to a scheduling instance.

Preamble
import Mathlib
Formal statement
namespace FlowJobShop.SPT

/-- Prefix sums are smallest in sorted order: if `σ` lists `Fin n` so that `L (σ 0) ≤ L (σ 1) ≤ ⋯`,
then for every bijection `ρ` and every `k`, `∑_{j ≤ k} L_{σ j} ≤ ∑_{j ≤ k} L_{ρ j}`
(Gonzalez–Sahni 1978, proof of Lemma 9, p. 47: `∑_{j=1}^k L_{i_j}/m ≥ ∑_{j=1}^k L_j/m`). -/
theorem sorted_prefix_le {n : ℕ} (L : Fin n → ℝ) (σ : Fin n ≃ Fin n)
    (hσ : Monotone fun k => L (σ k)) (ρ : Fin n ≃ Fin n) (k : Fin n) :
    ∑ j ∈ Finset.Iic k, L (σ j) ≤ ∑ j ∈ Finset.Iic k, L (ρ j) := by sorry

end FlowJobShop.SPT
Source
Gonzalez, Sahni, Flowshop and Jobshop Schedules: Complexity and Approximation, Operations Research 26(1) (1978), p. 47, §2, proof of Lemma 9 ('Σ_{j=1}^k L_{i_j}/m ≥ Σ_{j=1}^k L_j/m')
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