Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

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

Proved
ZhengQR.CostBounds.opt_qty_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, with HHH and CCC as in §2, for every Q>0Q>0Q>0: QQQ minimizes CCC over (0,∞)(0,\infty)(0,∞) if and only if

H(Q)=C(Q).H(Q)=C(Q).H(Q)=C(Q).

This is the first-order optimality condition for the order quantity, necessary and sufficient because CCC is convex (Lemma 5).

Formalization Note "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.

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

theorem opt_qty_iff (M : QRModel) (Q : ℝ) (hQ : 0 < Q) :
    IsOptQty M.G M.lam M.K Q ↔ Hfun M.G M.lam M.K Q = Cfun M.G M.lam M.K Q := by sorry

end ZhengQR.CostBounds
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. 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.
  • μ\muμ is a probability measure on R\mathbb RR with x≥0x\ge0x≥0 μ\muμ-a.e., xxx integrable, and ∫x dμ=λL\int x\,d\mu=\lambda L∫xdμ=λL.
  • 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 a unique global minimizer y0y^0y0.

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 global minimizer of c(Q,⋅)c(Q,\cdot)c(Q,⋅) over R\mathbb RR, if one exists; otherwise 000.
  • H(Q)=G(r(Q))H(Q)=G(r(Q))H(Q)=G(r(Q)) for Q>0Q>0Q>0, and H(Q)=G(y0)H(Q)=G(y^0)H(Q)=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 an optimal order quantity if Q>0Q>0Q>0 and C(Q)≤C(Q′)C(Q)\le C(Q')C(Q)≤C(Q′) for all Q′>0Q'>0Q′>0.

Statement. For every real Q>0Q>0Q>0:

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

Degenerate cases. Only Q>0Q>0Q>0 is covered; nothing is said about Q≤0Q\le0Q≤0. If no optimal reorder point exists for some QQQ, then r(Q)=0r(Q)=0r(Q)=0 is used in both HHH and CCC. Integrals of non-integrable functions count as 000. The statement does not assert that any optimal order quantity exists.

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