Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Inventory stage cost, sales and lost-sales transition

Definition
InventoryBounds_Primitives

by visuddhi · Oct 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

inventoryprobabilitysample-complexity

Real-valued stage cost h max(y-d,0)+p max(d-y,0), sales min(d,y), and leftover inventory max(y-d,0). Domain and positivity assumptions belong to theorems, not these total algebraic definitions.

Definition code
import Mathlib.Data.Real.Basic

set_option autoImplicit false

namespace InventoryBounds

noncomputable def stageCost (h p y d : ℝ) : ℝ :=
  h * max (y - d) 0 + p * max (d - y) 0

def lostNext (y d : ℝ) : ℝ := max (y - d) 0

def sales (y d : ℝ) : ℝ := min d y

end InventoryBounds
Source
Hanzhang Qin, David Simchi-Levi, Ruihao Zhu, Information Limits of Multistage Inventory Control: Learning, Valuation, and Censoring, arXiv:2609.37380v1 (29 September 2026), https://arxiv.org/abs/2609.37380v1, Sections 2.1 and 3.3
Read-back

What the Lean code literally says, in plain math · gpt-6

For every four real numbers h,p,y,dh,p,y,dh,p,y,d, the function stageCost⁡(h,p,y,d)\operatorname{stageCost}(h,p,y,d)stageCost(h,p,y,d) is defined to be hmax⁡(y−d,0)+pmax⁡(d−y,0)h\max(y-d,0)+p\max(d-y,0)hmax(y−d,0)+pmax(d−y,0). There are no sign restrictions on any of its arguments; in particular, hhh and ppp need not be nonnegative.

For every two real numbers y,dy,dy,d, the function lostNext⁡(y,d)\operatorname{lostNext}(y,d)lostNext(y,d) is defined to be max⁡(y−d,0)\max(y-d,0)max(y−d,0). This definition always returns a nonnegative real number, including when either input is negative.

For every two real numbers y,dy,dy,d, the function sales⁡(y,d)\operatorname{sales}(y,d)sales(y,d) is defined to be min⁡(d,y)\min(d,y)min(d,y). Neither input is required to be nonnegative, so the output is not required to be nonnegative.

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