Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Chapter V, Theorem 3 — finite horizon: order-up-to levels that increase with the number of stages

Proved
BellmanDP.Inventory.finite_horizon_stock_levels

by mikedeng1 · Oct 2, 2026 · Mathlib 0df444a (Lean v4.33.1)

dynamic-programminginventoryp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1

Consider the undiscounted nnn-stage inventory process (Chapter V, Eq. (7.2)):

f1(x)=min⁡y≥x[k(y−x)+p∫y∞(s−y)φ(s) ds],f_1(x) = \min_{y\ge x}\Big[k(y-x) + p\int_y^\infty (s-y)\varphi(s)\,ds\Big],f1​(x)=y≥xmin​[k(y−x)+p∫y∞​(s−y)φ(s)ds], fn+1(x)=min⁡y≥x[k(y−x)+p∫y∞(s−y)φ(s) ds+fn(0)∫y∞φ(s) ds+∫0yfn(y−s)φ(s) ds].f_{n+1}(x) = \min_{y\ge x}\Big[k(y-x) + p\int_y^\infty (s-y)\varphi(s)\,ds + f_n(0)\int_y^\infty \varphi(s)\,ds + \int_0^y f_n(y-s)\varphi(s)\,ds\Big].fn+1​(x)=y≥xmin​[k(y−x)+p∫y∞​(s−y)φ(s)ds+fn​(0)∫y∞​φ(s)ds+∫0y​fn​(y−s)φ(s)ds].

Assume 0<k<p0 < k < p0<k<p and that φ\varphiφ is a demand density (φ>0\varphi > 0φ>0 on (0,∞)(0,\infty)(0,∞), ∫0∞φ=1\int_0^\infty\varphi = 1∫0∞​φ=1, finite mean). Then there are levels xˉ1≤xˉ2≤⋯\bar x_1 \le \bar x_2 \le \cdotsxˉ1​≤xˉ2​≤⋯, all ≥0\ge 0≥0, such that for every nnn and every x≥0x \ge 0x≥0 the minimum defining fn(x)f_n(x)fn​(x) is attained at

y=xˉn  if x≤xˉn,y=x  if x≥xˉn.y = \bar x_n \ \text{ if } x \le \bar x_n, \qquad y = x \ \text{ if } x \ge \bar x_n.y=xˉn​  if x≤xˉn​,y=x  if x≥xˉn​.

With finitely many stages the optimal policy is again a constant stock level at each stage, and the level rises as more stages remain.

Formalization Note fnf_nfn​ is obtained from f0=0f_0 = 0f0​=0 by the discounted recursion with discount factor 111; the Lean sequence xbar is indexed from 000, so xbar n is the level xˉn+1\bar x_{n+1}xˉn+1​ of fn+1f_{n+1}fn+1​. The book's hypothesis is "the natural assumption p>kp > kp>k"; k>0k > 0k>0 and the density conditions of Theorem 1 are taken from the chapter's setting (the proof uses f1′′=pφ>0f_1'' = p\varphi > 0f1′′​=pφ>0).

Preamble
import Mathlib
import Definitions.Def_BellmanDP_Inventory_Model

open MeasureTheory Filter Topology
Formal statement
namespace BellmanDP.Inventory

/-- Bellman, *Dynamic Programming*, Ch. V, § 7, Theorem 3, p. 166. Undiscounted finite process
(7.2): `f₁(x) = Min_{y ≥ x} [k(y − x) + p ∫_y^∞ (s − y) φ(s) ds]` and
`f_{n+1}(x) = Min_{y ≥ x} [k(y − x) + p ∫_y^∞ (s − y) φ(s) ds + f_n(0) ∫_y^∞ φ(s) ds
+ ∫_0^y f_n(y − s) φ(s) ds]`; in Lean `f_{n+1} = invIter k p 1 φ 0 (n + 1)` (starting from
`f₀ = 0`, discount `a = 1`). If `0 < k < p` and `φ` is a demand density, then for each
`n ≥ 1` there is a level `x̄_n ≥ 0` (here `xbar n` is the level of `f_{n+1}`, i.e. the book's
`x̄_{n+1}`) such that ordering up to `max(x, x̄_n)` attains the minimum defining `f_n(x)` for
every `x ≥ 0`, and the levels are monotone increasing in `n`. -/
theorem finite_horizon_stock_levels (k p : ℝ) (φ : ℝ → ℝ)
    (hk : 0 < k) (hkp : k < p) (hφ : DemandDensity φ) :
    ∃ xbar : ℕ → ℝ, Monotone xbar ∧ (∀ n : ℕ, 0 ≤ xbar n) ∧
      ∀ (n : ℕ) (x : ℝ), 0 ≤ x →
        IsLeast (invT k p 1 φ (invIter k p 1 φ (fun _ => 0) n) x '' Set.Ici x)
          (invT k p 1 φ (invIter k p 1 φ (fun _ => 0) n) x (max x (xbar n))) := by sorry

end BellmanDP.Inventory
Source
Bellman, Dynamic Programming, Princeton University Press (1957; Princeton Landmarks ed. 2010), DOI 10.2307/j.ctv1nxcw0f, Chapter V, § 7, Theorem 3, p. 166 (recurrence (7.2), p. 166)
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me