Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definition 3.1: the rule with thresholds (sk,Sk)(s_k,S_k)(sk​,Sk​) and the nominal problem that remains from period kkk and stock xxx

Definition
RobustInventory_SingleStation_Supplement_Policy

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

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

This file defines what it means for a threshold rule to be optimal at every period and every stock in the single-station inventory model, with horizon TTT, purchasing cost CCC of (7) and holding/shortage cost RRR of (8).

For a demand sequence www, a period kkk and a stock xxx at the beginning of period kkk, the tail problem is

min⁡uk,…,uT−1≥0 ∑i=kT−1[C(ui)+R(x+∑l=ki(ul−wl))].\min_{u_k,\dots,u_{T-1}\ge0}\ \sum_{i=k}^{T-1}\Big[C(u_i)+R\Big(x+\sum_{l=k}^{i}(u_l-w_l)\Big)\Big].uk​,…,uT−1​≥0min​ i=k∑T−1​[C(ui​)+R(x+l=k∑i​(ul​−wl​))].

An order sequence is optimal for it if it is nonnegative on periods k,…,T−1k,\dots,T-1k,…,T−1 and has least cost among all such sequences.

Given thresholds (si,Si)(s_i,S_i)(si​,Si​), the rule of Definition 3.1 orders, at stock xix_ixi​,

ui={Si−xiif xi<si,0otherwise,xi+1=xi+ui−wi,u_i=\begin{cases}S_i-x_i&\text{if }x_i<s_i,\\0&\text{otherwise,}\end{cases}\qquad x_{i+1}=x_i+u_i-w_i,ui​={Si​−xi​0​if xi​<si​,otherwise,​xi+1​=xi​+ui​−wi​,

starting from xk=xx_k=xxk​=x. At k=0k=0k=0 and x=x0x=x_0x=x0​ the tail problem is the nominal problem of the published model.

Formalization Note The rule is started at an arbitrary pair (k,x)(k,x)(k,x); its values at periods before kkk are never used.

Definition code
import Definitions.Def_RobustInventory_SingleStation_Model

namespace RobustInventory.SingleStation.Supplement

open Finset

/-- The stock at the end of period `i ≥ k` when the stock at the beginning of period `k` is `x`:
`x + ∑_{l=k}^{i} (u_l - w_l)`. -/
def tailStock (w u : ℕ → ℝ) (k : ℕ) (x : ℝ) (i : ℕ) : ℝ :=
  x + ∑ l ∈ Finset.Ico k (i + 1), (u l - w l)

/-- The cost of periods `k, …, T - 1` of the nominal problem with demand `w`, from the stock `x`
at the beginning of period `k`: `∑_{i=k}^{T-1} (C(u_i) + R(x_{i+1}))`. -/
noncomputable def tailCost (M : Model) (w : ℕ → ℝ) (k : ℕ) (x : ℝ) (u : ℕ → ℝ) : ℝ :=
  ∑ i ∈ Finset.Ico k M.T, (M.C (u i) + M.R (tailStock w u k x i))

/-- `u` is optimal for the nominal problem that remains from period `k` and stock `x`: it is
nonnegative on periods `k, …, T - 1` and minimizes `tailCost` over all such sequences. -/
def IsTailOptimal (M : Model) (w : ℕ → ℝ) (k : ℕ) (x : ℝ) (u : ℕ → ℝ) : Prop :=
  (∀ i ∈ Finset.Ico k M.T, 0 ≤ u i) ∧
    ∀ u' : ℕ → ℝ, (∀ i ∈ Finset.Ico k M.T, 0 ≤ u' i) →
      tailCost M w k x u ≤ tailCost M w k x u'

/-- The order of Definition 3.1 with thresholds `s`, `S` at stock `x`:
`S - x` if `x < s` and `0` otherwise. -/
noncomputable def sSOrder (s S x : ℝ) : ℝ := if x < s then S - x else 0

/-- `sSStock s S w k x n` is the stock at the beginning of period `k + n` when the rule with
thresholds `(s_i, S_i)` is followed from period `k` and stock `x`, against the demand `w`. -/
noncomputable def sSStock (s S w : ℕ → ℝ) (k : ℕ) (x : ℝ) : ℕ → ℝ
  | 0 => x
  | n + 1 => sSStock s S w k x n +
      sSOrder (s (k + n)) (S (k + n)) (sSStock s S w k x n) - w (k + n)

/-- The order of period `i ≥ k` under that rule. Its values at `i < k` are never used. -/
noncomputable def sSPolicy (s S w : ℕ → ℝ) (k : ℕ) (x : ℝ) (i : ℕ) : ℝ :=
  sSOrder (s i) (S i) (sSStock s S w k x (i - k))

end RobustInventory.SingleStation.Supplement
Source
Bertsimas, Thiele, A Robust Optimization Approach to Inventory Theory, Operations Research 54(1):150–168 (2006), p. 154 (PDF 5), Definition 3.1; p. 152 (PDF 3), Eqs. (5)–(8)

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