Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq. (7): ∫r(Q)r(Q)+QG=∫0QH\int_{r(Q)}^{r(Q)+Q}G = \int_0^Q H∫r(Q)r(Q)+Q​G=∫0Q​H and C(Q)=(λK+∫0QH)/QC(Q) = (\lambda K + \int_0^Q H)/QC(Q)=(λK+∫0Q​H)/Q

Proved
ZhengQR.CostBounds.cost_integral_form

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

inventoryp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1qr-policy

In the stochastic (Q,r)(Q,r)(Q,r) model, let r(Q)r(Q)r(Q) be the optimal reorder point for order quantity QQQ, H(Q)=G(r(Q))H(Q)=G(r(Q))H(Q)=G(r(Q)) with H(0)=G(y0)H(0)=G(y^0)H(0)=G(y0), and C(Q)=c(Q,r(Q))C(Q)=c(Q,r(Q))C(Q)=c(Q,r(Q)). For every Q>0Q>0Q>0,

∫r(Q)r(Q)+QG(y) dy=∫0QH(y) dyandC(Q)=λK+∫0QH(y) dyQ.\int_{r(Q)}^{r(Q)+Q}G(y)\,dy=\int_0^Q H(y)\,dy\qquad\text{and}\qquad C(Q)=\frac{\lambda K+\int_0^Q H(y)\,dy}{Q}.∫r(Q)r(Q)+Q​G(y)dy=∫0Q​H(y)dyandC(Q)=QλK+∫0Q​H(y)dy​.

This rewrites the optimal-reorder cost as a function of QQQ alone, through the single-variable function HHH; every later result on the order quantity starts from this form.

Preamble
import Mathlib
import Definitions.Def_ZhengQR_CostBounds_QRMachinery
import Definitions.Def_ZhengQR_CostBounds_Model
Formal statement
namespace ZhengQR.CostBounds

theorem cost_integral_form (M : QRModel) (Q : ℝ) (hQ : 0 < Q) :
    (∫ y in reorderPt M.G M.lam M.K Q..reorderPt M.G M.lam M.K Q + Q, M.G y)
        = ∫ y in (0 : ℝ)..Q, Hfun M.G M.lam M.K y ∧
      Cfun M.G M.lam M.K Q = (M.lam * M.K + ∫ y in (0 : ℝ)..Q, Hfun M.G M.lam M.K y) / Q := by sorry

end ZhengQR.CostBounds
Source
Zheng, On Properties of Stochastic Inventory Systems, Management Science 38(1), 1992, p. 91, Eq. (7)
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Fix a model (λ,L,K,h,p,μ)(\lambda,L,K,h,p,\mu)(λ,L,K,h,p,μ):

  • λ,L,K,h,p>0\lambda,L,K,h,p>0λ,L,K,h,p>0 are real numbers.
  • μ\muμ is a probability measure on R\mathbb RR concentrated on [0,∞)[0,\infty)[0,∞) (almost everywhere), with ∫x dμ=λL\int x\,d\mu=\lambda L∫xdμ=λL and xxx integrable.
  • G(y)=∫(hmax⁡(y−x,0)+pmax⁡(x−y,0)) dμ(x)G(y)=\int\big(h\max(y-x,0)+p\max(x-y,0)\big)\,d\mu(x)G(y)=∫(hmax(y−x,0)+pmax(x−y,0))dμ(x) has exactly one global minimizer.

Derived objects.

  • c(Q,r)=(λK+∫rr+QG)/Qc(Q,r)=\big(\lambda K+\int_r^{r+Q}G\big)/Qc(Q,r)=(λK+∫rr+Q​G)/Q.
  • r(Q)r(Q)r(Q) is a fixed but unspecified rrr minimizing c(Q,⋅)c(Q,\cdot)c(Q,⋅) over all of R\mathbb RR, if such an rrr exists; otherwise r(Q)=0r(Q)=0r(Q)=0.
  • y0y^0y0 is the chosen global minimizer of GGG. Under the model's assumption it is the unique one.
  • H(y)=G(r(y))H(y)=G(r(y))H(y)=G(r(y)) for y>0y>0y>0, and H(y)=G(y0)H(y)=G(y^0)H(y)=G(y0) for y≤0y\le 0y≤0.
  • C(Q)=c(Q,r(Q))C(Q)=c(Q,r(Q))C(Q)=c(Q,r(Q)).

Statement. For every real Q>0Q>0Q>0, both of the following hold:

∫r(Q)r(Q)+QG(y) dy=∫0QH(y) dy,C(Q)=λK+∫0QH(y) dyQ.\int_{r(Q)}^{r(Q)+Q}G(y)\,dy=\int_0^Q H(y)\,dy, \qquad C(Q)=\frac{\lambda K+\int_0^Q H(y)\,dy}{Q}.∫r(Q)r(Q)+Q​G(y)dy=∫0Q​H(y)dy,C(Q)=QλK+∫0Q​H(y)dy​.

Degenerate cases. Only Q>0Q>0Q>0 is covered. The statement does not assume that an optimal reorder point exists for QQQ or for the y∈(0,Q]y\in(0,Q]y∈(0,Q] appearing in HHH. Where none exists, r(⋅)=0r(\cdot)=0r(⋅)=0 is used. The integrals are the convention-valued ones: they are 000 if the integrand is not integrable on the interval. The statement asserts no integrability. On the integration interval, H(0)=G(y0)H(0)=G(y^0)H(0)=G(y0) is used only at the single endpoint y=0y=0y=0.

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

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 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