Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq. (7): ∫_{r(Q)}^{r(Q)+Q} G = ∫_0^Q H and C(Q) = (λK + ∫_0^Q H(y)dy)/Q

Proved
ZhengQR.Flatness.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 an optimal reorder point for the order quantity QQQ, let 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 let C(Q)=c(Q,r(Q))C(Q) = c(Q, r(Q))C(Q)=c(Q,r(Q)) be the average cost with the reorder point chosen optimally. Then 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 two-variable cost as a function of the order quantity alone, and is the starting point of every comparison between the stochastic model and the EOQ model.

Preamble
import Mathlib
import Definitions.Def_ZhengQR_Flatness_QRModel
Formal statement
namespace ZhengQR.Flatness

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

end ZhengQR.Flatness
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. MMM is an arbitrary model consisting of:

  • real numbers λ,L,K,h,p\lambda, L, K, h, pλ,L,K,h,p, all strictly positive;
  • a probability measure μ\muμ on R\mathbb{R}R that has a finite first moment, has mean λL\lambda LλL, and gives full mass to [0,∞)[0,\infty)[0,∞);
  • the requirement that the function
G(y)=∫(h(y−x)++p(x−y)+) dμ(x)G(y)=\int\big(h(y-x)^+ + p(x-y)^+\big)\,d\mu(x)G(y)=∫(h(y−x)++p(x−y)+)dμ(x)

has exactly one global minimizer y0y^0y0.

Definitions used.

  • 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 chosen global minimizer of c(Q,⋅)c(Q,\cdot)c(Q,⋅) over R\mathbb{R}R, or 000 if none exists.
  • 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)).

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

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

  • The only explicit hypothesis is Q>0Q>0Q>0, so Q=0Q=0Q=0 and Q<0Q<0Q<0 are excluded.
  • Nothing in the hypotheses guarantees that c(Q,⋅)c(Q,\cdot)c(Q,⋅) has a minimizer. If it had none, r(Q)r(Q)r(Q) would be the placeholder 000, and the claim would then be about the integral of GGG over [0,Q][0,Q][0,Q].
  • HHH is defined through the choice function r(⋅)r(\cdot)r(⋅) at every point y∈(0,Q]y\in(0,Q]y∈(0,Q]. So the right-hand integral depends on those choices.
  • If HHH is not integrable on [0,Q][0,Q][0,Q], ∫0QH\int_0^Q H∫0Q​H counts as 000. The same convention applies to GGG on [r(Q),r(Q)+Q][r(Q), r(Q)+Q][r(Q),r(Q)+Q]. In that case the first equation compares these conventional values.
  • The claim is stated for every Q>0Q>0Q>0; no range restriction on QQQ beyond positivity.
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