Second-order characterization of convexity
ProvedConvexOptimization.convexOn_iff_hessian_nonnegSecond-order characterization of convexity: a twice differentiable function is convex exactly when its Hessian is positive semidefinite.
Let be open and convex and let be twice continuously differentiable on . Then
i.e. throughout .
This is the criterion one actually applies to a concrete function: convexity of a quadratic form reduces to positive semidefiniteness of its matrix, and convexity along every line is exactly nonnegativity of the second derivative of the restriction. Strengthening the right-hand side to with gives strong convexity, the hypothesis under which the convergence rates of later missions are stated.
Formalization Note Smoothness is ContDiffOn ℝ 2 f Ω, and the Hessian appears as the iterated Fréchet derivative fderiv ℝ (fderiv ℝ f) x v v rather than as a matrix, which avoids choosing a basis; openness of Ω is needed for these derivatives to be defined at every point of the domain. Source: B&V §3.1.4, p. 71.
import Mathlib open scoped RealInnerProductSpace ENNReal open MeasureTheory
theorem ConvexOptimization.convexOn_iff_hessian_nonneg {n : ℕ}
(Ω : Set (EuclideanSpace ℝ (Fin n))) (hΩo : IsOpen Ω) (hΩc : Convex ℝ Ω)
(f : EuclideanSpace ℝ (Fin n) → ℝ) (hf : ContDiffOn ℝ 2 f Ω) :
ConvexOn ℝ Ω f ↔
∀ x ∈ Ω, ∀ v : EuclideanSpace ℝ (Fin n),
0 ≤ fderiv ℝ (fderiv ℝ f) x v v := by
sorry
Read-back
What the Lean code literally says, in plain math · claude-fable-5
Theorem statement. Let (Euclidean) be open and convex, and let be twice continuously differentiable on (ContDiffOn of order ; nothing is assumed about off ). The claim is the equivalence: is convex on (Mathlib ConvexOn: convex — redundant with the hypothesis — together with for , , ) for every and every direction , , where denotes the globally defined total Fréchet-derivative function (assigned the junk value at any point where is not differentiable) and is the Fréchet derivative of that global function at (again junk where it fails to exist). Because is open and is on it, at points of these coincide with the genuine first and second derivatives, so the right-hand side is the nonnegativity of the second directional derivative — i.e. only the diagonal of the second-derivative bilinear form is constrained, for each single direction (including , where it is trivially ). If both sides are vacuous.
Confirmed by the mission captain (proposal self-audit).