Kantorovich duality and the c-transform
Certify an optimal transport value with feasible potentials and construct the best companion potential using the cost transform.
On this page
The question for today
What you’ll understand
- Derive weak duality directly from the marginal constraints.
- Define the c-transform with a consistent sign convention.
- Check complementary slackness and a complete finite primal–dual certificate.
An allocation plan gives an upper bound on the minimum transport cost. A pair of dual potentials gives a lower bound by assigning source and target values whose sum never exceeds the cost of linking those locations. When the bounds agree, optimality is certified without guessing what an optimizer ought to look like. The c-transform builds the largest admissible companion to one potential, making the dual constraints geometric rather than a list of unrelated inequalities.
Integrate a feasible inequality to obtain a lower bound
For a clean strong-duality setting, take compact metric source and target spaces, probability marginals, and a finite continuous cost c. Potentials f and g are feasible if f(x) + g(y) is at most c(x, y) everywhere. Integrating this inequality against any coupling replaces the integral of f(x) by its μ-integral and the integral of g(y) by its ν-integral. Thus every feasible dual objective is at most every feasible primal objective.
Kantorovich duality states that the largest dual value equals the smallest primal value in this setting, and suitable continuous maximizing potentials exist. The weak-duality inequality is elementary; equality of the optima is the substantial theorem. Noncompact spaces and less regular costs admit broader formulations, but their integrability and attainment assumptions must be checked separately. One should not transplant every compact-space conclusion merely because the formal inequality still makes sense.
The c-transform saturates one side of the constraints
For a fixed f, feasibility requires g(y) to be at most c(x, y) − f(x) for every source x. Taking the infimum over x therefore gives the largest admissible g. This is the c-transform fᶜ. Replacing any smaller g by fᶜ cannot reduce the dual objective because ν is a positive measure. With our convention the transform uses an infimum, not the supremum used in the ordinary convex conjugate.
Applying the analogous transform again produces fᶜᶜ, which is at least f and is called a c-concave representative when equality holds. This process improves feasible potentials while preserving the direction of the inequality. In a finite problem, each transformed value is a minimum over a row or column of the cost matrix. Costs, potentials, and transforms must use the same units and any factor of one-half in the quadratic cost must be maintained throughout.
Tight pairs identify where optimal mass can travel
For a feasible plan and feasible dual potentials, the primal–dual gap is the integral of the nonnegative slack c − f − g. If their objective values agree, the slack is zero almost everywhere under the plan. This complementary-slackness condition identifies allowed optimal pairs. A zero-slack pair need not carry positive mass, because marginal constraints still decide how mass can be distributed among all such pairs.
The dual therefore provides both a numerical certificate and a geometric contact set. In the quadratic setting the contact relation will connect transport maps to convex potentials, but duality alone does not guarantee differentiability or graph structure. Numerical approximate potentials require an actual feasibility check before their objective is a valid lower bound. Agreement of two unconstrained solver printouts is not the same as a verified primal–dual certificate.
Work it through
A complete two-by-two certificate
Let source masses be (1/2, 1/2), target masses (3/4, 1/4), and cost matrix [[0, 4], [4, 0]]. Certify the optimal value using one plan and one dual pair.
Choose P = [[1/2, 0], [1/4, 1/4]]. Its row sums and column sums match the required masses. Only the lower-left entry pays positive cost, giving primal value 4 × 1/4 = 1.
Choose source potential f = (0, 4) and target potential g = (0, −4). Their four sums are [[0, −4], [4, 0]], each at most the corresponding cost. The dual is therefore feasible.
Its objective is (1/2)0 + (1/2)4 + (3/4)0 + (1/4)(−4) = 1. Matching the primal value proves both are optimal; every positive plan entry lies at a zero-slack pair.
The optimal cost is 1, certified from both sides. The unused upper-right pair has strictly positive slack and carries no mass.
The living notebook
Explore the model
Interactive lab · function
A quadratic has an inspectable tangent certificate
Pause and Reset, then set coefficient a = 0.5 and position x = 1. Predict f(x) = 0.5 and tangent slope one. Convexity makes this tangent a global lower affine support for the selected quadratic. This illustrates the supporting-inequality logic behind dual certificates, not the c-transform of arbitrary potentials or a transport optimizer. The plotted function is exactly y = ax².
- y at chosen x
- 0.608
- Tangent slope · 2ax
- 1.35
- Signed area · ax³/3
- 0.182
This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forAn optimization certificate is an inequality valid over its entire allowed domain, not merely a matching value at one point.
Pause & reason
Check your understanding
Your turn
Try it yourself
For cost matrix [[0, 2], [3, 1]], compute fᶜ when f = (0, 1), then verify every dual inequality and identify the zero-slack entries.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
For each target column, take the minimum of cost minus the corresponding source potential.
Compare with the solution
The first transformed value is min(0 − 0, 3 − 1) = 0; the second is min(2 − 0, 1 − 1) = 0. Thus g = fᶜ = (0, 0). The potential sums are [[0, 0], [1, 1]], which are bounded by the four costs. Slack is zero at the upper-left and lower-right entries, while the other two slacks are two. This determines a contact set, but whether a plan supported there meets chosen marginals must still be checked separately.
Keep the idea
Take it with you
- Marginal constraints turn feasible potential inequalities into lower bounds.
- The c-transform is the largest feasible companion under the stated infimum convention.
- Matching feasible primal and dual values certifies optimality and forces zero slack on transported mass.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.