Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Lost-sales dynamics, admissible policies, and the two-variable cost certificate

Definition
CappedBaseStock_Model

by StellaXin · Sep 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

approximationcapped-base-stockinventorylost-salesoperations-research

Consider a periodic-review lost-sales inventory system. Demand is i.i.d., nonnegative and real-valued, with 0<μ=E[D]<∞0<\mu=\mathbb E[D]<\infty0<μ=E[D]<∞. Lead time is an integer L≥1L\ge1L≥1, and holding and lost-sales rates satisfy h,p>0h,p>0h,p>0. Inventory and the LLL pipeline coordinates initially equal zero. The first pipeline component arrives, the order is placed before current demand is observed, demand is served up to available inventory, and the remaining pipeline shifts; today's order arrives LLL periods later. The period cost is hIt+1+p(Dt−It−x1,t)+hI_{t+1}+p(D_t-I_t-x_{1,t})^+hIt+1​+p(Dt​−It​−x1,t​)+.

Costs use the upper limit of finite-horizon expected average costs from this empty initial state. OPT\mathrm{OPT}OPT is the infimum over all measurable, possibly time-dependent history policies in the canonical demand-path model, with independent uniform private randomization. Infinite expected costs remain infinite. A capped base-stock rule orders min⁡{(S−It−∑ixi,t)+,r}\min\{(S-I_t-\sum_i x_{i,t})^+,r\}min{(S−It​−∑i​xi,t​)+,r}, with finite S,r≥0S,r\ge0S,r≥0. Its cost is denoted by C(πS,r)C(\pi_{S,r})C(πS,r​), and CCBS∗C^*_{\rm CBS}CCBS∗​ is the infimum over these parameters. Ordinary base stock at level SSS is the same rule with cap SSS.

For a demand block, let Irm=max⁡0≤k≤m∑i=1k(r−Di)I_r^m=\max_{0\le k\le m}\sum_{i=1}^k(r-D_i)Irm​=max0≤k≤m​∑i=1k​(r−Di​), including the zero empty sum. A pair (r,z)(r,z)(r,z) is feasible when 0≤r≤μ0\le r\le\mu0≤r≤μ, z≥0z\ge0z≥0, and, for both m=Lm=Lm=L and m=L+1m=L+1m=L+1,

E[(Irm+∑i=1m(Di−r)−z)+]≤m(μ−r).\mathbb E\left[\left(I_r^m+\sum_{i=1}^m(D_i-r)-z\right)^+\right]\le m(\mu-r).E[(Irm​+i=1∑m​(Di​−r)−z)+]≤m(μ−r).

The lower certificate C‾\underline CC​ is the infimum of hz+p(μ−r)hz+p(\mu-r)hz+p(μ−r) over this feasible set. Neither attainment of the infimum nor positivity of OPT\mathrm{OPT}OPT is assumed.

The formal representation uses nonnegative real stock and orders, a canonical infinite product of the demand law, and an independent uniform seed on [0,1][0,1][0,1]. A policy's period-ttt decision is a measurable function of the demands in periods 0,…,t−10,\ldots,t-10,…,t−1 and that seed. Period zero corresponds to period one in the manuscript. The explicit capped-policy state recursion uses the same zero initial state. Nonnegative expectations, upper limits, and infima take values in [0,∞][0,\infty][0,∞].

The factor is κL=1+4L2/((L+1)(3L−1))\kappa_L=1+4L^2/((L+1)(3L-1))κL​=1+4L2/((L+1)(3L−1)), with ρ=L/(L+1)\rho=L/(L+1)ρ=L/(L+1). The definitions contain no assumptions of stationary optimality or approximation inequalities. Establishing any stationary representation and its connection to zero-start expected average costs remains mathematical work. The canonical policy representation is a stated convention; connecting general randomized control formulations to it is an additional representation obligation.

Definition code
import Mathlib.Probability.Independence.InfinitePi
import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
import Mathlib.MeasureTheory.Integral.Bochner.Basic
import Mathlib.Order.Filter.ENNReal
import Mathlib.Tactic

/-!
# Periodic-review lost-sales model for the capped base-stock approximation theorem

This file contains definitions, with no admitted facts. Time is zero-based: `t = 0`
is period 1 of the manuscript. The state is immediately before delivery, so an order
placed at `t` first arrives at `t + L`. Both initial inventory and pipeline are zero.

The probability space is the canonical i.i.d. nonnegative demand path together with
an independent uniform `[0,1]` seed. An admissible policy is an arbitrary sequence of
Borel measurable functions of the strict demand history and that private seed. Thus
policies need not be stationary, Markov, bounded, or integrable. This is the standard
Borel realization convention for randomized nonanticipative policies; deterministic
policies simply ignore the seed. Equivalence with formulations on arbitrary private
probability spaces is not proved here. Past orders and states are functions of the same
history and seed. Costs and both policy infima take values in `ℝ≥0∞`, so divergent
expectations and infinite long-run costs are retained as infinity.
-/

noncomputable section

open MeasureTheory ProbabilityTheory Filter
open scoped ENNReal NNReal BigOperators

namespace CappedBaseStock

/-- Exactly the paper's distribution assumptions: nonnegative demand, probability
law, finite mean, and strictly positive mean. -/
structure DemandLaw where
  law : Measure ℝ≥0
  probability : IsProbabilityMeasure law
  finiteMean : Integrable (fun d : ℝ≥0 => (d : ℝ)) law
  positiveMean : 0 < ∫ d : ℝ≥0, (d : ℝ) ∂law

attribute [instance] DemandLaw.probability

/-- The (finite real) mean demand. -/
def mean (P : DemandLaw) : ℝ := ∫ d : ℝ≥0, (d : ℝ) ∂P.law

/-- Exactly the lead-time and cost assumptions in the model. -/
structure Parameters where
  L : ℕ
  leadTime_pos : 1 ≤ L
  h : ℝ
  p : ℝ
  holding_pos : 0 < h
  penalty_pos : 0 < p

abbrev DemandPath := ℕ → ℝ≥0
abbrev Sample := DemandPath × ℝ

/-- Canonical i.i.d. demand measure. -/
def demandPathLaw (P : DemandLaw) : Measure DemandPath :=
  Measure.infinitePi (fun _ : ℕ => P.law)

/-- Private uniform seed in the chosen realization of randomized history-dependent
control rules. The whole seed is available to the controller before period 0. -/
def seedLaw : Measure ℝ := volume.restrict (Set.Icc 0 1)

instance seedLaw_probability : IsProbabilityMeasure seedLaw := by
  constructor
  simp [seedLaw, Real.volume_Icc]

/-- Independent product of the complete demand sequence and the private seed. -/
def sampleLaw (P : DemandLaw) : Measure Sample := (demandPathLaw P).prod seedLaw

instance demandPathLaw_probability (P : DemandLaw) : IsProbabilityMeasure (demandPathLaw P) := by
  unfold demandPathLaw
  infer_instance

instance sampleLaw_probability (P : DemandLaw) : IsProbabilityMeasure (sampleLaw P) := by
  unfold sampleLaw
  infer_instance

/-- The demand observations that are available before the order at time `t`. -/
def history (t : ℕ) (ω : Sample) : (Fin t → ℝ≥0) × ℝ :=
  (fun i => ω.1 i, ω.2)

/-- The full class of measurable nonanticipative policies, allowing time dependence
and private randomization. Current demand `D_t` is absent from the arguments. -/
structure AdmissiblePolicy where
  decision : (t : ℕ) → ((Fin t → ℝ≥0) × ℝ) → ℝ≥0
  measurable_decision : ∀ t, Measurable (decision t)

/-- The order induced on the canonical probability space. -/
def order (π : AdmissiblePolicy) (t : ℕ) (ω : Sample) : ℝ≥0 :=
  π.decision t (history t ω)

/-- Pre-delivery on-hand inventory and the `L` delivery slots. Slot 0 arrives now. -/
abbrev State (L : ℕ) := ℝ≥0 × (Fin L → ℝ≥0)

def initialState (L : ℕ) : State L := (0, fun _ => 0)

def arrival (c : Parameters) (s : State c.L) : ℝ≥0 :=
  s.2 ⟨0, lt_of_lt_of_le Nat.zero_lt_one c.leadTime_pos⟩

/-- Inventory recursion uses truncated subtraction on `ℝ≥0`, which is the paper's
positive part. Delivery precedes demand, and today's order enters the last slot. -/
def step (c : Parameters) (s : State c.L) (q d : ℝ≥0) : State c.L :=
  (s.1 + arrival c s - d,
    fun i => if hi : i.val + 1 < c.L then s.2 ⟨i.val + 1, hi⟩ else q)

/-- Zero-start trajectory for any admissible history-dependent policy. -/
def run (c : Parameters) (π : AdmissiblePolicy) (ω : Sample) : ℕ → State c.L
  | 0 => initialState c.L
  | t + 1 => step c (run c π ω t) (order π t ω) (ω.1 t)

def filledDemand (c : Parameters) (s : State c.L) (d : ℝ≥0) : ℝ≥0 :=
  min d (s.1 + arrival c s)

def lostSales (c : Parameters) (s : State c.L) (d : ℝ≥0) : ℝ≥0 :=
  d - (s.1 + arrival c s)

/-- Nonnegative one-period cost `h I_(t+1) + p ell_t`, without a Bochner-integral
fallback to zero for nonintegrable policies. -/
def periodCost (c : Parameters) (s : State c.L) (d : ℝ≥0) : ℝ≥0∞ :=
  ENNReal.ofReal c.h * (↑(s.1 + arrival c s - d) : ℝ≥0∞) +
    ENNReal.ofReal c.p * (↑(lostSales c s d) : ℝ≥0∞)

/-- `T + 1` avoids an irrelevant zero-length denominator. This is exactly the
limsup of expected Cesàro costs, with the same limit as horizons `T ≥ 1`. -/
def averageCost (P : DemandLaw) (cost : ℕ → Sample → ℝ≥0∞) : ℝ≥0∞ :=
  Filter.limsup (fun T : ℕ =>
    (∑ t ∈ Finset.range (T + 1), ∫⁻ ω, cost t ω ∂sampleLaw P) /
      (T + 1 : ℝ≥0∞)) Filter.atTop

def policyCost (P : DemandLaw) (c : Parameters) (π : AdmissiblePolicy) : ℝ≥0∞ :=
  averageCost P (fun t ω => periodCost c (run c π ω t) (ω.1 t))

/-- Infimum over *all* admissible policies, not a stationary-policy optimum. -/
def OPT (P : DemandLaw) (c : Parameters) : ℝ≥0∞ :=
  ⨅ π : AdmissiblePolicy, policyCost P c π

/-- Finite-parameter capped base-stock order rule, applied before the delivery
slot is removed from inventory position. -/
def cbsOrder (L : ℕ) (S r : ℝ≥0) (s : State L) : ℝ≥0 :=
  min (S - (s.1 + ∑ i : Fin L, s.2 i)) r

/-- Actual closed-loop capped base-stock trajectory from the same zero state. -/
def cbsRun (c : Parameters) (S r : ℝ≥0) (ω : Sample) : ℕ → State c.L
  | 0 => initialState c.L
  | t + 1 => step c (cbsRun c S r ω t) (cbsOrder c.L S r (cbsRun c S r ω t)) (ω.1 t)

def cbsCost (P : DemandLaw) (c : Parameters) (S r : ℝ≥0) : ℝ≥0∞ :=
  averageCost P (fun t ω => periodCost c (cbsRun c S r ω t) (ω.1 t))

/-- The CBS class uses finite, nonnegative parameters. Ordinary base-stock is
already included by choosing `r = S`; no infinite cap or stock level is used. -/
def CbsOpt (P : DemandLaw) (c : Parameters) : ℝ≥0∞ :=
  ⨅ S : ℝ≥0, ⨅ r : ℝ≥0, cbsCost P c S r

def baseStockCost (P : DemandLaw) (c : Parameters) (S : ℝ≥0) : ℝ≥0∞ :=
  cbsCost P c S S

/-- Exact finite maximum `max_(0 ≤ k ≤ m) sum_(i=1)^k (r-D_i)`.
Demand coordinate 0 here is the manuscript's `D_1`. -/
def finiteInventory (d : DemandPath) (r : ℝ) (m : ℕ) : ℝ :=
  (Finset.range (m + 1)).sup' (by simp) (fun k =>
    ∑ i ∈ Finset.range k, (r - (d i : ℝ)))

/-- The positive-part random variable appearing in each certificate constraint. -/
def certificateExcess (d : DemandPath) (r z : ℝ) (m : ℕ) : ℝ≥0∞ :=
  ENNReal.ofReal (finiteInventory d r m +
    (∑ i ∈ Finset.range m, ((d i : ℝ) - r)) - z)

/-- The two distinct horizon constraints of the paper, expressed using genuine
nonnegative expectations; all finite-mean distributions are allowed. -/
def CertificateFeasible (P : DemandLaw) (c : Parameters) (r z : ℝ) : Prop :=
  0 ≤ r ∧ r ≤ mean P ∧ 0 ≤ z ∧
  (∫⁻ d, certificateExcess d r z c.L ∂demandPathLaw P) ≤
    ENNReal.ofReal ((c.L : ℝ) * (mean P - r)) ∧
  (∫⁻ d, certificateExcess d r z (c.L + 1) ∂demandPathLaw P) ≤
    ENNReal.ofReal (((c.L : ℝ) + 1) * (mean P - r))

def certificateObjective (P : DemandLaw) (c : Parameters) (r z : ℝ) : ℝ≥0∞ :=
  ENNReal.ofReal (c.h * z + c.p * (mean P - r))

/-- Lower certificate as an extended nonnegative infimum; feasibility is part of
its indexing set, not an assumption that encodes any desired conclusion. -/
def lowerCertificate (P : DemandLaw) (c : Parameters) : ℝ≥0∞ :=
  ⨅ rz : {rz : ℝ × ℝ // CertificateFeasible P c rz.1 rz.2},
    certificateObjective P c rz.val.1 rz.val.2

/-- The exact lead-time-dependent ratio in the main theorem. -/
def rho (L : ℕ) : ℝ := (L : ℝ) / ((L : ℝ) + 1)

def kappa (L : ℕ) : ℝ :=
  1 + 4 * (L : ℝ) ^ 2 / (((L : ℝ) + 1) * (3 * (L : ℝ) - 1))



/-- Complete a finite observed history with zero demands. Future coordinates are
only placeholders: `cbsRun_congr_history` proves that they do not affect the state. -/
def completeHistory (t : ℕ) (a : (Fin t → ℝ≥0) × ℝ) : Sample :=
  (fun k => if hk : k < t then a.1 ⟨k, hk⟩ else 0, a.2)

lemma measurable_completeHistory (t : ℕ) : Measurable (completeHistory t) := by
  unfold completeHistory
  refine Measurable.prodMk (measurable_pi_lambda _ (fun k => ?_)) measurable_snd
  split_ifs <;> fun_prop

lemma measurable_cbsRun (c : Parameters) (S r : ℝ≥0) (t : ℕ) :
    Measurable (fun ω => cbsRun c S r ω t) := by
  induction t with
  | zero => exact measurable_const
  | succ t ih =>
    simp only [cbsRun, step, cbsOrder, arrival]
    refine Measurable.prodMk ?_ (measurable_pi_lambda _ (fun i => ?_))
    · fun_prop
    · split_ifs <;> fun_prop

lemma measurable_cbsOrder (L : ℕ) (S r : ℝ≥0) : Measurable (cbsOrder L S r) := by
  unfold cbsOrder
  fun_prop

/-- The CBS feedback rule realized as an admissible measurable history policy. -/
def cbsPolicy (c : Parameters) (S r : ℝ≥0) : AdmissiblePolicy where
  decision t a := cbsOrder c.L S r (cbsRun c S r (completeHistory t a) t)
  measurable_decision t := (measurable_cbsOrder _ _ _).comp
    ((measurable_cbsRun c S r t).comp (measurable_completeHistory t))

lemma cbsRun_congr_history (c : Parameters) (S r : ℝ≥0) (t : ℕ)
    (ω η : Sample) (heq : ∀ k < t, ω.1 k = η.1 k) :
    cbsRun c S r ω t = cbsRun c S r η t := by
  induction t with
  | zero => rfl
  | succ t ih =>
    have hs := ih (fun k hk => heq k (Nat.lt_succ_of_lt hk))
    simp only [cbsRun, hs, heq t (Nat.lt_succ_self t)]

lemma cbsRun_completeHistory (c : Parameters) (S r : ℝ≥0) (t : ℕ) (ω : Sample) :
    cbsRun c S r (completeHistory t (history t ω)) t = cbsRun c S r ω t := by
  apply cbsRun_congr_history
  intro k hk
  simp [completeHistory, history, hk]

lemma run_cbsPolicy (c : Parameters) (S r : ℝ≥0) (ω : Sample) (t : ℕ) :
    run c (cbsPolicy c S r) ω t = cbsRun c S r ω t := by
  induction t with
  | zero => rfl
  | succ t ih =>
    rw [run, ih]
    simp only [order, cbsPolicy, cbsRun_completeHistory, cbsRun]

/-- The directly defined CBS process has exactly the cost of its admissible
policy realization. This removes any gap between the two definitions of cost. -/
lemma policyCost_cbsPolicy (P : DemandLaw) (c : Parameters) (S r : ℝ≥0) :
    policyCost P c (cbsPolicy c S r) = cbsCost P c S r := by
  simp only [policyCost, cbsCost, run_cbsPolicy]

/-- The CBS family is a subclass of the admissible policies in the model. -/
lemma OPT_le_CbsOpt (P : DemandLaw) (c : Parameters) : OPT P c ≤ CbsOpt P c := by
  unfold CbsOpt
  refine le_iInf (fun S => le_iInf (fun r => ?_))
  rw [← policyCost_cbsPolicy]
  exact iInf_le (fun π : AdmissiblePolicy => policyCost P c π) (cbsPolicy c S r)


end CappedBaseStock
Source
Linwei Xin, Capped Base-Stock Policies: A 2.33-Approximation, author-supplied LaTeX manuscript (756 lines); public paper listing https://papers.ssrn.com/sol3/papers.cfm?abstract_id=7134538 . Author-supplied source SHA-256: f353793c255e1ebed5f3ec541037284bd926183e3e5b71941f13e79c2d67cb7a. Model section, lines 133–180; certificate definitions, lines 184–246; constants, lines 651–657.
Read-back

What the Lean code literally says, in plain math · GPT-6 (independent Codex sub-agent)

DemandLaw. A demand-law object consists of a measure PPP on the nonnegative finite real numbers [0,∞)[0,\infty)[0,∞), a proof that PPP has total mass one, a proof that the real-valued identity function d↦dd\mapsto dd↦d is Bochner integrable under PPP, and the strict inequality 0<∫d P(dd)0<\int d\,P(\mathrm d d)0<∫dP(dd). Thus its real mean is finite and strictly positive. There is no assumption of a density, non-atomicity, bounded support, or any higher moment; individual demands may be zero, and a deterministic strictly positive demand law is included. The probability proof is registered for subsequent use as a probability-measure assumption.

mean. For any demand-law object PPP, whose underlying measure is a probability measure on [0,∞)[0,\infty)[0,∞) with integrable identity and strictly positive identity integral, mean⁡(P)\operatorname{mean}(P)mean(P) is the real Bochner integral μ=∫[0,∞)d P(dd)\mu=\int_{[0,\infty)}d\,P(\mathrm d d)μ=∫[0,∞)​dP(dd). The hypotheses carried by PPP make μ\muμ finite and strictly positive; this definition does not use an extended-real mean.

Parameters. A parameter object ccc contains a natural number LLL, a proof of 1≤L1\le L1≤L, two real numbers h,ph,ph,p, and proofs of 0<h0<h0<h and 0<p0<p0<p. In particular the admissible parameter objects have a positive integer lead-time value and strictly positive finite real coefficients; neither L=0L=0L=0 nor a zero or negative coefficient is included. No demand law or other relation among these parameters is part of the object.

DemandPath. A demand path is an arbitrary function d:N→[0,∞)d:\mathbb N\to[0,\infty)d:N→[0,∞), with natural indices starting at zero and each value a finite nonnegative real number. This type includes every such infinite sequence; no probabilistic, convergence, boundedness, or support condition is imposed on an individual path.

Sample. A sample is a pair ω=(d,u)\omega=(d,u)ω=(d,u), where d:N→[0,∞)d:\mathbb N\to[0,\infty)d:N→[0,∞) is an arbitrary demand sequence and u∈Ru\in\mathbb Ru∈R is an arbitrary real number. The sample space itself allows every real seed, including values outside [0,1][0,1][0,1]; restriction of the seed to that interval is a property of the sampling measure, not of this type.

demandPathLaw. For a probability measure PPP on [0,∞)[0,\infty)[0,∞) supplied with an integrable identity and strictly positive mean, the demand-path law is the countable product measure ⨂i∈NP\bigotimes_{i\in\mathbb N}P⨂i∈N​P on [0,∞)N[0,\infty)^{\mathbb N}[0,∞)N, with the usual product measurable structure. Accordingly its coordinate demands all have law PPP and are independent. The finite-positive-mean assumptions are required by the argument type even though the displayed product construction uses only the underlying measures and their probability structure.

seedLaw. The seed law on R\mathbb RR is Lebesgue measure restricted to the closed interval [0,1][0,1][0,1]: for a measurable set AAA, its measure is the Lebesgue measure of A∩[0,1]A\cap[0,1]A∩[0,1]. This is uniform probability on that interval, with both endpoints having mass zero; it is defined on all real seeds.

seedLaw_probability. Lebesgue measure on R\mathbb RR restricted to [0,1][0,1][0,1] has total mass one, so it is a probability measure. This assertion has no parameters or additional hypotheses and is registered as a probability-measure instance.

sampleLaw. For a demand-law object PPP with finite strictly positive real mean, the sampling measure on ([0,∞)N)×R([0,\infty)^{\mathbb N})\times\mathbb R([0,∞)N)×R is QP=(⨂i∈NP)⊗(λ∣[0,1])\mathbb Q_P=(\bigotimes_{i\in\mathbb N}P)\otimes(\lambda|_{[0,1]})QP​=(⨂i∈N​P)⊗(λ∣[0,1]​), where λ\lambdaλ is real Lebesgue measure. Thus the demands are independent with common law PPP, and the real seed is uniform on [0,1][0,1][0,1] and independent of the entire demand sequence. There is one real seed coordinate, not a separately specified sequence of seed coordinates.

demandPathLaw_probability. For every probability demand measure PPP on finite nonnegative reals that comes with an integrable identity and strictly positive mean, its countably infinite product ⨂i∈NP\bigotimes_{i\in\mathbb N}P⨂i∈N​P is a probability measure on demand sequences. This conclusion is registered as an instance; there are no additional assumptions on PPP.

sampleLaw_probability. For every probability demand measure PPP on finite nonnegative reals with integrable identity and strictly positive mean, the product of its countable demand-sequence law and Lebesgue measure restricted to [0,1][0,1][0,1] is a probability measure on pairs consisting of a demand sequence and a real seed. This is an instance assertion about the full sampling measure QP\mathbb Q_PQP​, with no additional assumptions.

history. For every t∈Nt\in\mathbb Nt∈N and every sample ω=(d,u)∈([0,∞)N)×R\omega=(d,u)\in([0,\infty)^{\mathbb N})\times\mathbb Rω=(d,u)∈([0,∞)N)×R, the history at ttt is the pair ((d0,…,dt−1),u)((d_0,\ldots,d_{t-1}),u)((d0​,…,dt−1​),u), formally a function on {0,…,t−1}\{0,\ldots,t-1\}{0,…,t−1} together with the original seed. It contains all demands strictly before ttt and the seed, and contains no demand at or after ttt. When t=0t=0t=0, the demand-history domain is empty and only the seed carries variable information.

AdmissiblePolicy. An admissible policy is a family, indexed by every t∈Nt\in\mathbb Nt∈N, of measurable functions πt:([0,∞){0,…,t−1})×R→[0,∞)\pi_t:([0,\infty)^{\{0,\ldots,t-1\}})\times\mathbb R\to[0,\infty)πt​:([0,∞){0,…,t−1})×R→[0,∞), using the usual product measurable structures. Each output is a finite nonnegative real order. The input is the entire past demand vector and one real seed; no condition of stationarity, bounded order size, integrable orders or costs, or any prescribed dependence on a state is imposed. Measurability is required separately for each time, and the functions are defined on every possible history and every real seed. At t=0t=0t=0 a decision can depend on the seed and has no past demands to use.

order. For every admissible policy π\piπ, time t∈Nt\in\mathbb Nt∈N, and sample ω=(d,u)\omega=(d,u)ω=(d,u), the order is qt(ω)=πt((d0,…,dt−1),u)∈[0,∞)q_t(\omega)=\pi_t((d_0,\ldots,d_{t-1}),u)\in[0,\infty)qt​(ω)=πt​((d0​,…,dt−1​),u)∈[0,∞). Here each πt\pi_tπt​ is a measurable function of exactly that finite past-demand vector and the real seed. This evaluation uses no present or future demand; in particular q0q_0q0​ is evaluated on the empty demand vector and uuu. No demand-law or parameter argument is required.

State. For every natural number LLL, a state is a pair (x,a)(x,a)(x,a) with x∈[0,∞)x\in[0,\infty)x∈[0,∞) and a:{0,…,L−1}→[0,∞)a:\{0,\ldots,L-1\}\to[0,\infty)a:{0,…,L−1}→[0,∞); all entries are finite. This type itself allows L=0L=0L=0, in which case the vector has empty domain, as well as every nonnegative value of xxx and every nonnegative vector. It imposes no bound or reachability condition.

initialState. For every L∈NL\in\mathbb NL∈N, the initial state is (0,(0)i=0L−1)(0,(0)_{i=0}^{L-1})(0,(0)i=0L−1​): its scalar coordinate and every vector coordinate are zero. This is defined also at L=0L=0L=0, where the vector is the unique empty function.

arrival. Given parameters c=(L,h,p)c=(L,h,p)c=(L,h,p) with L∈NL\in\mathbb NL∈N, L≥1L\ge1L≥1, and h,p>0h,p>0h,p>0, and any state (x,a)∈[0,∞)×[0,∞){0,…,L−1}(x,a)\in[0,\infty)\times[0,\infty)^{\{0,\ldots,L-1\}}(x,a)∈[0,∞)×[0,∞){0,…,L−1}, the arrival is a0a_0a0​. The positive-lead-time proof supplies the existence of coordinate zero. The value is finite and nonnegative, and h,p,xh,p,xh,p,x do not enter its formula.

step. Given parameters c=(L,h,p)c=(L,h,p)c=(L,h,p) with L≥1L\ge1L≥1 and h,p>0h,p>0h,p>0, any state (x,a)(x,a)(x,a) with nonnegative finite coordinates, and any finite nonnegative order qqq and demand ddd, one step returns (x′,a′)(x',a')(x′,a′), where x′=(x+a0−d)+x'=(x+a_0-d)^+x′=(x+a0​−d)+ and ai′=ai+1a'_i=a_{i+1}ai′​=ai+1​ if i+1<Li+1<Li+1<L, while ai′=qa'_i=qai′​=q otherwise, for every i∈{0,…,L−1}i\in\{0,\ldots,L-1\}i∈{0,…,L−1}. Here v+=max⁡(v,0)v^+=\max(v,0)v+=max(v,0): subtraction in the nonnegative-real type is truncated. The final vector coordinate is therefore qqq, and all earlier coordinates shift down by one. For L=1L=1L=1 the new vector consists only of qqq. The current order does not enter x′x'x′; only the old vector's first coordinate does. The positive real coefficients h,ph,ph,p are carried by the parameter object but do not affect this transition.

run. For parameters c=(L,h,p)c=(L,h,p)c=(L,h,p) with L≥1L\ge1L≥1 and h,p>0h,p>0h,p>0, any admissible family of measurable decisions πt\pi_tπt​, and every sample ω=(d,u)\omega=(d,u)ω=(d,u), the state sequence st=(xt,at)s_t=(x_t,a_t)st​=(xt​,at​) is defined for all t∈Nt\in\mathbb Nt∈N by x0=0x_0=0x0​=0, a0,i=0a_{0,i}=0a0,i​=0, and xt+1=(xt+at,0−dt)+x_{t+1}=(x_t+a_{t,0}-d_t)^+xt+1​=(xt​+at,0​−dt​)+, at+1,i=at,i+1a_{t+1,i}=a_{t,i+1}at+1,i​=at,i+1​ for i+1<Li+1<Li+1<L, and at+1,L−1=πt((d0,…,dt−1),u)a_{t+1,L-1}=\pi_t((d_0,\ldots,d_{t-1}),u)at+1,L−1​=πt​((d0​,…,dt−1​),u). Every demand and seed here is arbitrary at the pointwise level; no sampling measure is needed to define the recursion. In particular the period-ttt order is inserted in the state at t+1t+1t+1 and enters the available amount used with demand dt+Ld_{t+L}dt+L​; dtd_tdt​ is processed using sts_tst​ and its existing first vector coordinate. All shortages are truncated to zero in the scalar coordinate.

filledDemand. For parameters c=(L,h,p)c=(L,h,p)c=(L,h,p) with positive integer LLL and strictly positive real h,ph,ph,p, any nonnegative state (x,a)(x,a)(x,a) of length LLL, and any finite nonnegative demand ddd, the filled-demand value is min⁡(d,x+a0)∈[0,∞)\min(d,x+a_0)\in[0,\infty)min(d,x+a0​)∈[0,∞). It uses the scalar state plus the existing first vector coordinate and is defined for arbitrary states, not only states reached by a policy; no current order is an argument.

lostSales. For parameters c=(L,h,p)c=(L,h,p)c=(L,h,p) with L≥1L\ge1L≥1 and h,p>0h,p>0h,p>0, any state (x,a)(x,a)(x,a) with finite nonnegative coordinates, and any finite nonnegative demand ddd, lost sales are (d−(x+a0))+∈[0,∞)(d-(x+a_0))^+\in[0,\infty)(d−(x+a0​))+∈[0,∞). The subtraction is truncated at zero, so this value is zero whenever demand is at most x+a0x+a_0x+a0​. The definition does not carry a negative inventory balance forward.

periodCost. For parameters c=(L,h,p)c=(L,h,p)c=(L,h,p) with positive integer LLL and strictly positive finite real h,ph,ph,p, a state (x,a)(x,a)(x,a) with finite nonnegative coordinates, and finite nonnegative demand ddd, the period cost is the extended nonnegative real h(x+a0−d)++p(d−x−a0)+h(x+a_0-d)^++p(d-x-a_0)^+h(x+a0​−d)++p(d−x−a0​)+. More literally, each coefficient is embedded by v↦max⁡(v,0)v\mapsto\max(v,0)v↦max(v,0) into [0,∞][0,\infty][0,∞], and each truncated nonnegative-real quantity is embedded there before multiplication and addition; positivity of h,ph,ph,p means those coefficient embeddings do not change their values. Each such pointwise cost is finite. The two terms use the amount remaining after demand and the demand left unfilled, respectively; no cost of the order itself or separate vector-coordinate cost occurs in this formula.

averageCost. For a probability demand law PPP on finite nonnegative reals with integrable identity and strictly positive mean, and an arbitrary function C:N×(([0,∞)N)×R)→[0,∞]C:\mathbb N\times(([0,\infty)^{\mathbb N})\times\mathbb R)\to[0,\infty]C:N×(([0,∞)N)×R)→[0,∞], define averageCost⁡P(C)=lim sup⁡T→∞1T+1∑t=0T∫−C(t,ω) QP(dω)\operatorname{averageCost}_P(C)=\limsup_{T\to\infty}\frac{1}{T+1}\sum_{t=0}^{T}\int^- C(t,\omega)\,\mathbb Q_P(\mathrm d\omega)averageCostP​(C)=limsupT→∞​T+11​∑t=0T​∫−C(t,ω)QP​(dω), where QP=(⨂i∈NP)⊗(λ∣[0,1])\mathbb Q_P=(\bigotimes_{i\in\mathbb N}P)\otimes(\lambda|_{[0,1]})QP​=(⨂i∈N​P)⊗(λ∣[0,1]​) and the limsup is along natural TTT. Each integral is the extended nonnegative lower Lebesgue integral; the argument CCC is not required to be measurable or integrable, so the definition uses the total lower-integral construction even for a nonmeasurable section. Infinite integrals and the value +∞+\infty+∞ are allowed. There are T+1T+1T+1 periods starting at zero, including just period zero when T=0T=0T=0; the divisor is always a finite strictly positive extended nonnegative real. The limsup is taken after summing the separate timewise integrals and normalizing, not on samplewise average costs.

policyCost. For a probability demand law PPP on [0,∞)[0,\infty)[0,∞) with finite strictly positive mean, parameters c=(L,h,p)c=(L,h,p)c=(L,h,p) with L≥1L\ge1L≥1 and h,p>0h,p>0h,p>0, and an admissible policy consisting of measurable maps πt\pi_tπt​ from past demand vectors and a real seed to finite nonnegative orders, its cost is lim sup⁡T→∞(T+1)−1∑t=0T∫−[h(xt+at,0−dt)++p(dt−xt−at,0)+] QP(d(d,u))\limsup_{T\to\infty}(T+1)^{-1}\sum_{t=0}^{T}\int^-[h(x_t+a_{t,0}-d_t)^++p(d_t-x_t-a_{t,0})^+]\,\mathbb Q_P(\mathrm d(d,u))limsupT→∞​(T+1)−1∑t=0T​∫−[h(xt​+at,0​−dt​)++p(dt​−xt​−at,0​)+]QP​(d(d,u)). Here QP\mathbb Q_PQP​ is the independent product of i.i.d. demand coordinates with law PPP and a uniform [0,1][0,1][0,1] seed; x0=0x_0=0x0​=0, a0,i=0a_{0,i}=0a0,i​=0, xt+1=(xt+at,0−dt)+x_{t+1}=(x_t+a_{t,0}-d_t)^+xt+1​=(xt​+at,0​−dt​)+, earlier vector coordinates shift left, and at+1,L−1=πt((d0,…,dt−1),u)a_{t+1,L-1}=\pi_t((d_0,\ldots,d_{t-1}),u)at+1,L−1​=πt​((d0​,…,dt−1​),u). The sum and lower integrals take values in [0,∞][0,\infty][0,∞], so pointwise finite period costs need not give a finite value for this definition; no finite-cost assumption is placed on the policy.

OPT. For every probability demand law PPP on [0,∞)[0,\infty)[0,∞) with finite strictly positive mean and every parameter tuple (L,h,p)(L,h,p)(L,h,p) with integer L≥1L\ge1L≥1 and h,p>0h,p>0h,p>0, OPT(P,c)\mathrm{OPT}(P,c)OPT(P,c) is the infimum in [0,∞][0,\infty][0,∞] over all families of measurable maps πt:[0,∞){0,…,t−1}×R→[0,∞)\pi_t:[0,\infty)^{\{0,\ldots,t-1\}}\times\mathbb R\to[0,\infty)πt​:[0,∞){0,…,t−1}×R→[0,∞) of their limsup expected average cost. For each such family, the state starts at zero, period-ttt order is πt(d<t,u)\pi_t(d_{<t},u)πt​(d<t​,u), the next scalar state is (xt+at,0−dt)+(x_t+a_{t,0}-d_t)^+(xt​+at,0​−dt​)+, the vector shifts left and appends the order, and the period cost is h(xt+at,0−dt)++p(dt−xt−at,0)+h(x_t+a_{t,0}-d_t)^++p(d_t-x_t-a_{t,0})^+h(xt​+at,0​−dt​)++p(dt​−xt​−at,0​)+. The average is lim sup⁡T→∞(T+1)−1∑t=0T∫−(period cost) dQP\limsup_{T\to\infty}(T+1)^{-1}\sum_{t=0}^{T}\int^- (\text{period cost})\,\mathrm d\mathbb Q_PlimsupT→∞​(T+1)−1∑t=0T​∫−(period cost)dQP​, with i.i.d. law-PPP demands and an independent uniform [0,1][0,1][0,1] seed. Orders are finite and nonnegative but not uniformly bounded or required to be integrable. The set of policies includes the identically zero policy; the definition is an infimum, with no claim that a minimizing policy exists.

cbsOrder. For every natural LLL, finite nonnegative numbers S,rS,rS,r, and any state (x,a)∈[0,∞)×[0,∞){0,…,L−1}(x,a)\in[0,\infty)\times[0,\infty)^{\{0,\ldots,L-1\}}(x,a)∈[0,∞)×[0,∞){0,…,L−1}, the order is QL,S,r(x,a)=min⁡((S−x−∑i=0L−1ai)+,r)Q_{L,S,r}(x,a)=\min\bigl((S-x-\sum_{i=0}^{L-1}a_i)^+,r\bigr)QL,S,r​(x,a)=min((S−x−∑i=0L−1​ai​)+,r). The sum includes all vector coordinates, including coordinate zero when it exists, and the subtraction is truncated before taking the minimum. There is no condition r≤Sr\le Sr≤S or relation to a demand mean. Either S=0S=0S=0 or r=0r=0r=0 makes this order zero for every state. The definition also allows L=0L=0L=0, when the vector sum is zero and the formula is min⁡((S−x)+,r)\min((S-x)^+,r)min((S−x)+,r).

cbsRun. For parameters (L,h,p)(L,h,p)(L,h,p) with integer L≥1L\ge1L≥1 and h,p>0h,p>0h,p>0, any finite nonnegative S,rS,rS,r, and any sample (d,u)(d,u)(d,u), the sequence st=(xt,at)s_t=(x_t,a_t)st​=(xt​,at​) starts with all coordinates zero and satisfies qt=min⁡((S−xt−∑i=0L−1at,i)+,r)q_t=\min((S-x_t-\sum_{i=0}^{L-1}a_{t,i})^+,r)qt​=min((S−xt​−∑i=0L−1​at,i​)+,r), xt+1=(xt+at,0−dt)+x_{t+1}=(x_t+a_{t,0}-d_t)^+xt+1​=(xt​+at,0​−dt​)+, at+1,i=at,i+1a_{t+1,i}=a_{t,i+1}at+1,i​=at,i+1​ for i+1<Li+1<Li+1<L, and at+1,L−1=qta_{t+1,L-1}=q_tat+1,L−1​=qt​, for all t∈Nt\in\mathbb Nt∈N. Thus the order is computed from the state at ttt, whose vector still contains its first coordinate, and is used as an arrival with demand dt+Ld_{t+L}dt+L​. The recursion ignores the seed uuu and places no probabilistic condition on the demand path. In particular its first order is min⁡(S,r)\min(S,r)min(S,r); if S=0S=0S=0 or r=0r=0r=0, all orders and state coordinates remain zero.

cbsCost. For a probability demand law PPP on finite nonnegative reals with finite strictly positive mean, parameters (L,h,p)(L,h,p)(L,h,p) with L≥1L\ge1L≥1 and h,p>0h,p>0h,p>0, and any finite nonnegative S,rS,rS,r, the cost is lim sup⁡T→∞(T+1)−1∑t=0T∫−[h(xt+at,0−dt)++p(dt−xt−at,0)+] QP(d(d,u))\limsup_{T\to\infty}(T+1)^{-1}\sum_{t=0}^{T}\int^-[h(x_t+a_{t,0}-d_t)^++p(d_t-x_t-a_{t,0})^+]\,\mathbb Q_P(\mathrm d(d,u))limsupT→∞​(T+1)−1∑t=0T​∫−[h(xt​+at,0​−dt​)++p(dt​−xt​−at,0​)+]QP​(d(d,u)). Here demands are i.i.d. with law PPP, the seed is independent uniform on [0,1][0,1][0,1], all state coordinates start at zero, qt=min⁡((S−xt−∑iat,i)+,r)q_t=\min((S-x_t-\sum_i a_{t,i})^+,r)qt​=min((S−xt​−∑i​at,i​)+,r), the scalar state updates to (xt+at,0−dt)+(x_t+a_{t,0}-d_t)^+(xt​+at,0​−dt​)+, and the vector shifts left and appends qtq_tqt​. The integral is the extended nonnegative lower integral, the resulting cost is defined in [0,∞][0,\infty][0,∞], and the state and integrand ignore uuu. Neither a strict positive cap nor a strict positive target nor a relation between rrr and the mean is assumed.

CbsOpt. For a probability demand law PPP on [0,∞)[0,\infty)[0,∞) with finite strictly positive mean and parameters (L,h,p)(L,h,p)(L,h,p) with positive integer LLL and h,p>0h,p>0h,p>0, this quantity is the nested extended-nonnegative-real infimum inf⁡S∈[0,∞)inf⁡r∈[0,∞)CP,c(S,r)\inf_{S\in[0,\infty)}\inf_{r\in[0,\infty)}C_{P,c}(S,r)infS∈[0,∞)​infr∈[0,∞)​CP,c​(S,r). For each pair, CP,c(S,r)C_{P,c}(S,r)CP,c​(S,r) is the limsup of the mean of periodwise lower integrals over periods 0,…,T0,\ldots,T0,…,T, under i.i.d. law-PPP demands and an independent uniform [0,1][0,1][0,1] seed, of h(xt+at,0−dt)++p(dt−xt−at,0)+h(x_t+a_{t,0}-d_t)^++p(d_t-x_t-a_{t,0})^+h(xt​+at,0​−dt​)++p(dt​−xt​−at,0​)+; states start at zero, update their scalar coordinate by (xt+at,0−dt)+(x_t+a_{t,0}-d_t)^+(xt​+at,0​−dt​)+, and shift the length-LLL vector left while appending min⁡((S−xt−∑iat,i)+,r)\min((S-x_t-\sum_i a_{t,i})^+,r)min((S−xt​−∑i​at,i​)+,r). Both optimization variables range over all finite nonnegative reals, including zero, without a constraint involving one another or the demand mean. This is an infimum and does not assert attainment.

baseStockCost. For a probability demand law PPP on [0,∞)[0,\infty)[0,∞) with finite strictly positive mean, parameters (L,h,p)(L,h,p)(L,h,p) with L≥1L\ge1L≥1 and h,p>0h,p>0h,p>0, and any finite nonnegative SSS, this is the cost obtained by setting both the target and the cap equal to SSS in the preceding capped-order recursion. Explicitly, all state coordinates start at zero, qt=min⁡((S−xt−∑iat,i)+,S)q_t=\min((S-x_t-\sum_i a_{t,i})^+,S)qt​=min((S−xt​−∑i​at,i​)+,S), xt+1=(xt+at,0−dt)+x_{t+1}=(x_t+a_{t,0}-d_t)^+xt+1​=(xt​+at,0​−dt​)+, and the length-LLL vector shifts left and appends qtq_tqt​. The cost is lim sup⁡T→∞(T+1)−1∑t=0T∫−[h(xt+at,0−dt)++p(dt−xt−at,0)+] dQP\limsup_{T\to\infty}(T+1)^{-1}\sum_{t=0}^{T}\int^-[h(x_t+a_{t,0}-d_t)^++p(d_t-x_t-a_{t,0})^+]\,\mathrm d\mathbb Q_PlimsupT→∞​(T+1)−1∑t=0T​∫−[h(xt​+at,0​−dt​)++p(dt​−xt​−at,0​)+]dQP​, where demands are i.i.d. with law PPP and the seed is independent uniform on [0,1][0,1][0,1]. Because all state coordinates are nonnegative, the minimum with SSS cannot reduce the displayed positive-part shortfall; S=0S=0S=0 is included and gives zero orders.

finiteInventory. For every arbitrary demand sequence d:N→[0,∞)d:\mathbb N\to[0,\infty)d:N→[0,∞), every real rrr (including negative values), and every natural mmm (including zero), this real-valued function is Im(d,r)=max⁡0≤k≤m∑i=0k−1(r−di)I_m(d,r)=\max_{0\le k\le m}\sum_{i=0}^{k-1}(r-d_i)Im​(d,r)=max0≤k≤m​∑i=0k−1​(r−di​). The maximum is over the nonempty finite set of integers 0,…,m0,\ldots,m0,…,m, and the k=0k=0k=0 sum is zero. In particular Im(d,r)≥0I_m(d,r)\ge0Im​(d,r)≥0 and I0(d,r)=0I_0(d,r)=0I0​(d,r)=0. The sum consists of prefixes starting at index zero; it involves only d0,…,dm−1d_0,\ldots,d_{m-1}d0​,…,dm−1​ and does not maximize over a starting index or over an infinite horizon. No measure, mean, or stability assumption occurs in this definition.

certificateExcess. For every demand sequence d:N→[0,∞)d:\mathbb N\to[0,\infty)d:N→[0,∞), arbitrary real r,zr,zr,z, and natural mmm, this is the extended nonnegative real Em(d;r,z)=(max⁡0≤k≤m∑i=0k−1(r−di)+∑i=0m−1(di−r)−z)+E_m(d;r,z)=\left(\max_{0\le k\le m}\sum_{i=0}^{k-1}(r-d_i)+\sum_{i=0}^{m-1}(d_i-r)-z\right)^+Em​(d;r,z)=(max0≤k≤m​∑i=0k−1​(r−di​)+∑i=0m−1​(di​−r)−z)+ embedded in [0,∞][0,\infty][0,∞]. The maximum includes the zero prefix, both sums are finite, and no nonnegativity or mean restriction is imposed on rrr or zzz here. Thus every pointwise value is finite, even though later lower integrals use an extended codomain. At m=0m=0m=0 this is (−z)+(-z)^+(−z)+, independent of the demand path and of rrr.

CertificateFeasible. Let PPP be a probability law on finite nonnegative reals with finite strictly positive real mean μ=∫d P(dd)\mu=\int d\,P(\mathrm d d)μ=∫dP(dd), let (L,h,p)(L,h,p)(L,h,p) satisfy L∈NL\in\mathbb NL∈N, L≥1L\ge1L≥1, and h,p>0h,p>0h,p>0, and let r,zr,zr,z be arbitrary real numbers. The predicate holds exactly when all five conditions hold: 0≤r0\le r0≤r, r≤μr\le\mur≤μ, 0≤z0\le z0≤z, ∫−EL(d;r,z) d(P⊗N)≤(L(μ−r))+\int^- E_L(d;r,z)\,\mathrm d(P^{\otimes\mathbb N})\le (L(\mu-r))^+∫−EL​(d;r,z)d(P⊗N)≤(L(μ−r))+, and ∫−EL+1(d;r,z) d(P⊗N)≤((L+1)(μ−r))+\int^- E_{L+1}(d;r,z)\,\mathrm d(P^{\otimes\mathbb N})\le ((L+1)(\mu-r))^+∫−EL+1​(d;r,z)d(P⊗N)≤((L+1)(μ−r))+. Here Em(d;r,z)=(max⁡0≤k≤m∑i=0k−1(r−di)+∑i=0m−1(di−r)−z)+E_m(d;r,z)=\left(\max_{0\le k\le m}\sum_{i=0}^{k-1}(r-d_i)+\sum_{i=0}^{m-1}(d_i-r)-z\right)^+Em​(d;r,z)=(max0≤k≤m​∑i=0k−1​(r−di​)+∑i=0m−1​(di​−r)−z)+, each right-hand side is embedded in [0,∞][0,\infty][0,∞], and the integrals are extended nonnegative lower integrals over the canonical i.i.d. demand-path measure, without a seed. The first two conditions make these right-hand sides finite and nonnegative without truncation, so feasibility requires finite integrals at both specified horizons. The tests are only at LLL and L+1L+1L+1, not at all horizons. Both endpoints r=0r=0r=0 and r=μr=\mur=μ and the endpoint z=0z=0z=0 are permitted; at r=μr=\mur=μ both integral bounds are zero. The coefficients h,ph,ph,p satisfy the carried parameter assumptions but do not enter the feasibility inequalities.

certificateObjective. For a probability demand law PPP on finite nonnegative reals with finite strictly positive real mean μ\muμ, parameters (L,h,p)(L,h,p)(L,h,p) with integer L≥1L\ge1L≥1 and h,p>0h,p>0h,p>0, and arbitrary real r,zr,zr,z, the objective is the extended nonnegative real (hz+p(μ−r))+(hz+p(\mu-r))^+(hz+p(μ−r))+. The positive part is applied to the whole real sum before embedding it in [0,∞][0,\infty][0,∞]; it is not applied to the two summands separately. This definition does not assume feasibility, r≥0r\ge0r≥0, r≤μr\le\mur≤μ, or z≥0z\ge0z≥0, so it also assigns zero to any inputs making the sum nonpositive. Each value is finite. For feasible inputs the two summands are nonnegative and the positive part leaves their sum unchanged.

lowerCertificate. For a probability demand law PPP on finite nonnegative reals with finite strictly positive mean μ\muμ, and parameters (L,h,p)(L,h,p)(L,h,p) with integer L≥1L\ge1L≥1 and h,p>0h,p>0h,p>0, this is the infimum in [0,∞][0,\infty][0,∞] of (hz+p(μ−r))+(hz+p(\mu-r))^+(hz+p(μ−r))+ over real pairs (r,z)(r,z)(r,z) such that 0≤r≤μ0\le r\le\mu0≤r≤μ, z≥0z\ge0z≥0, and, for each of the two values m=L,L+1m=L,L+1m=L,L+1, ∫−(max⁡0≤k≤m∑i=0k−1(r−di)+∑i=0m−1(di−r)−z)+ d(P⊗N)≤m(μ−r)\int^-\left(\max_{0\le k\le m}\sum_{i=0}^{k-1}(r-d_i)+\sum_{i=0}^{m-1}(d_i-r)-z\right)^+\,\mathrm d(P^{\otimes\mathbb N})\le m(\mu-r)∫−(max0≤k≤m​∑i=0k−1​(r−di​)+∑i=0m−1​(di​−r)−z)+d(P⊗N)≤m(μ−r). The right-hand side is embedded in the extended nonnegative reals, and the integral is the lower integral over i.i.d. demand sequences. The indexing is by the subtype of pairs satisfying all these conditions, with no minimizer or separate existence witness required as an argument. In this codomain an infimum over an empty index type would be +∞+\infty+∞, but here (r,z)=(0,0)(r,z)=(0,0)(r,z)=(0,0) satisfies both tests: the maximum prefix is zero, the excess is the sum of the first mmm demands, and its integral is mμm\mumμ. Its objective is pμp\mupμ. A strictly positive value is not required: for a law concentrated at the positive number μ\muμ, the feasible pair (μ,0)(\mu,0)(μ,0) has zero excess and zero objective, and this infimum is zero. No attainment or comparison to any policy cost is asserted.

rho. For every natural LLL, independently of any parameter object or demand law, ρ(L)\rho(L)ρ(L) is the real number L/(L+1)L/(L+1)L/(L+1), with the naturals cast to reals before arithmetic. This includes L=0L=0L=0, for which ρ(0)=0\rho(0)=0ρ(0)=0; its denominator is nonzero for every allowed input.

kappa. For every natural LLL, independently of any parameter object or demand law, κ(L)\kappa(L)κ(L) is the real number 1+4L2(L+1)(3L−1)1+\frac{4L^2}{(L+1)(3L-1)}1+(L+1)(3L−1)4L2​, with subtraction, multiplication, exponentiation, and division performed in the reals after casting LLL. The denominator uses the real expression 3L−13L-13L−1, not truncated natural subtraction. The domain includes L=0L=0L=0, where the denominator is −1-1−1 and κ(0)=1\kappa(0)=1κ(0)=1; for integer L≥1L\ge1L≥1 the denominator is positive, so it is never zero on the stated domain.

completeHistory. For every t∈Nt\in\mathbb Nt∈N and every pair a=(v,u)a=(v,u)a=(v,u) with v:{0,…,t−1}→[0,∞)v:\{0,\ldots,t-1\}\to[0,\infty)v:{0,…,t−1}→[0,∞) and u∈Ru\in\mathbb Ru∈R, the completed sample is (d~,u)(\widetilde d,u)(d,u), where d~k=vk\widetilde d_k=v_kdk​=vk​ if k<tk<tk<t and d~k=0\widetilde d_k=0dk​=0 if k≥tk\ge tk≥t. Thus the supplied finite demand vector is extended by zeros from index ttt onward, with the seed preserved even when it lies outside [0,1][0,1][0,1]. At t=0t=0t=0 the entire completed demand sequence is zero. The construction has no law or support requirement.

measurable_completeHistory. For each natural ttt, the map from a finite nonnegative demand vector v:{0,…,t−1}→[0,∞)v:\{0,\ldots,t-1\}\to[0,\infty)v:{0,…,t−1}→[0,∞) and real seed uuu to the sample (d~,u)(\widetilde d,u)(d,u), where d~k=vk\widetilde d_k=v_kdk​=vk​ for k<tk<tk<t and d~k=0\widetilde d_k=0dk​=0 for k≥tk\ge tk≥t, is measurable for the usual product measurable structures. This holds also at t=0t=0t=0 and on all real seeds; it has no probability-law, integrability, or parameter hypotheses.

measurable_cbsRun. For every parameter tuple (L,h,p)(L,h,p)(L,h,p) with positive integer LLL and h,p>0h,p>0h,p>0, every finite nonnegative S,rS,rS,r, and every natural ttt, the map from an arbitrary sample (d,u)∈[0,∞)N×R(d,u)\in[0,\infty)^{\mathbb N}\times\mathbb R(d,u)∈[0,∞)N×R to the state (xt,at)(x_t,a_t)(xt​,at​) is measurable, where all coordinates start at zero and, at each index jjj, qj=min⁡((S−xj−∑i=0L−1aj,i)+,r)q_j=\min((S-x_j-\sum_{i=0}^{L-1}a_{j,i})^+,r)qj​=min((S−xj​−∑i=0L−1​aj,i​)+,r), xj+1=(xj+aj,0−dj)+x_{j+1}=(x_j+a_{j,0}-d_j)^+xj+1​=(xj​+aj,0​−dj​)+, earlier vector coordinates shift left, and aj+1,L−1=qja_{j+1,L-1}=q_jaj+1,L−1​=qj​. The codomain is the scalar nonnegative-real coordinate times the length-LLL nonnegative vector with its product measurable structure. This assertion includes t=0t=0t=0, S=0S=0S=0, and r=0r=0r=0 and does not require a demand law or a restricted seed value.

measurable_cbsOrder. For each natural LLL and all finite nonnegative S,rS,rS,r, the function on all nonnegative states (x,a)∈[0,∞)×[0,∞){0,…,L−1}(x,a)\in[0,\infty)\times[0,\infty)^{\{0,\ldots,L-1\}}(x,a)∈[0,∞)×[0,∞){0,…,L−1} given by (x,a)↦min⁡((S−x−∑i=0L−1ai)+,r)(x,a)\mapsto\min((S-x-\sum_{i=0}^{L-1}a_i)^+,r)(x,a)↦min((S−x−∑i=0L−1​ai​)+,r) is measurable. This uses the usual product measurable structure and requires no lead-time positivity, demand law, or state reachability hypothesis. At L=0L=0L=0 the sum is empty and zero; zero targets and zero caps are included.

cbsPolicy. For each parameter tuple (L,h,p)(L,h,p)(L,h,p) with positive integer LLL and h,p>0h,p>0h,p>0, and each finite nonnegative S,rS,rS,r, this constructs an admissible family of measurable decisions as follows. At time t∈Nt\in\mathbb Nt∈N, given a finite history v:{0,…,t−1}→[0,∞)v:\{0,\ldots,t-1\}\to[0,\infty)v:{0,…,t−1}→[0,∞) and real seed uuu, extend vvv to a demand path by assigning zero at every index k≥tk\ge tk≥t, retain uuu, and run from zero for ttt steps with orders qj=min⁡((S−xj−∑i=0L−1aj,i)+,r)q_j=\min((S-x_j-\sum_{i=0}^{L-1}a_{j,i})^+,r)qj​=min((S−xj​−∑i=0L−1​aj,i​)+,r), scalar updates xj+1=(xj+aj,0−dj)+x_{j+1}=(x_j+a_{j,0}-d_j)^+xj+1​=(xj​+aj,0​−dj​)+, and vector updates that shift left and append qjq_jqj​. Output min⁡((S−xt−∑iat,i)+,r)\min((S-x_t-\sum_i a_{t,i})^+,r)min((S−xt​−∑i​at,i​)+,r). The construction supplies measurability of every decision by composition of the measurable history completion, state recursion, and order map. It is defined for every history and real seed, and in fact its output does not depend on that seed; at t=0t=0t=0 it outputs min⁡(S,r)\min(S,r)min(S,r).

cbsRun_congr_history. For every parameter tuple (L,h,p)(L,h,p)(L,h,p) with positive integer LLL and h,p>0h,p>0h,p>0, all finite nonnegative S,rS,rS,r, any natural ttt, and any two samples ω=(d,u)\omega=(d,u)ω=(d,u) and η=(e,v)\eta=(e,v)η=(e,v), if dk=ekd_k=e_kdk​=ek​ for every natural k<tk<tk<t, then their states at time ttt coincide under the following recursion: start at zero, set each order to min⁡((S−xj−∑iaj,i)+,r)\min((S-x_j-\sum_i a_{j,i})^+,r)min((S−xj​−∑i​aj,i​)+,r), update the scalar state to (xj+aj,0−dj)+(x_j+a_{j,0}-d_j)^+(xj​+aj,0​−dj​)+ or (xj+aj,0−ej)+(x_j+a_{j,0}-e_j)^+(xj​+aj,0​−ej​)+ respectively, and shift the length-LLL vector left while appending the order. No equality of seeds or of demands at or after ttt is required. At t=0t=0t=0 the hypothesis is vacuous and both states are the zero state. This is a pointwise equality for all samples, not an almost-everywhere assertion under any measure.

cbsRun_completeHistory. For every parameter tuple (L,h,p)(L,h,p)(L,h,p) with positive integer LLL and h,p>0h,p>0h,p>0, all finite nonnegative S,rS,rS,r, every natural ttt, and every sample (d,u)(d,u)(d,u), replacing its demand path by d~k=dk\widetilde d_k=d_kdk​=dk​ for k<tk<tk<t and d~k=0\widetilde d_k=0dk​=0 for k≥tk\ge tk≥t, while preserving uuu, does not change the state at time ttt of the recursion that starts at zero, orders min⁡((S−xj−∑iaj,i)+,r)\min((S-x_j-\sum_i a_{j,i})^+,r)min((S−xj​−∑i​aj,i​)+,r), updates the scalar state to (xj+aj,0−dj)+(x_j+a_{j,0}-d_j)^+(xj​+aj,0​−dj​)+, and shifts the length-LLL vector left and appends that order. The same recursion is used with d~\widetilde dd on the other side. This holds pointwise for all paths and real seeds, including t=0t=0t=0, and requires no sampling law or almost-everywhere qualification.

run_cbsPolicy. For every parameter tuple (L,h,p)(L,h,p)(L,h,p) with positive integer LLL and h,p>0h,p>0h,p>0, all finite nonnegative S,rS,rS,r, every sample (d,u)(d,u)(d,u), and every natural ttt, two zero-initialized state constructions have exactly the same state at time ttt. The first uses the admissible decision which, at each time jjj, completes the observed vector (d0,…,dj−1)(d_0,\ldots,d_{j-1})(d0​,…,dj−1​) by zeros, runs the state-based recursion for jjj steps on that completed sample, and returns min⁡((S−xj−∑iaj,i)+,r)\min((S-x_j-\sum_i a_{j,i})^+,r)min((S−xj​−∑i​aj,i​)+,r) for that reconstructed state. The second directly returns this same order formula from its current state on the original sample. In both constructions the scalar update is (xj+aj,0−dj)+(x_j+a_{j,0}-d_j)^+(xj​+aj,0​−dj​)+ and the length-LLL vector shifts left and appends the chosen order. Equality is pointwise for every time and every real seed, including t=0t=0t=0, without a demand-law hypothesis.

policyCost_cbsPolicy. For every probability demand law PPP on finite nonnegative reals with finite strictly positive mean, every parameter tuple (L,h,p)(L,h,p)(L,h,p) with positive integer LLL and h,p>0h,p>0h,p>0, and all finite nonnegative S,rS,rS,r, the extended average cost of the admissible history-based policy constructed by zero-completing the past and reconstructing the capped-order state equals the extended average cost of the direct capped-order state recursion. More explicitly, the reconstructed policy at time jjj evaluates min⁡((S−xj−∑iaj,i)+,r)\min((S-x_j-\sum_i a_{j,i})^+,r)min((S−xj​−∑i​aj,i​)+,r) after running from zero on the zero-completed observed demands; the direct recursion evaluates that formula on its current state. Both use scalar update (xj+aj,0−dj)+(x_j+a_{j,0}-d_j)^+(xj​+aj,0​−dj​)+ and a length-LLL vector that shifts left and appends the order. Each cost is lim sup⁡T→∞(T+1)−1∑t=0T∫−[h(xt+at,0−dt)++p(dt−xt−at,0)+] dQP\limsup_{T\to\infty}(T+1)^{-1}\sum_{t=0}^{T}\int^-[h(x_t+a_{t,0}-d_t)^++p(d_t-x_t-a_{t,0})^+]\,\mathrm d\mathbb Q_PlimsupT→∞​(T+1)−1∑t=0T​∫−[h(xt​+at,0​−dt​)++p(dt​−xt​−at,0​)+]dQP​, with i.i.d. law-PPP demands and an independent uniform [0,1][0,1][0,1] seed. The assertion is equality in [0,∞][0,\infty][0,∞], with no extra finiteness or positivity requirement on S,rS,rS,r.

OPT_le_CbsOpt. For every probability demand law PPP on finite nonnegative reals with finite strictly positive mean and every parameter tuple (L,h,p)(L,h,p)(L,h,p) with positive integer LLL and h,p>0h,p>0h,p>0, the infimum over all measurable history-and-seed policies is less than or equal to the infimum over all finite nonnegative targets SSS and caps rrr of the costs of the state-based order formula min⁡((S−xt−∑iat,i)+,r)\min((S-x_t-\sum_i a_{t,i})^+,r)min((S−xt​−∑i​at,i​)+,r). The larger policy class consists of all measurable maps πt:[0,∞){0,…,t−1}×R→[0,∞)\pi_t:[0,\infty)^{\{0,\ldots,t-1\}}\times\mathbb R\to[0,\infty)πt​:[0,∞){0,…,t−1}×R→[0,∞) for each t∈Nt\in\mathbb Nt∈N. Every cost uses zero initial state, the scalar update (xt+at,0−dt)+(x_t+a_{t,0}-d_t)^+(xt​+at,0​−dt​)+, and the length-LLL vector update that shifts left and appends the chosen order; it is the limsup over T∈NT\in\mathbb NT∈N of (T+1)−1∑t=0T∫−[h(xt+at,0−dt)++p(dt−xt−at,0)+] dQP(T+1)^{-1}\sum_{t=0}^{T}\int^-[h(x_t+a_{t,0}-d_t)^++p(d_t-x_t-a_{t,0})^+]\,\mathrm d\mathbb Q_P(T+1)−1∑t=0T​∫−[h(xt​+at,0​−dt​)++p(dt​−xt​−at,0​)+]dQP​, where demands are i.i.d. with law PPP and the seed is independent uniform on [0,1][0,1][0,1]. The comparison is OPT(P,c)≤CbsOpt(P,c)\mathrm{OPT}(P,c)\le\mathrm{CbsOpt}(P,c)OPT(P,c)≤CbsOpt(P,c) in [0,∞][0,\infty][0,∞], includes zero target or cap, and requires no optimizer to exist.

Human review
  • Endorsed by Shuze Chen · Sep 8, 2026

  • Endorsed by StellaXin · Sep 8, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me