Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1 — the dynamic learning algorithm is 1 − O(ε) competitive when B = min_i b_i ≥ Ω(m log(n/ε)/ε²)

Proved
DynamicOnlineLP.DLA.dla_competitive_ratio

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

competitive-ratioonline-algorithmsonline-linear-programmingrandom-permutation

Consider the online linear program: nnn columns (πt,at)(\pi_t,a_t)(πt​,at​) with πt≥0\pi_t\ge0πt​≥0 and at∈[0,1]ma_t\in[0,1]^mat​∈[0,1]m (m≥1m\ge1m≥1), a right-hand side b∈Rmb\in\mathbb R^mb∈Rm, and the offline optimum

OPT=max⁡{∑t=1nπtxt: ∑t=1naitxt≤bi (i≤m), 0≤xt≤1}.\mathrm{OPT}=\max\Big\{\sum_{t=1}^n\pi_tx_t:\ \sum_{t=1}^n a_{it}x_t\le b_i\ (i\le m),\ 0\le x_t\le1\Big\}.OPT=max{t=1∑n​πt​xt​: t=1∑n​ait​xt​≤bi​ (i≤m), 0≤xt​≤1}.

The columns are chosen adversarially but arrive in a uniformly random order σ\sigmaσ (Assumption 1), nnn is known in advance (Assumption 2), and the inputs are in general position (Assumption 3: for any price vector p∈Rmp\in\mathbb R^mp∈Rm at most mmm columns satisfy p⊤at=πtp^{\top}a_t=\pi_tp⊤at​=πt​). Let ε=2−E\varepsilon=2^{-E}ε=2−E with E≥1E\ge1E≥1 and let εn\varepsilon nεn be a positive integer. Let xtx_txt​ be the decisions of the dynamic learning algorithm (DLA): it accepts nothing up to time εn\varepsilon nεn; at each time ttt in a period (ℓ,2ℓ](\ell,2\ell](ℓ,2ℓ], ℓ∈{εn,2εn,… }\ell\in\{\varepsilon n,2\varepsilon n,\dots\}ℓ∈{εn,2εn,…}, it proposes xt(p^ℓ)x_t(\hat p^{\ell})xt​(p^​ℓ), the threshold decision at an optimal dual price p^ℓ\hat p^\ellp^​ℓ of the partial LP (13) on the first ℓ\ellℓ arrivals with right-hand side (1−hℓ)ℓnb(1-h_\ell)\frac{\ell}{n}b(1−hℓ​)nℓ​b, hℓ=εn/ℓh_\ell=\varepsilon\sqrt{n/\ell}hℓ​=εn/ℓ​, and executes it if no constraint is violated.

There are absolute constants C1,C2>0C_1,C_2>0C1​,C2​>0 such that, whenever

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

the DLA is 1−C2ε1-C_2\varepsilon1−C2​ε competitive in the random permutation model:

Eσ[∑t=1nπtxt] ≥ (1−C2 ε) OPT.\mathbb E_\sigma\Big[\sum_{t=1}^n\pi_tx_t\Big]\ \ge\ (1-C_2\,\varepsilon)\,\mathrm{OPT}.Eσ​[t=1∑n​πt​xt​] ≥ (1−C2​ε)OPT.

This is the main result of Agrawal, Wang and Ye: a 1−O(ε)1-O(\varepsilon)1−O(ε) competitive ratio for online linear programming under random order, with a right-hand-side requirement whose dependence on ε\varepsilonε matches the lower bound for the one-dimensional secretary problem.

Formalization Note The paper writes 1−O(ε)1-O(\varepsilon)1−O(ε) and B≥Ω(mlog⁡(n/ε)/ε2)B\ge\Omega(m\log(n/\varepsilon)/\varepsilon^2)B≥Ω(mlog(n/ε)/ε2); its proof aims at C1=10C_1=10C1​=10, C2=15C_2=15C2​=15 but the constant 101010 does not survive the union-bound arithmetic of Appendix B.1, so the statement asserts absolute constants C1,C2C_1,C_2C1​,C2​, quantified before mmm, nnn, ε\varepsilonε, the instance and the algorithm. The expectation is the average over all n!n!n! arrival orders. Because optimal dual prices need not be unique, the DLA is parametrized by a dual-selection rule, and the theorem holds for every valid rule (one that returns an optimal dual price of the partial LP and looks only at the first ℓ\ellℓ arrivals). ε=2−E\varepsilon=2^{-E}ε=2−E and the integrality of εn\varepsilon nεn are the paper's standing assumptions of §3; log⁡\loglog is the natural logarithm.

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

/-- Theorem 1 (Agrawal–Wang–Ye 2014, p. 878), with absolute constants `C₁, C₂` in place of the
paper's `Ω(·)` and `O(·)`: under Assumptions 1–3, `ε = 2^{-E}` and `εn ∈ ℕ`, if
`B = min_i b_i ≥ C₁ m log(n/ε)/ε²`, then Algorithm DLA (with any valid dual-selection rule) is
`1 - C₂ ε` competitive in the random permutation model:
`E_σ[∑_t π_t x_t] ≥ (1 - C₂ ε) OPT`. -/
theorem dla_competitive_ratio :
    ∃ C₁ C₂ : ℝ, 0 < 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 - C₂ * eps E) * I.OPT ≤ avgPerm (fun σ : Equiv.Perm (Fin n) => dlaValue I rule E σ) := by sorry

end DynamicOnlineLP.DLA
Source
Agrawal, Wang, Ye, A Dynamic Near-Optimal Algorithm for Online Linear Programming, Oper. Res. 62(4), 2014, p. 878, Theorem 1 (proof: p. 885, §3.1)
Read-back

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

The statement asserts that two positive real constants C1C_1C1​ and C2C_2C2​ exist. The same pair must work for every choice of problem dimensions, instance, dual-selection rule and accuracy exponent.

Symbols from the imported files. Several names come from three imported definition files that are not shown here: Instance, DualRule, IsValidDualRule, GeneralPosition, OPT, b, eps, dlaValue and avgPerm. This read-back cannot unfold them, so it describes each one only by how it is used in the statement. The auditor should check their actual definitions separately.

  • III is an object of type "instance with mmm and nnn", written Instance(m,n)\mathrm{Instance}(m,n)Instance(m,n). It has a real-valued vector b=(b1,…,bm)b = (b_1,\dots,b_m)b=(b1​,…,bm​) indexed by i∈{0,…,m−1}i \in \{0,\dots,m-1\}i∈{0,…,m−1}, a real number OPT(I)\mathrm{OPT}(I)OPT(I), and a predicate "III is in general position".
  • rule\mathrm{rule}rule is an object of type DualRule(m,n)\mathrm{DualRule}(m,n)DualRule(m,n) that satisfies a predicate called "valid dual rule".
  • εE\varepsilon_EεE​ is a real number that depends only on the natural number EEE.
  • dlaValue(I,rule,E,σ)\mathrm{dlaValue}(I,\mathrm{rule},E,\sigma)dlaValue(I,rule,E,σ) is a real number defined for each permutation σ\sigmaσ of {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1}.
  • avgPerm(f)\mathrm{avgPerm}(f)avgPerm(f) turns a real-valued function fff on the permutations of {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1} into a single real number.

The doc comment calls this Theorem 1 of Agrawal–Wang–Ye (2014) and mentions Assumptions 1–3 and the random permutation model. Those descriptions are commentary only. The code's hypotheses are exactly the ones listed below.

The statement. There exist real numbers C1>0C_1 > 0C1​>0 and C2>0C_2 > 0C2​>0 with the following property. Take any natural numbers m,n,Em, n, Em,n,E, any instance III and any dual rule rule\mathrm{rule}rule such that:

  1. m≥1m \ge 1m≥1;
  2. E≥1E \ge 1E≥1;
  3. n>0n > 0n>0;
  4. 2E2^E2E divides nnn;
  5. III is in general position;
  6. rule\mathrm{rule}rule is a valid dual rule;
  7. for every i∈{0,…,m−1}i \in \{0,\dots,m-1\}i∈{0,…,m−1},
C1 m log⁡ ⁣(n/εE)εE2  ≤  bi.\frac{C_1\, m\, \log\!\big(n/\varepsilon_E\big)}{\varepsilon_E^{2}} \;\le\; b_i .εE2​C1​mlog(n/εE​)​≤bi​.

Then

(1−C2 εE) OPT(I)  ≤  avgPerm(σ↦dlaValue(I,rule,E,σ)),(1 - C_2\,\varepsilon_E)\,\mathrm{OPT}(I) \;\le\; \mathrm{avgPerm}\Big(\sigma \mapsto \mathrm{dlaValue}(I,\mathrm{rule},E,\sigma)\Big),(1−C2​εE​)OPT(I)≤avgPerm(σ↦dlaValue(I,rule,E,σ)),

where σ\sigmaσ ranges over all permutations of {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1}.

Order of quantifiers. The constants are chosen once, before mmm, nnn, EEE, III and rule\mathrm{rule}rule. Nothing is said about how large they are, beyond both being strictly positive. The conclusion is a one-sided "≤\le≤". There is no equality claim and no bound in the other direction.

What the hypotheses leave in place.

  • Hypotheses 3 and 4 together force n≥2E≥2n \ge 2^E \ge 2n≥2E≥2.
  • log⁡\loglog is the real logarithm, which by convention gives log⁡0=0\log 0 = 0log0=0 and log⁡x=log⁡∣x∣\log x = \log|x|logx=log∣x∣ for x<0x < 0x<0.
  • Real division by zero gives 000. So if εE=0\varepsilon_E = 0εE​=0 for some EEE, hypothesis 7 turns into 0≤bi0 \le b_i0≤bi​.
  • If n/εE<1n/\varepsilon_E < 1n/εE​<1 (for example, a large positive εE\varepsilon_EεE​), the logarithm is negative and hypothesis 7 becomes a weaker lower bound on bib_ibi​, possibly a negative one.
  • The statement does not say that εE\varepsilon_EεE​ is positive or small. Whether it equals 2−E2^{-E}2−E depends on the unseen definition.
  • If C2 εE≥1C_2\,\varepsilon_E \ge 1C2​εE​≥1, the factor 1−C2 εE1 - C_2\,\varepsilon_E1−C2​εE​ is zero or negative. The conclusion then only requires the average to be at least a non-positive multiple of OPT(I)\mathrm{OPT}(I)OPT(I). This is trivially true if the average is non-negative and OPT(I)≥0\mathrm{OPT}(I) \ge 0OPT(I)≥0.
  • If OPT(I)\mathrm{OPT}(I)OPT(I) is negative, or takes a default value because the underlying optimum does not exist, the inequality carries whatever meaning that value gives it.
  • Hypotheses 5 and 6 are vacuous if no instance is in general position or no rule is valid. Whether that happens cannot be determined from this code.
  • Because C1C_1C1​ is existential and has no upper bound, hypothesis 7 can require arbitrarily large bib_ibi​. The statement only covers instances whose bib_ibi​ all reach that threshold.
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