Dual Problem
Duality turns the transport problem into a search for potentials rather than couplings. This chapter explains why potentials certify optimality, how -transforms regularize them, and why the quadratic case reveals convex analysis behind Brenier maps. Linear-programming duality gives the discrete picture Bertsimas & Tsitsiklis, 1997, while the continuous form is one of the central theorems of optimal transport Villani, 2003Santambrogio, 2015.
Discrete Dual¶
The discrete dual gives finite-dimensional certificates of optimality. Its complementary-slackness conditions identify where an optimal coupling can put mass.
The two vectors play the role of source and target prices; admissibility means that no transported pair is priced above its travel cost. The discrete Kantorovich problem is a linear program. Hence its value can be computed either by minimizing over couplings or by maximizing over a pair of dual vectors.
Proof
Start from the primal problem
Introduce multipliers for its two marginal constraints. The Lagrangian is
For fixed potentials, the dual function is
The last infimum is zero when for all , and otherwise. The primal coupling polytope is nonempty because it contains , and it is compact. Finite-dimensional linear-programming strong duality and attainment therefore give (2).
Proof
The marginal constraints give , proving the gap identity. All summands are nonnegative. If the two feasible objects are optimal, strong duality makes their gap zero, so every summand with vanishes. Conversely, the contact condition makes the gap zero and weak duality forces optimality.
Thus potentials are not transport maps themselves. They are certificates, and their equality set with the cost matrix is where an optimal coupling is allowed to place mass.
Figure Div shows these finite-dimensional certificates on a one-dimensional quadratic problem.

Discrete Kantorovich dual potentials for the quadratic cost . The upper strip shows the fixed source histogram in red and the target histogram in blue. The lower strip shows optimal dual vectors , with a gauge chosen so that . Complementary slackness states that mass can be transported only through entries where .
The interactive demo varies the target law and the number of bins. The lower curves are reconstructed from the active monotone transport graph, so the equality set moves as the coupling support changes.
Interactive panel. Use the geometry and slack controls to see feasible dual potentials touch the cost surface exactly on matched pairs.
The formula (2) also shows that is convex, being a supremum of linear functions. From the primal formulation, is concave.
General Formulation¶
The continuous dual is the analytic counterpart of the discrete linear program. It uses continuous potentials because measures are naturally probed through integration.
Continuous Duality¶
The finite-dimensional price vectors become continuous test functions. The pairing is .
Proof
Weak duality is immediate. If and , then
Taking the supremum over admissible potentials and the infimum over couplings gives the first inequality.
For the reverse inequality, let and consider the cone
The cone is closed in the product weak topology: convergence of one marginal bounds the masses, compactness provides a weakly convergent subnet, and continuity of marginalization and of identifies its limit. For , the point is not in . Strong separation gives , and such that
Testing gives , and testing Dirac generators gives . If , integration against contradicts strict separation, so . Therefore and are admissible and have dual value greater than . Letting proves equality.
For attainment, take a maximizing sequence and successively set
These replacements preserve feasibility and improve the objective. Normalize . The envelopes inherit the uniform moduli of in the two variables and are uniformly bounded. Arzela--Ascoli gives a uniformly convergent maximizing subsequence, whose limit remains admissible.
Complementary Slackness¶
As in the finite problem, equality of primal and dual values localizes the support of every optimal coupling.
Proof
The marginal identities give the equality, and admissibility gives nonnegativity. A zero gap is equivalent to equality of feasible primal and dual values. The slack is continuous and nonnegative; if it were positive at a point of , it would have positive integral on a neighborhood of that point.
The discrete case corresponds to dual vectors that sample the continuous potentials, .
For the one-dimensional quadratic cost, the continuous potentials can be read from the monotone map : on the active graph, and .
Figure Div shows how these continuous potentials adapt to increasingly multimodal source and target densities while retaining the same complementary-slackness interpretation.

Continuous Kantorovich potentials for the same source and target families as the discrete potential figure. The upper strips show the source density in red and the target density in blue. The lower strips show potentials and for the quadratic cost . The equality set contains the monotone transport graph.
The same optimality condition is even more explicit if one plots the slack
Dual feasibility is the statement , while complementary slackness says that an optimal coupling can only live where this slack vanishes. The next figure shows this zero set for increasingly structured one-dimensional transports, including a Gaussian source mapped to a separated three-component target mixture: the transported graph is not guessed from the potentials separately, but appears as the contact valley of the dual inequality.
Figure Div shows this zero set for increasingly structured one-dimensional transports, including a Gaussian source mapped to a three-component target mixture: the transported graph is not guessed from the potentials separately, but appears as the contact valley of the dual inequality.

Complementary slackness contacts for one-dimensional quadratic OT. From left to right: two Gaussian densities, two-component Gaussian-mixture densities, and one Gaussian density transported to a separated three-component mixture. The central heatmaps display the nonnegative dual slack : pale colors mark the contact valley and darker blue means larger strict slack. The red top strip and blue side strip show the source and target densities. The violet curve is the quantile transport contact graph , where and the optimal Monge plan is supported.
The interactive view computes the monotone map from numerical quantiles and then integrates . It makes clear that the potentials change smoothly with the target law, even though the equality set remains a thin transport graph.
Interactive panel. Use the regularity and time controls to view continuous Kantorovich potentials and their active transport contacts.
In contrast to the primal problem, dual attainment is not immediate: the constraint set is not compact and the objective is not coercive. The -transform selects canonical representatives that inherit the modulus of continuity of the cost; a gauge condition then makes the family compact.
c-Transforms¶
The -transform is the operation that improves potentials without changing feasibility. It is both a proof device for dual attainment and the route from duality to Brenier’s convex potentials.
Best-Response Potentials¶
Keeping a dual potential fixed, one can maximize in closed form over the second potential in the dual problem:
The constraint is equivalent to .
Since is nonnegative, maximizing is achieved by taking on the support of , equivalently -almost everywhere.
Figure Div makes the best-response operation geometric: the discrete -transform is the lower envelope of the shifted cost functions.

Discrete -transform as a lower envelope for costs . The red circles are four source atoms with potential values ; the gray curves are ; the colored curve is their lower envelope . This is the semi-discrete situation where the source space is finite.
The interactive envelope view exposes the exponent, the number of atoms, and the potential amplitude. This is the local mechanism behind many dual regularity statements: taking a pointwise minimum of translated costs inherits regularity from the cost.
Interactive panel. Use the support and curvature controls to see the c-transform as a lower envelope of shifted cost functions.
Proof
The constraint for all is equivalent, for each fixed , to
Since is nonnegative, the largest possible value of is obtained by saturating this pointwise upper bound on the support of . The proof for is identical after exchanging the two marginals.
For the primal formula, disintegrate any feasible plan as . Then
The argmin sets are nonempty and compact, and the measurable maximum theorem provides a Borel selector . The coupling attains equality.
The updates must be sequential:
Each step preserves feasibility and improves the objective. Simultaneously replacing an arbitrary old pair by need not preserve feasibility, because the two best responses were computed against different old coordinates. For example, if and , both transforms equal 1 and their simultaneous update violates the dual constraint. Functions of the form and are called -concave and -concave, respectively.
Proof
For each , set and . Since all functions share the same modulus,
The proof in the first variable is identical.
This stability is crucial for dual attainment. On compact spaces, continuity of already supplies uniform moduli; sequential closure and a harmless additive gauge then give compactness by Arzela--Ascoli.
Euclidean Case¶
The Euclidean quadratic cost is the model case where -transforms become ordinary convex conjugates after removing quadratic terms. This is the algebraic bridge between Kantorovich duality and Brenier maps.
Normalize the quadratic cost as . For any ,
The first two terms depend only on the marginals, so quadratic OT reduces to . For this bilinear cost,
On full Euclidean space, . Hence -closed functions are negatives of lower semicontinuous convex functions, and closure gives the smallest upper semicontinuous concave majorant. On restricted compact domains, the supporting slopes must additionally belong to the opposite domain.
Why Hard Alternating Optimization Stops¶
A crucial property of the Legendre transform is that , while is the lower semicontinuous convex envelope of a proper . Analogous identities explain why exact alternating best responses stop after one cycle for -transforms Rockafellar, 2015.
Proof
The first inequality follows directly from the minus sign. For every ,
Thus , and taking the infimum over proves (ii). The relation is symmetric. To prove (iv), use order reversal with to get . Applying (iii) to gives the reverse inequality.
This invariance shows that exact block maximization reaches a coordinatewise fixed point after one full cycle:
The resulting pair is dual feasible but need not maximize the joint objective, because its value still depends on the arbitrary initial . Entropic regularization replaces hard minima by soft log-sum-exp responses and leads to the nontrivial Sinkhorn scaling iteration.
For on compact intervals, is the smallest concave majorant representable with slopes in the opposite interval. In the displayed example that interval contains every relevant supporting slope, so the restricted closure is the ordinary concave envelope.
In Figure Div, the displayed interval contains all relevant supporting slopes, so this restricted closure agrees with the ordinary concave envelope.

Hard -transforms for the bilinear cost . Dark curves are the double-transform closures and , while dashed lighter curves are the one-sided best responses after a harmless gauge shift. The domains contain the relevant supporting slopes, so these restricted closures coincide with ordinary concave majorants. Exact best responses are useful for certificates but do not give the smooth iterative dynamics of entropic regularization.
The final interactive demo turns this algebra into a visible operation: change the roughness of the starting potential and observe that the hard double transform jumps directly to its concave closure.
Interactive panel. Use the iteration and asymmetry controls to see why alternating c-transforms can stall or fail without the right assumptions.
- Bertsimas, D., & Tsitsiklis, J. N. (1997). Introduction to Linear Optimization. Athena Scientific.
- Villani, C. (2003). Topics in Optimal Transportation (Vol. 58). American Mathematical Society.
- Santambrogio, F. (2015). Optimal Transport for Applied Mathematicians: Calculus of Variations, PDEs, and Modeling. Birkhäuser.
- Rockafellar, R. T. (2015). Convex Analysis. Princeton university press.