Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1.15 — convex functions are almost differentiable and their almost-gradients are subgradients

Proved
ShorNonsmooth.AlmostDiff.convex_almostDifferentiable_almostGradient_isSubgradient

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

almost-differentiableconvex-analysisp2o-batch-b23ap2o-gran-per-chapterp2o-plan-bookp2o-v1subgradient

Let f:En→Rf : E_n \to \mathbb{R}f:En​→R be convex. Then

  1. fff is almost differentiable: it is Lipschitz on every bounded set, differentiable almost everywhere, and its gradient is continuous on the set of points where it is differentiable;
  2. at every point x0∈Enx_0 \in E_nx0​∈En​, every almost-gradient of fff is a subgradient:
G(x0)⊆Gf(x0)={g∈En:f(x)−f(x0)≥(g,x−x0) for all x∈En}.G(x_0) \subseteq G_f(x_0) = \{ g \in E_n : f(x) - f(x_0) \ge (g, x - x_0) \ \text{for all } x \in E_n \}.G(x0​)⊆Gf​(x0​)={g∈En​:f(x)−f(x0​)≥(g,x−x0​) for all x∈En​}.

The theorem places convex functions inside the class of almost differentiable functions, so that methods designed for almost-gradients apply to convex minimization, with every almost-gradient a valid subgradient.

Formalization Note The printed theorem says that the almost-gradients "coincide with" the subgradients. That set equality is false: for f(x)=∣x∣f(x) = |x|f(x)=∣x∣ on E1E_1E1​ the almost-gradients at 000 are {−1,1}\{-1, 1\}{−1,1}, while the subgradients form [−1,1][-1, 1][−1,1]. The book's proof establishes exactly the inclusion stated here, and this is what is formalized. (The true equality is between the subdifferential and the closed convex hull of the almost-gradients; the book does not prove it.)

Preamble
import Mathlib
import Definitions.Def_ShorNonsmooth_AlmostDiff_IsSubgradient
import Definitions.Def_ShorNonsmooth_AlmostDiff_AlmostDifferentiable
import Definitions.Def_ShorNonsmooth_AlmostDiff_almostGradients
Formal statement
namespace ShorNonsmooth.AlmostDiff

/-- Shor (1985), p. 18, Theorem 1.15, in the form its proof establishes: a convex function `f`
on `E_n` is almost differentiable, and at every point `x₀` every almost-gradient of `f` is a
subgradient of `f` at `x₀`.

The printed statement says the almost-gradients "coincide with" the subgradients; that set
equality is false (for `f(x) = |x|` on `ℝ¹` the almost-gradients at `0` are `{-1, 1}` while the
subgradients form `[-1, 1]`), and the book's proof shows only the inclusion stated here. -/
theorem convex_almostDifferentiable_almostGradient_isSubgradient {n : ℕ}
    (f : EuclideanSpace ℝ (Fin n) → ℝ) (hf : ConvexOn ℝ Set.univ f) :
    AlmostDifferentiable f ∧
      ∀ x₀ : EuclideanSpace ℝ (Fin n), ∀ g ∈ almostGradients f x₀,
        IsSubgradient f x₀ g := by sorry

end ShorNonsmooth.AlmostDiff
Source
Shor, Minimization Methods for Non-Differentiable Functions, Springer 1985, p. 18, Theorem 1.15 (corrected: inclusion, as proved)
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