Primal–dual representation of D(J; q): the transportation LP and its dual both attain D(J; q)
ProvedScenarioReduction.Redistribution.primal_dual_representationby mikedeng1 · Sep 26, 2026 · Mathlib 0df444a (Lean v4.33.1)
linear-programminglp-dualityoptimal-transportp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1stochastic-programming
Let P=∑i=1Npiδωi with pi>0 and ∑ipi=1, let c:Ω×Ω→R+ satisfy c(ω,ω~)=0 iff ω=ω~ and c(ω,ω~)=c(ω~,ω), and write cij=c(ωi,ωj). Let J⊂{1,…,N} and let q be reduced weights: qj≥0 for j∈/J and ∑j∈/Jqj=1. Then the Kantorovich functional D(J;q) of (10) is both the minimum of the transportation problem and the maximum of its dual:
D(J;q)=min{i,j∑cijηij:ηij≥0, j∈/J∑ηij=pi, i∈I, i=1∑Nηij=qj, j∈/J}=max{i=1∑Npiui+j∈/J∑qjvj:ui+vj≤cij, i∈I, j∈/J}.
Both extrema are attained. This is strong duality for a balanced transportation problem, and it is the tool the proof of Theorem 2 uses in both directions: dual feasible points give lower bounds on D(J;q) and primal feasible plans give upper bounds.
Formalization Note The first conjunct says D(J;q) is the least transport cost over feasible plans (so the infimum is attained); the second says it is the greatest dual objective over dual-feasible (u,v), with u,v unrestricted in sign. Only entries ηij, vj with j∈/J enter. The standing assumptions of §3 are carried; the measurability, continuity (C3) and growth (C4) conditions on c concern Ω⊂Rs and are dropped, so Ω is an arbitrary set.
Preamble
import Mathlib
import Definitions.Def_ScenarioReduction_Redistribution_transportValue
open Finset
Formal statement
namespace ScenarioReduction.Redistribution
theorem primal_dual_representation {Ω : Type*} {N : ℕ} (c : Ω → Ω → ℝ) (ω : Fin N → Ω) (p : Fin N → ℝ)
(hc : ∀ a b : Ω, 0 ≤ c a b) (hc1 : ∀ a b : Ω, c a b = 0 ↔ a = b)
(hc2 : ∀ a b : Ω, c a b = c b a)
(hp : ∀ i, 0 < p i) (hp1 : ∑ i, p i = 1)
(J : Finset (Fin N)) (q : Fin N → ℝ) (hq : IsReducedWeight J q) :
IsLeast {x : ℝ | ∃ η : Fin N → Fin N → ℝ, IsTransportPlan p J q η ∧ x = transportCost c ω J η}
(transportValue c ω p J q) ∧
IsGreatest {x : ℝ | ∃ u v : Fin N → ℝ, IsDualFeasible c ω J u v ∧ x = dualObjective p J q u v}
(transportValue c ω p J q) := by sorry
end ScenarioReduction.Redistribution
Source
Dupačová, Gröwe-Kuska, Römisch, Scenario reduction in stochastic programming, Math. Program. Ser. A 95 (2003), p. 501, §3, proof of Theorem 2, first display (lead-in at the foot of p. 500); cf. p. 495
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
The data are:
- an arbitrary type Ω;
- N∈N;
- a function c:Ω×Ω→R;
- points ω:[N]→Ω, where [N]={0,…,N−1};
- a vector p:[N]→R;
- a subset J⊆[N];
- a vector q:[N]→R.
The hypotheses are:
- c(a,b)≥0 for all a,b∈Ω;
- c(a,b)=0⟺a=b;
- c(a,b)=c(b,a);
- pi>0 for every i, and ∑i∈[N]pi=1;
- q is a reduced weight for J: qj≥0 for j∈/J and ∑j∈/Jqj=1, with qj for j∈J unconstrained.
The theorem refers to D(J;q), defined as the infimum of ∑i∈[N]∑j∈/Jc(ωi,ωj)ηij over all matrices η with:
- ηij≥0 for all i and all j∈/J;
- ∑j∈/Jηij=pi for every i∈[N];
- ∑i∈[N]ηij=qj for every j∈/J.
Entries ηij with j∈J are free. The infimum is 0 if the set is empty or unbounded below.
The theorem asserts two things:
- Primal side. D(J;q) is the least element of the set of such costs. So a feasible plan exists, some feasible plan attains cost exactly D(J;q), and every feasible plan costs at least D(J;q).
- Dual side. D(J;q) is the greatest element of the set
{i∈[N]∑piui+j∈/J∑qjvj:u,v:[N]→R, ui+vj≤c(ωi,ωj) for all i∈[N], j∈/J}.
So some dual-feasible pair (u,v) attains D(J;q), and no dual-feasible pair exceeds it. The values vj for j∈J play no role.
Degenerate cases:
- N=0. The condition ∑ipi=1 cannot hold, so the statement is vacuous.
- J=[N]. The reduced-weight condition requires an empty sum to equal 1, which is impossible, so the statement is vacuous. The effective cases therefore have N≥1 and Jc=∅.
- J=∅. The statement is about transport from p to q on all of [N].
- Ω empty. Then N≥1 leaves no possible ω.
- Repeated points. ω need not be injective; if ωi=ωj, then c(ωi,ωj)=0.
View graph
Confirmed by the moderator at approval.