Lost-sales dynamics, admissible policies, and the two-variable cost certificate
DefinitionCappedBaseStock_ModelConsider a periodic-review lost-sales inventory system. Demand is i.i.d., nonnegative and real-valued, with . Lead time is an integer , and holding and lost-sales rates satisfy . Inventory and the 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 periods later. The period cost is .
Costs use the upper limit of finite-horizon expected average costs from this empty initial state. 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 , with finite . Its cost is denoted by , and is the infimum over these parameters. Ordinary base stock at level is the same rule with cap .
For a demand block, let , including the zero empty sum. A pair is feasible when , , and, for both and ,
The lower certificate is the infimum of over this feasible set. Neither attainment of the infimum nor positivity of 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 . A policy's period- decision is a measurable function of the demands in periods 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 .
The factor is , with . 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.
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
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 on the nonnegative finite real numbers , a proof that has total mass one, a proof that the real-valued identity function is Bochner integrable under , and the strict inequality . 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 , whose underlying measure is a probability measure on with integrable identity and strictly positive identity integral, is the real Bochner integral . The hypotheses carried by make finite and strictly positive; this definition does not use an extended-real mean.
Parameters. A parameter object contains a natural number , a proof of , two real numbers , and proofs of and . In particular the admissible parameter objects have a positive integer lead-time value and strictly positive finite real coefficients; neither 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 , 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 , where is an arbitrary demand sequence and is an arbitrary real number. The sample space itself allows every real seed, including values outside ; restriction of the seed to that interval is a property of the sampling measure, not of this type.
demandPathLaw. For a probability measure on supplied with an integrable identity and strictly positive mean, the demand-path law is the countable product measure on , with the usual product measurable structure. Accordingly its coordinate demands all have law 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 is Lebesgue measure restricted to the closed interval : for a measurable set , its measure is the Lebesgue measure of . 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 restricted to 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 with finite strictly positive real mean, the sampling measure on is , where is real Lebesgue measure. Thus the demands are independent with common law , and the real seed is uniform on 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 on finite nonnegative reals that comes with an integrable identity and strictly positive mean, its countably infinite product is a probability measure on demand sequences. This conclusion is registered as an instance; there are no additional assumptions on .
sampleLaw_probability. For every probability demand measure on finite nonnegative reals with integrable identity and strictly positive mean, the product of its countable demand-sequence law and Lebesgue measure restricted to 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 , with no additional assumptions.
history. For every and every sample , the history at is the pair , formally a function on together with the original seed. It contains all demands strictly before and the seed, and contains no demand at or after . When , the demand-history domain is empty and only the seed carries variable information.
AdmissiblePolicy. An admissible policy is a family, indexed by every , of measurable functions , 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 a decision can depend on the seed and has no past demands to use.
order. For every admissible policy , time , and sample , the order is . Here each 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 is evaluated on the empty demand vector and . No demand-law or parameter argument is required.
State. For every natural number , a state is a pair with and ; all entries are finite. This type itself allows , in which case the vector has empty domain, as well as every nonnegative value of and every nonnegative vector. It imposes no bound or reachability condition.
initialState. For every , the initial state is : its scalar coordinate and every vector coordinate are zero. This is defined also at , where the vector is the unique empty function.
arrival. Given parameters with , , and , and any state , the arrival is . The positive-lead-time proof supplies the existence of coordinate zero. The value is finite and nonnegative, and do not enter its formula.
step. Given parameters with and , any state with nonnegative finite coordinates, and any finite nonnegative order and demand , one step returns , where and if , while otherwise, for every . Here : subtraction in the nonnegative-real type is truncated. The final vector coordinate is therefore , and all earlier coordinates shift down by one. For the new vector consists only of . The current order does not enter ; only the old vector's first coordinate does. The positive real coefficients are carried by the parameter object but do not affect this transition.
run. For parameters with and , any admissible family of measurable decisions , and every sample , the state sequence is defined for all by , , and , for , and . Every demand and seed here is arbitrary at the pointwise level; no sampling measure is needed to define the recursion. In particular the period- order is inserted in the state at and enters the available amount used with demand ; is processed using and its existing first vector coordinate. All shortages are truncated to zero in the scalar coordinate.
filledDemand. For parameters with positive integer and strictly positive real , any nonnegative state of length , and any finite nonnegative demand , the filled-demand value is . 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 with and , any state with finite nonnegative coordinates, and any finite nonnegative demand , lost sales are . The subtraction is truncated at zero, so this value is zero whenever demand is at most . The definition does not carry a negative inventory balance forward.
periodCost. For parameters with positive integer and strictly positive finite real , a state with finite nonnegative coordinates, and finite nonnegative demand , the period cost is the extended nonnegative real . More literally, each coefficient is embedded by into , and each truncated nonnegative-real quantity is embedded there before multiplication and addition; positivity of 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 on finite nonnegative reals with integrable identity and strictly positive mean, and an arbitrary function , define , where and the limsup is along natural . Each integral is the extended nonnegative lower Lebesgue integral; the argument 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 are allowed. There are periods starting at zero, including just period zero when ; 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 on with finite strictly positive mean, parameters with and , and an admissible policy consisting of measurable maps from past demand vectors and a real seed to finite nonnegative orders, its cost is . Here is the independent product of i.i.d. demand coordinates with law and a uniform seed; , , , earlier vector coordinates shift left, and . The sum and lower integrals take values in , 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 on with finite strictly positive mean and every parameter tuple with integer and , is the infimum in over all families of measurable maps of their limsup expected average cost. For each such family, the state starts at zero, period- order is , the next scalar state is , the vector shifts left and appends the order, and the period cost is . The average is , with i.i.d. law- demands and an independent uniform 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 , finite nonnegative numbers , and any state , the order is . 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 or relation to a demand mean. Either or makes this order zero for every state. The definition also allows , when the vector sum is zero and the formula is .
cbsRun. For parameters with integer and , any finite nonnegative , and any sample , the sequence starts with all coordinates zero and satisfies , , for , and , for all . Thus the order is computed from the state at , whose vector still contains its first coordinate, and is used as an arrival with demand . The recursion ignores the seed and places no probabilistic condition on the demand path. In particular its first order is ; if or , all orders and state coordinates remain zero.
cbsCost. For a probability demand law on finite nonnegative reals with finite strictly positive mean, parameters with and , and any finite nonnegative , the cost is . Here demands are i.i.d. with law , the seed is independent uniform on , all state coordinates start at zero, , the scalar state updates to , and the vector shifts left and appends . The integral is the extended nonnegative lower integral, the resulting cost is defined in , and the state and integrand ignore . Neither a strict positive cap nor a strict positive target nor a relation between and the mean is assumed.
CbsOpt. For a probability demand law on with finite strictly positive mean and parameters with positive integer and , this quantity is the nested extended-nonnegative-real infimum . For each pair, is the limsup of the mean of periodwise lower integrals over periods , under i.i.d. law- demands and an independent uniform seed, of ; states start at zero, update their scalar coordinate by , and shift the length- vector left while appending . 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 on with finite strictly positive mean, parameters with and , and any finite nonnegative , this is the cost obtained by setting both the target and the cap equal to in the preceding capped-order recursion. Explicitly, all state coordinates start at zero, , , and the length- vector shifts left and appends . The cost is , where demands are i.i.d. with law and the seed is independent uniform on . Because all state coordinates are nonnegative, the minimum with cannot reduce the displayed positive-part shortfall; is included and gives zero orders.
finiteInventory. For every arbitrary demand sequence , every real (including negative values), and every natural (including zero), this real-valued function is . The maximum is over the nonempty finite set of integers , and the sum is zero. In particular and . The sum consists of prefixes starting at index zero; it involves only 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 , arbitrary real , and natural , this is the extended nonnegative real embedded in . The maximum includes the zero prefix, both sums are finite, and no nonnegativity or mean restriction is imposed on or here. Thus every pointwise value is finite, even though later lower integrals use an extended codomain. At this is , independent of the demand path and of .
CertificateFeasible. Let be a probability law on finite nonnegative reals with finite strictly positive real mean , let satisfy , , and , and let be arbitrary real numbers. The predicate holds exactly when all five conditions hold: , , , , and . Here , each right-hand side is embedded in , 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 and , not at all horizons. Both endpoints and and the endpoint are permitted; at both integral bounds are zero. The coefficients satisfy the carried parameter assumptions but do not enter the feasibility inequalities.
certificateObjective. For a probability demand law on finite nonnegative reals with finite strictly positive real mean , parameters with integer and , and arbitrary real , the objective is the extended nonnegative real . The positive part is applied to the whole real sum before embedding it in ; it is not applied to the two summands separately. This definition does not assume feasibility, , , or , 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 on finite nonnegative reals with finite strictly positive mean , and parameters with integer and , this is the infimum in of over real pairs such that , , and, for each of the two values , . 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 , but here satisfies both tests: the maximum prefix is zero, the excess is the sum of the first demands, and its integral is . Its objective is . A strictly positive value is not required: for a law concentrated at the positive number , the feasible pair 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 , independently of any parameter object or demand law, is the real number , with the naturals cast to reals before arithmetic. This includes , for which ; its denominator is nonzero for every allowed input.
kappa. For every natural , independently of any parameter object or demand law, is the real number , with subtraction, multiplication, exponentiation, and division performed in the reals after casting . The denominator uses the real expression , not truncated natural subtraction. The domain includes , where the denominator is and ; for integer the denominator is positive, so it is never zero on the stated domain.
completeHistory. For every and every pair with and , the completed sample is , where if and if . Thus the supplied finite demand vector is extended by zeros from index onward, with the seed preserved even when it lies outside . At the entire completed demand sequence is zero. The construction has no law or support requirement.
measurable_completeHistory. For each natural , the map from a finite nonnegative demand vector and real seed to the sample , where for and for , is measurable for the usual product measurable structures. This holds also at and on all real seeds; it has no probability-law, integrability, or parameter hypotheses.
measurable_cbsRun. For every parameter tuple with positive integer and , every finite nonnegative , and every natural , the map from an arbitrary sample to the state is measurable, where all coordinates start at zero and, at each index , , , earlier vector coordinates shift left, and . The codomain is the scalar nonnegative-real coordinate times the length- nonnegative vector with its product measurable structure. This assertion includes , , and and does not require a demand law or a restricted seed value.
measurable_cbsOrder. For each natural and all finite nonnegative , the function on all nonnegative states given by is measurable. This uses the usual product measurable structure and requires no lead-time positivity, demand law, or state reachability hypothesis. At the sum is empty and zero; zero targets and zero caps are included.
cbsPolicy. For each parameter tuple with positive integer and , and each finite nonnegative , this constructs an admissible family of measurable decisions as follows. At time , given a finite history and real seed , extend to a demand path by assigning zero at every index , retain , and run from zero for steps with orders , scalar updates , and vector updates that shift left and append . Output . 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 it outputs .
cbsRun_congr_history. For every parameter tuple with positive integer and , all finite nonnegative , any natural , and any two samples and , if for every natural , then their states at time coincide under the following recursion: start at zero, set each order to , update the scalar state to or respectively, and shift the length- vector left while appending the order. No equality of seeds or of demands at or after is required. At 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 with positive integer and , all finite nonnegative , every natural , and every sample , replacing its demand path by for and for , while preserving , does not change the state at time of the recursion that starts at zero, orders , updates the scalar state to , and shifts the length- vector left and appends that order. The same recursion is used with on the other side. This holds pointwise for all paths and real seeds, including , and requires no sampling law or almost-everywhere qualification.
run_cbsPolicy. For every parameter tuple with positive integer and , all finite nonnegative , every sample , and every natural , two zero-initialized state constructions have exactly the same state at time . The first uses the admissible decision which, at each time , completes the observed vector by zeros, runs the state-based recursion for steps on that completed sample, and returns 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 and the length- vector shifts left and appends the chosen order. Equality is pointwise for every time and every real seed, including , without a demand-law hypothesis.
policyCost_cbsPolicy. For every probability demand law on finite nonnegative reals with finite strictly positive mean, every parameter tuple with positive integer and , and all finite nonnegative , 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 evaluates after running from zero on the zero-completed observed demands; the direct recursion evaluates that formula on its current state. Both use scalar update and a length- vector that shifts left and appends the order. Each cost is , with i.i.d. law- demands and an independent uniform seed. The assertion is equality in , with no extra finiteness or positivity requirement on .
OPT_le_CbsOpt. For every probability demand law on finite nonnegative reals with finite strictly positive mean and every parameter tuple with positive integer and , the infimum over all measurable history-and-seed policies is less than or equal to the infimum over all finite nonnegative targets and caps of the costs of the state-based order formula . The larger policy class consists of all measurable maps for each . Every cost uses zero initial state, the scalar update , and the length- vector update that shifts left and appends the chosen order; it is the limsup over of , where demands are i.i.d. with law and the seed is independent uniform on . The comparison is in , includes zero target or cap, and requires no optimizer to exist.
Confirmed by the mission captain (proposal self-audit).