Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 1 — the threshold solution at an optimal dual price is below every optimal primal solution and differs from it in at most m places

Proved
DynamicOnlineLP.DLA.threshold_le_optimal

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

complementary-slacknesslinear-programminglp-duality

Consider the packing linear program with box constraints on a finite column set SSS,

max⁡∑t∈Sπtxts.t.∑t∈Saitxt≤di (i=1,…,m),0≤xt≤1,\max\sum_{t\in S}\pi_tx_t\quad\text{s.t.}\quad\sum_{t\in S}a_{it}x_t\le d_i\ (i=1,\dots,m),\quad 0\le x_t\le 1,maxt∈S∑​πt​xt​s.t.t∈S∑​ait​xt​≤di​ (i=1,…,m),0≤xt​≤1,

and its dual min⁡∑idipi+∑t∈Syt\min \sum_i d_ip_i+\sum_{t\in S}y_tmin∑i​di​pi​+∑t∈S​yt​ subject to ∑iaitpi+yt≥πt\sum_i a_{it}p_i+y_t\ge\pi_t∑i​ait​pi​+yt​≥πt​, p,y≥0p,y\ge0p,y≥0. Let x∗x^*x∗ be an optimal primal solution and (p∗,y∗)(p^*,y^*)(p∗,y∗) an optimal dual solution, and let xt(p∗)∈{0,1}x_t(p^*)\in\{0,1\}xt​(p∗)∈{0,1} be the threshold rule (xt(p∗)=1x_t(p^*)=1xt​(p∗)=1 iff πt>(p∗)⊤at\pi_t>(p^*)^{\top}a_tπt​>(p∗)⊤at​). Then

xt(p∗)≤xt∗for all t∈S,x_t(p^*)\le x^*_t\quad\text{for all }t\in S,xt​(p∗)≤xt∗​for all t∈S,

and, if the columns in SSS are in general position (for any p∈Rmp\in\mathbb R^mp∈Rm at most mmm columns satisfy p⊤at=πtp^{\top}a_t=\pi_tp⊤at​=πt​), then xt(p∗)≠xt∗x_t(p^*)\ne x^*_txt​(p∗)=xt∗​ for at most mmm indices t∈St\in St∈S.

This is the bridge between dual prices and primal decisions used throughout the paper's analysis: it is applied to the offline LP (1), the sample LP (7) and the partial LP (13).

Formalization Note The paper states the lemma for the offline LP (1); it is stated here for an arbitrary finite column set, arbitrary real data and an arbitrary right-hand side ddd, which covers each LP it is applied to.

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

/-- Lemma 1 (Agrawal–Wang–Ye 2014, p. 881). Let `x*` be an optimal solution of the packing LP
`max ∑_{t∈S} π_t x_t` s.t. `∑_{t∈S} a_{it} x_t ≤ d_i`, `0 ≤ x_t ≤ 1`, and `(p*, y*)` an optimal
solution of its dual. Then `x_t(p*) ≤ x*_t` for all `t ∈ S`, and under Assumption 3 (general
position) `x*_t` and `x_t(p*)` differ for at most `m` values of `t ∈ S`. -/
theorem threshold_le_optimal {ι : Type} {m : ℕ} (S : Finset ι) (π : ι → ℝ)
    (a : ι → Fin m → ℝ) (d : Fin m → ℝ) (x : ι → ℝ) (p : Fin m → ℝ) (y : ι → ℝ)
    (hx : IsPrimalOptimal S π a d x) (hpy : IsDualOptimal S π a d p y) :
    (∀ t ∈ S, threshold π a p t ≤ x t) ∧
      (GeneralPositionOn S π a → (S.filter (fun t => threshold π a p t ≠ x t)).card ≤ m) := by sorry

end DynamicOnlineLP.DLA
Source
Agrawal, Wang, Ye, A Dynamic Near-Optimal Algorithm for Online Linear Programming, Oper. Res. 62(4), 2014, p. 881, Lemma 1
Read-back

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

Let ι\iotaι be any type, m∈Nm\in\mathbb{N}m∈N, S⊆ιS\subseteq\iotaS⊆ι finite, and let π:ι→R\pi:\iota\to\mathbb{R}π:ι→R, entries at,ia_{t,i}at,i​ and d∈Rmd\in\mathbb{R}^md∈Rm be arbitrary real data. Let x:ι→Rx:\iota\to\mathbb{R}x:ι→R, p∈Rmp\in\mathbb{R}^mp∈Rm and y:ι→Ry:\iota\to\mathbb{R}y:ι→R satisfy two hypotheses:

  • (i) xxx is primal optimal. It satisfies ∑t∈Sat,ixt≤di\sum_{t\in S}a_{t,i}x_t\le d_i∑t∈S​at,i​xt​≤di​ for all iii and 0≤xt≤10\le x_t\le10≤xt​≤1 for t∈St\in St∈S, and it maximizes ∑t∈Sπtxt\sum_{t\in S}\pi_tx_t∑t∈S​πt​xt​ among all such vectors.
  • (ii) (p,y)(p,y)(p,y) is dual optimal. It satisfies p≥0p\ge0p≥0, yt≥0y_t\ge0yt​≥0 and πt≤∑iat,ipi+yt\pi_t\le\sum_i a_{t,i}p_i+y_tπt​≤∑i​at,i​pi​+yt​ for t∈St\in St∈S, and it minimizes ∑idipi+∑t∈Syt\sum_i d_ip_i+\sum_{t\in S}y_t∑i​di​pi​+∑t∈S​yt​ among all such pairs.

Write xt(p)x_t(p)xt​(p) for the threshold value: 000 if πt≤∑ipiat,i\pi_t\le\sum_i p_ia_{t,i}πt​≤∑i​pi​at,i​, and 111 otherwise. The theorem asserts both of the following:

  1. For every t∈St\in St∈S, xt(p)≤xtx_t(p)\le x_txt​(p)≤xt​. In other words, whenever πt>∑ipiat,i\pi_t>\sum_ip_ia_{t,i}πt​>∑i​pi​at,i​, then xt≥1x_t\ge1xt​≥1 (so xt=1x_t = 1xt​=1).
  2. If general position holds on SSS, then
#{t∈S:xt(p)≠xt}≤m.\#\{t\in S : x_t(p)\ne x_t\}\le m.#{t∈S:xt​(p)=xt​}≤m.

General position here means: for every p′≥0p'\ge0p′≥0 in Rm\mathbb{R}^mRm, at most mmm indices t∈St\in St∈S satisfy ∑ipi′at,i=πt\sum_ip'_ia_{t,i}=\pi_t∑i​pi′​at,i​=πt​.

No sign conditions are imposed on π\piπ, aaa or ddd. Coordinates outside SSS play no role.

Degenerate cases:

  • Vacuous hypotheses. If no primal-optimal xxx or no dual-optimal (p,y)(p,y)(p,y) exists (for instance, an infeasible primal), the statement is vacuous.
  • S=∅S=\emptysetS=∅. Both conclusions hold trivially.
  • m=0m=0m=0. The second conclusion says that under general position (no t∈St\in St∈S with πt=0\pi_t=0πt​=0), xtx_txt​ equals 111 when πt>0\pi_t>0πt​>0 and 000 when πt≤0\pi_t\le0πt​≤0, for every t∈St\in St∈S.
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