The gradient inequality and subgradients of differentiable functions #
The gradient inequality f x + ⟪∇f x, y - x⟫ ≤ f y for a real valued convex function, from a
derivative of f at x along the segment towards y, its form f x + ⟪∇f x, y - x⟫ + (m / 2) ‖y - x‖² ≤ f y for an m-strongly convex function, and the subdifferential of a convex
function f : H → ℝ that is differentiable at x: the singleton {∇f x}. At a point of
differentiability every subgradient of any function is the gradient.
Main statements #
ConvexAnalysis.ConvexOn.add_hasLineDerivWithinAt_le: the gradient inequalityf x + f' ≤ f yforfconvex ons,x, y ∈ sand a derivativef'offatxin the directiony - x, withins;ConvexAnalysis.ConvexOn.add_hasLineDerivAt_lewith a two-sided directional derivative.ConvexAnalysis.ConvexOn.add_hasGradientWithinAt_le: the gradient inequalityf x + ⟪g, y - x⟫ ≤ f ywith a gradientgoffatxwithins, andConvexAnalysis.ConvexOn.add_hasGradientAt_le.ConvexAnalysis.StrongConvexOn.add_hasGradientWithinAt_add_le: the gradient inequalityf x + ⟪g, y - x⟫ + (m / 2) ‖y - x‖² ≤ f yof anm-strongly convex function.ConvexAnalysis.hasSubgradientAt_coe_of_hasGradientAt: the gradient of a differentiable convexf : H → ℝis a subgradient.ConvexAnalysis.HasSubgradientAt.eq_of_hasGradientAt: at a point of differentiability, every subgradient is the gradient; no convexity is needed.ConvexAnalysis.subdifferential_coe_eq_singleton_of_hasGradientAt:∂f x = {∇f x}for a convexfdifferentiable atx.
Implementation notes #
The gradient inequality is proved on the line through x and y with Mathlib's
one-dimensional ConvexOn.le_slope_of_hasDerivWithinAt. It needs only a directional derivative
within s (Mathlib's HasLineDerivWithinAt, a derivative of t ↦ f (x + t • (y - x)) at 0
within the preimage of s), so f may be arbitrary outside s; a Fréchet derivative within s
(HasGradientWithinAt) or a Gâteaux derivative at x gives one. The forms with a directional
derivative need no inner product and hold on every real vector space.
The open Mathlib PR #41494 (first-order convexity inequalities, open on 2026-12-01) proves
ConvexOn.add_hasLineDerivAt_le, ConvexOn.add_hasFDerivAt_le, ConvexOn.add_fderiv_le,
ConvexOn.fderiv_sub_nonneg, ConvexOn.isMinOn_of_fderiv_eq_zero and
convexOn_iff_add_fderiv_le on a real normed space. ConvexAnalysis.ConvexOn.add_hasLineDerivAt_le
has the name and the statement of the PR's lemma (on a real vector space); the forms within a set
and with a gradient follow the PR's pattern of names.
References #
- H. H. Bauschke, P. L. Combettes, Convex Analysis and Monotone Operator Theory in Hilbert Spaces, 2nd ed., Springer, 2017, Propositions 10.8, 17.6 and 17.31.
Tags #
subgradient, gradient, gradient inequality, directional derivative, differentiable convex function, strongly convex function, Fréchet derivative
The gradient inequality with a directional derivative: if f is convex on s, x, y ∈ s,
and f' is the derivative of f at x in the direction y - x within s, then
f x + f' ≤ f y. This contains BC, Proposition 17.6 (there with a Gâteaux gradient at x
and f : H → ]-∞, +∞] convex, which is the case s = dom f here); only the derivative of
t ↦ f (x + t • (y - x)) at 0 within the preimage of s is used.
The gradient inequality with a directional derivative at x: if f is convex on s,
x, y ∈ s, and f' is the derivative of f at x in the direction y - x, then
f x + f' ≤ f y. This is the statement of ConvexOn.add_hasLineDerivAt_le in the open Mathlib
PR #41494.
The gradient inequality BC, Proposition 17.6: if f is convex on s and has the
gradient g within s at x ∈ s, then f x + ⟪g, y - x⟫ ≤ f y for every y ∈ s. [BC17] assumes
a Gâteaux gradient at x; here the gradient is a Fréchet gradient, but only within s, so the
two statements are incomparable. Both are cases of
ConvexAnalysis.ConvexOn.add_hasLineDerivWithinAt_le.
The gradient inequality BC, Proposition 17.6 with the gradient at x (a Fréchet
gradient, where [BC17] assumes a Gâteaux gradient): if f is convex on s and x, y ∈ s, then
f x + ⟪g, y - x⟫ ≤ f y.
A gradient g of f at x gives the gradient g - m • x of f - (m / 2) ‖·‖².
A gradient g of f at x within s gives the gradient g - m • x of
f - (m / 2) ‖·‖² within s.
The gradient inequality of a strongly convex function: if f is m-strongly convex on
s and has the gradient g within s at x ∈ s, then
f x + ⟪g, y - x⟫ + (m / 2) ‖y - x‖² ≤ f y for every y ∈ s. The proof applies the gradient
inequality to the convex function f - (m / 2) ‖·‖² (Mathlib's strongConvexOn_iff_convex,
BC, Proposition 10.8).
The gradient of a differentiable convex function is a subgradient
BC, Proposition 17.31 (i) (there with a Gâteaux gradient, for f : H → ]-∞, +∞]).
At a point of differentiability, a subgradient is the gradient; no convexity is needed.
∂f x = {∇f x} for a convex function differentiable at x BC, Proposition 17.31 (there
for Gâteaux differentiable f with values in ]-∞, +∞]).