Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Classical (R,nQ)(R,nQ)(R,nQ) rules with an outcome-dependent upstream remainder

Definition
TwoStageRnQ_RuleRand

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

inventoryoperations-researchstochastic-processes

Two classes of shipment policies on the model TwoStageRnQ_Model, for fixed integer reorder points R1,R2R_1,R_2R1​,R2​ and lot parameters Q,n≥1Q,n\ge1Q,n≥1. Write IPi=xi+Ui−NIP_i=x_i+U_i-NIPi​=xi​+Ui​−N, IL2(t)=x2+U2(t−L2)−N(t)IL_2(t)=x_2+U_2(t-L_2)-N(t)IL2​(t)=x2​+U2​(t−L2​)−N(t), and W=IL2−IP1W=IL_2-IP_1W=IL2​−IP1​ for the physical stock held at Stage 2.

FollowsRnQRand S π R₁ R₂ Q n: there are an upstream remainder ρ(ω)∈{0,…,Q−1}\rho(\omega)\in\{0,\dots,Q-1\}ρ(ω)∈{0,…,Q−1}, measurable with respect to the information at time 000 (so it may vary with the outcome), and an integer process IP^1\widehat{IP}_1IP1​ such that, almost surely, for every t≥0t\ge0t≥0:

  1. IP2(0)−ρ≡IP^1(0)(modQ)IP_2(0)-\rho\equiv\widehat{IP}_1(0)\pmod QIP2​(0)−ρ≡IP1​(0)(modQ);
  2. IP^1(t)+N(t)≡IP^1(0)+N(0)(modQ)\widehat{IP}_1(t)+N(t)\equiv\widehat{IP}_1(0)+N(0)\pmod QIP1​(t)+N(t)≡IP1​(0)+N(0)(modQ);
  3. nQnQnQ divides U2(t)−U2(0)U_2(t)-U_2(0)U2​(t)−U2​(0);
  4. R2<IP2(t)≤R2+nQR_2<IP_2(t)\le R_2+nQR2​<IP2​(t)≤R2​+nQ;
  5. R1<IP^1(t)≤R1+QR_1<\widehat{IP}_1(t)\le R_1+QR1​<IP1​(t)≤R1​+Q;
  6. IP1(t)=min⁡{IP^1(t), IL2(t)−ρ}IP_1(t)=\min\{\widehat{IP}_1(t),\,IL_2(t)-\rho\}IP1​(t)=min{IP1​(t),IL2​(t)−ρ}.

With a constant ρ\rhoρ this is Rule.FollowsRnQ for the controls (R1,R2,Q,n,ρ)(R_1,R_2,Q,n,\rho)(R1​,R2​,Q,n,ρ).

PaperRnQAll S π R₁ R₂ Q n transcribes the paper's compatible initialization and operating rule (Appendix A.2) with no condition on the remainder: there is a process β≥0\beta\ge0β≥0 of pending downstream requests such that, almost surely, the initial Stage-2 pipeline consists of complete lots (nQnQnQ divides U2(0)−U2(s)U_2(0)-U_2(s)U2​(0)−U2​(s) for s∈[−L2,0]s\in[-L_2,0]s∈[−L2​,0]) and, for every t≥0t\ge0t≥0, R1<IP1+Qβ≤R1+QR_1<IP_1+Q\beta\le R_1+QR1​<IP1​+Qβ≤R1​+Q, QQQ divides U1(t)−U1(0)U_1(t)-U_1(0)U1​(t)−U1​(0), nQnQnQ divides U2(t)−U2(0)U_2(t)-U_2(0)U2​(t)−U2​(0), R2<IP2≤R2+nQR_2<IP_2\le R_2+nQR2​<IP2​≤R2​+nQ, and β>0\beta>0β>0 implies W<QW<QW<Q.

Formalization Note The remainder W(0) mod QW(0)\bmod QW(0)modQ of a PaperRnQAll policy may be any time-0 random variable. The companion target TwoStageRnQ.paper_rule_follows_rand proves PaperRnQAll → FollowsRnQRand and FollowsRnQ → FollowsRnQRand. Conditions of the paper that this inclusion does not need (finite moments of the initial state, complete Stage-1 pipeline lots, FIFO order) are left out of PaperRnQAll, which only enlarges it. The earlier definition TwoStageRnQ_Rule covers a fixed remainder only: its FollowsRnQ holds for compatible initializations whose remainder equals the control ρ\rhoρ.

Definition code
import Definitions.Def_TwoStageRnQ_Rule

/-!
# Classical `(R,nQ)` rules from compatible initializations with an outcome-dependent remainder

Definitions accompanying "A 5/3 Guarantee for Echelon Stock (R,nQ)
Policies in Two-Stage Stochastic Serial Systems" (manuscript `rq_167.tex`), Section 4.1 and
Appendices A.2-A.3, on the model `TwoStageRnQ_Model`.

The controls `R₁, R₂ ∈ ℤ` and `Q, n ≥ 1` are fixed numbers. With `IP_i = x_i + U_i - N`,
`IL₂(t) = x₂ + U₂(t - L₂) - N(t)` and the Stage-2 physical stock `W = IL₂ - IP₁`:

* `FollowsRnQRand S π R₁ R₂ Q n`: there are an upstream remainder `ρ(ω) ∈ {0, …, Q-1}`, known at time
  `0` and allowed to vary with the outcome, and an integer nominal downstream position `Î₁` such
  that, almost surely, for all `t ≥ 0`: `IP₂(0) - ρ ≡ Î₁(0) (mod Q)`;
  `Î₁(t) + N(t) ≡ Î₁(0) + N(0) (mod Q)`; `nQ` divides `U₂(t) - U₂(0)`; `R₂ < IP₂(t) ≤ R₂ + nQ`;
  `R₁ < Î₁(t) ≤ R₁ + Q`; and `IP₁(t) = min(Î₁(t), IL₂(t) - ρ)`. For a constant `ρ` this is
  `Rule.FollowsRnQ` with controls `(R₁, R₂, Q, n, ρ)`.
* `PaperRnQAll S π R₁ R₂ Q n`: a literal transcription of the paper's compatible initialization and
  operating rule with no condition on the remainder: there is a process `β ≥ 0` of pending
  downstream requests such that, almost surely, the initial Stage-2 pipeline consists of complete
  lots (`nQ ∣ U₂(0) - U₂(s)` for `s ∈ [-L₂, 0]`) and, for all `t ≥ 0`, the nominal position
  `IP₁ + Qβ` lies in `{R₁+1, …, R₁+Q}`, downstream dispatches are complete lots
  (`Q ∣ U₁(t) - U₁(0)`), upstream orders are lots of `nQ` with `IP₂ ∈ {R₂+1, …, R₂+nQ}`, and a
  pending request implies `W < Q`. Its remainder `W(0) mod Q` may be any time-`0` random variable.
-/

open MeasureTheory

noncomputable section

namespace TwoStageRnQ

namespace RuleRand

/-- `π` follows the classical `(R, nQ)` rule with fixed controls `(R₁, R₂, Q, n)` from a compatible
initialization whose upstream remainder `ρ`, known at time `0`, may vary with the outcome. -/
def FollowsRnQRand {P : Params} (S : DemandSpace P) (π : ShipmentPolicy P S) (R1 R2 : ℤ)
    (Q n : ℕ+) : Prop :=
  ∃ ρ : S.Ω → ℕ, Measurable[S.𝓕 0] ρ ∧ (∀ ω, ρ ω < (Q : ℕ)) ∧
    ∃ Ihat : ℝ → S.Ω → ℤ, ∀ᵐ ω ∂S.ν,
      ((Q : ℕ) : ℤ) ∣ (π.x2 ω + π.U2 0 ω - S.N 0 ω) - (ρ ω : ℤ) - Ihat 0 ω ∧
      ∀ t : ℝ, 0 ≤ t →
        ((Q : ℕ) : ℤ) ∣ (Ihat t ω + S.N t ω) - (Ihat 0 ω + S.N 0 ω) ∧
        ((n : ℕ) : ℤ) * ((Q : ℕ) : ℤ) ∣ π.U2 t ω - π.U2 0 ω ∧
        (R2 < π.x2 ω + π.U2 t ω - S.N t ω ∧
          π.x2 ω + π.U2 t ω - S.N t ω ≤ R2 + ((n : ℕ) : ℤ) * ((Q : ℕ) : ℤ)) ∧
        (R1 < Ihat t ω ∧ Ihat t ω ≤ R1 + ((Q : ℕ) : ℤ)) ∧
        π.x1 ω + π.U1 t ω - S.N t ω
          = min (Ihat t ω) (π.x2 ω + π.U2 (t - P.L2) ω - S.N t ω - (ρ ω : ℤ))

/-- Literal transcription of the paper's classical complete-lot rule with controls
`(R₁, R₂, Q, n)` from a compatible initialization, with no condition on the upstream remainder. -/
def PaperRnQAll {P : Params} (S : DemandSpace P) (π : ShipmentPolicy P S) (R1 R2 : ℤ)
    (Q n : ℕ+) : Prop :=
  ∃ β : ℝ → S.Ω → ℤ, ∀ᵐ ω ∂S.ν,
    (∀ s : ℝ, -P.L2 ≤ s → s ≤ 0 → ((n : ℕ) : ℤ) * ((Q : ℕ) : ℤ) ∣ π.U2 0 ω - π.U2 s ω) ∧
    ∀ t : ℝ, 0 ≤ t →
      0 ≤ β t ω ∧
      (R1 < π.x1 ω + π.U1 t ω - S.N t ω + ((Q : ℕ) : ℤ) * β t ω ∧
        π.x1 ω + π.U1 t ω - S.N t ω + ((Q : ℕ) : ℤ) * β t ω ≤ R1 + ((Q : ℕ) : ℤ)) ∧
      ((Q : ℕ) : ℤ) ∣ π.U1 t ω - π.U1 0 ω ∧
      ((n : ℕ) : ℤ) * ((Q : ℕ) : ℤ) ∣ π.U2 t ω - π.U2 0 ω ∧
      (R2 < π.x2 ω + π.U2 t ω - S.N t ω ∧
        π.x2 ω + π.U2 t ω - S.N t ω ≤ R2 + ((n : ℕ) : ℤ) * ((Q : ℕ) : ℤ)) ∧
      (0 < β t ω →
        (π.x2 ω + π.U2 (t - P.L2) ω - S.N t ω) - (π.x1 ω + π.U1 t ω - S.N t ω) < ((Q : ℕ) : ℤ))

end RuleRand

end TwoStageRnQ
Source
M. Hu, "A 5/3 Guarantee for Echelon Stock (R,nQ) Policies in Two-Stage Stochastic Serial Systems", manuscript rq_167.tex (Sept. 28, 2026 version); posted as arXiv:2609.06318. Section 4.1; Appendices A.2-A.3 (compatible initialization, Lemma A.2).

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