Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1.10 — a C2C^2C2 function is convex iff its Hessian is positive semidefinite

Proved
ShorNonsmooth.Subdiff.convex_iff_hessian_posSemidef

by mikedeng1 · Oct 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

convex-analysishessianp2o-batch-b23ap2o-gran-per-chapterp2o-plan-bookp2o-v1

Let f:En→Rf : E_n \to \mathbb{R}f:En​→R be twice continuously differentiable, with Hessian H(x)H(x)H(x) at xxx. Then fff is convex if and only if H(x)H(x)H(x) is positive semidefinite at every point:

f convex  ⟺  (H(x)v,v)≥0for all x,v∈En.f \text{ convex} \iff (H(x)v, v) \ge 0 \quad \text{for all } x, v \in E_n.f convex⟺(H(x)v,v)≥0for all x,v∈En​.

This is the classical second-order test for convexity.

Formalization Note (H(x)v,v)(H(x)v, v)(H(x)v,v) is written as the second Fréchet derivative applied twice, fderiv ℝ (fderiv ℝ f) x v v; twice continuous differentiability is ContDiff ℝ 2 f.

Preamble
import Mathlib
Formal statement
namespace ShorNonsmooth.Subdiff

/-- Shor (1985), p. 11, Theorem 1.10: a twice continuously differentiable function `f` on `E_n`
is convex if and only if its Hessian `H(x)` is positive semidefinite at every point `x`, i.e.
`(H(x) v, v) = D²f(x)(v, v) ≥ 0` for all `x` and `v`. -/
theorem convex_iff_hessian_posSemidef {n : ℕ} (f : EuclideanSpace ℝ (Fin n) → ℝ)
    (hf : ContDiff ℝ 2 f) :
    ConvexOn ℝ Set.univ f ↔ ∀ x v : EuclideanSpace ℝ (Fin n), 0 ≤ fderiv ℝ (fderiv ℝ f) x v v := by sorry

end ShorNonsmooth.Subdiff
Source
Shor, Minimization Methods for Non-Differentiable Functions, Springer 1985, p. 11, Theorem 1.10
Human review
  • Endorsed by Shuze Chen · Oct 2, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 2, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me