Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 3.1(c), (15)–(16): ordering times tjt_jtj​, lengths LjL_jLj​, indices IjI_jIj​ and thresholds SjS_jSj​, sjs_jsj​

Definition
RobustInventory_SingleStation_Supplement_Thresholds

by mikedeng1 · Nov 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

inventoryp2o-batch-supp500p2o-gran-per-chapterp2o-plan-paperp2o-v1robust-optimization

This file defines the quantities in the closed-form thresholds of Lemma 3.1(c), for the single-station model with initial stock x0x_0x0​, horizon TTT, unit ordering cost ccc, holding cost hhh and shortage cost ppp, and a demand sequence www.

For an order sequence uuu, the ordering times t1<⋯<tJt_1<\dots<t_Jt1​<⋯<tJ​ are exactly the periods k<Tk<Tk<T with uk>0u_k>0uk​>0; by convention tJ+1=Tt_{J+1}=TtJ+1​=T. Put

Lj=tj+1−tj,Ij=⌊pLj−c 1{j=J}h+p⌋.L_j=t_{j+1}-t_j,\qquad I_j=\Big\lfloor\frac{pL_j-c\,\mathbf 1_{\{j=J\}}}{h+p}\Big\rfloor .Lj​=tj+1​−tj​,Ij​=⌊h+ppLj​−c1{j=J}​​⌋.

The thresholds (15) and (16) are

Sj=∑i=0Ijwtj+i,s1=x0−∑i=0t1−1wi,sj=−∑i=Ij−1+1Lj−1−1wtj−1+i(j≥2).S_j=\sum_{i=0}^{I_j}w_{t_j+i},\qquad s_1=x_0-\sum_{i=0}^{t_1-1}w_i,\qquad s_j=-\sum_{i=I_{j-1}+1}^{L_{j-1}-1}w_{t_{j-1}+i}\quad(j\ge2).Sj​=i=0∑Ij​​wtj​+i​,s1​=x0​−i=0∑t1​−1​wi​,sj​=−i=Ij−1​+1∑Lj−1​−1​wtj−1​+i​(j≥2).

The file also defines the stock before ordering in period kkk, xk=x0+∑i<k(ui−wi)x_k=x_0+\sum_{i<k}(u_i-w_i)xk​=x0​+∑i<k​(ui​−wi​).

The same formulas are used at the nominal demand in Lemma 3.1(c) and at the modified demand in Theorem 3.2(c).

Formalization Note The index jjj runs over 1,…,J1,\dots,J1,…,J, and J=0J=0J=0 is allowed. Empty sums are zero. On ordering times one has Lj≥1L_j\ge1Lj​≥1, so the numerator in IjI_jIj​ is positive (as p>cp>cp>c) and the natural-number floor is the integer floor.

Definition code
import Definitions.Def_RobustInventory_SingleStation_Model

namespace RobustInventory.SingleStation.Supplement

open Finset

/-- `t 1 < t 2 < … < t J` are exactly the periods `k < T` with `u_k > 0`, and `t (J + 1) = T`
(the convention of the proof of Lemma 3.1(c), p. 155). Indices `j` run over `1, …, J`; the other
values of `t` are never used. -/
def IsOrderingTimes (T : ℕ) (u : ℕ → ℝ) (J : ℕ) (t : ℕ → ℕ) : Prop :=
  t (J + 1) = T ∧
    (∀ j ∈ Finset.Icc 1 J, t j < t (j + 1)) ∧
    ∀ k, (k < T ∧ 0 < u k) ↔ ∃ j ∈ Finset.Icc 1 J, t j = k

/-- `L_j = t_{j+1} - t_j`; on ordering times this difference is positive for `1 ≤ j ≤ J`. -/
def intervalLength (t : ℕ → ℕ) (j : ℕ) : ℕ := t (j + 1) - t j

/-- `I_j = ⌊(p L_j - c 1_{j = J}) / (h + p)⌋`. On ordering times and for `1 ≤ j ≤ J` the
numerator is positive (`L_j ≥ 1`, `p > c`), so the natural floor is the integer floor. -/
noncomputable def floorIndex (M : Model) (J : ℕ) (t : ℕ → ℕ) (j : ℕ) : ℕ :=
  ⌊(M.p * (intervalLength t j : ℝ) - (if j = J then M.c else 0)) / (M.h + M.p)⌋₊

/-- (15): `S_j = ∑_{i=0}^{I_j} w_{t_j + i}`, for the demand sequence `w`. -/
noncomputable def upperThreshold (M : Model) (w : ℕ → ℝ) (J : ℕ) (t : ℕ → ℕ) (j : ℕ) : ℝ :=
  ∑ i ∈ Finset.range (floorIndex M J t j + 1), w (t j + i)

/-- (16): `s_1 = x₀ - ∑_{i=0}^{t_1 - 1} w_i` and, for `j ≥ 2`,
`s_j = -∑_{i = I_{j-1} + 1}^{L_{j-1} - 1} w_{t_{j-1} + i}` (empty sums are zero). -/
noncomputable def lowerThreshold (M : Model) (w : ℕ → ℝ) (J : ℕ) (t : ℕ → ℕ) (j : ℕ) : ℝ :=
  if j = 1 then M.x0 - ∑ i ∈ Finset.range (t 1), w i
  else -∑ i ∈ Finset.Ico (floorIndex M J t (j - 1) + 1) (intervalLength t (j - 1)),
    w (t (j - 1) + i)

/-- The stock `x_k = x₀ + ∑_{i<k} (u_i - w_i)` at the beginning of period `k`, before ordering. -/
def stockBefore (M : Model) (w u : ℕ → ℝ) (k : ℕ) : ℝ :=
  M.x0 + ∑ i ∈ Finset.range k, (u i - w i)

end RobustInventory.SingleStation.Supplement
Source
Bertsimas, Thiele, A Robust Optimization Approach to Inventory Theory, Operations Research 54(1):150–168 (2006), pp. 154–155 (PDF 5–6), Lemma 3.1(c), Eqs. (15)–(16), and the conventions of its proof

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