Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section 3.4.3, p. 65 — every greedy marginal-analysis solution is optimal for Problem 5 at its own budget

Proved
ServiceParts.StockLevels.greedy_fill_rate_optimal

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

fill-rategreedy-algorithminventorymarginal-analysisp2o-batch-b23ap2o-gran-per-chapterp2o-plan-bookp2o-v1

Consider n≥1n \ge 1n≥1 item types, item iii with simple Poisson demand of rate λi>0\lambda_i > 0λi​>0, mean repair time τˉi>0\bar\tau_i > 0τˉi​>0, unit cost ci>0c_i > 0ci​>0 and fill rate Fi(s)=∑x<se−λiτˉi(λiτˉi)x/x!F_i(s) = \sum_{x < s} e^{-\lambda_i\bar\tau_i}(\lambda_i\bar\tau_i)^x/x!Fi​(s)=∑x<s​e−λi​τˉi​(λi​τˉi​)x/x!. Problem 5 (3.41) is

max⁡∑i=1nλi∑jλj Fi(si)s.t.∑i=1ncisi≤b,si≥⌊λiτˉi⌋ and integral.\max \sum_{i=1}^n \frac{\lambda_i}{\sum_j \lambda_j}\,F_i(s_i) \quad\text{s.t.}\quad \sum_{i=1}^n c_i s_i \le b,\quad s_i \ge \lfloor \lambda_i\bar\tau_i \rfloor \text{ and integral}.maxi=1∑n​∑j​λj​λi​​Fi​(si​)s.t.i=1∑n​ci​si​≤b,si​≥⌊λi​τˉi​⌋ and integral.

Run the greedy procedure: start from si=⌊λiτˉi⌋s_i = \lfloor\lambda_i\bar\tau_i\rfloorsi​=⌊λi​τˉi​⌋ and repeatedly raise by one the stock level of an item i∗i^*i∗ maximizing

Δi(si)=λi∑jλj⋅Fi(si+1)−Fi(si)ci,\Delta_i(s_i) = \frac{\lambda_i}{\sum_j \lambda_j}\cdot\frac{F_i(s_i + 1) - F_i(s_i)}{c_i},Δi​(si​)=∑j​λj​λi​​⋅ci​Fi​(si​+1)−Fi​(si​)​,

with ties broken arbitrarily. Let s(k)s^{(k)}s(k) be the stock vector after kkk steps. Then for every k≥0k \ge 0k≥0, s(k)s^{(k)}s(k) is an optimal solution of Problem 5 with budget

b=∑i=1nci si(k):b = \sum_{i=1}^n c_i\,s^{(k)}_i:b=i=1∑n​ci​si(k)​:

it satisfies the floor constraints, and every integer vector sss with si≥⌊λiτˉi⌋s_i \ge \lfloor\lambda_i\bar\tau_i\rfloorsi​≥⌊λi​τˉi​⌋ and ∑icisi≤b\sum_i c_i s_i \le b∑i​ci​si​≤b has average fill rate at most that of s(k)s^{(k)}s(k).

The case k=1k = 1k=1 is the book's displayed solution; the book states that continuing in this manner the greedy algorithm finds the optimal solution for the budgets it generates.

Formalization Note The greedy procedure is a relation on sequences, so the statement covers every tie-breaking rule.

Preamble
import Mathlib
import Definitions.Def_ServiceParts_StockLevels_Basic
import Definitions.Def_ServiceParts_StockLevels_CompoundPoissonDemand
import Definitions.Def_ServiceParts_StockLevels_Problems
Formal statement
namespace ServiceParts.StockLevels

theorem greedy_fill_rate_optimal {ι : Type*} [Fintype ι] [DecidableEq ι] [Nonempty ι]
    (lam tbar c : ι → ℝ) (hlam : ∀ i, 0 < lam i) (htbar : ∀ i, 0 < tbar i)
    (hc : ∀ i, 0 < c i) (seq : ℕ → ι → ℕ) (hseq : IsGreedySeq lam tbar c seq) (k : ℕ) :
    (∀ i, ⌊lam i * tbar i⌋₊ ≤ seq k i) ∧
    ∀ s : ι → ℕ, (∀ i, ⌊lam i * tbar i⌋₊ ≤ s i) →
      ∑ i, c i * (s i : ℝ) ≤ ∑ i, c i * (seq k i : ℝ) →
      avgFillRate lam tbar s ≤ avgFillRate lam tbar (seq k) := by sorry

end ServiceParts.StockLevels
Source
Muckstadt, Analysis and Algorithms for Service Parts Supply Chains, Springer 2005, DOI 10.1007/b138879, pp. 64-65, Section 3.4.3, Problem 5, Eq. (3.41), and the greedy procedure
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

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