Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The doubly-weighted sum is at most the primal objective

Proved
PrimalDualOnline.LP.weighted_le_primal

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

complementary-slacknessdualitylinear-programmingoptimization

One of the two inequalities in the weak-duality chain. If xxx is componentwise nonnegative and yyy satisfies the dual constraints ∑jAijyj≤ci\sum_j A_{ij} y_j \le c_i∑j​Aij​yj​≤ci​ for every iii, then

∑i(∑jAijyj)xi ≤ ∑icixi.\sum_i \Bigl(\sum_j A_{ij} y_j\Bigr) x_i \ \le\ \sum_i c_i x_i.i∑​(j∑​Aij​yj​)xi​ ≤ i∑​ci​xi​.

Only these two hypotheses are needed: the dual nonnegativity y≥0y \ge 0y≥0 and the primal constraints Ax≥bAx \ge bAx≥b play no part. Stated separately so that the weak-duality proof reduces to composing this with the reindexing identity and its dual-side counterpart.

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

theorem PrimalDualOnline.LP.weighted_le_primal
    {I J : Type*} [Fintype I] [Fintype J]
    (A : I → J → ℝ) (c : I → ℝ) (x : I → ℝ) (y : J → ℝ)
    (hx : ∀ i : I, 0 ≤ x i) (hdc : ∀ i : I, ∑ j : J, A i j * y j ≤ c i) :
    (∑ i : I, (∑ j : J, A i j * y j) * x i) ≤ primalObjective c x := 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, first inequality in the proof of Theorem 2.1, p. 8
Read-back

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

Read-back 1 — weighted_le_primal

Data and binders. The statement quantifies over two types III and JJJ (implicit arguments, living in arbitrary universes), each equipped with a finiteness structure (Fintype), i.e. each is a finite index set with a fixed enumeration. No further structure is assumed on III or JJJ: no order, no nonemptiness, no decidable equality beyond what finiteness supplies. It then quantifies over four explicit pieces of real-valued data:

  • A:I→J→RA : I \to J \to \mathbb{R}A:I→J→R, a real matrix whose rows are indexed by III and whose columns are indexed by JJJ; write Ai,jA_{i,j}Ai,j​ for its entry;
  • c:I→Rc : I \to \mathbb{R}c:I→R, one real number cic_ici​ per row index;
  • x:I→Rx : I \to \mathbb{R}x:I→R, one real number xix_ixi​ per row index;
  • y:J→Ry : J \to \mathbb{R}y:J→R, one real number yjy_jyj​ per column index.

Hypotheses. Two hypotheses are assumed, both universally quantified over their whole index type:

  1. ∀i∈I,  0≤xi\forall i \in I,\; 0 \le x_i∀i∈I,0≤xi​ — every component of xxx is nonnegative.
  2. ∀i∈I,  ∑j∈JAi,j yj  ≤  ci\forall i \in I,\; \displaystyle\sum_{j \in J} A_{i,j}\, y_j \;\le\; c_i∀i∈I,j∈J∑​Ai,j​yj​≤ci​ — for each row index iii, the sum over all column indices jjj of Ai,jyjA_{i,j} y_jAi,j​yj​ is at most cic_ici​.

Conclusion. Unfolding the bundle's definition primalObjective(c,x)=∑i∈Ici xi\texttt{primalObjective}(c,x) = \sum_{i \in I} c_i\, x_iprimalObjective(c,x)=∑i∈I​ci​xi​, the asserted conclusion is

∑i∈I(∑j∈JAi,j yj)xi    ≤    ∑i∈Ici xi.\sum_{i \in I} \left( \sum_{j \in J} A_{i,j}\, y_j \right) x_i \;\;\le\;\; \sum_{i \in I} c_i\, x_i .i∈I∑​​j∈J∑​Ai,j​yj​​xi​≤i∈I∑​ci​xi​.

On the left, the inner sum runs over jjj, the second index of AAA (a row of AAA paired against yyy), and the outer sum runs over iii, the first index of AAA; the row-sum is multiplied on the right by xix_ixi​. The inequality is non-strict and points in the direction: weighted quantity ≤\le≤ primal objective.

Sign conditions present and absent. Nonnegativity is assumed only for xxx. There is no sign condition anywhere on yyy, on the entries of AAA, or on ccc; yjy_jyj​ and Ai,jA_{i,j}Ai,j​ may be negative, and cic_ici​ may be negative provided hypothesis 2 still holds. Both stated hypotheses appear in the conclusion's data (xxx in hypothesis 1, and the row-sums and ccc in hypothesis 2); neither is left dangling on data absent from the conclusion.

Degenerate cases. If III is empty, both hypotheses are vacuously true and both sides of the conclusion are the empty sum 000, so the claim is 0≤00 \le 00≤0. If JJJ is empty, every inner sum ∑jAi,jyj\sum_{j} A_{i,j} y_j∑j​Ai,j​yj​ is 000, hypothesis 2 degenerates to 0≤ci0 \le c_i0≤ci​ for every iii, the left-hand side of the conclusion is ∑i0⋅xi=0\sum_{i} 0 \cdot x_i = 0∑i​0⋅xi​=0, and the assertion becomes 0≤∑icixi0 \le \sum_i c_i x_i0≤∑i​ci​xi​. If both are empty, the whole statement reduces to 0≤00 \le 00≤0. Nothing rules out x=0x = 0x=0, y=0y = 0y=0, or A=0A = 0A=0.

Not asserted. The statement does not assert equality, nor a strict inequality. It does not assert that either side is nonnegative. It says nothing about any vector bbb, about any dual objective, about feasibility of xxx for constraints of the form Ax≥bAx \ge bAx≥b or Ax≤bAx \le bAx≤b (no such hypothesis appears), or about optimality of xxx or yyy. It does not assert the converse inequality, nor that the left-hand side may be rewritten with the summation order reversed, nor any relation to the other two statements in this bundle. It is a single inequality between two finite sums, and nothing more. The declaration's body is a placeholder, so no proof is supplied by the code.


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