Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eqs. (18), (20): Hd(Q)=hph+pQH_d(Q) = \frac{hp}{h+p}QHd​(Q)=h+php​Q and Qd∗=2λK(h+p)/(hp)Q^*_d = \sqrt{2\lambda K(h+p)/(hp)}Qd∗​=2λK(h+p)/(hp)​ is the EOQ optimum

Proved
ZhengQR.CostBounds.eoq_optimum

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

eoqinventoryp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Apply the §2 machinery to the deterministic (EOQ) model, whose inventory cost rate is Gd(y)=h(y−λL)++p(λL−y)+G_d(y)=h(y-\lambda L)^+ + p(\lambda L-y)^+Gd​(y)=h(y−λL)++p(λL−y)+, and write HdH_dHd​, CdC_dCd​ for the resulting functions. Then:

  1. For every Q≥0Q\ge0Q≥0,
Hd(Q)=hph+p Q.(18)H_d(Q)=\frac{hp}{h+p}\,Q.\qquad(18)Hd​(Q)=h+php​Q.(18)
  1. The unique optimal order quantity of the EOQ model is
Qd∗=2λK(h+p)hp.(20)Q^*_d=\sqrt{\frac{2\lambda K(h+p)}{hp}}.\qquad(20)Qd∗​=hp2λK(h+p)​​.(20)
  1. At it, Cd(Qd∗)=Hd(Qd∗)C_d(Q^*_d)=H_d(Q^*_d)Cd​(Qd∗​)=Hd​(Qd∗​) (Eq. (8) for the EOQ model).

This identifies the optimal EOQ cost Cd∗=Cd(Qd∗)C^*_d=C_d(Q^*_d)Cd∗​=Cd​(Qd∗​) used in Theorem 3.

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

theorem eoq_optimum (M : QRModel) :
    (∀ Q : ℝ, 0 ≤ Q → Hfun M.Gd M.lam M.K Q = M.h * M.p / (M.h + M.p) * Q) ∧
    (∀ Q : ℝ, IsOptQty M.Gd M.lam M.K Q ↔ Q = M.Qd) ∧
    Cfun M.Gd M.lam M.K M.Qd = Hfun M.Gd M.lam M.K M.Qd := by sorry

end ZhengQR.CostBounds
Source
Zheng, On Properties of Stochastic Inventory Systems, Management Science 38(1), 1992, p. 94, Eqs. (18) and (20)
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 a.e., xxx integrable, and ∫x dμ=λL\int x\,d\mu=\lambda L∫xdμ=λL.
  • The function y↦∫(hmax⁡(y−x,0)+pmax⁡(x−y,0)) dμ(x)y\mapsto\int\big(h\max(y-x,0)+p\max(x-y,0)\big)\,d\mu(x)y↦∫(hmax(y−x,0)+pmax(x−y,0))dμ(x) has a unique global minimizer.

μ\muμ does not appear in the conclusion.

The deterministic cost is

Gd(y)=hmax⁡(y−λL,0)+pmax⁡(λL−y,0).G_d(y)=h\max(y-\lambda L,0)+p\max(\lambda L-y,0).Gd​(y)=hmax(y−λL,0)+pmax(λL−y,0).

Derived objects (all built from GdG_dGd​, with the model's λ\lambdaλ and KKK):

  • c(Q,r)=(λK+∫rr+QGd)/Qc(Q,r)=\big(\lambda K+\int_r^{r+Q}G_d\big)/Qc(Q,r)=(λK+∫rr+Q​Gd​)/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.
  • yd0y^0_dyd0​ is a fixed chosen global minimizer of GdG_dGd​, if one exists; otherwise 000.
  • H(Q)=Gd(r(Q))H(Q)=G_d(r(Q))H(Q)=Gd​(r(Q)) for Q>0Q>0Q>0, and H(Q)=Gd(yd0)H(Q)=G_d(y^0_d)H(Q)=Gd​(yd0​) 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 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.
  • Qd=2λK(h+p)/(hp)Q_d=\sqrt{2\lambda K(h+p)/(hp)}Qd​=2λK(h+p)/(hp)​, which is strictly positive here.

Statement. Three claims hold.

  1. For every real Q≥0Q\ge0Q≥0:
H(Q)=hph+p Q.H(Q)=\frac{hp}{h+p}\,Q.H(Q)=h+php​Q.
  1. For every real QQQ: QQQ is optimal if and only if Q=QdQ=Q_dQ=Qd​.
  2. C(Qd)=H(Qd)C(Q_d)=H(Q_d)C(Qd​)=H(Qd​).

Degenerate cases.

  • Claim 1 includes Q=0Q=0Q=0. There it asserts Gd(yd0)=0G_d(y^0_d)=0Gd​(yd0​)=0.
  • Claim 1 says nothing about Q<0Q<0Q<0.
  • Claim 2 ranges over all reals. Nonpositive QQQ are never optimal by definition, so for them it amounts to Q≠QdQ\ne Q_dQ=Qd​.
  • Integrals of non-integrable functions would count as 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