Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq. (8) — Q>0Q > 0Q>0 is an optimal order quantity iff H(Q)=C(Q)H(Q) = C(Q)H(Q)=C(Q)

Proved
ZhengQR.EOQHeuristic.optQty_iff

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 (as in Lemma 2, with K>0K > 0K>0), let H(Q)=G(r(Q))H(Q) = G(r(Q))H(Q)=G(r(Q)) 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,

Q is an optimal order quantity  ⟺  H(Q)=C(Q).(8)Q \text{ is an optimal order quantity} \iff H(Q) = C(Q). \qquad (8)Q is an optimal order quantity⟺H(Q)=C(Q).(8)

Here "optimal" means C(Q)≤C(Q′)C(Q) \le C(Q')C(Q)≤C(Q′) for every Q′>0Q' > 0Q′>0. The paper derives (8) as the first-order condition C′(Q∗)=0C'(Q^*) = 0C′(Q∗)=0, "the necessary and sufficient condition for optimality".

Preamble
import Mathlib
import Definitions.Def_ZhengQR_EOQHeuristic_qrCost
import Definitions.Def_ZhengQR_EOQHeuristic_costCurves
import Definitions.Def_ZhengQR_EOQHeuristic_stochasticModel
open MeasureTheory Filter Topology
Formal statement
namespace ZhengQR.EOQHeuristic

theorem optQty_iff {lam L K h p : ℝ} {μ : Measure ℝ} (hM : IsQRModel lam L h p μ) (hK : 0 < K) (Q : ℝ) (hQ : 0 < Q) :
    IsOptQty (newsvendorCost μ h p) lam K Q ↔ hFun (newsvendorCost μ h p) lam K Q = optCost (newsvendorCost μ h p) lam K Q := by sorry

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

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

Setting. Let λ,L,K,h,p\lambda, L, K, h, pλ,L,K,h,p be real numbers and μ\muμ a measure on R\mathbb{R}R. Assume the model hypotheses:

  • λ,L,h,p>0\lambda, L, h, p > 0λ,L,h,p>0;
  • μ\muμ is a probability measure with finite first moment and mean λL\lambda LλL;
  • μ\muμ is concentrated on x≥0x\ge0x≥0 almost everywhere;
  • 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 a unique global minimizer y0y^0y0.

Assume also K>0K>0K>0, and fix a real Q>0Q > 0Q>0.

Notation.

  • r(Q)r(Q)r(Q) is a chosen minimizer over real rrr of 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, or 000 if none exists.
  • H(Q)=G(r(Q))H(Q) = G(r(Q))H(Q)=G(r(Q)) for Q>0Q>0Q>0 (and G(y0)G(y^0)G(y0) for Q≤0Q\le0Q≤0).
  • C(Q)=c(Q,r(Q))C(Q) = c(Q, r(Q))C(Q)=c(Q,r(Q)).
  • "QQQ is optimal" means Q>0Q>0Q>0 and C(Q)≤C(Q′)C(Q) \le C(Q')C(Q)≤C(Q′) for all Q′>0Q'>0Q′>0.

Claim.

Q is optimal  ⟺  H(Q)=C(Q).Q \text{ is optimal} \iff H(Q) = C(Q).Q is optimal⟺H(Q)=C(Q).

Degenerate cases. Q≤0Q\le 0Q≤0 is excluded by hypothesis. The statement does not assert that an optimal QQQ exists. The hypotheses can all hold, for example with μ\muμ the point mass at λL\lambda LλL.

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