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(y)dy)/QC(Q) = (\lambda K + \int_0^Q H(y)dy)/QC(Q)=(λK+∫0Q​H(y)dy)/Q

Proved
ZhengQR.OrderQty.integral_H_eq

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

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

Under the standing assumptions of the model (λ,L,K,h,p>0\lambda, L, K, h, p > 0λ,L,K,h,p>0; the leadtime demand distribution μ\muμ is a probability measure, integrable, with mean λL\lambda LλL and nonnegative support; G(y)=E[h(y−D)++p(D−y)+]G(y) = \mathbb{E}[h(y-D)^+ + p(D-y)^+]G(y)=E[h(y−D)++p(D−y)+] has a unique minimizer y0y^0y0), let r(Q)r(Q)r(Q) be the optimal reorder point for QQQ, H(Q)=G(r(Q))H(Q) = G(r(Q))H(Q)=G(r(Q)) for Q>0Q > 0Q>0 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)).

Then for every Q>0Q > 0Q>0,

∫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​.

This expresses the optimal cost for a given order quantity through the single-variable function HHH, which reduces the two-dimensional optimization over (Q,r)(Q, r)(Q,r) to a one-dimensional one over QQQ.

Preamble
import Mathlib
import Definitions.Def_ZhengQR_OrderQty_newsvendorCost
import Definitions.Def_ZhengQR_OrderQty_qrMachinery

open MeasureTheory Filter Topology
Formal statement
namespace ZhengQR.OrderQty

/-- Eq. (7) (Zheng 1992, p. 91): for `Q > 0`, `∫_{r(Q)}^{r(Q)+Q} G = ∫_0^Q H`, and hence
`C(Q) = (λK + ∫_0^Q H(y) dy) / Q`. -/
theorem integral_H_eq
    {lam L K h p : ℝ} {μ : Measure ℝ}
    (hlam : 0 < lam) (hL : 0 < L) (hK : 0 < K) (hh : 0 < h) (hp : 0 < p)
    (hμ : IsLeadtimeDemand lam L μ)
    (hG : ∃! y : ℝ, IsMinimizer (newsvendorCost h p μ) y)
    {Q : ℝ} (hQ : 0 < Q) :
    (∫ y in optReorder (newsvendorCost h p μ) Q..optReorder (newsvendorCost h p μ) Q + Q,
        newsvendorCost h p μ y) =
      (∫ y in (0 : ℝ)..Q, Hfun (newsvendorCost h p μ) y) ∧
    optCost (newsvendorCost h p μ) lam K Q =
      (lam * K + ∫ y in (0 : ℝ)..Q, Hfun (newsvendorCost h p μ) y) / Q := by sorry

end ZhengQR.OrderQty
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. Let λ,L,K,h,p>0\lambda, L, K, h, p > 0λ,L,K,h,p>0. Let μ\muμ be a probability measure on R\mathbb{R}R with finite mean λL\lambda LλL that is almost surely nonnegative. Let

G(y)=∫(h(y−x)++p(x−y)+) μ(dx).G(y) = \int \big( h(y-x)^+ + p(x-y)^+ \big)\,\mu(dx).G(y)=∫(h(y−x)++p(x−y)+)μ(dx).

Hypotheses.

  • GGG has exactly one global minimizer.
  • Q>0Q > 0Q>0.

Notation.

  • r(Q)r(Q)r(Q) is the chosen global minimizer of r↦∫rr+QGr \mapsto \int_r^{r+Q} Gr↦∫rr+Q​G, or 000 if none exists.
  • y0y^0y0 is the chosen global minimizer of GGG, or 000 if none exists.
  • H(t)=G(r(t))H(t) = G(r(t))H(t)=G(r(t)) for t>0t > 0t>0, and H(t)=G(y0)H(t) = G(y^0)H(t)=G(y0) for t≤0t \le 0t≤0.
  • C(Q)=c(Q,r(Q))C(Q) = c(Q, r(Q))C(Q)=c(Q,r(Q)), where 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.

Conclusions.

∫r(Q)r(Q)+QG(y) dy=∫0QH(y) dy\int_{r(Q)}^{r(Q)+Q} G(y)\,dy = \int_0^Q H(y)\,dy∫r(Q)r(Q)+Q​G(y)dy=∫0Q​H(y)dy

and

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

Degenerate cases.

  • Because Q>0Q > 0Q>0, the interval is correctly oriented and there is no division by zero.
  • The statement does not separately assert that HHH is integrable on [0,Q][0, Q][0,Q]. If it were not, the right-hand integral would be defined as 000, and the statement would then assert that the left-hand integral also equals 000.
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