Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

(3.8), p. 419 — exact complementary slackness makes σ an optimal assignment and (g^{C̄}, g) an optimal dual pair

Proved
CompOT.Auction.eq_3_8

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

assignment-problemcomplementary-slacknessdualityoptimal-transportp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-bookp2o-v1

Let C∈Rn×n\mathbf C\in\mathbb R^{n\times n}C∈Rn×n be a cost matrix, g∈Rn\mathbf g\in\mathbb R^ng∈Rn a dual vector and σ\sigmaσ a permutation of [ ⁣[n] ⁣][\![n]\!][[n]] such that, for every iii,

Ci,σi−gσi=min⁡jCi,j−gj.(3.8)\mathbf C_{i,\sigma_i}-\mathbf g_{\sigma_i}=\min_j \mathbf C_{i,j}-\mathbf g_j. \tag{3.8}Ci,σi​​−gσi​​=jmin​Ci,j​−gj​.(3.8)

Then both are optimal:

  1. σ\sigmaσ is an optimal assignment: ∑iCi,σi≤∑iCi,τi\sum_i \mathbf C_{i,\sigma_i}\le\sum_i \mathbf C_{i,\tau_i}∑i​Ci,σi​​≤∑i​Ci,τi​​ for every permutation τ\tauτ;
  2. (gCˉ,g)(\mathbf g^{\bar{\mathbf C}},\mathbf g)(gCˉ,g), where (gCˉ)i=min⁡jCi,j−gj(\mathbf g^{\bar{\mathbf C}})_i=\min_j\mathbf C_{i,j}-\mathbf g_j(gCˉ)i​=minj​Ci,j​−gj​, is dual feasible, giCˉ+gj≤Ci,j\mathbf g^{\bar{\mathbf C}}_i+\mathbf g_j\le\mathbf C_{i,j}giCˉ​+gj​≤Ci,j​ for all i,ji,ji,j;
  3. and it is an optimal dual pair: ∑ifi′+∑jgj′≤∑i(gCˉ)i+∑jgj\sum_i\mathbf f'_i+\sum_j\mathbf g'_j\le\sum_i(\mathbf g^{\bar{\mathbf C}})_i+\sum_j\mathbf g_j∑i​fi′​+∑j​gj′​≤∑i​(gCˉ)i​+∑j​gj​ for every dual feasible (f′,g′)(\mathbf f',\mathbf g')(f′,g′).

This is the exact form of the complementary slackness condition that the auction algorithm relaxes to ε-complementary slackness.

Formalization Note [ ⁣[n] ⁣][\![n]\!][[n]] is Fin n. The optimal assignment problem (2.2) and its dual (2.20) with uniform marginals a=b=1n/na=b=\mathbb 1_n/na=b=1n​/n carry a factor 1n\frac1nn1​ in both objectives; it is dropped here, which does not change which assignments or dual pairs are optimal.

Preamble
import Mathlib
import Definitions.Def_CompOT_Auction_Defs
Formal statement
namespace CompOT.Auction

/-- (3.8), p. 419: if a dual vector `g` and a permutation `σ` satisfy
`C_{i,σ_i} − g_{σ_i} = min_j C_{i,j} − g_j` for every `i`, then `σ` is an optimal assignment and
`(g^{C̄}, g)` is an optimal dual pair. -/
theorem eq_3_8 {n : ℕ} (C : Matrix (Fin n) (Fin n) ℝ) (g : Fin n → ℝ)
    (σ : Equiv.Perm (Fin n)) (h : ∀ i, C i (σ i) - g (σ i) = ⨅ j, (C i j - g j)) :
    (∀ τ : Equiv.Perm (Fin n), assignmentCost C σ ≤ assignmentCost C τ) ∧
      DualFeasible C (cbarTransform C g) g ∧
      ∀ f' g' : Fin n → ℝ, DualFeasible C f' g' →
        ∑ i, f' i + ∑ j, g' j ≤ ∑ i, cbarTransform C g i + ∑ j, g j := by sorry

end CompOT.Auction
Source
Peyré & Cuturi, Computational Optimal Transport (FnT ML 2019), §3.7, (3.8), p. 419
Human review
  • Endorsed by Shuze Chen · Oct 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 8, 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