Documentation

ConvexAnalysis.SmoothConvex

Differentiable convex functions #

First-order characterizations of convexity for a real valued function f : H → ℝ on a convex set s of a real Hilbert space, with the gradient paired by the inner product: the gradient inequality f x + ⟪∇f x, y - x⟫ ≤ f y and monotonicity of the gradient, their forms for strongly convex functions, and the optimality condition -∇f x ∈ N_C x for minimizing a differentiable convex function on a convex set.

Main statements #

Implementation notes #

The gradient is a hypothesis HasGradientWithinAt f g s x (or HasGradientAt), as in ConvexAnalysis.Gradient and ConvexAnalysis.Cocoercive: a Fréchet gradient, where [BC17] uses Gâteaux gradients on an open domain, so the results here and those of [BC17] are incomparable. A derivative within s suffices for the gradient inequality and the optimality condition, so f may be arbitrary outside s; the converse of monotonicity uses the mean value theorem along segments and assumes the gradient at each point of s. The gradient inequality itself, ConvexAnalysis.ConvexOn.add_hasGradientWithinAt_le, is proved in ConvexAnalysis.Gradient from a directional derivative (ConvexAnalysis.ConvexOn.add_hasLineDerivWithinAt_le), which contains BC, Proposition 17.6. Strong convexity reduces to convexity of f - (m / 2) ‖·‖² (Mathlib's strongConvexOn_iff_convex, BC, Proposition 10.8).

The open Mathlib PR #41494 (first-order convexity inequalities, open on 2026-12-01) proves, on a real normed space and with the Fréchet derivative, ConvexOn.add_hasLineDerivAt_le, ConvexOn.add_hasFDerivAt_le, ConvexOn.add_fderiv_le, the monotonicity ConvexOn.fderiv_sub_nonneg, the optimality condition ConvexOn.isMinOn_of_fderiv_eq_zero for a vanishing derivative, and the converse convexOn_iff_add_fderiv_le. The statements here are their forms with the gradient, within a set, with the converse of monotonicity, strong convexity and the optimality condition on a convex set. The gradient inequality follows the PR's pattern of names (add_hasGradientWithinAt_le); the PR has no gradient forms to align the other names with.

References #

Tags #

convex function, gradient, first-order condition, gradient inequality, monotone gradient, strongly convex function, strongly monotone gradient, normal cone, variational inequality, constrained optimization

theorem ConvexAnalysis.ConvexOn.inner_sub_sub_nonneg_of_hasGradientWithinAt {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] {f : H → ℝ} {s : Set H} {u v x y : H} (hf : ConvexOn ℝ s f) (hx : x ∈ s) (hy : y ∈ s) (hu : HasGradientWithinAt f u s x) (hv : HasGradientWithinAt f v s y) :
0 ≤ inner ℝ (x - y) (u - v)

Monotonicity of the gradient, BC, Proposition 17.7 (i)⇒(iii) with a Fréchet gradient within s in place of [BC17]'s Gâteaux gradient on an open domain: for f convex on s with gradients u at x ∈ s and v at y ∈ s (within s), 0 ≤ ⟪x - y, u - v⟫.

theorem ConvexAnalysis.ConvexOn.isMonotoneOp_gradient {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] {f : H → ℝ} {f' : H → H} (hf : ConvexOn ℝ Set.univ f) (hf' : ∀ (x : H), HasGradientAt f (f' x) x) :
IsMonotoneOp fun (x : H) => {f' x}

The gradient of a convex differentiable function f : H → ℝ is a monotone operator, BC, Proposition 17.7 (i)⇒(iii) with a Fréchet gradient in place of [BC17]'s Gâteaux gradient.

theorem ConvexAnalysis.convexOn_of_forall_add_inner_le {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] {f : H → ℝ} {f' : H → H} {s : Set H} (hs : Convex ℝ s) (h : ∀ x ∈ s, ∀ y ∈ s, f x + inner ℝ (f' x) (y - x) ≤ f y) :

Converse of the gradient inequality BC, Proposition 17.7 (ii)⇒(i): if f x + ⟪f' x, y - x⟫ ≤ f y for all x, y in a convex set s, then f is convex on s. No differentiability is needed: f' is any map, for example a selection of subgradients, and s is any convex set, where [BC17] assumes an open domain and Gâteaux differentiability.

theorem ConvexAnalysis.convexOn_iff_forall_add_inner_le {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] {f : H → ℝ} {f' : H → H} {s : Set H} (hs : Convex ℝ s) (hf' : ∀ x ∈ s, HasGradientWithinAt f (f' x) s x) :
ConvexOn ℝ s f ↔ ∀ x ∈ s, ∀ y ∈ s, f x + inner ℝ (f' x) (y - x) ≤ f y

First-order characterization of convexity, BC, Proposition 17.7 (i)⇔(ii) with a Fréchet gradient within s in place of [BC17]'s Gâteaux gradient: a function with a gradient within the convex set s at every point of s is convex on s iff it satisfies the gradient inequality. [BC17] assumes dom f open; here s is any convex set.

theorem ConvexAnalysis.convexOn_of_inner_sub_sub_nonneg {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] {f : H → ℝ} {f' : H → H} {s : Set H} (hs : Convex ℝ s) (hf' : ∀ x ∈ s, HasGradientAt f (f' x) x) (hmono : ∀ x ∈ s, ∀ y ∈ s, 0 ≤ inner ℝ (x - y) (f' x - f' y)) :

A function with a monotone gradient is convex, BC, Proposition 17.7 (iii)⇒(i) with a Fréchet gradient in place of [BC17]'s Gâteaux gradient: if f has the gradient f' x at every point x of the convex set s and 0 ≤ ⟪x - y, f' x - f' y⟫ for all x, y ∈ s, then f is convex on s. The proof applies the mean value theorem on segments. [BC17] assumes dom f open.

theorem ConvexAnalysis.convexOn_iff_inner_sub_sub_nonneg {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] {f : H → ℝ} {f' : H → H} {s : Set H} (hs : Convex ℝ s) (hf' : ∀ x ∈ s, HasGradientAt f (f' x) x) :
ConvexOn ℝ s f ↔ ∀ x ∈ s, ∀ y ∈ s, 0 ≤ inner ℝ (x - y) (f' x - f' y)

Monotone gradients characterize convexity, BC, Proposition 17.7 (i)⇔(iii) with a Fréchet gradient in place of [BC17]'s Gâteaux gradient: a function with a gradient at every point of the convex set s is convex on s iff its gradient is monotone on s.

theorem ConvexAnalysis.StrongConvexOn.mul_norm_sub_sq_le_inner_of_hasGradientWithinAt {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] {f : H → ℝ} {s : Set H} {u v x y : H} {m : ℝ} (hf : StrongConvexOn s m f) (hx : x ∈ s) (hy : y ∈ s) (hu : HasGradientWithinAt f u s x) (hv : HasGradientWithinAt f v s y) :
m * ‖x - y‖ ^ 2 ≤ inner ℝ (x - y) (u - v)

The gradient of an m-strongly convex function is m-strongly monotone: for f m-strongly convex on s with gradients u at x ∈ s and v at y ∈ s (within s), m ‖x - y‖² ≤ ⟪x - y, u - v⟫ (compare BC, Example 22.4 (iv), there for ∂f).

theorem ConvexAnalysis.strongConvexOn_of_forall_add_inner_add_le {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] {f : H → ℝ} {f' : H → H} {s : Set H} {m : ℝ} (hs : Convex ℝ s) (h : ∀ x ∈ s, ∀ y ∈ s, f x + inner ℝ (f' x) (y - x) + m / 2 * ‖y - x‖ ^ 2 ≤ f y) :

Converse of the gradient inequality of a strongly convex function: if f x + ⟪f' x, y - x⟫ + (m / 2) ‖y - x‖² ≤ f y for all x, y in a convex set s, then f is m-strongly convex on s; f' is any map.

theorem ConvexAnalysis.strongConvexOn_iff_forall_add_inner_add_le {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] {f : H → ℝ} {f' : H → H} {s : Set H} {m : ℝ} (hs : Convex ℝ s) (hf' : ∀ x ∈ s, HasGradientWithinAt f (f' x) s x) :
StrongConvexOn s m f ↔ ∀ x ∈ s, ∀ y ∈ s, f x + inner ℝ (f' x) (y - x) + m / 2 * ‖y - x‖ ^ 2 ≤ f y

First-order characterization of strong convexity: a function with a gradient within the convex set s at every point of s is m-strongly convex on s iff f x + ⟪f' x, y - x⟫ + (m / 2) ‖y - x‖² ≤ f y for all x, y ∈ s.

theorem ConvexAnalysis.strongConvexOn_of_mul_norm_sub_sq_le_inner {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] {f : H → ℝ} {f' : H → H} {s : Set H} {m : ℝ} (hs : Convex ℝ s) (hf' : ∀ x ∈ s, HasGradientAt f (f' x) x) (hmono : ∀ x ∈ s, ∀ y ∈ s, m * ‖x - y‖ ^ 2 ≤ inner ℝ (x - y) (f' x - f' y)) :

A function with a strongly monotone gradient is strongly convex: if f has the gradient f' x at every point x of the convex set s and m ‖x - y‖² ≤ ⟪x - y, f' x - f' y⟫ for all x, y ∈ s, then f is m-strongly convex on s.

theorem ConvexAnalysis.strongConvexOn_iff_mul_norm_sub_sq_le_inner {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] {f : H → ℝ} {f' : H → H} {s : Set H} {m : ℝ} (hs : Convex ℝ s) (hf' : ∀ x ∈ s, HasGradientAt f (f' x) x) :
StrongConvexOn s m f ↔ ∀ x ∈ s, ∀ y ∈ s, m * ‖x - y‖ ^ 2 ≤ inner ℝ (x - y) (f' x - f' y)

Strongly monotone gradients characterize strong convexity: a function with a gradient at every point of the convex set s is m-strongly convex on s iff its gradient is m-strongly monotone on s.

theorem ConvexAnalysis.IsMinOn.neg_mem_normalCone_of_hasGradientWithinAt {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] {f : H → ℝ} {C : Set H} {g x : H} (hmin : IsMinOn f C x) (hC : Convex ℝ C) (hx : x ∈ C) (hg : HasGradientWithinAt f g C x) :

First-order necessary condition on a convex set: if x minimizes f on the convex set C and f has the gradient g within C at x, then -g ∈ N_C x, that is, ⟪g, y - x⟫ ≥ 0 for every y ∈ C (a variational inequality). No convexity of f is needed.

Optimality condition for differentiable convex problems, BC, Proposition 27.8 (i)⇔(vi) with a Fréchet gradient within C in place of [BC17]'s Gâteaux gradient at x: if f is convex on C and has the gradient g within C at x ∈ C, then x minimizes f on C iff -g ∈ N_C x, that is, iff ⟪g, y - x⟫ ≥ 0 for every y ∈ C. [BC17] states this for f ∈ Γ₀(H), a closed convex set C and a qualification condition; here f is real valued and convex on C only, C need not be closed, and no qualification is needed.

theorem ConvexAnalysis.ConvexOn.isMinOn_iff_neg_mem_normalCone_of_hasGradientAt {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] {f : H → ℝ} {C : Set H} {g x : H} (hf : ConvexOn ℝ C f) (hx : x ∈ C) (hg : HasGradientAt f g x) :

The optimality condition with the gradient at x.