Eq. (5) — the session-end identity
ProvedSVFAppt.eq_5_session_endappointment-schedulingconvex-orderp2o-gran-per-chapterp2o-plan-paperp2o-v1queueingsequencingstochastic-orders
Fix , a sequence , a schedule and a realization of the service times. The Lindley recursion (1) implies , and summing over gives
Both sides are the time at which the last patient has been served (the "session end time"). Taking expectations under the mean-based schedule gives , which reduces the cost to waiting times only.
Formalization Note 0-based: Lean's and slot are the paper's and slot ; the sum runs over Lean slots with . The identity is pathwise.
Differences from the source:
- encoding: slots and patients numbered 1, …, n → Fin n (0-based); Lean slot i is the paper's slot i + 1; reason: Lean convention; same instances
- reading: initial waiting and idle times not stated → W_0 = I_0 = 0 (the paper's W_1 = I_1 = 0); reason: the paper's identity (5) holds exactly under this convention; the first patient arrives to an idle doctor
- encoding: n patients (n ≥ 1 implicit: the identity names B_τ(n)) → hypothesis 0 < n; reason: for n = 0 the right-hand side refers to a nonexistent slot; excludes only an undefined case
Preamble
import Mathlib import Definitions.Def_SVFAppt_lindley
Formal statement
namespace SVFAppt
/-- **Eq. (5): the session-end identity.**
de Kemp, Mandjes, Olver, arXiv:1812.01467v4, §2.2, eq. (5), p. 10: "Note that (1) implies
Wi+1 − Ii+1 = Wi + Bτ(i) − xτ(i). Summing over i we find the identity
Σ_{i=1}^{n} Ii + Σ_{i=1}^{n} Bi = Σ_{i=1}^{n−1} xτ(i) + Wn + Bτ(n)".
For `n ≥ 1`, every sequence `τ`, schedule `x` and realization `b` of the service times,
`Σ_{i<n} I_i + Σ_j b_j = Σ_{i<n−1} x_{τ(i)} + W_{n−1} + b_{τ(n−1)}`.
**Formalization Note** Slots are 0-based: Lean `W_{n−1}` and slot `n−1` are the paper's `W_n` and
slot `n`. The identity is pathwise; `W_0 = I_0 = 0` (the paper's `W_1 = I_1 = 0`) is built into
`lindley`. `n − 1` is natural-number subtraction under `0 < n`. -/
theorem eq_5_session_end {n : ℕ} (hn : 0 < n) (τ : Equiv.Perm (Fin n)) (x b : Fin n → ℝ) :
∑ i : Fin n, idle τ x b i + ∑ j : Fin n, b j =
∑ i ∈ Finset.univ.filter (fun i : Fin n => i.val + 1 < n), x (τ i)
+ wait τ x b (n - 1) + b (τ ⟨n - 1, by omega⟩) := by sorry
end SVFAppt
Source
de Kemp, Mandjes, Olver, Performance of the Smallest-Variance-First Rule in Appointment Sequencing, arXiv:1812.01467v4, §2.2, eq. (5), p. 10
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.