Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq. (A2) — closed max-form of the backlog Qi(t)Q_i(t)Qi​(t)

Proved
GravesWillems.Serial.backlog_closed_form

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

base-stockinventoryp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1serial-systemsupply-chain

Let Qi(t)Q_i(t)Qi​(t) be the backlog of the NNN-stage serial base-stock system defined by the recursion (A1), with lead times Ti∈NT_i \in \mathbb{N}Ti​∈N, arbitrary real base stocks BiB_iBi​ and an arbitrary real demand path ddd. Then for every stage i∈{1,…,N}i \in \{1, \dots, N\}i∈{1,…,N} and every period t∈Zt \in \mathbb{Z}t∈Z,

Qi(t)=max⁡[0,  max⁡i≤j≤N(d(t−Ti−Ti+1−⋯−Tj, t]−Bi−Bi+1−⋯−Bj)].Q_i(t) = \max\Bigl[0,\; \max_{i \le j \le N} \bigl( d(t - T_i - T_{i+1} - \dots - T_j,\, t] - B_i - B_{i+1} - \dots - B_j \bigr)\Bigr].Qi​(t)=max[0,i≤j≤Nmax​(d(t−Ti​−Ti+1​−⋯−Tj​,t]−Bi​−Bi+1​−⋯−Bj​)].

That is, the backlog at stage iii is the largest excess of demand over a window reaching back through the lead times of stages i,…,ji, \dots, ji,…,j over the base stocks held at those stages. This closed form is what makes the expected backlogs tractable as functions of the base stocks.

Formalization Note The inner maximum is Finset.sup' over the nonempty range {i,…,N}\{i, \dots, N\}{i,…,N}; no hypothesis on the signs of BBB or ddd is needed.

Preamble
import Mathlib
import Definitions.Def_GravesWillems_Serial_backlog
Formal statement
namespace GravesWillems.Serial

/-- Eq. (A2) of Graves–Willems 2000 (Appendix, p. 81): the backlog defined by the recursion (A1)
has the closed max-form
`Qᵢ(t) = max[0, max_{i ≤ j ≤ N} (d(t − Tᵢ − ⋯ − T_j, t] − Bᵢ − ⋯ − B_j)]` for `i = 1, …, N`. -/
theorem backlog_closed_form (N : ℕ) (T : ℕ → ℕ) (B : ℕ → ℝ) (d : ℤ → ℝ) (i : ℕ)
    (hi : i ∈ Finset.Icc 1 N) (t : ℤ) :
    backlog N T B d i t =
      max 0 ((Finset.Icc i N).sup' (Finset.nonempty_Icc.mpr (Finset.mem_Icc.mp hi).2)
        (fun j => windowDemand d (t - ((∑ m ∈ Finset.Icc i j, T m : ℕ) : ℤ)) t
          - ∑ m ∈ Finset.Icc i j, B m)) := by sorry

end GravesWillems.Serial
Source
Graves and Willems, Optimizing Strategic Safety Stock Placement in Supply Chains, Manufacturing & Service Operations Management 2(1), 2000, p. 81, Appendix, Eq. (A2)
Read-back

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

Setup. The statement quantifies over:

  • any N∈NN\in\mathbb NN∈N;
  • any lead times T:N→NT:\mathbb N\to\mathbb NT:N→N;
  • any real base stocks B:N→RB:\mathbb N\to\mathbb RB:N→R;
  • any real demand path d:Z→Rd:\mathbb Z\to\mathbb Rd:Z→R;
  • any stage iii with 1≤i≤N1\le i\le N1≤i≤N;
  • any time t∈Zt\in\mathbb Zt∈Z.

Here d(a,b]=∑a<τ≤bd(τ)d(a,b]=\sum_{a<\tau\le b}d(\tau)d(a,b]=∑a<τ≤b​d(τ), which is 000 when a≥ba\ge ba≥b. The backlog QiQ_iQi​ is defined by the recursion

Qi(t)=max⁡(0, d(t−Ti,t]+Qi+1(t−Ti)−Bi)(i≤N),Qi≡0(i>N).Q_i(t)=\max\bigl(0,\ d(t-T_i,t]+Q_{i+1}(t-T_i)-B_i\bigr)\quad (i\le N),\qquad Q_i\equiv 0\quad (i>N).Qi​(t)=max(0, d(t−Ti​,t]+Qi+1​(t−Ti​)−Bi​)(i≤N),Qi​≡0(i>N).

Claim. The backlog equals the closed form

Qi(t)=max⁡(0, max⁡i≤j≤N[ d(t−∑m=ijTm, t]−∑m=ijBm]).Q_i(t)=\max\Bigl(0,\ \max_{i\le j\le N}\Bigl[\,d\Bigl(t-\sum_{m=i}^{j}T_m,\ t\Bigr]-\sum_{m=i}^{j}B_m\Bigr]\Bigr).Qi​(t)=max(0, i≤j≤Nmax​[d(t−m=i∑j​Tm​, t]−m=i∑j​Bm​]).

The inner maximum is over a nonempty finite set, because i≤Ni\le Ni≤N.

Degenerate cases.

  • N=0N=0N=0: no iii satisfies 1≤i≤N1\le i\le N1≤i≤N, so the statement is vacuous.
  • i=Ni=Ni=N: the claim says QN(t)=max⁡(0, d(t−TN,t]−BN)Q_N(t)=\max(0,\ d(t-T_N,t]-B_N)QN​(t)=max(0, d(t−TN​,t]−BN​).
  • Zero lead times: windows of zero total lead time contribute demand 000.
  • Signs: there are no sign restrictions on BBB or ddd.
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