Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof sketch of Theorem 1, Step 4, p. 23 — the excess cost equals Σ(1{a≤0} − 1{b≤0})b/|Ω| and is at most Σ|a − b|/|Ω|

Proved
InventoryAnomaly.EW.step4_excess_cost

by mikedeng1 · Oct 22, 2026 · Mathlib 0df444a (Lean v4.33.1)

excess-costp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1threshold-rule

Fix an instance whose costs cij(0),cij(1)c^{(0)}_{ij},c^{(1)}_{ij}cij(0)​,cij(1)​ are nonnegative, any rank-rrr selector and any estimator θ^\hat\thetaθ^, and an observation XΩX_\OmegaXΩ​. Define

aij=−cij(1)+(cij(0)+cij(1))f^ij,bij=−cij(1)+(cij(0)+cij(1))fij∗.a_{ij}=-c^{(1)}_{ij}+\big(c^{(0)}_{ij}+c^{(1)}_{ij}\big)\hat f_{ij},\qquad b_{ij}=-c^{(1)}_{ij}+\big(c^{(0)}_{ij}+c^{(1)}_{ij}\big)f^*_{ij}.aij​=−cij(1)​+(cij(0)​+cij(1)​)f^​ij​,bij​=−cij(1)​+(cij(0)​+cij(1)​)fij∗​.

Then

costπEW(XΩ)−costπ∗(XΩ)=1∣Ω∣∑(i,j)∈Ω(1{aij≤0}−1{bij≤0})bij≤1∣Ω∣∑(i,j)∈Ω∣aij−bij∣.\mathrm{cost}^{\pi^{EW}}(X_\Omega)-\mathrm{cost}^{\pi^*}(X_\Omega)=\frac1{|\Omega|}\sum_{(i,j)\in\Omega}\big(\mathbf 1\{a_{ij}\le0\}-\mathbf 1\{b_{ij}\le0\}\big)b_{ij}\le\frac1{|\Omega|}\sum_{(i,j)\in\Omega}|a_{ij}-b_{ij}| .costπEW(XΩ​)−costπ∗(XΩ​)=∣Ω∣1​(i,j)∈Ω∑​(1{aij​≤0}−1{bij​≤0})bij​≤∣Ω∣1​(i,j)∈Ω∑​∣aij​−bij​∣.

This reduces the excess cost of the EW algorithm to the estimation error ∣f^ij−fij∗∣|\hat f_{ij}-f^*_{ij}|∣f^​ij​−fij∗​∣, weighted by cij(0)+cij(1)c^{(0)}_{ij}+c^{(1)}_{ij}cij(0)​+cij(1)​.

Formalization Note. The costs are those of the closed form (5) with deterministic decisions. Nonnegativity of the costs (assumed on p. 11) is needed: it makes the threshold rule "f≤c(1)/(c(0)+c(1))f\le c^{(1)}/(c^{(0)}+c^{(1)})f≤c(1)/(c(0)+c(1))" equivalent to a≤0a\le0a≤0; when cij(0)+cij(1)=0c^{(0)}_{ij}+c^{(1)}_{ij}=0cij(0)​+cij(1)​=0 both costs vanish and the entry contributes nothing.

Preamble
import Mathlib
import Definitions.Def_InventoryAnomaly_EW_Model

open MeasureTheory ProbabilityTheory
open scoped NNReal
Formal statement
namespace InventoryAnomaly.EW

theorem step4_excess_cost {d : ℕ} (I : Instance d)
    (hc : ∀ i j, 0 ≤ I.c0 i j ∧ 0 ≤ I.c1 i j)
    (svdr : Matrix (Fin I.n) (Fin I.m) ℝ → Matrix (Fin I.n) (Fin I.m) ℝ)
    (θhat : I.Obs → EuclideanSpace ℝ (Fin (d + 1))) (x : I.Obs) :
    let a := fun i j => -I.c1 i j + (I.c0 i j + I.c1 i j) * I.fhat svdr θhat x i j
    let b := fun i j => -I.c1 i j + (I.c0 i j + I.c1 i j) * I.fstar x i j
    I.costEW svdr θhat x - I.costStar x =
        (1 / ((I.omega x).card : ℝ)) * ∑ ij ∈ I.omega x,
          ((if a ij.1 ij.2 ≤ 0 then 1 else 0) - (if b ij.1 ij.2 ≤ 0 then 1 else 0)) * b ij.1 ij.2 ∧
      I.costEW svdr θhat x - I.costStar x ≤
        (1 / ((I.omega x).card : ℝ)) * ∑ ij ∈ I.omega x, |a ij.1 ij.2 - b ij.1 ij.2| := by sorry

end InventoryAnomaly.EW
Source
Farias, Li & Peng, Fixing Inventory Inaccuracies at Scale, arXiv:2006.13126v3, p. 23, proof sketch of Theorem 1, Step 4
Human review
  • Endorsed by Shuze Chen · Oct 23, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 23, 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