Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Pathwise invariants of πFIFO\pi_{\rm FIFO}πFIFO​: supplier rule on YtY_tYt​, Wt≥0W_t\ge0Wt​≥0, Pi,t≤P^i,tP_{i,t}\le\widehat P_{i,t}Pi,t​≤Pi,t​, WtΔt=0W_t\Delta_t=0Wt​Δt​=0, and the continuation charge (Lemma 7)

Proved
OWMR.fifo_engine_invariants

by Ming Hu · Nov 16, 2026 · Mathlib 0df444a (Lean v4.33.1)

approximation-algorithmsinventoryinventory-theoryoperations-researchrenewal-theorystochastic-control

Fix a network NNN satisfying the standing assumptions, a valid initial state xxx, FIFO choices ccc with si≤Sis_i\le S_isi​≤Si​ and s0≤S0s_0\le S_0s0​≤S0​ (no optimality is assumed), and a deterministic demand path d=(Dt)d=(D_t)d=(Dt​). Write Bi=Ii+∑s<Liri,sB_i=I_i+\sum_{s<L_i}r_{i,s}Bi​=Ii​+∑s<Li​​ri,s​ for retailer iii's initial net inventory plus its prescribed pipeline, wsw_sws​ for the prescribed supplier pipeline, and Tpipe=max⁡(L0,max⁡iLi)T_{\rm pipe}=\max(L_0,\max_iL_i)Tpipe​=max(L0​,maxi​Li​). Let the activation flag be

actt  ⟺  Tpipe≤t+1 and Bi−∑s<tDs,i≤Si for all i,\mathrm{act}_t\iff T_{\rm pipe}\le t+1\ \text{and}\ B_i-\sum_{s<t}D_{s,i}\le S_i\ \text{for all }i,actt​⟺Tpipe​≤t+1 and Bi​−s<t∑​Ds,i​≤Si​ for all i,

the start rule of Appendix B. Let the aggregate position be

Y0=W+∑s<L0ws+∑i(Bi−ai),Yt+1=(S0 if actt and Yt≤s0, else Yt)−∑iDt,i.Y_0=W+\sum_{s<L_0}w_s+\sum_i(B_i-a_i),\qquad Y_{t+1}=\bigl(S_0\ \text{if}\ \mathrm{act}_t\ \text{and}\ Y_t\le s_0,\ \text{else}\ Y_t\bigr)-\sum_iD_{t,i}.Y0​=W+s<L0​∑​ws​+i∑​(Bi​−ai​),Yt+1​=(S0​ if actt​ and Yt​≤s0​, else Yt​)−i∑​Dt,i​.

Let the request positions be P^i,t=Bi−∑s<tDs,i\widehat P_{i,t}=B_i-\sum_{s<t}D_{s,i}Pi,t​=Bi​−∑s<t​Ds,i​ before activation and P^i,t=Si\widehat P_{i,t}=S_iPi,t​=Si​ in the first active period, and afterwards P^i,t+1=σi(P^i,t−Dt,i)\widehat P_{i,t+1}=\sigma_i(\widehat P_{i,t}-D_{t,i})Pi,t+1​=σi​(Pi,t​−Dt,i​), where σi(y)=Si\sigma_i(y)=S_iσi​(y)=Si​ if y≤siy\le s_iy≤si​ and σi(y)=y\sigma_i(y)=yσi​(y)=y otherwise. (The statement quantifies over any functions satisfying these recursions; they are unique.) Then, for the supplier orders q0,tq_{0,t}q0,t​ and dispatches qi,tq_{i,t}qi,t​ of πFIFO\pi_{\rm FIFO}πFIFO​ along ddd, for all ttt, iii and TTT:

  1. q0,t=(S0−Yt) 1{actt, Yt≤s0}q_{0,t}=(S_0-Y_t)\,\mathbf 1_{\{\mathrm{act}_t,\ Y_t\le s_0\}}q0,t​=(S0​−Yt​)1{actt​, Yt​≤s0​}​;
  2. warehouse stock is nonnegative, Wt≥0W_t\ge0Wt​≥0;
  3. retailer iii's position after dispatches, Pi,t=Bi+∑r≤tqi,r−∑r<tDr,iP_{i,t}=B_i+\sum_{r\le t}q_{i,r}-\sum_{r<t}D_{r,i}Pi,t​=Bi​+∑r≤t​qi,r​−∑r<t​Dr,i​, satisfies Pi,t≤P^i,tP_{i,t}\le\widehat P_{i,t}Pi,t​≤Pi,t​;
  4. Wt∑i(P^i,t−Pi,t)=0W_t\sum_i(\widehat P_{i,t}-P_{i,t})=0Wt​∑i​(Pi,t​−Pi,t​)=0;
  5. (Lemma 7) with yi,t=P^i,t−1−Dt−1,iy_{i,t}=\widehat P_{i,t-1}-D_{t-1,i}yi,t​=Pi,t−1​−Dt−1,i​ the pre-request position,
∑t<T∑iKi1{qi,t>0}≤∑0<t<T1actt−1∑iKi1{yi,t≤si, yi,t<Si}+Kmax⁡(n+L0+∑t<T1{q0,t>0}).\sum_{t<T}\sum_iK_i\mathbf 1_{\{q_{i,t}>0\}}\le\sum_{0<t<T}\mathbf 1_{\mathrm{act}_{t-1}}\sum_iK_i\mathbf 1_{\{y_{i,t}\le s_i,\ y_{i,t}<S_i\}}+K_{\max}\Bigl(n+L_0+\sum_{t<T}\mathbf 1_{\{q_{0,t}>0\}}\Bigr).t<T∑​i∑​Ki​1{qi,t​>0}​≤0<t<T∑​1actt−1​​i∑​Ki​1{yi,t​≤si​, yi,t​<Si​}​+Kmax​(n+L0​+t<T∑​1{q0,t​>0}​).

Items 3 and 4 are the queue invariants (23), Pi=P^i−ΔiP_i=\widehat P_i-\Delta_iPi​=Pi​−Δi​ with Δi≥0\Delta_i\ge0Δi​≥0 and WΔ=0W\Delta=0WΔ=0; item 5 is the continuation charge (26), with Ninit≤L0N_{\rm init}\le L_0Ninit​≤L0​.

Preamble
import Definitions.Def_owmr_fifo_policy

open scoped ENNReal NNReal
Formal statement
namespace OWMR
theorem fifo_engine_invariants {n : ℕ} (N : Network n) (hN : N.Standing) (x : InitState n)
    (hx : x.Valid) (c : FIFOChoice n) (hsS : ∀ i, c.s i ≤ c.S i) (hs0 : c.s0 ≤ c.S0)
    (d : ℕ → DemandVec n) (act : ℕ → Prop) [DecidablePred act]
    (hact : ∀ t, act t ↔ (N.Tpipe ≤ t + 1 ∧ ∀ i, x.I i + ∑ s ∈ Finset.range (N.L i), x.retPipe i s
      - ∑ s ∈ Finset.range t, ((d s i : ℝ≥0) : ℝ) ≤ c.S i))
    (Yp : ℕ → ℝ)
    (hY0 : Yp 0 = x.W + ∑ s ∈ Finset.range N.L0, x.supPipe s
      + ∑ i, (x.I i + ∑ s ∈ Finset.range (N.L i), x.retPipe i s - c.a i))
    (hY : ∀ t, Yp (t + 1) = (if act t ∧ Yp t ≤ c.s0 then c.S0 else Yp t)
      - ∑ i, ((d t i : ℝ≥0) : ℝ))
    (Ph : ℕ → Fin n → ℝ)
    (hPh0 : ∀ i, Ph 0 i = if act 0 then c.S i else x.I i + ∑ s ∈ Finset.range (N.L i), x.retPipe i s)
    (hPh : ∀ t i, Ph (t + 1) i = if act (t + 1) then
        (if act t then (if Ph t i - ((d t i : ℝ≥0) : ℝ) ≤ c.s i then c.S i
          else Ph t i - ((d t i : ℝ≥0) : ℝ)) else c.S i)
      else x.I i + ∑ s ∈ Finset.range (N.L i), x.retPipe i s
        - ∑ s ∈ Finset.range (t + 1), ((d s i : ℝ≥0) : ℝ)) :
    (∀ t, (fifoPolicy N x c).toPolicy.order t () d
        = if act t ∧ Yp t ≤ c.s0 then c.S0 - Yp t else 0) ∧
    (∀ t, 0 ≤ Policy.whStock N x (fifoPolicy N x c).toPolicy () d t) ∧
    (∀ t i, x.I i + ∑ s ∈ Finset.range (N.L i), x.retPipe i s
        + ∑ r ∈ Finset.range (t + 1), (fifoPolicy N x c).toPolicy.dispatch r () d i
        - ∑ r ∈ Finset.range t, ((d r i : ℝ≥0) : ℝ) ≤ Ph t i) ∧
    (∀ t, Policy.whStock N x (fifoPolicy N x c).toPolicy () d t
        * ∑ i, (Ph t i - (x.I i + ∑ s ∈ Finset.range (N.L i), x.retPipe i s
          + ∑ r ∈ Finset.range (t + 1), (fifoPolicy N x c).toPolicy.dispatch r () d i
          - ∑ r ∈ Finset.range t, ((d r i : ℝ≥0) : ℝ))) = 0) ∧
    (∀ T, ∑ t ∈ Finset.range T, ∑ i, N.K i
          * (if 0 < (fifoPolicy N x c).toPolicy.dispatch t () d i then 1 else 0)
        ≤ ∑ t ∈ Finset.range T, (if 0 < t ∧ act (t - 1) then ∑ i, N.K i
            * (if Ph (t - 1) i - ((d (t - 1) i : ℝ≥0) : ℝ) ≤ c.s i
                ∧ Ph (t - 1) i - ((d (t - 1) i : ℝ≥0) : ℝ) < c.S i then 1 else 0) else 0)
          + N.Kmax * (n + N.L0 + ∑ t ∈ Finset.range T,
              (if 0 < (fifoPolicy N x c).toPolicy.order t () d then 1 else 0))) := by sorry
end OWMR
Source
M. Hu, "A 5/2 Guarantee for Echelon Stock (s,S) Policies in One-Warehouse Multi-Retailer Systems", working paper (manuscript of November 2026), Section 5.1, queue invariants (23) and aggregate position (24), pp. 21-22; Lemma 7 (Continuation Charge), eq. (26), p. 22; start of the policy in Appendix B, Step 1, p. E.4.

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