Documentation

CslibFrontier.Foundations.Analysis.Convex.FirstOrder

First-order conditions for convex functions on normed spaces #

A convex function lies above its tangent hyperplanes: if f is convex on K and differentiable within K at x ∈ K with derivative f', then f x + f' (y - x) ≤ f y for y ∈ K (strictly when f is strictly convex and y ≠ x). In a Hilbert space with gradient g this reads f x + ⟪g, y - x⟫ ≤ f y, so the gradient is a subgradient relative to K. For m-strongly convex functions the bound improves by m / 2 * ‖y - x‖ ^ 2. Mathlib proves the one-dimensional statements (ConvexOn.le_slope_of_hasDerivWithinAt_Ioi and its relatives); here they are lifted along the segment s ↦ x + s • (y - x).

These are the forms of convexity and strong convexity assumed by online convex optimization ([Haz22] §2.1).

Main results #

References #

theorem ConvexOn.add_le_of_hasFDerivWithinAt {F : Type u_1} [NormedAddCommGroup F] [NormedSpace ℝ F] {K : Set F} {f : F → ℝ} (hf : ConvexOn ℝ K f) {x y : F} {f' : F →L[ℝ] ℝ} (hx : x ∈ K) (hy : y ∈ K) (hd : HasFDerivWithinAt f f' K x) :
f x + f' (y - x) ≤ f y

A convex function lies above its tangent hyperplane at any point where it is differentiable within its domain: f x + f' (y - x) ≤ f y for x y ∈ K.

theorem ConvexOn.add_le_of_hasFDerivAt {F : Type u_1} [NormedAddCommGroup F] [NormedSpace ℝ F] {K : Set F} {f : F → ℝ} (hf : ConvexOn ℝ K f) {x y : F} {f' : F →L[ℝ] ℝ} (hx : x ∈ K) (hy : y ∈ K) (hd : HasFDerivAt f f' x) :
f x + f' (y - x) ≤ f y

A convex function lies above its tangent hyperplane at any point of differentiability: f x + f' (y - x) ≤ f y for x y ∈ K.

theorem ConcaveOn.le_add_mul_of_hasDerivWithinAt {K : Set ℝ} {f : ℝ → ℝ} {x y d : ℝ} (hf : ConcaveOn ℝ K f) (hx : x ∈ K) (hy : y ∈ K) (hd : HasDerivWithinAt f d K x) :
f y ≤ f x + d * (y - x)

A concave function on ℝ lies below its tangent line at any point where it is differentiable within its domain: f y ≤ f x + d * (y - x) for x y ∈ K.

theorem convexOn_of_forall_add_le {F : Type u_1} [NormedAddCommGroup F] [NormedSpace ℝ F] {K : Set F} {f : F → ℝ} (hK : Convex ℝ K) {g : F → F →L[ℝ] ℝ} (hsub : ∀ x ∈ K, ∀ y ∈ K, f x + (g x) (y - x) ≤ f y) :

Conversely, a function with a subgradient relative to K at every point of a convex set K is convex on K: if f x + g x (y - x) ≤ f y for all x y ∈ K, then f is convex on K.

theorem StrictConvexOn.add_lt_of_hasFDerivWithinAt {F : Type u_1} [NormedAddCommGroup F] [NormedSpace ℝ F] {K : Set F} {f : F → ℝ} (hf : StrictConvexOn ℝ K f) {x y : F} {f' : F →L[ℝ] ℝ} (hx : x ∈ K) (hy : y ∈ K) (hxy : y ≠ x) (hd : HasFDerivWithinAt f f' K x) :
f x + f' (y - x) < f y

A strictly convex function lies strictly above its tangent hyperplane at any point where it is differentiable within its domain: f x + f' (y - x) < f y for x y ∈ K with y ≠ x.

theorem StrictConvexOn.add_lt_of_hasFDerivAt {F : Type u_1} [NormedAddCommGroup F] [NormedSpace ℝ F] {K : Set F} {f : F → ℝ} (hf : StrictConvexOn ℝ K f) {x y : F} {f' : F →L[ℝ] ℝ} (hx : x ∈ K) (hy : y ∈ K) (hxy : y ≠ x) (hd : HasFDerivAt f f' x) :
f x + f' (y - x) < f y

A strictly convex function lies strictly above its tangent hyperplane at any point of differentiability: f x + f' (y - x) < f y for x y ∈ K with y ≠ x.

theorem strictConvexOn_of_forall_add_lt {F : Type u_1} [NormedAddCommGroup F] [NormedSpace ℝ F] {K : Set F} {f : F → ℝ} (hK : Convex ℝ K) {g : F → F →L[ℝ] ℝ} (hsub : ∀ x ∈ K, ∀ y ∈ K, y ≠ x → f x + (g x) (y - x) < f y) :

Conversely, a function with a strict subgradient relative to K at every point of a convex set K is strictly convex on K: if f x + g x (y - x) < f y for all x y ∈ K with y ≠ x, then f is strictly convex on K.

theorem ConvexOn.add_inner_le_of_hasGradientWithinAt {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] {K : Set E} {f : E → ℝ} (hf : ConvexOn ℝ K f) {x y g : E} (hx : x ∈ K) (hy : y ∈ K) (hg : HasGradientWithinAt f g K x) :
f x + inner ℝ g (y - x) ≤ f y

The gradient of a convex function within its domain is a subgradient relative to the domain: f x + ⟪g, y - x⟫ ≤ f y for x y ∈ K.

theorem ConvexOn.add_inner_le_of_hasGradientAt {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] {K : Set E} {f : E → ℝ} (hf : ConvexOn ℝ K f) {x y g : E} (hx : x ∈ K) (hy : y ∈ K) (hg : HasGradientAt f g x) :
f x + inner ℝ g (y - x) ≤ f y

The gradient of a convex function is a subgradient relative to its domain: f x + ⟪g, y - x⟫ ≤ f y for x y ∈ K.

theorem convexOn_of_forall_add_inner_le {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {K : Set E} {f : E → ℝ} (hK : Convex ℝ K) {g : E → E} (hsub : ∀ x ∈ K, ∀ y ∈ K, f x + inner ℝ (g x) (y - x) ≤ f y) :

Conversely, a function with a subgradient relative to K at every point of a convex set K is convex on K: if f x + ⟪g x, y - x⟫ ≤ f y for all x y ∈ K, then f is convex on K.

theorem abs_sub_le_of_forall_add_inner_le {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {K : Set E} {f : E → ℝ} {g : E → E} {ρ : ℝ} (hsub : ∀ x ∈ K, ∀ y ∈ K, f x + inner ℝ (g x) (y - x) ≤ f y) (hg : ∀ x ∈ K, ‖g x‖ ≤ ρ) {x y : E} (hx : x ∈ K) (hy : y ∈ K) :
|f x - f y| ≤ ρ * ‖x - y‖

Bounded subgradients make a function Lipschitz: if f x + ⟪g x, y - x⟫ ≤ f y for x y ∈ K and ‖g x‖ ≤ ρ on K, then |f x - f y| ≤ ρ * ‖x - y‖ for x y ∈ K.

theorem StrongConvexOn.add_inner_add_le_of_hasGradientWithinAt {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] {K : Set E} {f : E → ℝ} {m : ℝ} (hf : StrongConvexOn K m f) {x y g : E} (hx : x ∈ K) (hy : y ∈ K) (hg : HasGradientWithinAt f g K x) :
f x + inner ℝ g (y - x) + m / 2 * ‖y - x‖ ^ 2 ≤ f y

The first-order bound for an m-strongly convex function with a gradient within its domain: f x + ⟪g, y - x⟫ + m / 2 * ‖y - x‖ ^ 2 ≤ f y for x y ∈ K.

theorem StrongConvexOn.add_inner_add_le_of_hasGradientAt {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] {K : Set E} {f : E → ℝ} {m : ℝ} (hf : StrongConvexOn K m f) {x y g : E} (hx : x ∈ K) (hy : y ∈ K) (hg : HasGradientAt f g x) :
f x + inner ℝ g (y - x) + m / 2 * ‖y - x‖ ^ 2 ≤ f y

The first-order bound for an m-strongly convex function: f x + ⟪g, y - x⟫ + m / 2 * ‖y - x‖ ^ 2 ≤ f y for x y ∈ K.

theorem hasDerivWithinAt_nonpos_of_eventually_le {φ : ℝ → ℝ} {d : ℝ} (hd : HasDerivWithinAt φ d (Set.Ici 0) 0) (hmax : ∀ᶠ (t : ℝ) in nhdsWithin 0 (Set.Ici 0), φ t ≤ φ 0) :
d ≤ 0

First-order directional derivative nonpositivity for a right-differentiable function at a local maximum on [0, ∞): if φ has right derivative d at 0 within [0, ∞) and φ t ≤ φ 0 eventually as t → 0⁺, then d ≤ 0.

theorem eventually_add_mul_nonneg_nhdsGE {a b : ℝ} (ha : 0 ≤ a) (hb : a = 0 → 0 ≤ b) :
∀ᶠ (t : ℝ) in nhdsWithin 0 (Set.Ici 0), 0 ≤ a + t * b

If a ≥ 0 and any boundary point a = 0 moves inward (b ≥ 0), then 0 ≤ a + t * b holds eventually as t → 0⁺.

theorem eventually_add_mul_le_nhdsGE {a b c : ℝ} (hac : a ≤ c) (hb : a = c → b ≤ 0) :
∀ᶠ (t : ℝ) in nhdsWithin 0 (Set.Ici 0), a + t * b ≤ c

If a ≤ c and any tight point a = c moves weakly downward (b ≤ 0), then a + t * b ≤ c holds eventually as t → 0⁺.