Reindexing the doubly-weighted sum
ProvedPrimalDualOnline.LP.sum_interchangeThe unconditional reindexing identity at the centre of every primal-dual argument: for any matrix and any vectors and over finite index types,
Both sides are the double sum grouped differently. No hypotheses at all: no feasibility, no nonnegativity, no sign condition on the data. It is recorded as its own item because it is the one step that every later mission in the series reuses verbatim.
import Definitions.Def_PrimalDualOnline_FiniteLP import Mathlib.Tactic
open PrimalDualOnline.LP
theorem PrimalDualOnline.LP.sum_interchange
{I J : Type*} [Fintype I] [Fintype J]
(A : I → J → ℝ) (x : I → ℝ) (y : J → ℝ) :
(∑ i : I, (∑ j : J, A i j * y j) * x i)
= ∑ j : J, (∑ i : I, A i j * x i) * y j := by sorryRead-back
What the Lean code literally says, in plain math · claude-opus-5
Read-back 2 — sum_interchange
Data and binders. Again two implicitly quantified types and in arbitrary universes, each carrying a finiteness structure, and three explicit pieces of data: a real matrix with rows indexed by and columns by , a vector indexed by rows, and a vector indexed by columns.
Hypotheses. There are none. Beyond the two finiteness instances on the index types, the statement carries no assumption whatsoever: no nonnegativity, no feasibility, no bounds, no nonemptiness, no relation between , and . Consequently the claim is asserted for arbitrary real data, including negative entries of , negative , negative , mixed signs, and all-zero data; there is no hypothesis that could be vacuous or unsatisfiable, and no hypothesis that could be unused.
Conclusion. The asserted equality is
The two sides differ in which index of is summed inside and which outside:
- Left side: inner sum over (the second index of ), i.e. each row of is contracted against , and the resulting row value is multiplied by ; the outer sum runs over (the first index).
- Right side: inner sum over (the first index of ), i.e. each column of is contracted against , and the resulting column value is multiplied by ; the outer sum runs over (the second index).
In both cases the scalar factor from the outer index is written to the right of the inner sum. The relation asserted is exact equality of two real numbers, not an inequality and not an approximation.
Degenerate cases. If is empty, the left side is the empty sum ; on the right, each inner sum over is , so the right side is , and the claim is . Symmetrically, if is empty, the left side is and the right side is the empty sum . If both are empty, the claim is . Since all sums are over finite index types, no question of convergence arises and every sum is a well-defined real number.
Not asserted. The statement asserts no inequality in either direction, no sign information about the common value, and no nonnegativity of any of , , or the sums. It does not mention , , the primal objective, the dual objective, feasibility, or optimality. It does not claim that either side equals any third expression (for instance a doubly-indexed sum over ), only that the two displayed nestings agree. It makes no claim about the matrix having full rank, being square, or the index types having equal cardinality. The declaration's body is a placeholder, so no proof is supplied by the code.
Confirmed by the mission captain (proposal self-audit).