Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Finite covering/packing LP pair, optimality and (α,β)(\alpha,\beta)(α,β) complementary slackness

Definition
PrimalDualOnline_FiniteLP

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

complementary-slacknessdualitylinear-programmingoptimization

The primal-dual pair of Section 2.1 over arbitrary finite index types III (primal variables, dual constraints) and JJJ (primal constraints, dual variables). The primal (P)(P)(P) minimises ∑icixi\sum_i c_i x_i∑i​ci​xi​ subject to ∑iAijxi≥bj\sum_i A_{ij} x_i \ge b_j∑i​Aij​xi​≥bj​ for every jjj and x≥0x \ge 0x≥0; the dual (D)(D)(D) maximises ∑jbjyj\sum_j b_j y_j∑j​bj​yj​ subject to ∑jAijyj≤ci\sum_j A_{ij} y_j \le c_i∑j​Aij​yj​≤ci​ for every iii and y≥0y \ge 0y≥0. The matrix is indexed with the primal-variable index first, matching the source's aija_{ij}aij​ convention.

Optimality is defined as attainment: PrimalOptimal asserts that xxx is feasible and no feasible point has smaller cost, not merely that the infimum is bounded. Because the source's informal word "bounded" conflates several distinct conditions, four notions are kept apart deliberately: having an attained optimum (PrimalHasOptimum), having a nonempty feasible set (PrimalFeasibleNonempty), having a bounded objective (PrimalObjectiveBddBelow), and the dual-side counterparts of each.

NonnegInstance singles out the covering/packing subclass in which AAA, bbb and ccc are all nonnegative. PrimalApproxCS α\alphaα says that whenever xi>0x_i > 0xi​>0 the dual constraint iii is satisfied to within a factor α\alphaα, that is ci/α≤∑jAijyj≤cic_i/\alpha \le \sum_j A_{ij} y_j \le c_ici​/α≤∑j​Aij​yj​≤ci​; DualApproxCS β\betaβ says that whenever yj>0y_j > 0yj​>0 the primal constraint jjj is satisfied to within a factor β\betaβ, that is bj≤∑iAijxi≤βbjb_j \le \sum_i A_{ij} x_i \le \beta b_jbj​≤∑i​Aij​xi​≤βbj​. Both are two-sided, as in the source.

Definition code
import Mathlib.Tactic
import Mathlib.Algebra.Order.BigOperators.Ring.Finset

namespace PrimalDualOnline.LP

/-!
The finite primal-dual pair of Section 2.1.

Data: finite index types `I` (primal variables / dual constraints) and `J` (primal
constraints / dual variables), a matrix `A : I → J → ℝ`, a primal cost `c : I → ℝ`, and a
primal right-hand side `b : J → ℝ`.

Orientation follows the source (p. 7–8):

* primal `(P)`: minimise `∑ i, c i * x i` subject to `∀ j, b j ≤ ∑ i, A i j * x i` and `x ≥ 0`;
* dual `(D)`: maximise `∑ j, b j * y j` subject to `∀ i, ∑ j, A i j * y j ≤ c i` and `y ≥ 0`.

Note the index convention: `A i j` has the primal-variable index FIRST, so the primal
constraint `j` sums over `i` and the dual constraint `i` sums over `j`. The source writes
`a_{ij}` with `i` ranging over primal variables and `j` over primal constraints, which is the
same convention.
-/

variable {I J : Type*} [Fintype I] [Fintype J]

/-- Primal feasibility: every covering constraint is met and every variable is nonnegative.
Does not mention the cost vector `c`. -/
def PrimalFeasible (A : I → J → ℝ) (b : J → ℝ) (x : I → ℝ) : Prop :=
  (∀ j : J, b j ≤ ∑ i : I, A i j * x i) ∧ ∀ i : I, 0 ≤ x i

/-- Dual feasibility: every packing constraint is met and every variable is nonnegative.
Does not mention the right-hand side `b`. -/
def DualFeasible (A : I → J → ℝ) (c : I → ℝ) (y : J → ℝ) : Prop :=
  (∀ i : I, ∑ j : J, A i j * y j ≤ c i) ∧ ∀ j : J, 0 ≤ y j

/-- The primal objective `∑ i, c i * x i`, to be minimised. -/
def primalObjective (c : I → ℝ) (x : I → ℝ) : ℝ := ∑ i : I, c i * x i

/-- The dual objective `∑ j, b j * y j`, to be maximised. -/
def dualObjective (b : J → ℝ) (y : J → ℝ) : ℝ := ∑ j : J, b j * y j

/-- `x` is an optimal primal solution: feasible, and no feasible point has smaller cost.
This is attainment, not merely a bound on the infimum. -/
def PrimalOptimal (A : I → J → ℝ) (b : J → ℝ) (c : I → ℝ) (x : I → ℝ) : Prop :=
  PrimalFeasible A b x ∧
    ∀ x' : I → ℝ, PrimalFeasible A b x' → primalObjective c x ≤ primalObjective c x'

/-- `y` is an optimal dual solution: feasible, and no feasible point has larger value. -/
def DualOptimal (A : I → J → ℝ) (b : J → ℝ) (c : I → ℝ) (y : J → ℝ) : Prop :=
  DualFeasible A c y ∧
    ∀ y' : J → ℝ, DualFeasible A c y' → dualObjective b y' ≤ dualObjective b y

/-- The primal program has a finite attained optimum: some feasible point is optimal.
This is deliberately distinct from "the objective is bounded below on the feasible set" and
from "the feasible set is nonempty"; see `PrimalFeasibleNonempty` and
`PrimalObjectiveBddBelow`. -/
def PrimalHasOptimum (A : I → J → ℝ) (b : J → ℝ) (c : I → ℝ) : Prop :=
  ∃ x : I → ℝ, PrimalOptimal A b c x

/-- The dual program has a finite attained optimum. -/
def DualHasOptimum (A : I → J → ℝ) (b : J → ℝ) (c : I → ℝ) : Prop :=
  ∃ y : J → ℝ, DualOptimal A b c y

/-- The primal feasible set is nonempty. Separated from optimality on purpose: the source's
informal word "bounded" conflates feasibility, boundedness and attainment. -/
def PrimalFeasibleNonempty (A : I → J → ℝ) (b : J → ℝ) : Prop :=
  ∃ x : I → ℝ, PrimalFeasible A b x

/-- The dual feasible set is nonempty. -/
def DualFeasibleNonempty (A : I → J → ℝ) (c : I → ℝ) : Prop :=
  ∃ y : J → ℝ, DualFeasible A c y

/-- The primal objective is bounded below on the primal feasible set. Weaker than having an
attained optimum in general, though for linear programs over `ℝ` the two coincide when the
feasible set is nonempty. -/
def PrimalObjectiveBddBelow (A : I → J → ℝ) (b : J → ℝ) (c : I → ℝ) : Prop :=
  ∃ M : ℝ, ∀ x : I → ℝ, PrimalFeasible A b x → M ≤ primalObjective c x

/-- The dual objective is bounded above on the dual feasible set. -/
def DualObjectiveBddAbove (A : I → J → ℝ) (b : J → ℝ) (c : I → ℝ) : Prop :=
  ∃ M : ℝ, ∀ y : J → ℝ, DualFeasible A c y → dualObjective b y ≤ M

/-- A nonnegative covering/packing instance: all data nonnegative. This is the subclass the
source calls a covering problem (primal) with a packing dual. -/
def NonnegInstance (A : I → J → ℝ) (b : J → ℝ) (c : I → ℝ) : Prop :=
  (∀ i : I, ∀ j : J, 0 ≤ A i j) ∧ (∀ j : J, 0 ≤ b j) ∧ ∀ i : I, 0 ≤ c i

/-- Primal approximate complementary slackness with factor `α`: whenever a primal variable is
positive, its dual constraint is satisfied to within a factor `α`. -/
def PrimalApproxCS (α : ℝ) (A : I → J → ℝ) (c : I → ℝ) (x : I → ℝ) (y : J → ℝ) : Prop :=
  ∀ i : I, 0 < x i → c i / α ≤ ∑ j : J, A i j * y j ∧ ∑ j : J, A i j * y j ≤ c i

/-- Dual approximate complementary slackness with factor `β`: whenever a dual variable is
positive, its primal constraint is satisfied to within a factor `β`. -/
def DualApproxCS (β : ℝ) (A : I → J → ℝ) (b : J → ℝ) (x : I → ℝ) (y : J → ℝ) : Prop :=
  ∀ j : J, 0 < y j → b j ≤ ∑ i : I, A i j * x i ∧ ∑ i : I, A i j * x i ≤ β * b j

end PrimalDualOnline.LP
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, pp. 7-9 (programs (P) and (D); the complementary slackness conditions)
Read-back

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

Read-back — PrimalDualOnline.LP bundle (15 declarations)

Shared binders. Every declaration below lives in the namespace PrimalDualOnline.LP and is stated for two implicit type variables III and JJJ, each drawn from an arbitrary universe, together with two implicit instance hypotheses asserting that III is a finite type and that JJJ is a finite type. Finiteness is the only structure assumed of III and JJJ: they are not assumed nonempty, not assumed decidably ordered, and not related to one another. Nothing in the bundle is a theorem; all fifteen declarations are definitions, twelve of them producing a proposition (a truth-valued predicate) and two producing a real number, so nothing here asserts that any of these propositions holds. Throughout, a matrix-like datum is a function AAA taking a first index i∈Ii \in Ii∈I and a second index j∈Jj \in Jj∈J to a real number, written Ai,jA_{i,j}Ai,j​ below; the orientation is uniform across the whole bundle — the symbol is always applied as (first index in III, second index in JJJ), and no transpose is ever formed. Vectors indexed by III are xxx and ccc; vectors indexed by JJJ are bbb and yyy. Sums are finite sums over the whole index type, justified by the finiteness instances, and are 000 when the index type is empty.

1. PrimalFeasible

PrimalFeasible is a predicate with two implicit arguments (the finite types III, JJJ, with their two implicit finiteness instances) and three explicit arguments: a two-index real array AAA with first index in III and second index in JJJ, a real vector bbb indexed by JJJ, and a real vector xxx indexed by III. It asserts the conjunction of two families of conditions:

∀j∈J,bj  ≤  ∑i∈IAi,j xi,and∀i∈I,0≤xi.\forall j \in J,\quad b_j \;\le\; \sum_{i \in I} A_{i,j}\, x_i, \qquad\text{and}\qquad \forall i \in I,\quad 0 \le x_i .∀j∈J,bj​≤i∈I∑​Ai,j​xi​,and∀i∈I,0≤xi​.

The index convention is explicit here: for each fixed second index jjj, the sum runs over the first index iii, i.e. over the III-indexed family i↦Ai,ji \mapsto A_{i,j}i↦Ai,j​ paired with xix_ixi​. Both inequalities are non-strict, and the constraint direction is "≥\ge≥" in the sense that the bbb-side is the lower bound. There is no assumption that AAA, bbb, or xxx have any sign beyond the stated xi≥0x_i \ge 0xi​≥0. Degenerate cases: if III is empty, every sum is 000, the nonnegativity clause is vacuously true, and the predicate reduces to "bj≤0b_j \le 0bj​≤0 for all jjj"; if JJJ is empty, the first clause is vacuously true and the predicate reduces to "xi≥0x_i \ge 0xi​≥0 for all iii"; if both are empty the predicate is unconditionally true (and is then satisfied by the unique empty vector).

2. DualFeasible

DualFeasible is a predicate with implicit arguments III, JJJ and their two implicit finiteness instances, and three explicit arguments: the two-index array AAA (first index in III, second in JJJ), a real vector ccc indexed by III, and a real vector yyy indexed by JJJ. It asserts the conjunction

∀i∈I,∑j∈JAi,j yj  ≤  ci,and∀j∈J,0≤yj.\forall i \in I,\quad \sum_{j \in J} A_{i,j}\, y_j \;\le\; c_i, \qquad\text{and}\qquad \forall j \in J,\quad 0 \le y_j .∀i∈I,j∈J∑​Ai,j​yj​≤ci​,and∀j∈J,0≤yj​.

Here the summation convention is the mirror image of the primal one: for each fixed first index iii, the sum runs over the second index jjj, over the JJJ-indexed family j↦Ai,jj \mapsto A_{i,j}j↦Ai,j​ paired with yjy_jyj​. Both inequalities are non-strict and the ccc-side is the upper bound. No sign assumption is placed on AAA or ccc. Degenerate cases: if JJJ is empty, all sums are 000, the nonnegativity clause is vacuous, and the predicate reduces to "0≤ci0 \le c_i0≤ci​ for all iii"; if III is empty, the first clause is vacuous and the predicate reduces to "yj≥0y_j \ge 0yj​≥0 for all jjj"; if both are empty it is unconditionally true.

3. primalObjective

primalObjective is not a proposition but a real-valued function. It takes the implicit type III with its implicit finiteness instance (the type JJJ and its instance are also in scope as implicit arguments of the surrounding variable block, though JJJ plays no role in the body) and two explicit real vectors ccc and xxx, both indexed by III, and returns the finite sum

∑i∈Ici xi,\sum_{i \in I} c_i\, x_i ,i∈I∑​ci​xi​,

that is, the pairing of the coefficient vector ccc with the vector xxx in the order "ccc factor first, xxx factor second". No feasibility, sign, or normalization condition is imposed on either argument: the value is defined for arbitrary real vectors. If III is empty the value is 000.

4. dualObjective

dualObjective is likewise a real-valued function, taking the implicit type JJJ with its implicit finiteness instance (and the implicit III and its instance, unused in the body) and two explicit real vectors bbb and yyy, both indexed by JJJ, and returning

∑j∈Jbj yj,\sum_{j \in J} b_j\, y_j ,j∈J∑​bj​yj​,

the pairing of bbb with yyy in the order "bbb factor first, yyy factor second". Again no feasibility or sign condition is imposed on the arguments, and the value is 000 when JJJ is empty.

5. PrimalOptimal

PrimalOptimal is a predicate on a specific vector. Its implicit arguments are III, JJJ and their two finiteness instances; its explicit arguments are AAA (first index III, second index JJJ), bbb indexed by JJJ, ccc indexed by III, and xxx indexed by III. It asserts the conjunction of two things: first, that xxx is primal feasible in the sense of declaration 1, i.e. bj≤∑iAi,jxib_j \le \sum_{i} A_{i,j} x_ibj​≤∑i​Ai,j​xi​ for every j∈Jj \in Jj∈J and xi≥0x_i \ge 0xi​≥0 for every i∈Ii \in Ii∈I; and second, that for every real vector x′x'x′ indexed by III — the quantifier ranges over all functions I→RI \to \mathbb{R}I→R, filtered by the hypothesis that x′x'x′ is itself primal feasible in the same sense — one has

∑i∈Ici xi  ≤  ∑i∈Ici xi′.\sum_{i \in I} c_i\, x_i \;\le\; \sum_{i \in I} c_i\, x'_i .i∈I∑​ci​xi​≤i∈I∑​ci​xi′​.

So the direction of optimality is minimization: the objective at xxx is a lower bound for the objective at every feasible competitor. The inequality is non-strict, so nothing about uniqueness is claimed and several vectors may simultaneously satisfy this predicate. The statement does not require ccc, bbb, or AAA to be nonnegative. If JJJ is empty, feasibility of xxx and of each x′x'x′ reduces to nonnegativity, so the predicate says x≥0x \ge 0x≥0 and ∑icixi≤∑icixi′\sum_i c_i x_i \le \sum_i c_i x'_i∑i​ci​xi​≤∑i​ci​xi′​ for all x′≥0x' \ge 0x′≥0. If III is empty, the predicate reduces to "bj≤0b_j \le 0bj​≤0 for all jjj" (the objective comparison becomes 0≤00 \le 00≤0).

6. DualOptimal

DualOptimal is the corresponding predicate on a specific JJJ-indexed vector, with implicit III, JJJ and their two finiteness instances, and explicit arguments AAA, bbb indexed by JJJ, ccc indexed by III, and yyy indexed by JJJ. It asserts, first, that yyy is dual feasible in the sense of declaration 2, i.e. ∑jAi,jyj≤ci\sum_{j} A_{i,j} y_j \le c_i∑j​Ai,j​yj​≤ci​ for every i∈Ii \in Ii∈I and yj≥0y_j \ge 0yj​≥0 for every j∈Jj \in Jj∈J; and second, that for every real vector y′y'y′ indexed by JJJ that is dual feasible in the same sense,

∑j∈Jbj yj′  ≤  ∑j∈Jbj yj.\sum_{j \in J} b_j\, y'_j \;\le\; \sum_{j \in J} b_j\, y_j .j∈J∑​bj​yj′​≤j∈J∑​bj​yj​.

Note the orientation of this second clause: the competitor's objective appears on the left, so the direction of optimality is maximization — the objective at yyy dominates that at every dual feasible competitor. The inequality is non-strict and no uniqueness is claimed. If III is empty, dual feasibility reduces to y≥0y \ge 0y≥0 and the clause says ∑jbjyj′≤∑jbjyj\sum_j b_j y'_j \le \sum_j b_j y_j∑j​bj​yj′​≤∑j​bj​yj​ for all nonnegative y′y'y′. If JJJ is empty, the predicate reduces to "0≤ci0 \le c_i0≤ci​ for all iii" (the objective comparison becomes 0≤00 \le 00≤0).

7. PrimalHasOptimum

PrimalHasOptimum takes implicit III, JJJ with their two finiteness instances and explicit AAA (first index III, second JJJ), bbb indexed by JJJ, and ccc indexed by III; it asserts the bare existence statement: there exists a real vector xxx indexed by III such that xxx is primal optimal in the sense of declaration 5 — that is, xxx satisfies bj≤∑iAi,jxib_j \le \sum_i A_{i,j} x_ibj​≤∑i​Ai,j​xi​ for all jjj and xi≥0x_i \ge 0xi​≥0 for all iii, and ∑icixi≤∑icixi′\sum_i c_i x_i \le \sum_i c_i x'_i∑i​ci​xi​≤∑i​ci​xi′​ for every primal feasible x′x'x′. This is an ordinary existential, not a unique existential, so it does not claim that the minimizer is unique. It does assert, as part of the unfolded content, that the primal feasible set is nonempty (the witness lies in it) and that the infimum of the objective over that set is attained. If III is empty it reduces to "bj≤0b_j \le 0bj​≤0 for all jjj"; if JJJ is empty it reduces to the existence of a nonnegative xxx minimizing ∑icixi\sum_i c_i x_i∑i​ci​xi​ over all nonnegative vectors.

8. DualHasOptimum

DualHasOptimum takes implicit III, JJJ with their two finiteness instances and explicit AAA, bbb indexed by JJJ, and ccc indexed by III; it asserts that there exists a real vector yyy indexed by JJJ that is dual optimal in the sense of declaration 6 — i.e. ∑jAi,jyj≤ci\sum_j A_{i,j} y_j \le c_i∑j​Ai,j​yj​≤ci​ for all i∈Ii \in Ii∈I, yj≥0y_j \ge 0yj​≥0 for all j∈Jj \in Jj∈J, and ∑jbjyj′≤∑jbjyj\sum_j b_j y'_j \le \sum_j b_j y_j∑j​bj​yj′​≤∑j​bj​yj​ for every dual feasible y′y'y′. Again this is a plain existential with no uniqueness, and it entails both that the dual feasible set is nonempty and that the supremum of the dual objective over it is attained. If JJJ is empty it reduces to "0≤ci0 \le c_i0≤ci​ for all iii"; if III is empty it reduces to the existence of a nonnegative yyy maximizing ∑jbjyj\sum_j b_j y_j∑j​bj​yj​ over all nonnegative vectors.

9. PrimalFeasibleNonempty

PrimalFeasibleNonempty takes implicit III, JJJ with their two finiteness instances and only two explicit arguments — AAA (first index III, second JJJ) and bbb indexed by JJJ; the objective vector ccc does not appear. It asserts that there exists a real vector xxx indexed by III with bj≤∑i∈IAi,jxib_j \le \sum_{i \in I} A_{i,j} x_ibj​≤∑i∈I​Ai,j​xi​ for every j∈Jj \in Jj∈J and xi≥0x_i \ge 0xi​≥0 for every i∈Ii \in Ii∈I. Nothing is said about the value of any objective at this witness or about optimality. If JJJ is empty the statement is true for the zero vector (indeed for any nonnegative vector); if III is empty it is equivalent to "bj≤0b_j \le 0bj​≤0 for all jjj", witnessed by the empty vector.

10. DualFeasibleNonempty

DualFeasibleNonempty takes implicit III, JJJ with their two finiteness instances and two explicit arguments — AAA and ccc indexed by III; the vector bbb does not appear. It asserts that there exists a real vector yyy indexed by JJJ with ∑j∈JAi,jyj≤ci\sum_{j \in J} A_{i,j} y_j \le c_i∑j∈J​Ai,j​yj​≤ci​ for every i∈Ii \in Ii∈I and yj≥0y_j \ge 0yj​≥0 for every j∈Jj \in Jj∈J. Nothing is said about the value of the dual objective at this witness or about optimality. If III is empty the statement is true for the zero vector (indeed any nonnegative yyy); if JJJ is empty it is equivalent to "0≤ci0 \le c_i0≤ci​ for all iii", witnessed by the empty vector.

11. PrimalObjectiveBddBelow

PrimalObjectiveBddBelow takes implicit III, JJJ with their two finiteness instances and explicit AAA, bbb indexed by JJJ, and ccc indexed by III. It asserts that there exists a real number MMM such that for every real vector xxx indexed by III, if xxx is primal feasible — i.e. bj≤∑iAi,jxib_j \le \sum_i A_{i,j} x_ibj​≤∑i​Ai,j​xi​ for all j∈Jj \in Jj∈J and xi≥0x_i \ge 0xi​≥0 for all i∈Ii \in Ii∈I — then

M  ≤  ∑i∈Ici xi.M \;\le\; \sum_{i \in I} c_i\, x_i .M≤i∈I∑​ci​xi​.

The bound MMM is merely some lower bound: it is not required to be tight, to be the infimum, or to be attained by any feasible point, and the quantifier order is "∃M\exists M∃M, ∀x\forall x∀x", so a single MMM must work uniformly. Crucially, the implication is vacuous when no xxx is primal feasible: if the feasible set is empty, the statement holds with any MMM whatsoever, so this predicate carries no existence content. If III is empty, every feasible xxx has objective 000, so the predicate holds (e.g. with M=0M = 0M=0) regardless of bbb; if JJJ is empty the predicate says the objective ∑icixi\sum_i c_i x_i∑i​ci​xi​ is bounded below over the nonnegative orthant.

12. DualObjectiveBddAbove

DualObjectiveBddAbove takes implicit III, JJJ with their two finiteness instances and explicit AAA, bbb indexed by JJJ, and ccc indexed by III. It asserts that there exists a real number MMM such that for every real vector yyy indexed by JJJ, if yyy is dual feasible — i.e. ∑jAi,jyj≤ci\sum_j A_{i,j} y_j \le c_i∑j​Ai,j​yj​≤ci​ for all i∈Ii \in Ii∈I and yj≥0y_j \ge 0yj​≥0 for all j∈Jj \in Jj∈J — then

∑j∈Jbj yj  ≤  M.\sum_{j \in J} b_j\, y_j \;\le\; M .j∈J∑​bj​yj​≤M.

Again MMM is only some uniform upper bound, not required to be the supremum or to be attained, with quantifier order "∃M\exists M∃M, ∀y\forall y∀y"; and the implication is vacuous when the dual feasible set is empty, in which case any MMM works and the predicate asserts nothing about existence. If JJJ is empty the objective of any feasible yyy is 000 and the predicate holds (e.g. M=0M = 0M=0); if III is empty the predicate says ∑jbjyj\sum_j b_j y_j∑j​bj​yj​ is bounded above over the nonnegative orthant.

13. NonnegInstance

NonnegInstance takes implicit III, JJJ with their two finiteness instances and explicit AAA (first index III, second JJJ), bbb indexed by JJJ, and ccc indexed by III, and asserts a threefold conjunction of non-strict sign conditions:

∀i∈I, ∀j∈J,0≤Ai,j;∀j∈J,0≤bj;∀i∈I,0≤ci.\forall i \in I,\ \forall j \in J,\quad 0 \le A_{i,j}; \qquad \forall j \in J,\quad 0 \le b_j; \qquad \forall i \in I,\quad 0 \le c_i .∀i∈I, ∀j∈J,0≤Ai,j​;∀j∈J,0≤bj​;∀i∈I,0≤ci​.

All three are ≥0\ge 0≥0, not >0> 0>0, so zero entries, the zero matrix, and the zero vectors are all permitted; nothing is required about row or column sums, nonzero-ness, or any relation between AAA, bbb, and ccc. If III is empty, the first and third clauses are vacuous and only "bj≥0b_j \ge 0bj​≥0 for all jjj" survives; if JJJ is empty, the first and second are vacuous and only "ci≥0c_i \ge 0ci​≥0 for all iii" survives; if both are empty the conjunction is vacuously true.

14. PrimalApproxCS

PrimalApproxCS takes implicit III, JJJ with their two finiteness instances, and five explicit arguments: a real number α\alphaα (the first argument), the array AAA (first index III, second JJJ), the vector ccc indexed by III, the vector xxx indexed by III, and the vector yyy indexed by JJJ; the vector bbb does not appear. It asserts that for every i∈Ii \in Ii∈I, if xix_ixi​ is strictly positive, then the quantity Si:=∑j∈JAi,j yjS_i := \sum_{j \in J} A_{i,j}\, y_jSi​:=∑j∈J​Ai,j​yj​ — a sum over the second index of AAA with the first index fixed at iii, i.e. exactly the left-hand side of the iii-th dual constraint — is two-sidedly bounded:

ciα  ≤  SiandSi  ≤  ci.\frac{c_i}{\alpha} \;\le\; S_i \qquad\text{and}\qquad S_i \;\le\; c_i .αci​​≤Si​andSi​≤ci​.

So the bounded quantity is the dual-constraint sum SiS_iSi​, with the lower bound ci/αc_i/\alphaci​/α and the upper bound cic_ici​; both inequalities are non-strict, and they are imposed only at those indices iii where xi>0x_i > 0xi​>0 (indices with xi=0x_i = 0xi​=0, or xi<0x_i < 0xi​<0, are entirely unconstrained — the hypothesis is the strict inequality 0<xi0 < x_i0<xi​, so the predicate is vacuously true whenever xxx has no strictly positive coordinate, in particular for x=0x = 0x=0). Note that the upper bound Si≤ciS_i \le c_iSi​≤ci​ is the iii-th dual feasibility inequality restated at the support of xxx only; the predicate does not require it at other indices, nor does it require y≥0y \ge 0y≥0, x≥0x \ge 0x≥0, or any sign condition on α\alphaα, AAA, or ccc. Because division in the reals is a total operation here, α=0\alpha = 0α=0 is permitted and yields ci/0=0c_i/0 = 0ci​/0=0, so at α=0\alpha = 0α=0 the predicate degenerates to "for every iii with xi>0x_i > 0xi​>0: 0≤Si≤ci0 \le S_i \le c_i0≤Si​≤ci​" — a nonnegativity requirement on the dual-constraint sum rather than anything involving cic_ici​ on the left. For α<0\alpha < 0α<0 the quotient ci/αc_i/\alphaci​/α has the opposite sign pattern from the positive case (e.g. it is negative when ci>0c_i > 0ci​>0), and no hypothesis such as α≥1\alpha \ge 1α≥1 or α>0\alpha > 0α>0 is present to exclude this. Degenerate index types: if III is empty the predicate is vacuously true; if JJJ is empty then Si=0S_i = 0Si​=0 for every iii and the predicate says "for every iii with xi>0x_i > 0xi​>0: ci/α≤0c_i/\alpha \le 0ci​/α≤0 and 0≤ci0 \le c_i0≤ci​".

15. DualApproxCS

DualApproxCS takes implicit III, JJJ with their two finiteness instances, and five explicit arguments: a real number β\betaβ (the first argument), the array AAA (first index III, second JJJ), the vector bbb indexed by JJJ, the vector xxx indexed by III, and the vector yyy indexed by JJJ; the vector ccc does not appear. It asserts that for every j∈Jj \in Jj∈J, if yjy_jyj​ is strictly positive, then the quantity Tj:=∑i∈IAi,j xiT_j := \sum_{i \in I} A_{i,j}\, x_iTj​:=∑i∈I​Ai,j​xi​ — a sum over the first index of AAA with the second index fixed at jjj, i.e. exactly the left-hand side of the jjj-th primal constraint — is two-sidedly bounded:

bj  ≤  TjandTj  ≤  β bj.b_j \;\le\; T_j \qquad\text{and}\qquad T_j \;\le\; \beta\, b_j .bj​≤Tj​andTj​≤βbj​.

So the bounded quantity is the primal-constraint sum TjT_jTj​, with the lower bound bjb_jbj​ and the upper bound the product βbj\beta b_jβbj​ (a multiplication, not a division, so no junk-value issue arises); both inequalities are non-strict and are imposed only at indices jjj with yj>0y_j > 0yj​>0, leaving indices with yj=0y_j = 0yj​=0 or yj<0y_j < 0yj​<0 unconstrained, and making the predicate vacuously true when yyy has no strictly positive coordinate, in particular for y=0y = 0y=0. The lower bound bj≤Tjb_j \le T_jbj​≤Tj​ is the jjj-th primal feasibility inequality restated at the support of yyy only; the predicate does not require it elsewhere, nor does it require x≥0x \ge 0x≥0, y≥0y \ge 0y≥0, or any sign condition on β\betaβ, AAA, or bbb. At β=0\beta = 0β=0 the upper bound becomes Tj≤0T_j \le 0Tj​≤0, so the predicate then requires, for each jjj with yj>0y_j > 0yj​>0, that bj≤Tj≤0b_j \le T_j \le 0bj​≤Tj​≤0 — which in particular forces bj≤0b_j \le 0bj​≤0 at every such jjj; for β<0\beta < 0β<0 the two bounds read bj≤Tj≤βbjb_j \le T_j \le \beta b_jbj​≤Tj​≤βbj​, which is unsatisfiable whenever bj>0b_j > 0bj​>0 and β<1\beta < 1β<1, and no hypothesis such as β≥1\beta \ge 1β≥1 or β>0\beta > 0β>0 is present. Degenerate index types: if JJJ is empty the predicate is vacuously true; if III is empty then Tj=0T_j = 0Tj​=0 for every jjj and the predicate says "for every jjj with yj>0y_j > 0yj​>0: bj≤0b_j \le 0bj​≤0 and 0≤βbj0 \le \beta b_j0≤βbj​".

The four primal notions, as literally written

PrimalOptimal A b c x is a predicate about a named vector xxx: it says xxx is feasible and its objective is ≤\le≤ that of every feasible competitor. Unfolding it, it contains a feasible witness (xxx itself) and a uniform lower bound for the objective over the feasible set (namely ∑icixi\sum_i c_i x_i∑i​ci​xi​), so as written it entails both PrimalFeasibleNonempty A b and PrimalObjectiveBddBelow A b c, and it entails PrimalHasOptimum A b c by taking xxx as witness. It does not claim xxx is the only such vector.

PrimalHasOptimum A b c asserts only that some such xxx exists; it therefore entails feasible-nonemptiness and bounded-belowness and attainment of the minimum, but, having discarded the witness, it names no particular vector and asserts no uniqueness.

PrimalFeasibleNonempty A b mentions only AAA and bbb and asserts only that the constraint system has at least one solution with x≥0x \ge 0x≥0. As written it says nothing whatsoever about ccc or the objective: it does not imply PrimalObjectiveBddBelow, does not imply PrimalHasOptimum, and does not imply that any particular vector is optimal.

PrimalObjectiveBddBelow A b c asserts only the existence of one real number MMM bounding the objective from below across all feasible points. It does not imply that a feasible point exists (an empty feasible set makes the inner implication vacuous, so every MMM works and the predicate holds), it does not imply that the bound is tight or attained, and it does not imply PrimalHasOptimum or PrimalOptimal for any vector. Nor is any implication from the conjunction of feasible-nonemptiness and bounded-belowness to the existence of an optimum asserted anywhere in this bundle: these are four separate definitions, and no theorem connecting them is stated here.

The dual side is the exact mirror in every respect, with the direction of the objective comparison reversed: DualOptimal is maximality of ∑jbjyj\sum_j b_j y_j∑j​bj​yj​ among dual feasible vectors, DualHasOptimum its existential form, DualFeasibleNonempty (which mentions AAA and ccc but not bbb) the bare solvability of the dual constraint system, and DualObjectiveBddAbove the existence of one uniform upper bound MMM, vacuously true when the dual feasible set is empty. No relation between the primal and dual notions — no weak- or strong-duality inequality, no complementary-slackness implication — is stated in this bundle.

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