Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5 — with probability 1 − ε the learned prices never overspend: Σ_{t=ℓ+1}^{2ℓ} a_it x_t(p̂^ℓ) ≤ (ℓ/n) b_i for all i and ℓ ∈ L

Proved
DynamicOnlineLP.DLA.learned_price_feasible

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

concentration-inequalitiesonline-linear-programmingrandom-permutation

Consider an instance of the online linear program with nnn columns (πt≥0\pi_t\ge0πt​≥0, at∈[0,1]ma_t\in[0,1]^mat​∈[0,1]m, m≥1m\ge1m≥1) in general position, arriving in a uniformly random order. Let ε=2−E\varepsilon=2^{-E}ε=2−E with E≥1E\ge1E≥1, assume εn\varepsilon nεn is a positive integer, let L={εn,2εn,…,2E−1εn}L=\{\varepsilon n,2\varepsilon n,\dots,2^{E-1}\varepsilon n\}L={εn,2εn,…,2E−1εn}, hℓ=εn/ℓh_\ell=\varepsilon\sqrt{n/\ell}hℓ​=εn/ℓ​, and let p^ℓ\hat p^{\ell}p^​ℓ be an optimal dual price of the partial LP (13) on the first ℓ\ellℓ arrivals (chosen by any valid dual-selection rule). There is an absolute constant C>0C>0C>0 such that, if

B=min⁡ibi≥C mlog⁡(n/ε)ε2,B=\min_i b_i\ge \frac{C\,m\log(n/\varepsilon)}{\varepsilon^2},B=imin​bi​≥ε2Cmlog(n/ε)​,

then with probability at least 1−ε1-\varepsilon1−ε over the arrival order,

∑t=ℓ+12ℓait xt(p^ℓ)≤ℓn bifor all i∈{1,…,m}, ℓ∈L.\sum_{t=\ell+1}^{2\ell}a_{it}\,x_t(\hat p^{\ell})\le\frac{\ell}{n}\,b_i\qquad\text{for all } i\in\{1,\dots,m\},\ \ell\in L.t=ℓ+1∑2ℓ​ait​xt​(p^​ℓ)≤nℓ​bi​for all i∈{1,…,m}, ℓ∈L.

Here xt(p^ℓ)x_t(\hat p^\ell)xt​(p^​ℓ) is the threshold decision for the column arriving at time ttt. The lemma says that in each doubling period the decisions induced by the price learned at its start consume at most that period's proportional share of every resource, which is what keeps the dynamic learning algorithm from running out of capacity.

Formalization Note The paper states the condition as B≥10mlog⁡(n/ε)/ε2B\ge 10m\log(n/\varepsilon)/\varepsilon^2B≥10mlog(n/ε)/ε2. Its proof (Appendix B.1) does not close with the constant 101010 (the union-bound step needs 4mEεm−1≤14mE\varepsilon^{m-1}\le14mEεm−1≤1, false for m=1m=1m=1, and the count of distinct threshold patterns by nmn^mnm is too small), so the statement uses an absolute constant CCC, quantified before every instance parameter; everything else is exact, including the probability 1−ε1-\varepsilon1−ε. log⁡\loglog is the natural logarithm. Times are 0-based in Lean, so the paper's times ℓ+1,…,2ℓ\ell+1,\dots,2\ellℓ+1,…,2ℓ are Lean times ℓ,…,2ℓ−1\ell,\dots,2\ell-1ℓ,…,2ℓ−1. General position (Assumption 3), a standing assumption of the paper's analysis, is a hypothesis.

Preamble
import Mathlib
import Definitions.Def_DynamicOnlineLP_DLA_PackingLP
import Definitions.Def_DynamicOnlineLP_DLA_Instance
import Definitions.Def_DynamicOnlineLP_DLA_Algorithm
Formal statement
namespace DynamicOnlineLP.DLA

/-- Lemma 5 (Agrawal–Wang–Ye 2014, p. 884), with an absolute constant `C` in place of the paper's
`10`: under Assumptions 1–3, `ε = 2^{-E}` and `εn ∈ ℕ`, if `b_i ≥ C m log(n/ε)/ε²` for all `i`,
then with probability at least `1 - ε` over the arrival order,
`∑_{t=ℓ+1}^{2ℓ} a_{it} x_t(p̂^ℓ) ≤ (ℓ/n) b_i` for all `i` and all `ℓ ∈ L`
(paper times `ℓ+1, …, 2ℓ` are the 0-based times `ℓ, …, 2ℓ−1`). -/
theorem learned_price_feasible :
    ∃ C : ℝ, 0 < C ∧
      ∀ (m n E : ℕ) (I : Instance m n) (rule : DualRule m n),
        1 ≤ m → 1 ≤ E → 0 < n → 2 ^ E ∣ n → I.GeneralPosition → IsValidDualRule rule →
        (∀ i : Fin m, C * (m : ℝ) * Real.log ((n : ℝ) / eps E) / eps E ^ 2 ≤ I.b i) →
        1 - eps E ≤ probPerm (fun σ : Equiv.Perm (Fin n) =>
          ∀ ℓ ∈ phases n E, ∀ i : Fin m,
            ∑ t ∈ Finset.univ.filter (fun t : Fin n => ℓ ≤ t.val ∧ t.val < 2 * ℓ),
                I.arrA σ t i *
                  threshold (I.arrPi σ) (I.arrA σ) (learnedPrice I rule E σ ℓ) t ≤
              ((ℓ : ℝ) / (n : ℝ)) * I.b i) := by sorry

end DynamicOnlineLP.DLA
Source
Agrawal, Wang, Ye, A Dynamic Near-Optimal Algorithm for Online Linear Programming, Oper. Res. 62(4), 2014, p. 884, Lemma 5 (proof: p. 888, Appendix B.1)
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

The theorem asserts that there is a real constant C>0C>0C>0 that works for all of the following at once. The constant is chosen once, before m,n,Em,n,Em,n,E and everything else.

Setting. Take any m,n,E∈Nm,n,E\in\mathbb{N}m,n,E∈N, any instance III with mmm rows and nnn columns (so πj≥0\pi_j\ge0πj​≥0 and 0≤aj,i≤10\le a_{j,i}\le10≤aj,i​≤1, with bbb unrestricted), and any dual rule. Suppose:

  • m≥1m\ge1m≥1, E≥1E\ge1E≥1, n≥1n\ge1n≥1, and 2E2^E2E divides nnn;
  • III is in general position: for every p≥0p\ge0p≥0, at most mmm columns jjj satisfy ∑ipiaj,i=πj\sum_ip_ia_{j,i}=\pi_j∑i​pi​aj,i​=πj​;
  • the rule is valid: it depends only on the first ℓ\ellℓ arrivals, and for ℓ≤n\ell\le nℓ≤n and d≥0d\ge0d≥0 it returns an optimal dual price of the packing LP on the first ℓ\ellℓ columns;
  • with ε=2−E\varepsilon=2^{-E}ε=2−E and natural logarithm log⁡\loglog, for every iii:
bi ≥ C m log⁡(n/ε)ε2.b_i\ \ge\ \frac{C\,m\,\log(n/\varepsilon)}{\varepsilon^2}.bi​ ≥ ε2Cmlog(n/ε)​.

Conclusion. With σ\sigmaσ uniformly random over the n!n!n! permutations:

Pr⁡σ[ ∀ℓ∈L, ∀i: ∑t=ℓ2ℓ−1aσ(t),i  xt(p^ℓ(σ)) ≤ ℓn bi ] ≥ 1−ε.\Pr_\sigma\Big[\ \forall \ell\in L,\ \forall i:\ \sum_{t=\ell}^{2\ell-1} a_{\sigma(t),i}\;x_t\big(\hat p^\ell(\sigma)\big)\ \le\ \frac{\ell}{n}\,b_i\ \Big]\ \ge\ 1-\varepsilon.σPr​[ ∀ℓ∈L, ∀i: t=ℓ∑2ℓ−1​aσ(t),i​xt​(p^​ℓ(σ)) ≤ nℓ​bi​ ] ≥ 1−ε.

The symbols in the conclusion mean:

  • L={λ2r:0≤r≤E−1}L=\{\lambda 2^r: 0\le r\le E-1\}L={λ2r:0≤r≤E−1} with λ=n/2E\lambda=n/2^Eλ=n/2E, which is exact here.
  • ttt ranges over times in {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1} with ℓ≤t<2ℓ\ell\le t<2\ellℓ≤t<2ℓ.
  • xt(p)x_t(p)xt​(p) is 000 if πσ(t)≤∑ipiaσ(t),i\pi_{\sigma(t)}\le\sum_ip_ia_{\sigma(t),i}πσ(t)​≤∑i​pi​aσ(t),i​, and 111 otherwise.
  • p^ℓ(σ)\hat p^\ell(\sigma)p^​ℓ(σ) is the rule's output at ℓ\ellℓ on the permuted data, with right-hand side (1−hℓ)ℓnb(1-h_\ell)\frac{\ell}{n}b(1−hℓ​)nℓ​b, where hℓ=εn/ℓh_\ell=\varepsilon\sqrt{n/\ell}hℓ​=εn/ℓ​.

The quantity bounded is the resource use of the threshold proposals xt(p^ℓ)x_t(\hat p^\ell)xt​(p^​ℓ). It is not the resource use of the algorithm's executed decisions.

Degenerate cases:

  • Parameters. Here λ≥1\lambda\ge1λ≥1, every ℓ∈L\ell\in Lℓ∈L satisfies 1≤ℓ≤n/21\le\ell\le n/21≤ℓ≤n/2, and log⁡(n/ε)=log⁡(n2E)>0\log(n/\varepsilon)=\log(n2^E)>0log(n/ε)=log(n2E)>0. The bound on bbb therefore forces every bi>0b_i>0bi​>0.
  • Sign of 1−hℓ1-h_\ell1−hℓ​. Since ℓ≥εn\ell\ge\varepsilon nℓ≥εn, hℓ≤ε<1h_\ell\le\sqrt\varepsilon<1hℓ​≤ε​<1, so the right-hand side fed to the rule is nonnegative.
  • E=1E=1E=1. L={n/2}L=\{n/2\}L={n/2} and ε=1/2\varepsilon=1/2ε=1/2.
  • Excluded cases. m=0m=0m=0, n=0n=0n=0 and E=0E=0E=0 are excluded.
Human review
  • Endorsed by Shuze Chen · Oct 21, 2026

    Confirmed by the moderator at approval.

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