Skip to content
AIAI Wranglers

B Convex Analysis

Convexity is one of the most powerful structural assumptions in optimisation. When both the objective and feasible region are convex, local optima are global optima, duality theory provides certificates of optimality, and efficient algorithms exist with provable convergence guarantees. In generative modelling, convex analysis underpins Wasserstein distances (via Kantorovich duality), f-divergences (via Fenchel conjugates), and the ELBO derivation (via Jensen's inequality). This appendix develops the core ideas from first principles, emphasising the results that appear most frequently in the main text.

Convex Sets

The notion of convexity begins with geometry. A region is convex if, intuitively, you can walk in a straight line between any two of its points without ever leaving the region. This simple geometric property has remarkably deep consequences for analysis and optimisation.

Definition 1 (Convex Set).

A set CโІโ„nโก is convex if for every pair of points ๐’™,๐’šโˆˆC and every scalar ฮธโˆˆ[0,1], the point ฮธ๐’™+(1โˆ’ฮธ)๐’š also lies in C. In other words, the line segment connecting any two points of C is entirely contained in C.

Familiar examples abound: the real line โ„โก, any subspace, any halfspace {๐’™:๐šห™๐’™โ‰คb}, and the Euclidean ball {๐’™:โ€–๐’™โ€–โ‰คr} are all convex. The empty set and singleton sets are convex by convention (the defining condition holds vacuously or trivially).

Definition 2 (Convex Combination).

A point ๐’™ is a convex combination of points ๐’™1,โ€ฆ,๐’™k if it can be written as (Combination)๐’™=ฮธ1๐’™1+ฮธ2๐’™2+โ‹ฏ+ฮธk๐’™k, where ฮธiโ‰ฅ0 for all i and ฮธ1+ฮธ2+โ‹ฏ+ฮธk=1.

Convex combinations generalise the two-point definition: a set is convex if and only if it contains all convex combinations of its points. For k=2, we recover the original definition. For k=3, convex combinations sweep out a triangle; for general k, they form a simplex.

Definition 3 (Convex Hull).

The convex hull of a set SโІโ„nโก, denoted convโก(S), is the set of all convex combinations of points in S: (HULL)convโก(S)={โˆ‘i=1kฮธi๐’™i|kโˆˆโ„•,๐’™iโˆˆS,ฮธiโ‰ฅ0,โˆ‘i=1kฮธi=1}. Equivalently, convโก(S) is the smallest convex set containing S: the intersection of all convex sets that contain S.

The equivalence of these two characterisations is instructive. The intersection definition immediately shows that convโก(S) is convex (by Theorem 1 below), while the explicit formula makes it computable. In computational geometry, finding the convex hull of a finite point set is a fundamental problem with O(nlogโกn) algorithms in two dimensions.

Convex vs. non-convex sets. In the convex sets (left, centre), every line segment between interior points remains inside the set. In the L-shaped region (right), the dashed segment between two points of C passes through a region outside C.
The convex hull of eight points in โ„2โก. The extreme points ๐’™1,โ€ฆ,๐’™6 lie on the boundary of convโก{๐’™1,โ€ฆ,๐’™8}, while ๐’™7 and ๐’™8 lie in the interior and can be expressed as convex combinations of the extreme points.

Definition 4 (Affine Function).

A function f:โ„nโกโ†’โ„mโก is affine if f(๐’™)=A๐’™+๐› for some matrix Aโˆˆโ„mร—nโก and vector ๐›โˆˆโ„mโก. An affine function is simultaneously convex and concave.

Theorem 1 (Operations Preserving Convexity).

The following operations preserve convexity of sets:

  1. Intersection. If {Cฮฑ}ฮฑโˆˆ๐’œ is any (possibly infinite) family of convex sets, then โ‹‚ฮฑโˆˆ๐’œCฮฑ is convex.

  2. Affine image. If C is convex and f(๐’™)=A๐’™+๐› is affine, then f(C)={A๐’™+๐›:๐’™โˆˆC} is convex.

  3. Minkowski sum. If A and B are convex, then A+B={๐š+๐›:๐šโˆˆA,๐›โˆˆB} is convex.

Proof.

Part (i). Let ๐’™,๐’šโˆˆโ‹‚ฮฑCฮฑ and ฮธโˆˆ[0,1]. For each ฮฑ, both ๐’™ and ๐’š belong to Cฮฑ, and since Cฮฑ is convex, ฮธ๐’™+(1โˆ’ฮธ)๐’šโˆˆCฮฑ. Since this holds for every ฮฑ, we have ฮธ๐’™+(1โˆ’ฮธ)๐’šโˆˆโ‹‚ฮฑCฮฑ.

Part (ii). Let ๐ฎ,๐ฏโˆˆf(C), so ๐ฎ=A๐’™+๐› and ๐ฏ=A๐’š+๐› for some ๐’™,๐’šโˆˆC. Then ฮธ๐ฎ+(1โˆ’ฮธ)๐ฏ=A(ฮธ๐’™+(1โˆ’ฮธ)๐’š)+๐›. Since C is convex, ฮธ๐’™+(1โˆ’ฮธ)๐’šโˆˆC, so the right-hand side belongs to f(C).

Part (iii). Let ๐ฎ1=๐š1+๐›1 and ๐ฎ2=๐š2+๐›2 with ๐šiโˆˆA, ๐›iโˆˆB. For ฮธโˆˆ[0,1]: ฮธ๐ฎ1+(1โˆ’ฮธ)๐ฎ2=(ฮธ๐š1+(1โˆ’ฮธ)๐š2)โŸโˆˆA+(ฮธ๐›1+(1โˆ’ฮธ)๐›2)โŸโˆˆB, where the two terms lie in A and B respectively by convexity. Hence the sum belongs to A+B.

Key Idea.

In machine learning, many constraint sets are convex: the probability simplex ฮ”kโˆ’1={๐’™โˆˆโ„kโก:xiโ‰ฅ0,โˆ‘ixi=1} (probability vectors), the unit ball {๐’™:โ€–๐’™โ€–โ‰ค1} (weight decay), the cone of positive semidefinite matrices ๐•Š+n (kernel methods), and the Birkhoff polytope of doubly stochastic matrices (optimal transport). Even when the objective is non-convex (as in training neural networks), recognising convex constraint structure enables powerful algorithmic tools such as projected gradient descent and Frankโ€“Wolfe methods.

Convex Functions

Having established the geometry of convex sets, we turn to convex functions, which are the analytic counterpart. The graph of a convex function curves upward (or is flat), so that any secant line lies above the curve. This simple shape constraint leads to a rich theory of inequalities, optimality conditions, and duality.

Definition 5 (Convex Function).

A function f:โ„nโกโ†’โ„โกโˆช{+โˆž} is convex if its effective domain domโก(f)={๐’™:f(๐’™)<+โˆž} is a convex set and, for all ๐’™,๐’šโˆˆdomโก(f) and all ฮธโˆˆ[0,1], (Function DEF)f(ฮธ๐’™+(1โˆ’ฮธ)๐’š)โ‰คฮธf(๐’™)+(1โˆ’ฮธ)f(๐’š). A function f is concave if โˆ’f is convex.

The convention of allowing f to take the value +โˆž is a convenient device: it lets us encode constraints into the objective by setting f(๐’™)=+โˆž for infeasible points, unifying constrained and unconstrained optimisation.

Definition 6 (Strictly Convex).

A function f is strictly convex if the inequality in (Function DEF) is strict whenever ๐’™โ‰ ๐’š and ฮธโˆˆ(0,1). Geometrically, the chord between any two distinct points on the graph lies strictly above the graph (except at the endpoints).

Definition 7 (Strongly Convex).

A function f is ฮผ-strongly convex (with parameter ฮผ>0) if f(๐’™)โˆ’ฮผ2โ€–๐’™โ€–2 is convex. Equivalently, for all ๐’™,๐’šโˆˆdomโก(f), (Strong)f(๐’š)โ‰ฅf(๐’™)+โˆ‡f(๐’™)โŠค(๐’šโˆ’๐’™)+ฮผ2โ€–๐’šโˆ’๐’™โ€–2. Strong convexity means the function grows at least quadratically away from any tangent hyperplane.

Strong convexity is strictly stronger than strict convexity, which is strictly stronger than convexity. The function f(x)=x4 is strictly convex but not strongly convex (its curvature vanishes at the origin). In optimisation, strong convexity is the โ€œgold standardโ€ because it guarantees both uniqueness of the minimiser and linear convergence rates for gradient descent.

Proposition 1 (Unique Minimiser).

If f:โ„nโกโ†’โ„โกโˆช{+โˆž} is ฮผ-strongly convex with ฮผ>0, then f has at most one minimiser.

Proof.

Suppose ๐’™โˆ— and ๐’šโˆ— are both global minimisers, so f(๐’™โˆ—)=f(๐’šโˆ—)=fโˆ—. Applying the strong convexity condition (Strong) with ๐’™=๐’™โˆ— and ๐’š=๐’šโˆ—: f(๐’šโˆ—)โ‰ฅf(๐’™โˆ—)+โˆ‡f(๐’™โˆ—)โŠค(๐’šโˆ—โˆ’๐’™โˆ—)+ฮผ2โ€–๐’šโˆ—โˆ’๐’™โˆ—โ€–2. Since ๐’™โˆ— is a minimiser, the first-order optimality condition gives โˆ‡f(๐’™โˆ—)โŠค(๐’šโˆ—โˆ’๐’™โˆ—)โ‰ฅ0 (or, if f is unconstrained, โˆ‡f(๐’™โˆ—)=๐ŸŽ). Either way, fโˆ—โ‰ฅfโˆ—+ฮผ2โ€–๐’šโˆ—โˆ’๐’™โˆ—โ€–2, which forces โ€–๐’šโˆ—โˆ’๐’™โˆ—โ€–2โ‰ค0, hence ๐’™โˆ—=๐’šโˆ—.

Jensen's inequality visualised. For a convex function f, the value at a convex combination ฮธ๐’™+(1โˆ’ฮธ)๐’š lies below the secant line connecting (x,f(๐’™)) and (๐’š,f(๐’š)). The shaded region represents the โ€œJensen gap.โ€

Theorem 2 (Jensen's Inequality).

Let f be a convex function and let X be a random variable taking values in domโก(f) with ๐”ผ[X]โˆˆdomโก(f). Then (Jensen)f(๐”ผ[X])โ‰ค๐”ผ[f(X)]. If f is concave, the inequality reverses: f(๐”ผ[X])โ‰ฅ๐”ผ[f(X)].

Proof.

We proceed by induction on the number of mass points, then extend by a limiting argument.

Base case (k=2). If X takes values ๐’™1,๐’™2 with probabilities ฮธ,1โˆ’ฮธ, then ๐”ผ[X]=ฮธ๐’™1+(1โˆ’ฮธ)๐’™2 and ๐”ผ[f(X)]=ฮธf(๐’™1)+(1โˆ’ฮธ)f(๐’™2). The inequality f(๐”ผ[X])โ‰ค๐”ผ[f(X)] is precisely the definition of convexity.

Inductive step. Suppose the result holds for kโˆ’1 points. Let X take values ๐’™1,โ€ฆ,๐’™k with probabilities ฮธ1,โ€ฆ,ฮธk. Without loss of generality, ฮธ1<1 (otherwise the result is trivial). Write ๐”ผ[X]=ฮธ1๐’™1+(1โˆ’ฮธ1)โˆ‘i=2kฮธi1โˆ’ฮธ1๐’™iโŸ=๐’™โ€พ. By convexity of f, f(๐”ผ[X])โ‰คฮธ1f(๐’™1)+(1โˆ’ฮธ1)f(๐’™โ€พ). The point ๐’™โ€พ is the expectation of a random variable supported on kโˆ’1 points with probabilities ฮธi/(1โˆ’ฮธ1). By the inductive hypothesis, f(๐’™โ€พ)โ‰คโˆ‘i=2kฮธi1โˆ’ฮธ1f(๐’™i). Substituting: f(๐”ผ[X])โ‰คฮธ1f(๐’™1)+(1โˆ’ฮธ1)โˆ‘i=2kฮธi1โˆ’ฮธ1f(๐’™i)=โˆ‘i=1kฮธif(๐’™i)=๐”ผ[f(X)].

Extension to continuous distributions. For a general random variable X with density, approximate X by discrete random variables Xn (e.g., by quantisation) and pass to the limit using the dominated convergence theorem and lower semicontinuity of f.

Historical Note.

Jensen's inequality is named after Johan Jensen, who published it in 1906, although the result for finite sums was known earlier. Jensen was a Danish mathematician and engineer who worked for the Copenhagen Telephone Company. His inequality has become one of the most widely used tools in probability, information theory, and statistical physics.

Key Idea.

Jensen's inequality is arguably the single most important inequality in variational inference. The entire evidence lower bound (ELBO) rests on applying Jensen to the concave logarithm: logโก๐”ผq[p(๐’™,๐’›)q(๐’›)]โ‰ฅ๐”ผq[logโกp(๐’™,๐’›)q(๐’›)]. Every VAE, every diffusion model's variational bound, and every EM algorithm traces back to this one application of convexity. Understanding when the inequality is tight (when p(๐’™,๐’›)/q(๐’›) is almost surely constant, i.e., when q closely matches the true posterior) guides the design of better approximate posteriors.

Theorem 3 (First-Order Condition).

Let f:โ„nโกโ†’โ„โก be differentiable on an open convex domain. Then f is convex if and only if for all ๐’™,๐’šโˆˆdomโก(f), (First Order)f(๐’š)โ‰ฅf(๐’™)+โˆ‡f(๐’™)โŠค(๐’šโˆ’๐’™). Geometrically, the tangent hyperplane at any point is a global underestimator of the function.

Proof.

(โŸน) Assume f is convex. For any ฮธโˆˆ(0,1], convexity gives f(๐’™+ฮธ(๐’šโˆ’๐’™))โ‰ค(1โˆ’ฮธ)f(๐’™)+ฮธf(๐’š), which we rearrange to f(๐’š)โ‰ฅf(๐’™)+f(๐’™+ฮธ(๐’šโˆ’๐’™))โˆ’f(๐’™)ฮธ. Taking ฮธโ†’0+, the right-hand side converges to f(๐’™)+โˆ‡f(๐’™)โŠค(๐’šโˆ’๐’™) by the definition of the gradient.

(โŸธ) Assume (First Order) holds. Fix ๐’™,๐’šโˆˆdomโก(f) and ฮธโˆˆ[0,1], and let ๐’›=ฮธ๐’™+(1โˆ’ฮธ)๐’š. Apply the first-order condition at ๐’› in two directions: f(๐’™)โ‰ฅf(๐’›)+โˆ‡f(๐’›)โŠค(๐’™โˆ’๐’›),f(๐’š)โ‰ฅf(๐’›)+โˆ‡f(๐’›)โŠค(๐’šโˆ’๐’›). Multiply the first inequality by ฮธ and the second by 1โˆ’ฮธ, then add: ฮธf(๐’™)+(1โˆ’ฮธ)f(๐’š)โ‰ฅf(๐’›)+โˆ‡f(๐’›)โŠค(ฮธ(๐’™โˆ’๐’›)+(1โˆ’ฮธ)(๐’šโˆ’๐’›)). The second term vanishes because ฮธ(๐’™โˆ’๐’›)+(1โˆ’ฮธ)(๐’šโˆ’๐’›)=ฮธ๐’™+(1โˆ’ฮธ)๐’šโˆ’๐’›=๐ŸŽ. Therefore ฮธf(๐’™)+(1โˆ’ฮธ)f(๐’š)โ‰ฅf(๐’›), which is precisely convexity.

The first-order condition for convexity. The tangent line (or hyperplane) at any point ๐’™0 lies entirely below the graph of a convex function f. The vertical gap f(๐’š)โˆ’[f(๐’™0)+โˆ‡f(๐’™0)โŠค(๐’šโˆ’๐’™0)] is non-negative for all ๐’š.

Theorem 4 (Second-Order Condition).

Let f:โ„nโกโ†’โ„โก be twice continuously differentiable on an open convex domain. Then:

  1. f is convex if and only if the Hessian is positive semidefinite everywhere: โˆ‡2f(๐’™)โชฐ0 for all ๐’™โˆˆdomโก(f).

  2. f is ฮผ-strongly convex if and only if โˆ‡2f(๐’™)โชฐฮผI for all ๐’™โˆˆdomโก(f).

Proof.

We prove part (i); part (ii) follows by applying (i) to g(๐’™)=f(๐’™)โˆ’ฮผ2โ€–๐’™โ€–2.

(โŸน) Suppose f is convex. Fix ๐’™ and any direction ๐ฏโˆˆโ„nโก. The univariate function g(t)=f(๐’™+t๐ฏ) is convex in t (as the composition of f with an affine map). A convex function of one variable has non-negative second derivative wherever it exists, so gโ€ฒโ€ฒ(0)=๐ฏโŠคโˆ‡2f(๐’™)๐ฏโ‰ฅ0. Since ๐ฏ is arbitrary, โˆ‡2f(๐’™)โชฐ0.

(โŸธ) Suppose โˆ‡2f(๐’™)โชฐ0 for all ๐’™. By Taylor's theorem with integral remainder, for any ๐’™,๐’š: f(๐’š)=f(๐’™)+โˆ‡f(๐’™)โŠค(๐’šโˆ’๐’™)+12(๐’šโˆ’๐’™)โŠคโˆ‡2f(๐’›)(๐’šโˆ’๐’™) for some ๐’› on the line segment between ๐’™ and ๐’š. Since โˆ‡2f(๐’›)โชฐ0, the last term is non-negative, giving f(๐’š)โ‰ฅf(๐’™)+โˆ‡f(๐’™)โŠค(๐’šโˆ’๐’™), which is the first-order condition for convexity.

Theorem 5 (Operations Preserving Convexity of Functions).

The following operations preserve convexity of functions:

  1. Non-negative weighted sum. If f1,โ€ฆ,fm are convex and ฮฑ1,โ€ฆ,ฮฑmโ‰ฅ0, then โˆ‘i=1mฮฑifi is convex.

  2. Pointwise maximum. If {fi}iโˆˆโ„ is any family of convex functions, then g(๐’™)=supiโˆˆโ„โกfi(๐’™) is convex.

  3. Composition with affine mapping. If f is convex, then g(๐’™)=f(A๐’™+๐›) is convex for any matrix A and vector ๐›.

Proof.

Part (i). For ฮธโˆˆ[0,1]: โˆ‘iฮฑifi(ฮธ๐’™+(1โˆ’ฮธ)๐’š)โ‰คโˆ‘iฮฑi[ฮธfi(๐’™)+(1โˆ’ฮธ)fi(๐’š)]=ฮธโˆ‘iฮฑifi(๐’™)+(1โˆ’ฮธ)โˆ‘iฮฑifi(๐’š), where the inequality uses convexity of each fi and non-negativity of each ฮฑi.

Part (ii). For ฮธโˆˆ[0,1] and each i: fi(ฮธ๐’™+(1โˆ’ฮธ)๐’š)โ‰คฮธfi(๐’™)+(1โˆ’ฮธ)fi(๐’š)โ‰คฮธg(๐’™)+(1โˆ’ฮธ)g(๐’š). Taking the supremum over i on the left gives g(ฮธ๐’™+(1โˆ’ฮธ)๐’š)โ‰คฮธg(๐’™)+(1โˆ’ฮธ)g(๐’š).

Part (iii) follows directly from the definition, since the composition ๐’™โ†ฆA๐’™+๐› is affine and preserves convex combinations.

Example 1 (Important Convex Functions).

The following functions arise frequently in machine learning and generative modelling:

  • Quadratic: f(x)=x2 (and more generally f(๐’™)=๐’™โŠคA๐’™ for Aโชฐ0).

  • Exponential: f(x)=ex (convex on โ„โก; used in log-sum-exp).

  • Negative logarithm: f(x)=โˆ’logโกx on โ„++โก (the key function behind the ELBO).

  • Norms: f(๐’™)=โ€–๐’™โ€–p for pโ‰ฅ1, including the โ„“1-norm (sparsity) and โ„“2-norm (weight decay).

  • Max: f(๐’™)=maxโก(x1,โ€ฆ,xn) (convex as a pointwise maximum of linear functions).

  • Log-sum-exp: f(๐’™)=logโก(โˆ‘i=1nexi) (the smooth approximation to maxโก; convex by Theorem 5(ii) and a limiting argument).

Subgradients

Not all convex functions are differentiable. Consider f(x)=|x| at the origin, or f(x)=maxโก(0,x), the ReLU activation that has become ubiquitous in deep learning. At the โ€œkinkโ€ of these functions, no single tangent line exists. Yet the geometry of convexity still provides useful linear underestimators. The theory of subgradients extends calculus to non-smooth convex functions, providing the foundation for optimisation algorithms that handle non-differentiable objectives.

Definition 8 (Subgradient).

A vector ๐ โˆˆโ„nโก is a subgradient of a convex function f at a point ๐’™โˆˆdomโก(f) if (Subgradient)f(๐’š)โ‰ฅf(๐’™)+๐ โŠค(๐’šโˆ’๐’™)forย allย ๐’šโˆˆdomโก(f). Geometrically, ๐  defines a supporting hyperplane to the epigraph of f at the point (๐’™,f(๐’™)): the affine function ๐’šโ†ฆf(๐’™)+๐ โŠค(๐’šโˆ’๐’™) is a global underestimator of f.

Comparing with Theorem 3, we see that at a differentiable point, the gradient โˆ‡f(๐’™) is the unique subgradient. At non-differentiable points, there may be many subgradients, each defining a different supporting hyperplane.

Definition 9 (Subdifferential).

The subdifferential of f at ๐’™, denoted โˆ‚f(๐’™), is the set of all subgradients of f at ๐’™: (Subdifferential)โˆ‚f(๐’™)={๐ โˆˆโ„nโก:f(๐’š)โ‰ฅf(๐’™)+๐ โŠค(๐’šโˆ’๐’™)forย allย ๐’š}. When f is differentiable at ๐’™, the subdifferential reduces to a singleton: โˆ‚f(๐’™)={โˆ‡f(๐’™)}.

Subgradients of f(x)=|x|. At the kink x=0, any line with slope in [โˆ’1,1] lies below the graph, so โˆ‚f(0)=[โˆ’1,1] (three such lines are shown in red). At the smooth point x=2, the unique tangent line has slope +1, giving โˆ‚f(2)={1}.

Theorem 6 (Existence of Subgradients).

Let f:โ„nโกโ†’โ„โกโˆช{+โˆž} be convex. Then at every point ๐’™ in the interior of domโก(f), the subdifferential โˆ‚f(๐’™) is nonempty, closed, convex, and compact.

The proof relies on the supporting hyperplane theorem (a consequence of the Hahnโ€“Banach theorem in functional analysis) and is omitted here. The key practical message is that convex functions always admit subgradients at interior points, which guarantees that subgradient-based optimisation methods are always well-defined.

Example 2 (Subdifferentials of Common Functions).

  1. Absolute value, f(x)=|x|: โˆ‚f(x)={{โˆ’1}ifย x<0,[โˆ’1,1]ifย x=0,{+1}ifย x>0.

  2. ReLU, f(x)=maxโก(0,x): โˆ‚f(x)={{0}ifย x<0,[0,1]ifย x=0,{1}ifย x>0.

  3. Pointwise maximum, f(๐’™)=maxโก(f1(๐’™),โ€ฆ,fk(๐’™)) where each fi is convex and differentiable: โˆ‚f(๐’™)=convโก{โˆ‡fi(๐’™):fi(๐’™)=f(๐’™)}, the convex hull of the gradients of the โ€œactiveโ€ functions (those achieving the maximum).

Theorem 7 (Subgradient Optimality Condition).

Let f:โ„nโกโ†’โ„โกโˆช{+โˆž} be convex. A point ๐’™โˆ— is a global minimiser of f if and only if ๐ŸŽโˆˆโˆ‚f(๐’™โˆ—).

Proof.

(โŸน) Suppose ๐’™โˆ— minimises f, so f(๐’š)โ‰ฅf(๐’™โˆ—) for all ๐’š. This can be rewritten as f(๐’š)โ‰ฅf(๐’™โˆ—)+๐ŸŽโŠค(๐’šโˆ’๐’™โˆ—), which shows that ๐ŸŽ is a subgradient of f at ๐’™โˆ—.

(โŸธ) Suppose ๐ŸŽโˆˆโˆ‚f(๐’™โˆ—). By definition of the subgradient, f(๐’š)โ‰ฅf(๐’™โˆ—)+๐ŸŽโŠค(๐’šโˆ’๐’™โˆ—)=f(๐’™โˆ—) for all ๐’š, so ๐’™โˆ— is a global minimiser.

Remark 1 (Elegance of the Subgradient Condition).

The subgradient optimality condition is striking in its simplicity: checking global optimality of a convex function reduces to checking membership of the zero vector in a set. For smooth functions, this recovers the familiar โˆ‡f(๐’™โˆ—)=๐ŸŽ; for non-smooth functions, it provides a complete characterisation that no gradient-based condition can.

Key Idea.

Subgradients explain why non-smooth activations like ReLU work in deep learning. Although the gradient of maxโก(0,x) is undefined at x=0, the subdifferential [0,1] provides valid descent directions. In practice, automatic differentiation libraries choose an arbitrary element of the subdifferential (typically 0) at the non-differentiable point, and this works well because the set of inputs that land exactly at a kink has Lebesgue measure zero during training. The theory of Clarke subdifferentials extends these ideas to non-convex functions, providing the theoretical foundation for training deep networks with ReLU, leaky ReLU, and other piecewise-linear activations.

Epigraphs and Sublevel Sets

The epigraph provides a bridge between convex functions and convex sets, allowing us to translate questions about function convexity into questions about set convexity. This perspective is both theoretically elegant and practically powerful: operations that are natural for sets (intersection, projection) correspond to useful operations on functions (pointwise maximum, infimal convolution).

Definition 10 (Epigraph).

The epigraph of a function f:โ„nโกโ†’โ„โกโˆช{+โˆž} is the subset of โ„n+1โก defined by (Epigraph)epiโก(f)={(๐’™,t)โˆˆโ„n+1โก:f(๐’™)โ‰คt}. In words, epiโก(f) is the region โ€œon and aboveโ€ the graph of f. The name comes from the Greek epi (above).

The epigraph of a convex function f. The shaded region above (and including) the graph of f is epiโก(f). The point (๐’™0,t0) with t0>f(๐’™0) lies inside the epigraph, while (๐’™1,t1) with t1<f(๐’™1) lies outside.

Theorem 8 (Epigraph Characterisation of Convexity).

A function f:โ„nโกโ†’โ„โกโˆช{+โˆž} is convex if and only if epiโก(f) is a convex subset of โ„n+1โก.

Proof.

(โŸน) Suppose f is convex. Let (๐’™1,t1),(๐’™2,t2)โˆˆepiโก(f), so f(๐’™1)โ‰คt1 and f(๐’™2)โ‰คt2. For ฮธโˆˆ[0,1]: f(ฮธ๐’™1+(1โˆ’ฮธ)๐’™2)โ‰คฮธf(๐’™1)+(1โˆ’ฮธ)f(๐’™2)โ‰คฮธt1+(1โˆ’ฮธ)t2, where the first inequality uses convexity of f and the second uses f(๐’™i)โ‰คti. Hence (ฮธ๐’™1+(1โˆ’ฮธ)๐’™2,ฮธt1+(1โˆ’ฮธ)t2)โˆˆepiโก(f), proving that epiโก(f) is convex.

(โŸธ) Suppose epiโก(f) is convex. For any ๐’™1,๐’™2โˆˆdomโก(f), the points (๐’™1,f(๐’™1)) and (๐’™2,f(๐’™2)) lie in epiโก(f). By convexity of epiโก(f), for ฮธโˆˆ[0,1]: (ฮธ๐’™1+(1โˆ’ฮธ)๐’™2,ฮธf(๐’™1)+(1โˆ’ฮธ)f(๐’™2))โˆˆepiโก(f). By the definition of the epigraph, this means f(ฮธ๐’™1+(1โˆ’ฮธ)๐’™2)โ‰คฮธf(๐’™1)+(1โˆ’ฮธ)f(๐’™2), which is convexity of f.

The epigraph characterisation is more than a theoretical curiosity. It allows us to prove convexity of complicated functions by showing that their epigraphs can be expressed as intersections of halfspaces (which are convex sets by Theorem 1). This technique is particularly useful for functions defined implicitly as optima of parameterised families.

Definition 11 (Sublevel Set).

For a function f:โ„nโกโ†’โ„โกโˆช{+โˆž} and a scalar ฮฑโˆˆโ„โก, the ฮฑ-sublevel set of f is (Sublevel)Sฮฑ={๐’™โˆˆdomโก(f):f(๐’™)โ‰คฮฑ}.

Sublevel sets are the horizontal โ€œslicesโ€ of the epigraph. For the function f(๐’™)=โ€–๐’™โ€–2, the sublevel sets are Euclidean balls {๐’™:โ€–๐’™โ€–2โ‰คฮฑ}. For f(๐’™)=maxiโก|xi|, they are โ„“โˆž-balls.

Theorem 9 (Sublevel Sets of Convex Functions).

If f:โ„nโกโ†’โ„โกโˆช{+โˆž} is convex, then every sublevel set Sฮฑ is convex. The converse is false: a function can have all sublevel sets convex without being convex.

Proof.

Suppose f is convex and let ๐’™,๐’šโˆˆSฮฑ, so f(๐’™)โ‰คฮฑ and f(๐’š)โ‰คฮฑ. For ฮธโˆˆ[0,1]: f(ฮธ๐’™+(1โˆ’ฮธ)๐’š)โ‰คฮธf(๐’™)+(1โˆ’ฮธ)f(๐’š)โ‰คฮธฮฑ+(1โˆ’ฮธ)ฮฑ=ฮฑ. Hence ฮธ๐’™+(1โˆ’ฮธ)๐’šโˆˆSฮฑ, proving Sฮฑ is convex.

Remark 2 (Converse Fails).

Consider the function f(x)=โˆ’eโˆ’x2 on โ„โก. Each sublevel set Sฮฑ={x:โˆ’eโˆ’x2โ‰คฮฑ} is either empty (if ฮฑ<โˆ’1), all of โ„โก (if ฮฑโ‰ฅ0), or a symmetric interval [โˆ’c,c] for some c>0 (if โˆ’1โ‰คฮฑ<0). In every case, the sublevel set is convex (an interval). However, f is not convex: it has a local maximum at x=0 and is concave near the origin. Functions whose sublevel sets are all convex are called quasiconvex. Quasiconvexity is a strictly weaker condition than convexity, though it still permits useful optimisation theory; in particular, quasiconvex functions on compact convex sets attain their maxima at extreme points, a fact used in some game-theoretic formulations of generative adversarial networks.

Conjugate Functions and Fenchel Duality

The Fenchel conjugate (also called the convex conjugate or the Legendreโ€“Fenchel transform) is one of the most elegant constructions in convex analysis. It provides a systematic way to convert between primal and dual representations of convex functions, and it is the mathematical engine behind variational representations of divergences in generative modelling. In the next few pages we develop the theory from its definition through the biconjugate theorem and into the concrete conjugate computations that arise in the f-GAN framework.

Definition 12 (Convex Conjugate).

Let f:โ„nโกโ†’โ„โกโˆช{+โˆž}. The Fenchel conjugate (or convex conjugate) of f is the function fโˆ—:โ„nโกโ†’โ„โกโˆช{+โˆž} defined by (Conjugate DEF)fโˆ—(๐’š)=sup๐’™โˆˆdomโกfโก{๐’šโŠค๐’™โˆ’f(๐’™)}. The domain of fโˆ— consists of those ๐’š for which the supremum is finite.

Geometrically, fโˆ—(๐’š) measures the largest vertical gap between the linear function ๐’™โ†ฆ๐’šโŠค๐’™ and the graph of f. When f is smooth and strictly convex, the supremum is attained at the unique point ๐’™โˆ— where โˆ‡f(๐’™โˆ—)=๐’š, and the conjugate equals fโˆ—(๐’š)=๐’šโŠค๐’™โˆ—โˆ’f(๐’™โˆ—), the y-intercept of the tangent line with slope ๐’š. fig:convex:conjugate-geom illustrates this construction.

Geometric interpretation of the Fenchel conjugate. For a given slope ๐’š (dashed orange line xโ†ฆyx), the conjugate fโˆ—(๐’š) is the maximum vertical gap (red) between the line and the convex function f (blue). The gap is attained at ๐’™โˆ— where the tangent to f has slope ๐’š.

Theorem 10 (Conjugate is Always Convex).

For any function f:โ„nโกโ†’โ„โกโˆช{+โˆž} (not necessarily convex), the conjugate fโˆ— is convex and closed (lower semicontinuous).

Proof.

For each fixed ๐’™, the map ๐’šโ†ฆ๐’šโŠค๐’™โˆ’f(๐’™) is an affine function of ๐’š. The conjugate fโˆ—(๐’š)=sup๐’™โก{๐’šโŠค๐’™โˆ’f(๐’™)} is a pointwise supremum of this family of affine functions. A supremum of convex (in particular, affine) functions is convex (the epigraph of the supremum is the intersection of the individual epigraphs, which are half-spaces, hence convex). Furthermore, each ๐’šโ†ฆ๐’šโŠค๐’™โˆ’f(๐’™) is continuous and therefore closed; the supremum of closed functions is closed.

Theorem 11 (Fenchel's Inequality).

For any function f and all ๐’™,๐’šโˆˆโ„nโก, (Fenchel INEQ)f(๐’™)+fโˆ—(๐’š)โ‰ฅ๐’šโŠค๐’™.

Proof.

By definition, fโˆ—(๐’š)=sup๐’›โก{๐’šโŠค๐’›โˆ’f(๐’›)}โ‰ฅ๐’šโŠค๐’™โˆ’f(๐’™). Rearranging gives f(๐’™)+fโˆ—(๐’š)โ‰ฅ๐’šโŠค๐’™.

Theorem 12 (Fenchelโ€“Moreau Biconjugate Theorem).

If f:โ„nโกโ†’โ„โกโˆช{+โˆž} is closed (lower semicontinuous) and convex, then fโˆ—โˆ—=f. That is, the conjugate of the conjugate recovers the original function.

Proof.

We show both directions.

(fโˆ—โˆ—โ‰คf). By Theorem 11 applied with fโˆ— in place of f, for every ๐’™,๐’š we have fโˆ—(๐’š)+fโˆ—โˆ—(๐’™)โ‰ฅ๐’šโŠค๐’™, hence fโˆ—โˆ—(๐’™)โ‰ฅ๐’šโŠค๐’™โˆ’fโˆ—(๐’š) for all ๐’š. Taking the supremum over ๐’š gives fโˆ—โˆ—(๐’™)โ‰ฅfโˆ—โˆ—(๐’™), but more directly, applying the original Fenchel inequality to f gives fโˆ—(๐’š)โ‰ฅ๐’šโŠค๐’™โˆ’f(๐’™), so f(๐’™)โ‰ฅ๐’šโŠค๐’™โˆ’fโˆ—(๐’š) for every ๐’š. Since fโˆ—โˆ—(๐’™)=sup๐’šโก{๐’šโŠค๐’™โˆ’fโˆ—(๐’š)}, we obtain fโˆ—โˆ—(๐’™)โ‰คf(๐’™).

(fโˆ—โˆ—โ‰ฅf). Because f is closed and convex, it is the pointwise supremum of all affine functions that it dominates: for every ๐’™, f(๐’™)=supโก{aโŠค๐’™+b:aโŠค๐’›+bโ‰คf(๐’›)โˆ€๐’›}. Each such affine minorant ๐’›โ†ฆaโŠค๐’›+b satisfies bโ‰คf(๐’›)โˆ’aโŠค๐’› for all ๐’›, hence bโ‰คโˆ’fโˆ—(a). Therefore aโŠค๐’™+bโ‰คaโŠค๐’™โˆ’fโˆ—(a)โ‰คfโˆ—โˆ—(๐’™). Taking the supremum over all such (a,b) yields f(๐’™)โ‰คfโˆ—โˆ—(๐’™).

Theorem 13 (Fenchelโ€“Young Equality).

Let f:โ„nโกโ†’โ„โกโˆช{+โˆž} be a closed convex function. Then (Fenchel Young)f(๐’™)+fโˆ—(๐’š)=๐’šโŠค๐’™โŸบ๐’šโˆˆโˆ‚f(๐’™)โŸบ๐’™โˆˆโˆ‚fโˆ—(๐’š), where โˆ‚f(๐’™) denotes the subdifferential of f at ๐’™.

This elegant result says that Fenchel's inequality becomes an equality precisely at conjugate pairs (๐’™,๐’š) linked by the subgradient relation. In the smooth case it reduces to ๐’š=โˆ‡f(๐’™).

We now work through several conjugate computations that arise repeatedly in generative modelling.

Example 3 (Conjugate of a Quadratic).

Let f(๐’™)=12๐’™โŠคQ๐’™ where Qโ‰ป0. Setting the gradient of ๐’šโŠค๐’™โˆ’12๐’™โŠคQ๐’™ to zero gives ๐’šโˆ’Q๐’™=0, so ๐’™โˆ—=Qโˆ’1๐’š. Substituting back, (CONJ QUAD)fโˆ—(๐’š)=๐’šโŠคQโˆ’1๐’šโˆ’12๐’šโŠคQโˆ’1QQโˆ’1๐’š=12๐’šโŠคQโˆ’1๐’š. The conjugate of a quadratic defined by Q is a quadratic defined by Qโˆ’1. This is the matrix generalization of the scalar identity (ax2/2)โˆ—=y2/(2a).

Example 4 (Conjugate of a Norm).

Let f(๐’™)=โ€–๐’™โ€– for any norm โ€–โ‹…โ€–. Then (CONJ NORM)fโˆ—(๐’š)=sup๐’™โก{๐’šโŠค๐’™โˆ’โ€–๐’™โ€–}={0ifย โ€–๐’šโ€–โˆ—โ‰ค1,+โˆžotherwise, where โ€–โ‹…โ€–โˆ— is the dual norm. To see this, note that if โ€–๐’šโ€–โˆ—โ‰ค1 then ๐’šโŠค๐’™โ‰คโ€–๐’šโ€–โˆ—โ€–๐’™โ€–โ‰คโ€–๐’™โ€–, so the supremum is at most 0 (achieved at ๐’™=0). If โ€–๐’šโ€–โˆ—>1, choose ๐’™=t๐’™^ where ๐’šโŠค๐’™^/โ€–๐’™^โ€–=โ€–๐’šโ€–โˆ—>1 and send tโ†’โˆž to get +โˆž. Hence fโˆ— is the indicator function of the unit dual-norm ball.

Example 5 (Conjugate of Negative Entropy).

Let f(x)=xlogโกx for x>0 (with f(0)=0). Then ddx(yxโˆ’xlogโกx)=yโˆ’logโกxโˆ’1=0 gives xโˆ—=eyโˆ’1. Substituting: (CONJ Entropy)fโˆ—(y)=yeyโˆ’1โˆ’eyโˆ’1logโก(eyโˆ’1)=yeyโˆ’1โˆ’eyโˆ’1(yโˆ’1)=eyโˆ’1. This conjugate pair is central to the KL-divergence variational formula.

Example 6 (Conjugate of an Indicator Function).

Let CโІโ„nโก be a nonempty closed convex set and let ฮนC(๐’™) be its indicator function (0 on C, +โˆž outside). Then (CONJ Indicator)ฮนCโˆ—(๐’š)=sup๐’™โˆˆCโก๐’šโŠค๐’™=:ฯƒC(๐’š), the support function of C. The support function encodes the geometry of C: it gives the signed distance from the origin to the supporting hyperplane with outward normal ๐’š.

Example 7 (Log-Sum-Exp).

The function f(๐’™)=logโก(โˆ‘i=1nexi) is convex as a smooth approximation of maxiโกxi. Its conjugate is (CONJ Logsumexp)fโˆ—(๐’š)={โˆ‘i=1nyilogโกyiifย ๐’šโ‰ฅ0,โˆ‘iyi=1,+โˆžotherwise, the negative entropy restricted to the probability simplex. This duality between log-sum-exp and entropy is fundamental: it underlies the connection between softmax classifiers and maximum-entropy distributions.

Key Idea.

Fenchel conjugates are the mathematical engine behind the f-GAN framework. Every f-divergence Df(Pโ€–Q) has a variational (dual) representation Df(Pโ€–Q)=supTโก{๐”ผP[T(๐’™)]โˆ’๐”ผQ[fโˆ—(T(๐’™))]}, which turns divergence estimation into an optimisation over a critic/discriminator network T, with fโˆ— serving as the โ€œactivation functionโ€ applied to the critic's output. Different choices of f (and hence fโˆ—) recover different GAN variants: the original GAN uses f(u)=ulogโกuโˆ’(u+1)logโกu+12, the KL-GAN uses f(u)=ulogโกu, and the reverse-KL GAN uses f(u)=โˆ’logโกu.

Historical Note.

The Legendre transform was introduced by Adrien-Marie Legendre in the 18th century to convert between the Lagrangian and Hamiltonian formulations of classical mechanics. Werner Fenchel generalised it to arbitrary convex functions in the 1940s, removing the smoothness and strict-convexity assumptions that Legendre's version required. R. Tyrrell Rockafellar developed the full theory in his landmark 1970 monograph Convex Analysis, which remains the definitive reference. The application to divergences and generative models came much later, with Nguyen, Wainwright, and Jordan (2010) establishing the variational representation of f-divergences that would inspire the f-GAN framework of Nowozin, Cseke, and Tomioka (2016).

Lagrangian Duality

Many optimisation problems in machine learning are naturally constrained: the discriminator in a Wasserstein GAN must be 1-Lipschitz, the coupling in optimal transport must have prescribed marginals, and probability vectors must sum to one. Lagrangian duality provides a systematic way to handle constraints by introducing dual variables (Lagrange multipliers) that put a โ€œpriceโ€ on constraint violations. This section develops the theory from the Lagrangian through weak duality, Slater's condition, and strong duality, culminating in the inf-sup swap theorem that underpins the Kantorovichโ€“Rubinstein duality used in WGANs.

Consider the standard-form optimisation problem: (Standard FORM)minimisef0(๐’™)subjectย tofi(๐’™)โ‰ค0,i=1,โ€ฆ,m,hj(๐’™)=0,j=1,โ€ฆ,p, where the domain ๐’Ÿ=domโกf0โˆฉโ‹‚idomโกfiโˆฉโ‹‚jdomโกhj is nonempty. We denote the optimal primal value by pโˆ—.

Definition 13 (Lagrangian).

The Lagrangian L:โ„nโกร—โ„mโกร—โ„pโกโ†’โ„โก associated with problem is (Lagrangian)L(๐’™,ฮป,ฮฝ)=f0(๐’™)+โˆ‘i=1mฮปifi(๐’™)+โˆ‘j=1pฮฝjhj(๐’™), where the Lagrange multipliers ฮปiโ‰ฅ0 are the inequality dual variables and ฮฝjโˆˆโ„โก are the equality dual variables. The vectors ฮปโˆˆโ„mโก and ฮฝโˆˆโ„pโก are collectively called the dual variables.

The Lagrangian can be interpreted as a โ€œsoftโ€ version of the constrained objective: instead of forbidding constraint violations outright, it charges a per-unit penalty ฮปi for violating the i-th inequality constraint. Making ฮปi large forces the solution toward feasibility.

Definition 14 (Lagrange Dual Function).

The Lagrange dual function g:โ„mโกร—โ„pโกโ†’โ„โกโˆช{โˆ’โˆž} is (DUAL FUNC)g(ฮป,ฮฝ)=inf๐’™โˆˆ๐’ŸโกL(๐’™,ฮป,ฮฝ)=inf๐’™โˆˆ๐’Ÿโก(f0(๐’™)+โˆ‘i=1mฮปifi(๐’™)+โˆ‘j=1pฮฝjhj(๐’™)). The dual function is always concave, regardless of whether the primal problem is convex, because it is a pointwise infimum of affine functions of (ฮป,ฮฝ).

Theorem 14 (Weak Duality).

For any ฮปโ‰ฅ0 and any ฮฝ, (WEAK Duality)g(ฮป,ฮฝ)โ‰คpโˆ—. That is, the dual function provides a lower bound on the optimal primal value.

Proof.

Let ๐’™~ be any feasible point: fi(๐’™~)โ‰ค0 and hj(๐’™~)=0. Since ฮปiโ‰ฅ0 and fi(๐’™~)โ‰ค0, every term ฮปifi(๐’™~)โ‰ค0. Therefore L(๐’™~,ฮป,ฮฝ)=f0(๐’™~)+โˆ‘iฮปifi(๐’™~)+โˆ‘jฮฝjhj(๐’™~)โŸ=0โ‰คf0(๐’™~). Taking the infimum over all ๐’™โˆˆ๐’Ÿ: g(ฮป,ฮฝ)=inf๐’™โกL(๐’™,ฮป,ฮฝ)โ‰คL(๐’™~,ฮป,ฮฝ)โ‰คf0(๐’™~). Since this holds for every feasible ๐’™~, we obtain g(ฮป,ฮฝ)โ‰คinffeasibleย ๐’™~โกf0(๐’™~)=pโˆ—.

Definition 15 (Duality Gap).

The Lagrange dual problem is dโˆ—=supฮปโ‰ฅ0,ฮฝโกg(ฮป,ฮฝ). The duality gap is pโˆ—โˆ’dโˆ—โ‰ฅ0.

Definition 16 (Strong Duality).

Strong duality holds when the duality gap is zero: pโˆ—=dโˆ—. Strong duality does not hold in general, but it does hold under mild regularity conditions for convex problems.

Left: weak duality guarantees dโˆ—โ‰คpโˆ—, but a positive duality gap may remain. Right: under strong duality (e.g. Slater's condition for convex problems), the gap closes and pโˆ—=dโˆ—.

The fundamental question is: when does strong duality hold? The most widely used sufficient condition for convex problems is Slater's condition.

Definition 17 (Slater's Condition).

For a convex problem (where f0,f1,โ€ฆ,fm are convex and h1,โ€ฆ,hp are affine), Slater's condition holds if there exists a point ๐’™0โˆˆrelintโก(๐’Ÿ) such that fi(๐’™0)<0,i=1,โ€ฆ,m. Such a point ๐’™0 is called strictly feasible. When some of the inequality constraints fi are affine, the strict inequality is only required for the nonaffine constraints; the affine ones need only satisfy fi(๐’™0)โ‰ค0.

Theorem 15 (Slater's Theorem).

If the primal problem is convex and Slater's condition holds, then strong duality holds: pโˆ—=dโˆ—. Furthermore, if dโˆ— is finite, the dual optimum is attained.

Proof outline.

Define the set ๐’œ={(u,v,t)โˆˆโ„mโกร—โ„pโกร—โ„โก:โˆƒ๐’™ย withย fi(๐’™)โ‰คui,hj(๐’™)=vj,f0(๐’™)โ‰คt} and let โ„ฌ={(0,0,s):s<pโˆ—}. By convexity of the problem, ๐’œ is a convex set. The set โ„ฌ is convex (a ray), and ๐’œโˆฉโ„ฌ=โˆ… (no feasible point achieves an objective value strictly below pโˆ—).

By the separating hyperplane theorem, there exist (ฮป,ฮฝ,ฮผ)โ‰ 0 with ฮปโ‰ฅ0 and ฮผโ‰ฅ0 such that ฮปโŠคu+ฮฝโŠคv+ฮผtโ‰ฅฮผs for all (u,v,t)โˆˆ๐’œ and all s<pโˆ—. Slater's condition ensures that ฮผ>0: if ฮผ=0, the strictly feasible point ๐’™0 leads to a contradiction because the u-coordinates can be made strictly negative while staying in ๐’œ. Normalising by ฮผ (setting ฮผ=1) yields the Lagrange multipliers (ฮป,ฮฝ) for which g(ฮป,ฮฝ)=pโˆ—.

Example 8 (Least Squares with Equality Constraints).

Consider min๐’™โกโ€–A๐’™โˆ’๐›โ€–2 subject to C๐’™=๐. The Lagrangian is L(๐’™,ฮฝ)=โ€–A๐’™โˆ’๐›โ€–2+ฮฝโŠค(C๐’™โˆ’๐). Setting โˆ‡๐’™L=0 gives 2AโŠค(A๐’™โˆ’๐›)+CโŠคฮฝ=0, so ๐’™โˆ—=(AโŠคA)โˆ’1(AโŠค๐›โˆ’12CโŠคฮฝ). Substituting back into the constraint C๐’™โˆ—=๐ yields a linear system for ฮฝโˆ—. The combined primal-dual system is the familiar KKT system: (2AโŠคACโŠคC0)(๐’™โˆ—ฮฝโˆ—)=(2AโŠค๐›๐). Since the problem is convex and the constraints are affine, Slater's condition reduces to feasibility: any ๐’™ with C๐’™=๐ suffices.

Example 9 (Linear Program Duality).

The linear program min๐’™โก๐œโŠค๐’™ subject to A๐’™=๐›, ๐’™โ‰ฅ0 has Lagrangian L(๐’™,ฮป,ฮฝ)=๐œโŠค๐’™โˆ’ฮปโŠค๐’™+ฮฝโŠค(A๐’™โˆ’๐›) with ฮปโ‰ฅ0. The dual function is g(ฮป,ฮฝ)=inf๐’™โ‰ฅ0โก{(๐œโˆ’ฮป+AโŠคฮฝ)โŠค๐’™โˆ’ฮฝโŠค๐›}={โˆ’๐›โŠคฮฝifย AโŠคฮฝ+๐œโ‰ฅฮปโ‰ฅ0,โˆ’โˆžotherwise. Maximising over ฮป (which is absorbed by the constraint AโŠคฮฝโ‰ค๐œ), the dual LP is: maxฮฝโก๐›โŠคฮฝ subject to AโŠคฮฝโ‰ค๐œ. Strong duality always holds for LPs whenever the primal is feasible; Slater's condition is not needed because all constraints are affine.

Theorem 16 (Inf-Sup Swap).

For a convex problem with strong duality (e.g. Slater's condition satisfied), (INF SUP)inf๐’™โˆˆ๐’Ÿโกsupฮปโ‰ฅ0,ฮฝโกL(๐’™,ฮป,ฮฝ)=supฮปโ‰ฅ0,ฮฝโกinf๐’™โˆˆ๐’ŸโกL(๐’™,ฮป,ฮฝ).

Proof.

Left side equals pโˆ—. For a fixed ๐’™, consider the inner supremum over (ฮปโ‰ฅ0,ฮฝ). If ๐’™ violates any inequality constraint fi(๐’™)>0, setting ฮปiโ†’โˆž makes the supremum +โˆž. If ๐’™ violates any equality constraint hj(๐’™)โ‰ 0, sending ฮฝjโ†’ยฑโˆž likewise gives +โˆž. If ๐’™ is feasible, the optimal choice is ฮป=0 (since ฮปifi(๐’™)โ‰ค0 when ฮปiโ‰ฅ0 and fi(๐’™)โ‰ค0), yielding L(๐’™,0,ฮฝ)=f0(๐’™) (the hj terms vanish). Therefore supฮปโ‰ฅ0,ฮฝโกL(๐’™,ฮป,ฮฝ)={f0(๐’™)ifย ๐’™ย isย feasible,+โˆžotherwise. Taking the infimum over ๐’™ gives pโˆ—.

Right side equals dโˆ—. The inner infimum inf๐’™โกL(๐’™,ฮป,ฮฝ)=g(ฮป,ฮฝ) by definition. The outer supremum is supฮปโ‰ฅ0,ฮฝโกg(ฮป,ฮฝ)=dโˆ—.

Conclusion. Strong duality gives pโˆ—=dโˆ—, completing the proof.

Key Idea.

The Kantorovichโ€“Rubinstein duality for the Wasserstein-1 distance is a direct application of this machinery. The primal problem is: minimise ๐”ผฯ€[โ€–๐’™โˆ’๐’šโ€–] over couplings ฯ€ with marginals P and Q. This is a linear program (linear objective, affine marginal constraints). Slater's condition holds trivially: the product measure Pร—Q is strictly feasible. Strong duality then swaps infโก and supโก, yielding the dual: W1(P,Q)=supโ€–fโ€–Lโ‰ค1โก{๐”ผP[f(๐’™)]โˆ’๐”ผQ[f(๐’™)]}, which is precisely what the WGAN critic network optimises.

KKT Conditions

The Karushโ€“Kuhnโ€“Tucker (KKT) conditions are the most important optimality conditions in constrained optimisation. For convex problems with strong duality, they provide necessary and sufficient conditions for a point to be optimal. In machine learning, KKT conditions characterise the optimal solutions of support vector machines, constrained optimisation in normalising flows, and optimal transport problems.

Theorem 17 (KKT Conditions).

Consider a convex problem with all functions differentiable. If strong duality holds, then ๐’™โˆ— is primal optimal and (ฮปโˆ—,ฮฝโˆ—) is dual optimal if and only if the following four conditions hold simultaneously:

  1. Primal feasibility:; fi(๐’™โˆ—)โ‰ค0 for all i;; hj(๐’™โˆ—)=0 for all j.

  2. Dual feasibility:; ฮปiโˆ—โ‰ฅ0 for all i.

  3. Complementary slackness:; ฮปiโˆ—fi(๐’™โˆ—)=0 for all i.

  4. Stationarity:; โˆ‡f0(๐’™โˆ—)+โˆ‘i=1mฮปiโˆ—โˆ‡fi(๐’™โˆ—)+โˆ‘j=1pฮฝjโˆ—โˆ‡hj(๐’™โˆ—)=0.

Proof.

Sufficiency (for convex problems). Suppose the four conditions hold and the problem is convex. Because all fi are convex, L(โ‹…,ฮปโˆ—,ฮฝโˆ—) is convex in ๐’™. Stationarity (iv) says that โˆ‡๐’™L(๐’™โˆ—,ฮปโˆ—,ฮฝโˆ—)=0, so ๐’™โˆ— minimises L(โ‹…,ฮปโˆ—,ฮฝโˆ—). Therefore g(ฮปโˆ—,ฮฝโˆ—)=inf๐’™โกL(๐’™,ฮปโˆ—,ฮฝโˆ—)=L(๐’™โˆ—,ฮปโˆ—,ฮฝโˆ—)=f0(๐’™โˆ—)+โˆ‘iฮปiโˆ—fi(๐’™โˆ—)+โˆ‘jฮฝjโˆ—hj(๐’™โˆ—)=f0(๐’™โˆ—)+0+0=f0(๐’™โˆ—), where the penultimate step uses complementary slackness (iii) and primal feasibility (i). Hence dโˆ—โ‰ฅg(ฮปโˆ—,ฮฝโˆ—)=f0(๐’™โˆ—)โ‰ฅpโˆ—. Combined with weak duality dโˆ—โ‰คpโˆ—, we conclude pโˆ—=dโˆ—=f0(๐’™โˆ—), so ๐’™โˆ— is primal optimal and (ฮปโˆ—,ฮฝโˆ—) is dual optimal.

Necessity (under strong duality). Suppose ๐’™โˆ— is primal optimal and (ฮปโˆ—,ฮฝโˆ—) is dual optimal with pโˆ—=dโˆ—. Dual feasibility (ii) is part of the dual constraints. Primal feasibility (i) holds by assumption. We have f0(๐’™โˆ—)=pโˆ—=dโˆ—=g(ฮปโˆ—,ฮฝโˆ—)=inf๐’™โกL(๐’™,ฮปโˆ—,ฮฝโˆ—)โ‰คL(๐’™โˆ—,ฮปโˆ—,ฮฝโˆ—)=f0(๐’™โˆ—)+โˆ‘iฮปiโˆ—fi(๐’™โˆ—). Since ฮปiโˆ—โ‰ฅ0 and fi(๐’™โˆ—)โ‰ค0, each term ฮปiโˆ—fi(๐’™โˆ—)โ‰ค0. The inequality above forces the sum to be zero, which requires every term to vanish: ฮปiโˆ—fi(๐’™โˆ—)=0 for all i (complementary slackness). Additionally, the inequality inf๐’™โกL(๐’™,ฮปโˆ—,ฮฝโˆ—)โ‰คL(๐’™โˆ—,ฮปโˆ—,ฮฝโˆ—) must hold with equality, so ๐’™โˆ— is a minimiser of L(โ‹…,ฮปโˆ—,ฮฝโˆ—). Since L is differentiable, this gives โˆ‡๐’™L(๐’™โˆ—,ฮปโˆ—,ฮฝโˆ—)=0 (stationarity).

Remark 3 (Complementary Slackness Interpretation).

The condition ฮปiโˆ—fi(๐’™โˆ—)=0 has a clean interpretation. For each inequality constraint, exactly one of two situations occurs:

  • The constraint is inactive: fi(๐’™โˆ—)<0, meaning the constraint is slack. Then ฮปiโˆ—=0, so the constraint does not affect the optimal solution.

  • The constraint is active: fi(๐’™โˆ—)=0, meaning the constraint is tight. Then ฮปiโˆ— may be positive, reflecting the โ€œpriceโ€ of tightening the constraint.

In economic terms, ฮปiโˆ— is the shadow price: it measures how much the optimal objective would improve if the i-th constraint were relaxed by an infinitesimal amount.

KKT conditions in two dimensions. The contour lines of the objective f0 (blue ellipses) meet the constraint boundary f1(๐’™)=0 (red curve) at the optimum ๐’™โˆ— (green dot). The negative gradient of f0 (solid orange) and the gradient of f1 (dashed orange) are antiparallel, reflecting the stationarity condition โˆ‡f0(๐’™โˆ—)+ฮป1โˆ—โˆ‡f1(๐’™โˆ—)=0 with ฮป1โˆ—>0.

Example 10 (Water-Filling Power Allocation).

Consider the power allocation problem: distribute a total power budget B across n channels to maximise total capacity. In convex-minimisation form: min๐’™โกโˆ’โˆ‘i=1nlogโก(xi+ai)s.t.xiโ‰ฅ0,โˆ‘i=1nxi=B, where ai>0 is the noise level in channel i. The KKT stationarity condition with multiplier ฮฝ for the equality constraint and ฮผiโ‰ฅ0 for โˆ’xiโ‰ค0 gives โˆ’1xi+ai+ฮฝโˆ’ฮผi=0,ฮผixi=0. If xi>0, then ฮผi=0 and xi=1/ฮฝโˆ’ai. If 1/ฮฝโˆ’aiโ‰ค0, then xi=0. The resulting water-filling solution is (Water Filling)xiโˆ—=maxโก(0,1ฮฝโˆ’ai), where ฮฝ>0 is chosen so that โˆ‘ixiโˆ—=B. The name โ€œwater-fillingโ€ comes from imagining the ai as the bottoms of containers of varying depth: pouring water (power) fills from the shallowest container first, with the water level 1/ฮฝ uniform across all active channels.

Historical Note.

William Karush derived these optimality conditions in his 1939 master's thesis at the University of Chicago, but the work went largely unnoticed. Harold Kuhn and Albert Tucker independently rediscovered them in 1951, publishing the result in the proceedings of the Second Berkeley Symposium. For decades the conditions were known as the โ€œKuhnโ€“Tucker conditionsโ€ until Karush's priority was recognised in the 1970s through the efforts of historians of optimisation. This is one of many examples in mathematics where graduate student work was overshadowed by more established researchers, a pattern that, happily, the modern culture of open preprints and arxiv has done much to correct.

Minimax Problems and Saddle Points

Generative adversarial networks are fundamentally minimax problems: the generator minimises while the discriminator maximises the same objective. Understanding when minโกmaxโก=maxโกminโก, and when saddle points exist, is therefore directly relevant to understanding when and why GANs converge. This section develops the classical theory of minimax problems and saddle points, beginning with the definition of a saddle point and culminating in the Von Neumann minimax theorem and its implications for adversarial training.

Definition 18 (Saddle Point).

Let XโІโ„nโก, YโІโ„mโก, and let f:Xร—Yโ†’โ„โก. A pair (๐’™โˆ—,๐’šโˆ—)โˆˆXร—Y is a saddle point of f if (Saddle DEF)f(๐’™โˆ—,๐’š)โ‰คf(๐’™โˆ—,๐’šโˆ—)โ‰คf(๐’™,๐’šโˆ—)forย allย ๐’™โˆˆX,๐’šโˆˆY. Equivalently, ๐’™โˆ— minimises f(โ‹…,๐’šโˆ—) over X and ๐’šโˆ— maximises f(๐’™โˆ—,โ‹…) over Y. Geometrically, the graph of f curves upward in the ๐’™-direction and downward in the ๐’š-direction at the saddle point, resembling a horse saddle.

Theorem 18 (Minimax Inequality).

For any function f:Xร—Yโ†’โ„โก, (Minimax INEQ)sup๐’šโˆˆYโกinf๐’™โˆˆXโกf(๐’™,๐’š)โ‰คinf๐’™โˆˆXโกsup๐’šโˆˆYโกf(๐’™,๐’š). The left-hand side is called the maximin value and the right-hand side the minimax value. The inequality states that the best guaranteed payoff for the maximiser (who moves first) is at most the worst-case cost for the minimiser (who moves first).

Proof.

Fix an arbitrary ๐’š0โˆˆY. For every ๐’™โˆˆX we have inf๐’™โ€ฒโˆˆXโกf(๐’™โ€ฒ,๐’š0)โ‰คf(๐’™,๐’š0)โ‰คsup๐’šโˆˆYโกf(๐’™,๐’š). The left inequality holds because the infimum is a lower bound, and the right inequality holds because the supremum is an upper bound. Since the rightmost expression does not depend on ๐’š0, we take the infimum over ๐’™ on the right: inf๐’™โ€ฒโˆˆXโกf(๐’™โ€ฒ,๐’š0)โ‰คinf๐’™โˆˆXโกsup๐’šโˆˆYโกf(๐’™,๐’š). Since this holds for every ๐’š0โˆˆY, we may take the supremum over ๐’š0 on the left to obtain the desired inequality.

Theorem 19 (Saddle Point Implies Minimax Equality).

If (๐’™โˆ—,๐’šโˆ—) is a saddle point of f:Xร—Yโ†’โ„โก, then the minimax value equals the maximin value and both equal f(๐’™โˆ—,๐’šโˆ—): (Saddle Minimax)min๐’™โˆˆXโกmax๐’šโˆˆYโกf(๐’™,๐’š)=max๐’šโˆˆYโกmin๐’™โˆˆXโกf(๐’™,๐’š)=f(๐’™โˆ—,๐’šโˆ—).

Proof.

Since ๐’šโˆ— maximises f(๐’™โˆ—,โ‹…), we have f(๐’™โˆ—,๐’šโˆ—)=max๐’šโกf(๐’™โˆ—,๐’š). Bounding the outer minimisation by its value at ๐’™=๐’™โˆ—, min๐’™โกmax๐’šโกf(๐’™,๐’š)โ‰คmax๐’šโกf(๐’™โˆ—,๐’š)=f(๐’™โˆ—,๐’šโˆ—). Similarly, since ๐’™โˆ— minimises f(โ‹…,๐’šโˆ—), we have f(๐’™โˆ—,๐’šโˆ—)=min๐’™โกf(๐’™,๐’šโˆ—). Bounding the outer maximisation by its value at ๐’š=๐’šโˆ—, max๐’šโกmin๐’™โกf(๐’™,๐’š)โ‰ฅmin๐’™โกf(๐’™,๐’šโˆ—)=f(๐’™โˆ—,๐’šโˆ—). Combining these two bounds with the minimax inequality (Theorem 18), f(๐’™โˆ—,๐’šโˆ—)โ‰ฅmin๐’™โกmax๐’šโกf(๐’™,๐’š)โ‰ฅmax๐’šโกmin๐’™โกf(๐’™,๐’š)โ‰ฅf(๐’™โˆ—,๐’šโˆ—), so all three quantities are equal.

Theorem 20 (Von Neumann Minimax Theorem).

Let XโІโ„nโก and YโІโ„mโก be compact convex sets, and let f:Xร—Yโ†’โ„โก be continuous such that

  • f(โ‹…,๐’š) is convex for each fixed ๐’šโˆˆY, and

  • f(๐’™,โ‹…) is concave for each fixed ๐’™โˆˆX.

Then: (VON Neumann)min๐’™โˆˆXโกmax๐’šโˆˆYโกf(๐’™,๐’š)=max๐’šโˆˆYโกmin๐’™โˆˆXโกf(๐’™,๐’š), and a saddle point (๐’™โˆ—,๐’šโˆ—) exists.

Proof.

We give a sketch that highlights the key ideas. Define ฯ†(๐’™)=max๐’šโˆˆYโกf(๐’™,๐’š). Since f(๐’™,โ‹…) is concave and Y is compact, the maximum is attained for every ๐’™. Moreover, ฯ† is convex: for any ๐’™1,๐’™2โˆˆX and ฮปโˆˆ[0,1], ฯ†(ฮป๐’™1+(1โˆ’ฮป)๐’™2)=max๐’šโกf(ฮป๐’™1+(1โˆ’ฮป)๐’™2,๐’š)โ‰คmax๐’šโก[ฮปf(๐’™1,๐’š)+(1โˆ’ฮป)f(๐’™2,๐’š)]โ‰คฮปฯ†(๐’™1)+(1โˆ’ฮป)ฯ†(๐’™2), using the convexity of f in ๐’™. Since ฯ† is continuous and convex on the compact set X, it attains its minimum at some ๐’™โˆ—โˆˆX. Similarly, define ฯˆ(๐’š)=min๐’™โˆˆXโกf(๐’™,๐’š), which is concave and attains its maximum at some ๐’šโˆ—โˆˆY.

By the minimax inequality (Theorem 18), ฯˆ(๐’šโˆ—)โ‰คฯ†(๐’™โˆ—). The convex-concave structure of f can be used, via a separating hyperplane argument on the epigraphs, to show that ฯ†(๐’™โˆ—)โ‰คฯˆ(๐’šโˆ—) as well. It follows that f(๐’™โˆ—,๐’šโˆ—) is a saddle point, and the minimax and maximin values coincide.

Definition 19 (Nash Equilibrium).

In a two-player zero-sum game with payoff f(๐’™,๐’š), a Nash equilibrium is a pair (๐’™โˆ—,๐’šโˆ—) such that no player can improve their payoff by unilaterally changing their strategy: f(๐’™โˆ—,๐’š)โ‰คf(๐’™โˆ—,๐’šโˆ—)โ‰คf(๐’™,๐’šโˆ—)forย allย ๐’™โˆˆX,๐’šโˆˆY. For zero-sum games, Nash equilibria coincide exactly with saddle points.

Key Idea.

The original GAN solves minGโกmaxDโกV(G,D) where V is concave in D (a sum of logarithms of D and 1โˆ’D) but highly non-convex in G (since G is parameterised by a deep neural network). The Von Neumann minimax theorem does not apply, which is precisely why GAN training is unstable. The minimax inequality maxDโกminGโกVโ‰คminGโกmaxDโกV may be strict: the โ€œgenerator-firstโ€ game and the โ€œdiscriminator-firstโ€ game can have different values.

WGANs, spectral normalisation, and gradient penalties are all designed to bring the GAN objective closer to the convex-concave setting where minimax theory guarantees convergence. When the GAN objective is re-parameterised in distribution space (rather than parameter space), the optimal discriminator yields an objective that is convex in the generator's distribution pg, partially recovering the conditions of the Von Neumann theorem.

Example 11 (Bilinear Saddle Point).

Consider f(๐’™,๐’š)=๐’™โŠคA๐’š on compact convex sets XโІโ„nโก and YโІโ„mโก, where Aโˆˆโ„nร—mโก. For fixed ๐’š, f is linear (hence convex) in ๐’™; for fixed ๐’™, f is linear (hence concave) in ๐’š. The Von Neumann theorem applies, and a saddle point exists.

This bilinear game is the simplest model of a GAN-like adversarial problem. When X and Y are simplices (probability vectors), the game becomes a matrix game, and the saddle-point strategies are mixed Nash equilibria. Gradient descent-ascent on bilinear objectives oscillates without converging, which foreshadows the training instabilities observed in GANs.

Historical Note.

John von Neumann proved his minimax theorem in 1928 as part of his foundational work on game theory, which he later expanded with Oskar Morgenstern in their 1944 book Theory of Games and Economic Behavior. Maurice Sion generalised the theorem to quasi-convex/quasi-concave functions in 1958, weakening the linearity assumptions considerably. The connection to generative modelling was made explicit by Goodfellow et al. (2014), who showed that the optimal discriminator yields a convex-in-pg objective when viewed in distribution space, partially recovering the minimax setting.

Bregman Divergences

Bregman divergences generalise the notion of โ€œdistanceโ€ beyond Euclidean distance, using a convex function to define a measure of dissimilarity. They arise naturally in information geometry, entropic optimal transport, and mirror descent algorithms. In generative modelling, the Sinkhorn algorithm for optimal transport is elegantly understood as alternating Bregman projections, and the KL divergence, the central quantity in variational inference, is itself a Bregman divergence.

Definition 20 (Bregman Divergence).

Let ฯ†:โ„nโกโ†’โ„โก be a strictly convex, differentiable function. The Bregman divergence associated with ฯ† is (Bregman DEF)Dฯ†(๐’™,๐’š)=ฯ†(๐’™)โˆ’ฯ†(๐’š)โˆ’โˆ‡ฯ†(๐’š)โŠค(๐’™โˆ’๐’š). Intuitively, Dฯ†(๐’™,๐’š) measures the gap between ฯ†(๐’™) and its first-order Taylor approximation centred at ๐’š, evaluated at ๐’™.

Theorem 21 (Non-Negativity).

Dฯ†(๐’™,๐’š)โ‰ฅ0 for all ๐’™,๐’š, with equality if and only if ๐’™=๐’š.

Proof.

By the first-order condition for strict convexity of ฯ†: ฯ†(๐’™)>ฯ†(๐’š)+โˆ‡ฯ†(๐’š)โŠค(๐’™โˆ’๐’š)wheneverย ๐’™โ‰ ๐’š. Rearranging gives Dฯ†(๐’™,๐’š)>0 when ๐’™โ‰ ๐’š. When ๐’™=๐’š, we have Dฯ†(๐’™,๐’™)=ฯ†(๐’™)โˆ’ฯ†(๐’™)โˆ’0=0 trivially.

The Bregman divergence Dฯ†(๐’™,๐’š) is the vertical gap between the strictly convex function ฯ† (blue) and its tangent line at ๐’š (orange dashed), evaluated at ๐’™. The gap (red) is always non-negative by the first-order convexity condition.

Remark 4 (Bregman Divergence Is Not a Metric).

Despite its name, Dฯ† is not a metric in general. It is typically asymmetric (Dฯ†(๐’™,๐’š)โ‰ Dฯ†(๐’š,๐’™)) and does not satisfy the triangle inequality. The term โ€œdivergenceโ€ is used deliberately to distinguish it from a true distance. The asymmetry is not a defect but a feature: it allows Bregman divergences to encode directional information about the curvature of ฯ†.

Example 12 (Squared Euclidean Distance).

Let ฯ†(๐’™)=12โ€–๐’™โ€–2. Then โˆ‡ฯ†(๐’š)=๐’š and Dฯ†(๐’™,๐’š)=12โ€–๐’™โ€–2โˆ’12โ€–๐’šโ€–2โˆ’๐’šโŠค(๐’™โˆ’๐’š)=12โ€–๐’™โˆ’๐’šโ€–2. This is the unique Bregman divergence that is symmetric and satisfies the triangle inequality. It is both a Bregman divergence and a squared metric.

Example 13 (KL Divergence).

Let ฯ†(๐’‘)=โˆ‘ipilogโกpi (the negative entropy) defined on the probability simplex. Then โˆ‡ฯ†(๐’’)=(logโกqi+1)i and Dฯ†(๐’‘,๐’’)=โˆ‘ipilogโกpiโˆ’โˆ‘iqilogโกqiโˆ’โˆ‘i(logโกqi+1)(piโˆ’qi)=โˆ‘ipilogโกpiqi=KLโก(๐’‘โ€–๐’’). This reveals that the KL divergence is a Bregman divergence, which immediately explains its asymmetry: KLโก(๐’‘โ€–๐’’)โ‰ KLโก(๐’’โ€–๐’‘) in general.

Example 14 (Itakuraโ€“Saito Distance).

Let ฯ†(๐’™)=โˆ’โˆ‘ilogโกxi on โ„++nโก. Then Dฯ†(๐’™,๐’š)=โˆ‘i(xiyiโˆ’logโกxiyiโˆ’1). This divergence is scale-invariant and appears in audio signal processing, where it measures spectral distortion between power spectra.

Definition 21 (Bregman Projection).

The Bregman projection of a point ๐’™ onto a closed convex set C with respect to ฯ† is (Bregman PROJ)ฯ€Cฯ†(๐’™)=argโ€‰min๐’šโˆˆCโกDฯ†(๐’š,๐’™). When ฯ†=12โ€–โ‹…โ€–2, this reduces to the standard Euclidean projection ฮ C(๐’™)=argโ€‰min๐’šโˆˆCโกโ€–๐’šโˆ’๐’™โ€–2.

Key Idea.

The Sinkhorn algorithm for entropic optimal transport can be understood as alternating Bregman projections with ฯ† equal to the negative entropy, giving KL divergence as the Bregman divergence. The two constraint sets are:

  1. C1={ฯ€โ‰ฅ0:ฯ€๐Ÿ™โก=๐’‘} (row marginals match P), and

  2. C2={ฯ€โ‰ฅ0:ฯ€โŠค๐Ÿ™โก=๐’’} (column marginals match Q).

Each Sinkhorn iteration projects onto one constraint, then the other, by rescaling the rows and columns of the coupling matrix. The theory of alternating Bregman projections guarantees convergence to the unique point in C1โˆฉC2 that minimises the KL divergence from the initial coupling, which is precisely the entropy-regularised optimal transport plan.

Proximal Operators

Proximal operators provide a principled way to handle non-smooth terms in optimisation by combining a gradient-like step with a regularisation penalty. They are the building blocks of modern first-order methods for composite optimisation problems of the form min๐’™โกg(๐’™)+f(๐’™), where g is smooth and f may be non-differentiable.

Definition 22 (Proximal Operator).

For a closed, proper, convex function f:โ„nโกโ†’โ„โกโˆช{+โˆž}, the proximal operator of f is the mapping proxfโก:โ„nโกโ†’โ„nโก defined by (PROX DEF)proxfโก(๐’—)=argโ€‰min๐’™โˆˆโ„nโกโก{f(๐’™)+12โ€–๐’™โˆ’๐’—โ€–2}. The minimiser always exists and is unique because the objective is the sum of a convex function and a strictly convex quadratic, making it strongly convex. Intuitively, proxfโก(๐’—) finds the point that balances being close to ๐’— (the quadratic term) with having small f-value (the penalty term).

Theorem 22 (Proximal Operator is Firmly Non-Expansive).

For any closed convex f, the proximal operator satisfies: (PROX FIRM)โ€–proxfโก(๐’™)โˆ’proxfโก(๐’š)โ€–2โ‰ค(๐’™โˆ’๐’š)โŠค(proxfโก(๐’™)โˆ’proxfโก(๐’š)) for all ๐’™,๐’šโˆˆโ„nโก. In particular, โ€–proxfโก(๐’™)โˆ’proxfโก(๐’š)โ€–โ‰คโ€–๐’™โˆ’๐’šโ€– (non-expansiveness).

Proof.

Let ๐’–=proxfโก(๐’™) and ๐’˜=proxfโก(๐’š). By the optimality condition for (PROX DEF), we have ๐’™โˆ’๐’–โˆˆโˆ‚f(๐’–) and ๐’šโˆ’๐’˜โˆˆโˆ‚f(๐’˜). By the monotonicity of the subdifferential of a convex function (if ๐’”1โˆˆโˆ‚f(๐’–) and ๐’”2โˆˆโˆ‚f(๐’˜), then (๐’”1โˆ’๐’”2)โŠค(๐’–โˆ’๐’˜)โ‰ฅ0), we obtain: ((๐’™โˆ’๐’–)โˆ’(๐’šโˆ’๐’˜))โŠค(๐’–โˆ’๐’˜)โ‰ฅ0. Expanding gives (๐’™โˆ’๐’š)โŠค(๐’–โˆ’๐’˜)โˆ’โ€–๐’–โˆ’๐’˜โ€–2โ‰ฅ0, which rearranges to the stated inequality. The non-expansiveness follows by applying the Cauchyโ€“Schwarz inequality to the right-hand side.

Example 15 (Proximal of โ„“1 Norm: Soft-Thresholding).

For f(๐’™)=ฮปโ€–๐’™โ€–1 with ฮป>0, the proximal operator acts component-wise via soft-thresholding: (SOFT Threshold)(proxfโก(๐’—))i=signโก(vi)maxโก(|vi|โˆ’ฮป,0). This operator shrinks each component of ๐’— towards zero by ฮป, setting small components exactly to zero. It is the key step in LASSO regression and compressed sensing for promoting sparsity.

Example 16 (Proximal of Indicator Function: Projection).

For the indicator function f=IC of a closed convex set C (i.e., f(๐’™)=0 if ๐’™โˆˆC and f(๐’™)=+โˆž otherwise), the proximal operator reduces to the Euclidean projection: proxICโก(๐’—)=ฮ C(๐’—)=argโ€‰min๐’™โˆˆCโกโ€–๐’™โˆ’๐’—โ€–2. This shows that projection is a special case of the proximal operator, and all results for proximal operators (such as non-expansiveness) immediately apply to projections.

Theorem 23 (Moreau Decomposition).

For any closed proper convex function f and any ๐’—โˆˆโ„nโก: (Moreau)๐’—=proxfโก(๐’—)+proxfโˆ—โก(๐’—), where fโˆ— is the Fenchel conjugate of f. This decomposes every vector ๐’— into a โ€œprimalโ€ component proxfโก(๐’—) and a โ€œdualโ€ component proxfโˆ—โก(๐’—).

Remark 5 (Interpretation of the Moreau Decomposition).

When f=IC is the indicator of a closed convex set C, we have proxfโก(๐’—)=ฮ C(๐’—) and proxfโˆ—โก(๐’—)=๐’—โˆ’ฮ C(๐’—), which is the residual after projection. The conjugate fโˆ—=ฯƒC is the support function of C, and its proximal operator extracts the component of ๐’— that โ€œpoints awayโ€ from C. The decomposition ๐’—=ฮ C(๐’—)+(๐’—โˆ’ฮ C(๐’—)) is the familiar orthogonal decomposition in the Euclidean case.

Remark 6 (Proximal Gradient Methods).

For problems of the form min๐’™โกg(๐’™)+f(๐’™), where g is smooth with Lipschitz-continuous gradient and f is convex but possibly non-smooth with an inexpensive proximal operator, the proximal gradient method iterates: (PROX GRAD)๐’™k+1=proxtkfโก(๐’™kโˆ’tkโˆ‡g(๐’™k)), where tk>0 is the step size. Each iteration alternates a gradient step on g with a proximal step on f. With step size tk=1/L (where L is the Lipschitz constant of โˆ‡g), the method achieves an O(1/k) convergence rate. Accelerated variants such as FISTA (Fast Iterative Shrinkage-Thresholding Algorithm) achieve the optimal O(1/k2) rate among first-order methods.

In generative modelling, the denoising step in DDPM can be interpreted as a proximal-like operation: given a noisy observation, the learned denoiser finds the closest clean signal under the learned prior, balancing data fidelity (proximity to the noisy input) with prior plausibility (the regularisation term).

Exercises

Convex Sets and Functions ( B.1โ€“B.2)

Exercise 1 (Intersection of Convex Sets).

Let {Cฮฑ}ฮฑโˆˆA be an arbitrary family of convex subsets of โ„nโก. Prove that the intersection โ‹‚ฮฑโˆˆACฮฑ is convex. Give an example showing that the union of two convex sets need not be convex.

Exercise 2 (Convexity Preserved Under Affine Composition).

Let f:โ„mโกโ†’โ„โก be convex and let g:โ„nโกโ†’โ„mโก be affine, i.e., g(๐’™)=A๐’™+๐’ƒ for some matrix A and vector ๐’ƒ. Prove that h=fโˆ˜g is convex.

Hint: Use the definition of convexity directly and the affinity of g.

Exercise 3 (Jensen's Inequality).

Let f:โ„nโกโ†’โ„โก be convex and let X be a random variable with ๐”ผ[X] finite and ๐”ผ[X]โˆˆdomโกf. Prove that (Jensen EX)f(๐”ผ[X])โ‰ค๐”ผ[f(X)]. Hint: By the supporting hyperplane characterisation of convexity, for any ๐’™0โˆˆdomโกf there exists a subgradient ๐’ˆโˆˆโˆ‚f(๐’™0) such that f(๐’™)โ‰ฅf(๐’™0)+๐’ˆโŠค(๐’™โˆ’๐’™0) for all ๐’™. Choose ๐’™0=๐”ผ[X] and take expectations.

Subgradients ( B.3)

Exercise 4 (Subdifferential of the Max Function).

Let f(๐’™)=maxโก(x1,x2,โ€ฆ,xn) for ๐’™โˆˆโ„nโก. At a point ๐’™ where exactly k coordinates achieve the maximum (i.e., xi1=xi2=โ‹ฏ=xik=maxjโกxj), show that the subdifferential is โˆ‚f(๐’™)=convโก{๐’†i1,๐’†i2,โ€ฆ,๐’†ik}, where ๐’†i denotes the i-th standard basis vector.

Exercise 5 (Subdifferential of the Euclidean Norm).

Let f(๐’™)=โ€–๐’™โ€–2 for ๐’™โˆˆโ„nโก. Show that:

  1. For ๐’™โ‰ 0: โˆ‚f(๐’™)={๐’™/โ€–๐’™โ€–2} (a singleton).

  2. At ๐’™=0: โˆ‚f(0)={๐’ˆโˆˆโ„nโก:โ€–๐’ˆโ€–2โ‰ค1} (the closed unit ball).

Conjugate Functions ( B.5)

Exercise 6 (Conjugate of the Euclidean Norm).

Prove that the Fenchel conjugate of f(๐’™)=โ€–๐’™โ€–2 is the indicator function of the unit ball: fโˆ—(๐’š)=I{โ€–๐’šโ€–2โ‰ค1}(๐’š)={0ifย โ€–๐’šโ€–2โ‰ค1,+โˆžotherwise. Hint: Compute sup๐’™โก(๐’šโŠค๐’™โˆ’โ€–๐’™โ€–2) by considering the Cauchyโ€“Schwarz inequality and analysing the cases โ€–๐’šโ€–2โ‰ค1 and โ€–๐’šโ€–2>1 separately.

Exercise 7 (Conjugate of Log-Sum-Exp).

Consider the log-sum-exp function f(๐’™)=logโก(โˆ‘i=1nexi). Compute its conjugate fโˆ—(๐’š) and show that fโˆ—(๐’š)={โˆ‘i=1nyilogโกyiifย ๐’šโˆˆฮ”n,+โˆžotherwise, where ฮ”n={๐’šโˆˆโ„+nโก:โˆ‘iyi=1} is the probability simplex. This shows that the conjugate of log-sum-exp is the negative entropy restricted to the simplex.

Hint: Differentiate ๐’šโŠค๐’™โˆ’f(๐’™) with respect to ๐’™ and use the fact that the softmax function arises as the gradient of log-sum-exp.

Exercise 8 (Conjugate of a Quadratic).

Let f(๐’™)=12๐’™โŠคQ๐’™ where Qโ‰ป0 (positive definite).

  1. Compute fโˆ—(๐’š) and show that fโˆ—(๐’š)=12๐’šโŠคQโˆ’1๐’š.

  2. Verify the biconjugate identity: fโˆ—โˆ—(๐’™)=f(๐’™).

Duality and KKT Conditions ( B.6โ€“B.7)

Exercise 9 (Dual of a Standard-Form Linear Program).

Consider the LP in standard form: min๐’™โก๐’„โŠค๐’™s.t.A๐’™โ‰ค๐’ƒ,๐’™โ‰ฅ0. Write the Lagrangian, compute the dual function, and show that the dual problem is: max๐€โก๐’ƒโŠค๐€s.t.AโŠค๐€โ‰ฅ๐’„,๐€โ‰ค0. Note: Equivalently, with the sign convention ๐=โˆ’๐€โ‰ฅ0, the dual becomes max๐โกโˆ’๐’ƒโŠค๐ subject to AโŠค๐โ‰ค๐’„,๐โ‰ฅ0.

Exercise 10 (Slater's Condition for Optimal Transport).

The Kantorovich primal problem for Wasserstein-1 distance is minฯ€โˆˆฮ (P,Q)โกโˆซโ€–๐’™โˆ’๐’šโ€–dฯ€(๐’™,๐’š), where ฮ (P,Q) is the set of couplings with marginals P and Q. This is a linear program over the convex set ฮ (P,Q).

Verify that the product coupling ฯ€=Pร—Q belongs to ฮ (P,Q), and explain why Slater's condition is automatically satisfied for this LP (since all constraints are affine). Conclude that strong duality holds.

Exercise 11 (KKT Conditions for Constrained Least Norm).

Consider the optimisation problem: min๐’™โˆˆโ„nโกโกโ€–๐’™โ€–2s.t.A๐’™=๐’ƒ, where Aโˆˆโ„pร—nโก has full row rank and ๐’ƒโˆˆโ„pโก.

  1. Write the Lagrangian L(๐’™,๐‚) and derive the KKT conditions.

  2. Show that the KKT conditions yield the closed-form solution ๐’™โˆ—=AโŠค(AAโŠค)โˆ’1๐’ƒ.

  3. Verify that ๐’™โˆ— is the minimum-norm solution of A๐’™=๐’ƒ (the Mooreโ€“Penrose pseudoinverse solution).

Minimax Problems ( B.8)

Exercise 12 (Proving the Minimax Inequality).

Let f:Xร—Yโ†’โ„โก be an arbitrary function. Prove directly from the definitions of supremum and infimum that sup๐’šโˆˆYโกinf๐’™โˆˆXโกf(๐’™,๐’š)โ‰คinf๐’™โˆˆXโกsup๐’šโˆˆYโกf(๐’™,๐’š). Give a concrete example where the inequality is strict. Relate this to the observation that the โ€œgenerator-firstโ€ and โ€œdiscriminator-firstโ€ GAN objectives can differ.

Exercise 13 (Bilinear Saddle Point on a Square).

Consider the function f(x,y)=xy on [โˆ’1,1]ร—[โˆ’1,1].

  1. Find all saddle points of f.

  2. Compute minxโกmaxyโกf(x,y) and maxyโกminxโกf(x,y).

  3. Verify that minโกmaxโก=maxโกminโก and that the common value equals f evaluated at any saddle point.

Bregman Divergences and Proximal Operators ( B.9โ€“B.10)

Exercise 14 (KL Divergence as a Bregman Divergence).

Show that the KL divergence KLโก(๐’‘โ€–๐’’)=โˆ‘ipilogโก(pi/qi) is a Bregman divergence by identifying the generating function ฯ†. Specifically:

  1. Let ฯ†(๐’‘)=โˆ‘ipilogโกpi (negative entropy). Compute โˆ‡ฯ†(๐’’).

  2. Substitute into the Bregman divergence formula Dฯ†(๐’‘,๐’’)=ฯ†(๐’‘)โˆ’ฯ†(๐’’)โˆ’โˆ‡ฯ†(๐’’)โŠค(๐’‘โˆ’๐’’) and simplify to obtain KLโก(๐’‘โ€–๐’’).

  3. Explain why the fact that KL is a Bregman divergence immediately implies it is non-negative (Gibbs' inequality) and asymmetric.

Exercise 15 (Proximal Operator of the โ„“1 Norm).

For f(๐’™)=ฮปโ€–๐’™โ€–1 with ฮป>0, compute the proximal operator proxfโก(๐’—) from the definition: proxfโก(๐’—)=argโ€‰min๐’™โˆˆโ„nโกโก{ฮปโ€–๐’™โ€–1+12โ€–๐’™โˆ’๐’—โ€–2}.

  1. Show that the problem separates into n independent scalar problems.

  2. For each scalar problem minxiโก{ฮป|xi|+12(xiโˆ’vi)2}, analyse the subdifferential optimality condition to derive (proxfโก(๐’—))i=signโก(vi)maxโก(|vi|โˆ’ฮป,0).

  3. Sketch the function viโ†ฆ(proxfโก(๐’—))i and verify that it is a continuous, piecewise linear, non-expansive mapping.