Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Approximate complementary slackness: (α,β)(\alpha,\beta)(α,β)-slack feasible pairs are αβ\alpha\betaαβ-close

Proved
PrimalDualOnline.LP.approx_complementary_slackness

by moutei · Sep 17, 2026 · Mathlib 0df444a (Lean v4.33.1)

complementary-slacknessdualitylinear-programmingoptimization

Theorem 2.3 of the source. Let xxx be primal feasible and yyy dual feasible, and let α,β≥1\alpha, \beta \ge 1α,β≥1. Suppose the pair satisfies approximate complementary slackness: whenever xi>0x_i > 0xi​>0 the iii-th dual constraint is tight up to α\alphaα, and whenever yj>0y_j > 0yj​>0 the jjj-th primal constraint is tight up to β\betaβ. Then

∑icixi ≤ αβ∑jbjyj.\sum_i c_i x_i \ \le\ \alpha\beta \sum_j b_j y_j.i∑​ci​xi​ ≤ αβj∑​bj​yj​.

Together with weak duality this sandwiches the primal cost between the dual value and αβ\alpha\betaαβ times it, so xxx is within αβ\alpha\betaαβ of primal optimal whenever the dual optimum is attained. This is the result that converts a local, per-coordinate invariant maintained by an online algorithm into a global competitive ratio, and it is the goal of the mission.

The hypotheses are the source's, including the two-sided form of each slackness condition and α,β≥1\alpha, \beta \ge 1α,β≥1. A companion item records the minimal hypotheses under which the same conclusion holds.

Preamble
import Definitions.Def_PrimalDualOnline_FiniteLP
import Mathlib.Tactic
Formal statement
open PrimalDualOnline.LP

theorem PrimalDualOnline.LP.approx_complementary_slackness
    {I J : Type*} [Fintype I] [Fintype J]
    (A : I → J → ℝ) (b : J → ℝ) (c : I → ℝ) (x : I → ℝ) (y : J → ℝ)
    (α β : ℝ) (hα : 1 ≤ α) (hβ : 1 ≤ β)
    (hp : PrimalFeasible A b x) (hd : DualFeasible A c y)
    (hpcs : PrimalApproxCS α A c x y) (hdcs : DualApproxCS β A b x y) :
    primalObjective c x ≤ α * β * dualObjective b y := by sorry
Source
Niv Buchbinder, Designing Competitive Online Algorithms via a Primal-Dual Approach, PhD thesis, Tel Aviv University, 2008, https://www.tau.ac.il/~nivb/download/phd-thsis.pdf, Section 2.1, Theorem 2.3, pp. 8-9
Read-back

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

Setting common to all three statements

All three statements are parameterized by two types III and JJJ (arbitrary, in arbitrary universes) each carrying a finiteness assumption (a Fintype instance). Finiteness is what makes the sums below well-defined; nothing asserts that III or JJJ is nonempty, so both are allowed to be empty, in which case sums indexed by them are 000.

The data are four real-valued functions and one real matrix, all otherwise arbitrary (no sign, boundedness, or nondegeneracy assumptions on any of them):

  • A:I×J→RA : I \times J \to \mathbb{R}A:I×J→R, written Ai,jA_{i,j}Ai,j​;
  • b:J→Rb : J \to \mathbb{R}b:J→R, written bjb_jbj​;
  • c:I→Rc : I \to \mathbb{R}c:I→R, written cic_ici​;
  • x:I→Rx : I \to \mathbb{R}x:I→R, written xix_ixi​;
  • y:J→Ry : J \to \mathbb{R}y:J→R, written yjy_jyj​.

Two quantities are named by the bundle's own definitions, and are expanded inline throughout:

primal objective  =  ∑i∈Icixi,dual objective  =  ∑j∈Jbjyj.\text{primal objective} \;=\; \sum_{i \in I} c_i x_i, \qquad \text{dual objective} \;=\; \sum_{j \in J} b_j y_j .primal objective=i∈I∑​ci​xi​,dual objective=j∈J∑​bj​yj​.

Each of the three declarations is stated with its proof omitted, so each asserts its conclusion without supplying any justification.


Statement 2 — approx_complementary_slackness

For every pair of finite index types I,JI, JI,J, every real matrix AAA and every b,c,x,yb, c, x, yb,c,x,y as above, and additionally two real numbers α,β\alpha, \betaα,β, assume the six hypotheses

  1. 1≤α1 \le \alpha1≤α;
  2. 1≤β1 \le \beta1≤β;
  3. (primal feasibility of xxx) ∀j∈J:bj≤∑i∈IAi,jxi\forall j \in J: b_j \le \sum_{i \in I} A_{i,j} x_i∀j∈J:bj​≤∑i∈I​Ai,j​xi​, and ∀i∈I:0≤xi\forall i \in I: 0 \le x_i∀i∈I:0≤xi​;
  4. (dual feasibility of yyy) ∀i∈I:∑j∈JAi,jyj≤ci\forall i \in I: \sum_{j \in J} A_{i,j} y_j \le c_i∀i∈I:∑j∈J​Ai,j​yj​≤ci​, and ∀j∈J:0≤yj\forall j \in J: 0 \le y_j∀j∈J:0≤yj​;
  5. (α\alphaα-approximate primal complementary slackness) for every i∈Ii \in Ii∈I with xi>0x_i > 0xi​>0 (strictly), both
ciα  ≤  ∑j∈JAi,j yjand∑j∈JAi,j yj  ≤  ci;\frac{c_i}{\alpha} \;\le\; \sum_{j \in J} A_{i,j}\, y_j \qquad\text{and}\qquad \sum_{j \in J} A_{i,j}\, y_j \;\le\; c_i;αci​​≤j∈J∑​Ai,j​yj​andj∈J∑​Ai,j​yj​≤ci​;
  1. (β\betaβ-approximate dual complementary slackness) for every j∈Jj \in Jj∈J with yj>0y_j > 0yj​>0 (strictly), both
bj  ≤  ∑i∈IAi,j xiand∑i∈IAi,j xi  ≤  β bj.b_j \;\le\; \sum_{i \in I} A_{i,j}\, x_i \qquad\text{and}\qquad \sum_{i \in I} A_{i,j}\, x_i \;\le\; \beta\, b_j .bj​≤i∈I∑​Ai,j​xi​andi∈I∑​Ai,j​xi​≤βbj​.

Then the conclusion is

∑i∈Icixi  ≤  (αβ)⋅∑j∈Jbjyj,\sum_{i \in I} c_i x_i \;\le\; (\alpha \beta) \cdot \sum_{j \in J} b_j y_j ,i∈I∑​ci​xi​≤(αβ)⋅j∈J∑​bj​yj​,

i.e. the primal objective is at most the product αβ\alpha\betaαβ times the dual objective (the product is formed first and then multiplied by the dual objective).

Points of literal detail. The two complementary-slackness hypotheses are conditioned on strict positivity: indices iii with xi=0x_i = 0xi​=0 and indices jjj with yj=0y_j = 0yj​=0 are entirely unconstrained by them (and by nonnegativity, xi<0x_i < 0xi​<0, yj<0y_j < 0yj​<0 cannot occur). Hypothesis 5 is stated with a division, ci/αc_i/\alphaci​/α; since α≥1\alpha \ge 1α≥1, the divisor is nonzero, so no division-by-zero convention is in play. The upper bound in hypothesis 5, ∑jAi,jyj≤ci\sum_j A_{i,j} y_j \le c_i∑j​Ai,j​yj​≤ci​, is already asserted for all iii by dual feasibility (hypothesis 4), and the lower bound in hypothesis 6, bj≤∑iAi,jxib_j \le \sum_i A_{i,j} x_ibj​≤∑i​Ai,j​xi​, is already asserted for all jjj by primal feasibility (hypothesis 3); the two clauses therefore repeat, on the positive coordinates, conditions the feasibility hypotheses impose everywhere.

Degenerate readings. At α=1\alpha = 1α=1 the primal clause reads ci≤∑jAi,jyj≤cic_i \le \sum_j A_{i,j} y_j \le c_ici​≤∑j​Ai,j​yj​≤ci​, i.e. exact equality ∑jAi,jyj=ci\sum_j A_{i,j} y_j = c_i∑j​Ai,j​yj​=ci​ for every iii with xi>0x_i > 0xi​>0; at β=1\beta = 1β=1 the dual clause reads bj≤∑iAi,jxi≤bjb_j \le \sum_i A_{i,j} x_i \le b_jbj​≤∑i​Ai,j​xi​≤bj​, i.e. ∑iAi,jxi=bj\sum_i A_{i,j} x_i = b_j∑i​Ai,j​xi​=bj​ for every jjj with yj>0y_j > 0yj​>0. At α=β=1\alpha = \beta = 1α=β=1 the conclusion reads ∑icixi≤∑jbjyj\sum_i c_i x_i \le \sum_j b_j y_j∑i​ci​xi​≤∑j​bj​yj​, the reverse inequality of Statement 1's conclusion. If III is empty, the primal objective is 000, hypotheses 4-first-clause and 5 are vacuous, primal feasibility reduces to bj≤0b_j \le 0bj​≤0 for all jjj, and the conclusion reduces to 0≤αβ∑jbjyj0 \le \alpha\beta \sum_j b_j y_j0≤αβ∑j​bj​yj​. If JJJ is empty, the dual objective is 000 and the conclusion reduces to ∑icixi≤0\sum_i c_i x_i \le 0∑i​ci​xi​≤0; in that case hypothesis 5 says, for each iii with xi>0x_i > 0xi​>0, that ci/α≤0c_i/\alpha \le 0ci​/α≤0 and 0≤ci0 \le c_i0≤ci​, which together with α≥1\alpha \ge 1α≥1 forces ci=0c_i = 0ci​=0. Nothing rules out bj<0b_j < 0bj​<0 or ci<0c_i < 0ci​<0, so the products βbj\beta b_jβbj​ and ci/αc_i / \alphaci​/α may be negative and the scaled bounds are then weaker, not stronger, than the unscaled ones.


Human review
  • Endorsed by Shuze Chen · Sep 17, 2026

  • Endorsed by moutei · Sep 17, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me