Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 1 — decomposition of the no-stock-out probability of class iii

Proved
BassokSubstitution.no_stockout_identity

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

inventoryp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1probabilitysubstitution

Consider the model with Assumptions 1–3, b≥0b \ge 0b≥0, independent nonnegative demands with densities and finite means, and stock levels y≥0y \ge 0y≥0. For classes k<ik < ik<i,

Pr⁡{Sii=0}+∑m=ki−1Pr⁡{Sim+1>0, S⃗m,im=0}=1−Pr⁡{Sik>0},\Pr\{S^i_i = 0\} + \sum_{m=k}^{i-1} \Pr\{S^{m+1}_i > 0,\ \vec S^m_{m,i} = 0\} = 1 - \Pr\{S^k_i > 0\},Pr{Sii​=0}+m=k∑i−1​Pr{Sim+1​>0, Sm,im​=0}=1−Pr{Sik​>0},

where SjmS^m_jSjm​ is the shortage of class jjj in the subproblem with products m,…,jm, \dots, jm,…,j and S⃗m,im=0\vec S^m_{m,i} = 0Sm,im​=0 means that none of the classes m,…,im, \dots, im,…,i is short in its subproblem starting at product mmm.

The identity splits the event "class iii is not short when products k,…,ik, \dots, ik,…,i are available" according to the least flexible product that already suffices. It is used, with Lemmas 2 and 5, to bound the salvage terms in the proof of Theorem 2.

Formalization Note. The paper prints the sum with "…"; its general term is Pr⁡{Sim+1>0,S⃗m,im=0}\Pr\{S^{m+1}_i > 0, \vec S^m_{m,i} = 0\}Pr{Sim+1​>0,Sm,im​=0} for m=i−1m = i-1m=i−1 down to kkk. Indices are 0-based in Lean. The model hypotheses are those of the whole mission; the identity itself does not need independence.

Preamble
import Mathlib
import Definitions.Def_BassokSubstitution_Profit

open MeasureTheory
Formal statement
namespace BassokSubstitution

/-- Lemma 1: for classes `k < i` (0-based), the probability of no shortage of class `i` in the
subproblem with products `k, …, i` decomposes according to the first product (from `i`
downwards) whose subproblem already has no shortage of class `i`. -/
theorem no_stockout_identity {N : ℕ} (M : Model N)
    (hA1 : M.Assumption1) (hA2 : M.Assumption2) (hA3 : M.Assumption3) (hb : 0 ≤ M.b)
    (ν : Fin N → Measure ℝ) [∀ i, IsProbabilityMeasure (ν i)] (hν : DemandLaw ν)
    (y : Fin N → ℝ) (hy : 0 ≤ y) (k i : Fin N) (hki : k < i) :
    (Measure.pi ν).real {d | shortage y d i i = 0}
        + ∑ m ∈ Finset.univ.filter (fun m : Fin N => k ≤ m ∧ m < i),
            (Measure.pi ν).real {d | 0 < shortage y d (m + 1) i ∧ ShortVecZero y d m m i}
      = 1 - (Measure.pi ν).real {d | 0 < shortage y d k i} := by sorry

end BassokSubstitution
Source
Bassok, Anupindi, Akella, Single-Period Multiproduct Inventory Models with Substitution, Operations Research 47(4):632–642 (1999), p. 635, Lemma 1
Read-back

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

Let NNN be a natural number and MMM a model with data c,p,π,s,bc,p,\pi,s,bc,p,π,s,b.

Hypotheses:

  • Model assumptions: Assumptions 1–3 hold (πj+pj≤πi+pi\pi_j+p_j\le\pi_i+p_iπj​+pj​≤πi​+pi​ and sj≤sis_j\le s_isj​≤si​ for i<ji<ji<j; aij+πj−si≥0a_{ij}+\pi_j-s_i\ge0aij​+πj​−si​≥0 for i≤ji\le ji≤j) and b≥0b\ge0b≥0.
  • Demand laws: ν0,…,νN−1\nu_0,\dots,\nu_{N-1}ν0​,…,νN−1​ are probability measures on R\mathbb RR, each giving (−∞,0)(-\infty,0)(−∞,0) measure 000, with finite mean, and absolutely continuous. P\mathbb PP is their product law on RN\mathbb R^NRN.
  • Stock: y∈RNy\in\mathbb R^Ny∈RN with y≥0y\ge0y≥0.
  • Classes: k<ik<ik<i are classes in {0,…,N−1}\{0,\dots,N-1\}{0,…,N−1}, which forces N≥2N\ge2N≥2.

The model MMM, its assumptions and bbb do not occur in the conclusion.

Notation. All shortages are evaluated at (y,d)(y,d)(y,d).

  • Shortage SjaS^a_jSja​, for a natural number aaa and a class jjj with a≤ja\le ja≤j: the unmet demand of class jjj after the greedy procedure processes classes a,a+1,…,ja,a+1,\dots,ja,a+1,…,j. Starting from stock yyy, each class mmm receives min⁡(unmet,stockl)\min(\text{unmet},\text{stock}_l)min(unmet,stockl​) from products l=m,m−1,…,al=m,m-1,\dots,al=m,m−1,…,a in turn. Sja=0S^a_j=0Sja​=0 if a>ja>ja>j.
  • Vector condition. Za′,naZ^a_{a',n}Za′,na​ means Sla=0S^a_l=0Sla​=0 for every class lll with a′≤l≤na'\le l\le na′≤l≤n.
  • Natural-number indices. m+1m+1m+1 is a natural number.

Conclusion.

P(Sii=0)+∑m:  k≤m<iP(Sim+1>0 and Zm,im)=1−P(Sik>0),\mathbb P\big(S^i_i=0\big)+\sum_{m:\;k\le m<i}\mathbb P\big(S^{m+1}_i>0\text{ and }Z^m_{m,i}\big)=1-\mathbb P\big(S^k_i>0\big),P(Sii​=0)+m:k≤m<i∑​P(Sim+1​>0 and Zm,im​)=1−P(Sik​>0),

where each P(⋅)\mathbb P(\cdot)P(⋅) is the real-valued (outer) measure of the set of demand vectors ddd.

Degenerate cases:

  • k=i−1k=i-1k=i−1. The sum has the single term m=i−1m=i-1m=i−1.
  • Zero stock. yyy may be zero.
  • N≤1N\le1N≤1. No pair k<ik<ik<i exists, so the statement is vacuous.
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