Subdifferential Calculus: Sum Rule, Chain Rule, and Danskin's Theorem
Anchor (Master): Rockafellar 1970 Convex Analysis (Princeton) §23-§25, §27; Hiriart-Urruty & Lemaréchal 1993 Convex Analysis and Minimization Algorithms (Springer) Ch. VI, Ch. D; Bertsekas 1971/2009 Convex Optimization Theory on the Danskin theorem
Intuition Beginner
Picture a smooth valley floor. At any point there is one definite downhill direction and one tangent line that just touches the curve. Calculus calls the slope of that line the derivative, and it is a single number. Now bend the floor into a sharp V, like the graph of the absolute-value function. Right at the kink, there is no single tangent line. Instead there is a whole fan of straight lines you can lay underneath the corner, each one touching only at the tip and staying below the curve everywhere else. The set of all their slopes is the subdifferential.
So the subdifferential is the honest replacement for the derivative when a convex function has a corner. Where the function is smooth it gives back the usual single slope. Where there is a kink it gives an entire interval of allowed slopes. Each allowed slope defines a supporting line that under-estimates the function everywhere, which is exactly the property that makes the corner usable.
Why care about corners? Because the functions we most want to minimise are full of them. The largest of several costs, the absolute error, the penalty that switches on at a threshold — all have kinks precisely at the interesting points, often right at the optimum. A method that only knows about smooth slopes stalls there. The subdifferential lets us keep going.
There is one beautifully simple payoff. For a smooth bowl, the lowest point is where the slope is zero. For a convex function with corners, the lowest point is where zero is one of the allowed slopes — where the flat line is among the supporting lines you can slide under the graph. That single rule, "zero belongs to the fan of slopes," tells you that you have found the minimum, kink or no kink.
The rest of this unit is bookkeeping: rules for finding the fan of slopes of a sum, of a stretched-and-shifted function, and of a maximum, so you never have to draw the picture.
Visual Beginner
Figure: the V-shaped graph of the absolute-value function. At the kink at the origin a whole fan of straight lines is drawn, each passing through the origin and lying entirely on or below the V. The shallowest has slope minus one (matching the left arm), the steepest has slope plus one (matching the right arm), and every slope in between is allowed. A side panel shows a smooth bowl where only a single tangent line fits, so the fan collapses to one slope.
f(x) = |x| smooth case: one tangent
\ / . * .
\ / * | *
\ / * | *
......\.../...... <- fan of * | *
line slope -1 supporting *.....*
... line slope +1 lines at one slope only:
\ / kink the kink the derivative
------V------- x slopes fill ----------------
origin [-1, +1] f smooth -> df = {f'(x)}
any line with slope in [-1,1]
stays on or below the V
Worked example Beginner
Take the absolute-value function and find its fan of allowed slopes at three places by hand.
Step 1. A point on the right arm. At the graph is the straight line , smooth, with slope . A supporting line must touch at and stay below the V; only the line of slope does this. So the only allowed slope is .
Step 2. A point on the left arm. At the graph is the line , smooth, with slope . The same reasoning gives a single allowed slope, .
Step 3. The kink. At the value is . A line through the origin with slope is ; it stays on or below exactly when for every , which holds precisely for . So the fan of allowed slopes at the kink is the whole interval from to .
Step 4. Read off the minimum. The lowest point of is at . Check the rule: is the flat slope among the allowed slopes at ? The allowed slopes there run from to , and is inside, so yes. The rule correctly flags as the minimum.
What this tells us. Away from the kink the subdifferential is just the ordinary slope, a single number. At the kink it spreads into an interval, and the minimum is detected by the flat slope sitting inside that interval — the corner-friendly version of "set the derivative to zero."
Check your understanding Beginner
Formal definition Intermediate+
Throughout, is proper convex (notation from 44.01.01 and 37.07.03): is nonempty and never equals . The pairing is .
Definition (subgradient and subdifferential). A vector is a subgradient of at if
The subdifferential is the set of all such ; it is empty for , and by convention also where no subgradient exists. Geometrically, iff the affine function is a supporting (under-estimating) hyperplane to at [Rockafellar §23]. As an intersection of the closed halfspaces over , the set is always closed and convex.
Definition (directional derivative). The one-sided directional derivative of at in direction is
For convex the difference quotient is nondecreasing in , so the limit exists in and equals the infimum over . The map is positively homogeneous and convex — a sublinear function — whenever (relative interior, 44.01.02).
Definition (Fermat / stationarity). A point is a (global) minimiser of iff : the zero vector is a subgradient, i.e. the flat affine function under-estimates everywhere.
A normal example fixes the picture: for on , the subdifferential is for and , the closed unit ball — a single gradient away from the kink, a fat convex body at it.
Counterexamples to common slips
- The subdifferential can be empty on the boundary of the domain. For on (extended by for ), at the difference quotient , so no finite supporting slope exists and . Nonemptiness is guaranteed on , not on all of .
- The sum rule needs a qualification. With and (indicators of the two halflines), , so , while here — the inclusion is automatic, but equality can fail when relative interiors of the domains do not meet.
- exists pointwise does not mean is smooth as a map. A convex function differentiable at every point of an open set is automatically there; but a single-point gradient does not control nearby behaviour. Differentiability at is equivalent to being a singleton, not to being smooth near .
Key theorem with proof Intermediate+
The structural core is the identification of the subdifferential as the set whose support function is the directional derivative, from which compactness on the relative interior and the Fermat rule both follow.
Theorem (support-function formula and the Moreau-Rockafellar sum rule). Let be proper convex on .
(i) (Directional-derivative duality.) For , the set is nonempty, compact, and convex, and the directional derivative is its support function:
(ii) (Fermat's rule.) minimises if and only if .
(iii) (Sum rule.) Always . If , then for all ,
Proof of (i). Fix . The function is sublinear (positively homogeneous and convex) and finite on the subspace parallel to , because at a relative-interior point the difference quotients are bounded below. A finite sublinear function is the support function of a unique nonempty compact convex set , namely (the subdifferential of at ; this is the support-function/sublinearity correspondence of 44.01.01). It remains to identify with . If , then for every and , , so dividing by and letting gives ; hence . Conversely if , then for (using monotonicity of the quotient at ), which is the subgradient inequality; hence . So , nonempty compact convex, with support function .
Proof of (ii). By definition means for all , which is exactly the statement that is a global minimiser. There is no separate local-versus-global gap: the subgradient inequality is global.
Proof of (iii). The inclusion is immediate: if and , adding the two subgradient inequalities gives , so . For the reverse inclusion under the qualification, take . Consider in the two convex sets
the (shifted) epigraph of and the (shifted) hypograph of . The subgradient inequality says , i.e. and do not overlap; the relative-interior qualification makes the relative interiors of the projections meet, so the proper separation theorem (geometric Hahn-Banach, 02.11.02, in the finite-dimensional relative-interior form) supplies a hyperplane. Its normal, normalised in the last coordinate, is a vector with for all (so ) and , i.e. . Then .
Bridge. This theorem builds toward the entire first-order algorithmic layer and appears again in the convergence analysis of subgradient and proximal methods 44.06.01, where each step evaluates an element of . This is exactly the nonsmooth completion of the first-order characterisation of convexity from 44.01.01: where smoothness gave a single supporting hyperplane , the subdifferential gives the whole set of them, and the central insight is that this set is precisely the one whose support function is the directional derivative. The Fermat rule generalises the smooth condition to , and the sum rule is dual to the conjugate-of-a-sum (infimal-convolution) identity, since ties subgradients to the Fenchel-Young equality of 37.07.03. Putting these together, separation supplies the multiplier in the sum rule exactly as it supplied the supporting hyperplane behind biconjugation, so the constrained-optimisation calculus rests on one geometric fact.
Exercises Intermediate+
Advanced results Master
Danskin's theorem: differentiating a parametric maximum
Let with compact, convex for each , continuous, and define . Then is convex, and with the maximiser set ,
When each is differentiable and the maximiser is unique, is differentiable with — one differentiates through the maximisation, evaluating the gradient at the active maximiser and ignoring its dependence on . The directional-derivative form is the operative statement for descent methods on minimax problems and for the value functions of two-player games [Danskin 1966]. The finite-index special case is Exercise 6; the integral analogue (max over a measure) underlies the subdifferential of expected-value and risk functionals.
The Moreau-Rockafellar sum rule as the engine of duality
The sum rule is the differential shadow of the Fenchel duality theorem: under the relative-interior qualification, , and a primal-dual optimal pair satisfies and [Rockafellar §31]. Writing the constrained program as and applying the sum rule plus the chain rule to the constraint indicator reproduces the KKT system: with and complementary slackness, the constraint qualification being precisely the relative-interior (Slater) condition that lets the sum rule fire. The Fermat rule of Exercise 3 specialises this to a single feasible-set indicator 44.02.04.
Differentiability, the gradient, and Alexandrov's theorem
A convex function on an open set is differentiable at iff is a singleton, and then [Rockafellar §25]. By Rademacher's theorem a finite convex function is differentiable Lebesgue-almost everywhere; the gradient map is continuous on the (open, full-measure) set of differentiability, so a convex function on an open set is automatically where it is differentiable. Sharper, Alexandrov's theorem gives a second-order Taylor expansion with a symmetric positive-semidefinite Hessian almost everywhere, even when is not twice differentiable in the classical sense. The set-valued map is maximal monotone: for , and no monotone relation strictly contains its graph — the property that the resolvent (the proximal map) is single-valued and nonexpansive, the analytic foundation of proximal algorithms.
Subdifferential of the conjugate and the inverse correspondence
For closed proper convex , as relations on (Exercise 7). Single-valuedness of at — differentiability of — corresponds to being constant along an exposed face, i.e. strict convexity of in that direction, and vice versa; differentiability of is dual to strict convexity of . When is a Legendre function (essentially smooth and essentially strictly convex, 37.07.03), everywhere on the interior of its domain and the inverse map is , recovering the classical Legendre transform as the smooth core of the subdifferential calculus.
Synthesis. The subdifferential is exactly the set whose support function is the directional derivative, and this single identification generalises the gradient to the nonsmooth convex world while keeping every first-order fact intact: the Fermat rule is exactly the corner-aware version of , and the sum, chain, and max rules are the calculus that makes it computable. The central insight is that all three rules are one separation theorem in disguise — the relative-interior qualification is what guarantees the proper separating hyperplane whose normal is the missing multiplier, so the Moreau-Rockafellar sum rule is dual to Fenchel duality and the chain rule is dual to the conjugate-of-a-composition formula. The foundational reason these matter is that ties the whole apparatus to the conjugacy of 37.07.03: subgradient inversion is conjugate inversion, the proximal map is a resolvent of a maximal monotone operator, and putting these together the engine that drives subgradient and proximal methods 44.06.01 and the KKT multiplier theory 44.02.04 appears again in every nonsmooth optimisation algorithm, with Danskin's theorem the bridge from static convexity to the parametric value functions of games and control.
Full proof set Master
Proposition 1 (nonemptiness and local boundedness on the relative interior). If is proper convex and , then is nonempty, convex, and compact.
Proof. Convexity and closedness hold for any (intersection of halfspaces). For nonemptiness, is a boundary point of the convex set , which has nonempty interior relative to its affine hull; the supporting-hyperplane theorem 44.01.01 (a finite-dimensional consequence of separation, 02.11.02) supplies a supporting hyperplane to at . Because is in the relative interior of , this hyperplane is non-vertical (its last coordinate is nonzero), so normalising the last coordinate to yields with , i.e. . Boundedness: by the support-function formula (Key theorem (i)) and finiteness of for all in the parallel subspace, for every unit , so is bounded; closed and bounded in gives compact.
Proposition 2 (chain rule for a linear map). Let be proper convex on , linear, and . Then always, with equality whenever .
Proof. The inclusion is the computation of Exercise 5. For equality, let , so for all . Define on the functional that we wish to extend; concretely, consider the convex function restricted to the affine flat and the linear functional on given by (well-defined modulo : if then and the subgradient inequality forces and, by symmetry , equality, so depends only on ). The qualification places in the relative interior of along , so the one-step separation/extension (the sum-rule separation applied to and ) produces extending , meaning , i.e. . Hence .
Proposition 3 (Danskin's theorem, finite-index form). Let be proper convex and finite near , , and . Then is convex and .
Proof. Convexity of : a pointwise maximum of convex functions has epigraph , an intersection of convex sets, hence convex 44.01.01. For the subdifferential, first compute the directional derivative. For small and any inactive , continuity gives , so the max over is governed by active indices: . By the support-function formula each is the support function of , and a maximum of support functions is the support function of the convex hull of the union: with (the hull is compact as a convex hull of finitely many compact sets in ). Thus is the support function of , and also of by Key theorem (i); two compact convex sets with the same support function coincide, so .
Proposition 4 ( is maximal monotone). For proper convex lsc , the graph is monotone, and is not properly contained in the graph of any monotone relation.
Proof. Monotonicity: for , the two subgradient inequalities and add to , i.e. . For maximality, suppose is monotonically related to every in the graph but is not itself in it. Consider the Moreau-Yosida proximal point: the strongly convex function has a unique minimiser , characterised by Fermat as , i.e. . Set , so is in the graph. Monotonicity of the candidate against gives . But , so this reads , forcing and then , so , a contradiction. Hence the graph is maximal.
Connections Master
The Fenchel-Young equality of
37.07.03is the source of the conjugacy inversion : subgradients of and of its conjugate are inverse relations, so the subdifferential calculus and the Legendre-Fenchel transform are two descriptions of one duality, and the smooth Legendre transform is recovered when is a Legendre function with .The supporting-hyperplane and separation theory of
44.01.01and02.11.02is the single geometric engine behind nonemptiness of on the relative interior, the Moreau-Rockafellar sum rule, and the chain rule; each "equality under a relative-interior qualification" is one application of proper separation, the same construction that underlies biconjugation.The relative interior and Carathéodory material of
44.01.02supplies the precise qualification condition under which the sum rule holds with equality, and Carathéodory bounds the number of active subgradients needed to express any element of as a convex combination.The Fermat rule and the sum/chain calculus are exactly what the subgradient and proximal methods of
44.06.01evaluate, while the constrained form is the KKT system whose multiplier existence rests on the Farkas/separation theory of44.02.04.
Historical & philosophical context Master
The subgradient inequality and the systematic calculus of subdifferentials were developed in the early 1960s by Jean-Jacques Moreau and R. Tyrrell Rockafellar, working in parallel on the variational and convex-analytic sides. Moreau's Fonctionnelles convexes lectures [Moreau 1966] at the Collège de France introduced the proximal map and the inf-convolution regularisation now bearing his name, and established the subdifferential as a maximal monotone operator whose resolvent is the proximal mapping. Rockafellar's Convex Analysis (Princeton, 1970) [Rockafellar §23, §25] gave the definitive account of §23-§25: the directional-derivative duality, the differentiability characterisation, and the sum and chain rules under relative-interior qualifications, organised around the conjugacy inversion .
The max-rule for differentiating a parametric supremum was proved in its modern generality by John M. Danskin [Danskin 1966] in his 1966 SIAM Journal on Applied Mathematics paper on the theory of max-min, motivated by military allocation games; it had antecedents in the minimax work of von Neumann and in Valentine's and Fenchel's earlier convex-analytic notes. The encyclopaedic treatment of the calculus, with the support-function and maximal-monotone viewpoints made central, is due to Hiriart-Urruty and Lemaréchal [Hiriart-Urruty & Lemaréchal 1993] in Convex Analysis and Minimization Algorithms (Springer, 1993), the source that tied the subdifferential calculus to the bundle and proximal algorithms it now serves.
Bibliography Master
@book{rockafellar1970convex,
author = {Rockafellar, R. Tyrrell},
title = {Convex Analysis},
series = {Princeton Mathematical Series},
number = {28},
publisher = {Princeton University Press},
year = {1970}
}
@article{danskin1966maxmin,
author = {Danskin, John M.},
title = {The theory of max-min, with applications},
journal = {SIAM Journal on Applied Mathematics},
volume = {14},
number = {4},
pages = {641--664},
year = {1966}
}
@book{hiriarturruty1993convex,
author = {Hiriart-Urruty, Jean-Baptiste and Lemar\'echal, Claude},
title = {Convex Analysis and Minimization Algorithms I},
series = {Grundlehren der mathematischen Wissenschaften},
number = {305},
publisher = {Springer},
year = {1993}
}
@book{hiriarturruty2001fundamentals,
author = {Hiriart-Urruty, Jean-Baptiste and Lemar\'echal, Claude},
title = {Fundamentals of Convex Analysis},
series = {Grundlehren Text Editions},
publisher = {Springer},
year = {2001}
}
@incollection{moreau1967fonctionnelles,
author = {Moreau, Jean-Jacques},
title = {Fonctionnelles convexes},
booktitle = {S\'eminaire Jean Leray sur les \'equations aux d\'eriv\'ees partielles},
publisher = {Coll\`ege de France},
year = {1966--1967}
}
@book{bertsekas2009convex,
author = {Bertsekas, Dimitri P.},
title = {Convex Optimization Theory},
publisher = {Athena Scientific},
year = {2009}
}