Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Lemma 4, pp. 46–47 — counting bounds (46), (47) and revenue (48) for a deterministic online algorithm

Proved
MultiPriceOnline.Hardness.lemma_4_counts

by tianyipeng · Nov 4, 2026 · Mathlib 0df444a (Lean v4.33.1)

competitive-ratioonline-matchingrevenue-management

This is the counting step in the proof of Lemma 4 (inequalities (46), (47) and the revenue expression (48)), stated for a single deterministic online algorithm.

Let 0<r(1)<⋯<r(m)0<r^{(1)}<\dots<r^{(m)}0<r(1)<⋯<r(m) be a price set and let B1,…,BmB_1,\dots,B_mB1​,…,Bm​ be any reals. Consider the counterexample of §5 with n≥1n\ge 1n≥1 items, each with inventory kkk, and arrival sequence Aπ\mathcal A_\piAπ​ for a permutation π\piπ of the items. There are nknknk customers, split into groups t=0,…,n−1t=0,\dots,n-1t=0,…,n−1 of kkk consecutive customers each. Group ttt is interested only in the items πt,πt+1,…,πn−1\pi_t,\pi_{t+1},\dots,\pi_{n-1}πt​,πt+1​,…,πn−1​, at any price r(j)r^{(j)}r(j) with j≤phase(t)j\le \mathrm{phase}(t)j≤phase(t). Fix a deterministic online algorithm ALG\mathrm{ALG}ALG.

Then there are numbers q0,…,qn−1q_0,\dots,q_{n-1}q0​,…,qn−1​ with:

  1. qt≥0q_t\ge 0qt​≥0 for all t<nt<nt<n;
  2. ∑t=0n−1qt≤k\displaystyle\sum_{t=0}^{n-1} q_t\le kt=0∑n−1​qt​≤k (the inventory of item πn−1\pi_{n-1}πn−1​, (46));
  3. (n−t) qt≤k(n-t)\,q_t\le k(n−t)qt​≤k for all t<nt<nt<n (the size of group ttt, (47));
  4. the revenue averaged over a uniformly random π\piπ satisfies
1n!∑πALG(S,Aπ) ≤ ∑t=0n−1r(phase(t)) (n−t) qt.(48)\frac{1}{n!}\sum_{\pi}\mathrm{ALG}(\mathcal S,\mathcal A_\pi)\ \le\ \sum_{t=0}^{n-1} r^{(\mathrm{phase}(t))}\,(n-t)\,q_t .\qquad(48)n!1​π∑​ALG(S,Aπ​) ≤ t=0∑n−1​r(phase(t))(n−t)qt​.(48)

In the paper qtq_tqt​ is the expected number of group-ttt customers that buy item πi\pi_iπi​, which by symmetry is the same for every i≥ti\ge ti≥t. Together with the optimization step this yields Lemma 4.

Formalization Note Groups and positions are 0-based, so the paper's n+1−tn+1-tn+1−t becomes n−tn-tn−t. The statement is for one deterministic algorithm; the randomized case of Lemma 4 follows by integrating over the algorithm's randomness. The bound in item 4 is an inequality because a sale may happen at a price below r(phase(t))r^{(\mathrm{phase}(t))}r(phase(t)).

Preamble
import Mathlib
import Definitions.Def_MultiPriceOnline_Hardness_PriceSet
import Definitions.Def_MultiPriceOnline_Hardness_Model
import Definitions.Def_MultiPriceOnline_Hardness_Instance
Formal statement
namespace MultiPriceOnline.Hardness
open Finset
theorem lemma_4_counts {m : ℕ} {r : ℕ → ℝ} (hr : MultiPriceOnline.Balance.IsPriceSet m r)
    (B : ℕ → ℝ) (n k : ℕ) (hn : 1 ≤ n) (alg : OnlineAlg n) :
    ∃ q : ℕ → ℝ, (∀ t < n, 0 ≤ q t) ∧ (∑ t ∈ range n, q t) ≤ k ∧
      (∀ t < n, ((n : ℝ) - t) * q t ≤ k) ∧
      ((Nat.factorial n : ℝ))⁻¹ * ∑ π : Equiv.Perm (Fin n), revenue k m r alg (hardInstance n k m B π)
        ≤ ∑ t ∈ range n, r (phaseOf n m B t) * ((n : ℝ) - t) * q t := by sorry
end MultiPriceOnline.Hardness
Source
Ma, Simchi-Levi, Algorithms for Online Matching, Assortment, and Pricing with Tight Weight-dependent Competitive Ratios, arXiv:1905.04770v1, App. D, proof of Lemma 4, pp. 46–48, eqs. (46)–(48)

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