Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Eq. (6): the strongly convex empirical minimizer is replace-one stable, ∣f(h^S,z)−f(h^S(i),z)∣≤4L2/(λm)|f(\hat h_S,z)-f(\hat h_S^{(i)},z)|\le 4L^2/(\lambda m)∣f(h^S​,z)−f(h^S(i)​,z)∣≤4L2/(λm)

Proved
LearnStability.ConvexSCO.erm_replace_one_stability

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

learning-theoryp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1stabilitystrong-convexity

Consider a stochastic convex optimization problem on H\mathcal HH whose objective f(h;z)f(h;z)f(h;z) is, for every zzz, λ\lambdaλ-strongly convex (λ>0\lambda>0λ>0) and LLL-Lipschitz in h∈Hh\in\mathcal Hh∈H. Let S=(z1,…,zm)S=(z_1,\dots,z_m)S=(z1​,…,zm​) with m≥1m\ge1m≥1, fix an index iii and a replacement instance zi′z'_izi′​, and let S(i)S^{(i)}S(i) be SSS with ziz_izi​ replaced by zi′z'_izi′​. Let h^S∈H\hat h_S\in\mathcal Hh^S​∈H minimize FSF_SFS​ over H\mathcal HH and h^S(i)∈H\hat h_S^{(i)}\in\mathcal Hh^S(i)​∈H minimize FS(i)F_{S^{(i)}}FS(i)​ over H\mathcal HH. Then

∀z∈Z,∣f(h^S,z)−f(h^S(i),z)∣ ≤ 4L2λm.\forall z\in Z,\qquad \big|f(\hat h_S,z)-f(\hat h_S^{(i)},z)\big|\ \le\ \frac{4L^2}{\lambda m}.∀z∈Z,​f(h^S​,z)−f(h^S(i)​,z)​ ≤ λm4L2​.

This is a deterministic statement: it holds for every sample and every replacement. It says that empirical minimization of a strongly convex objective is uniform-RO stable with rate 4L2/(λm)4L^2/(\lambda m)4L2/(λm).

Formalization Note The paper's stochastic convex optimization standing assumptions (closed, bounded H\mathcal HH, ∣f∣≤C|f|\le C∣f∣≤C, measurability) are carried in the hypothesis bundle although this step does not use them.

Preamble
import Mathlib
import Definitions.Def_LearnStability_ConvexSCO_Setting
import Definitions.Def_LearnStability_ConvexSCO_Problem
Formal statement
namespace LearnStability.ConvexSCO

/-- Eq. (6), proof of Theorem 2 (p. 2645): in a stochastic convex optimization problem whose
objective is `λ`-strongly convex (`λ > 0`) and `L`-Lipschitz in `h` on `H`, let `ĥ_S` minimize
the empirical risk `F_S` over `H` and let `ĥ_S^{(i)}` minimize the empirical risk of the sample
`S^{(i)}` obtained by replacing the `i`-th instance of `S` by `z'_i`. Then for every
`z ∈ Z`, `|f(ĥ_S, z) − f(ĥ_S^{(i)}, z)| ≤ 4L²/(λm)`. -/
theorem erm_replace_one_stability {Z E : Type*} [MeasurableSpace Z] [NormedAddCommGroup E]
    [InnerProductSpace ℝ E] [CompleteSpace E] {Hset : Set E} {f : E → Z → ℝ} {L C lam : ℝ}
    (hP : IsStochasticConvexProblem Hset f L C) (hlam : 0 < lam)
    (hsc : ∀ z, StrongConvexOn Hset lam (fun h => f h z))
    {m : ℕ} (hm : 1 ≤ m) (S : Fin m → Z) (i : Fin m) (z'_i : Z) {hS hSi : E}
    (hS_mem : hS ∈ Hset) (hS_min : ∀ h ∈ Hset, empRisk f S hS ≤ empRisk f S h)
    (hSi_mem : hSi ∈ Hset)
    (hSi_min : ∀ h ∈ Hset,
      empRisk f (Function.update S i z'_i) hSi ≤ empRisk f (Function.update S i z'_i) h) :
    ∀ z : Z, |f hS z - f hSi z| ≤ 4 * L ^ 2 / (lam * m) := by sorry

end LearnStability.ConvexSCO
Source
Shalev-Shwartz, Shamir, Srebro and Sridharan, Learnability, Stability and Uniform Convergence, JMLR 11 (2010), p. 2645, Eq. (6) (proof of Theorem 2)
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. EEE is a complete real inner product space, ZZZ is a measurable space, H⊆E\mathcal H \subseteq EH⊆E, f:E×Z→Rf : E \times Z \to \mathbb{R}f:E×Z→R, and L,C,λ∈RL, C, \lambda \in \mathbb{R}L,C,λ∈R.

Hypothesis 1: (H,f,L,C)(\mathcal H, f, L, C)(H,f,L,C) is a stochastic convex optimization problem.

  • H\mathcal HH is nonempty, convex, closed and norm-bounded.
  • Each z↦f(h;z)z \mapsto f(h; z)z↦f(h;z) with h∈Hh \in \mathcal Hh∈H is measurable.
  • ∣f(h;z)∣≤C|f(h; z)| \le C∣f(h;z)∣≤C on H×Z\mathcal H \times ZH×Z.
  • Each h↦f(h;z)h \mapsto f(h; z)h↦f(h;z) is convex on H\mathcal HH.
  • L≥0L \ge 0L≥0, and ∣f(h;z)−f(h′;z)∣≤L∥h−h′∥|f(h;z) - f(h';z)| \le L\|h - h'\|∣f(h;z)−f(h′;z)∣≤L∥h−h′∥ for all zzz and h,h′∈Hh, h' \in \mathcal Hh,h′∈H.

Hypothesis 2: strong convexity. λ>0\lambda > 0λ>0, and for every z∈Zz \in Zz∈Z the map h↦f(h;z)h \mapsto f(h; z)h↦f(h;z) is λ\lambdaλ-strongly convex on H\mathcal HH. That is, for x,y∈Hx, y \in \mathcal Hx,y∈H and a,b≥0a, b \ge 0a,b≥0 with a+b=1a + b = 1a+b=1:

f(ax+by;z)≤af(x;z)+bf(y;z)−abλ2∥x−y∥2.f(ax+by; z) \le a f(x;z) + b f(y;z) - ab\frac{\lambda}{2}\|x-y\|^2.f(ax+by;z)≤af(x;z)+bf(y;z)−ab2λ​∥x−y∥2.

Hypothesis 3: the two samples. m≥1m \ge 1m≥1 is a natural number, S∈ZmS \in Z^mS∈Zm, i∈{1,…,m}i \in \{1,\dots,m\}i∈{1,…,m} and zi′∈Zz'_i \in Zzi′​∈Z. S(i)S^{(i)}S(i) is SSS with its iii-th entry replaced by zi′z'_izi′​.

Hypothesis 4: the two minimizers. With FS(h)=1m∑j=1mf(h;Sj)F_S(h) = \frac1m\sum_{j=1}^m f(h; S_j)FS​(h)=m1​∑j=1m​f(h;Sj​):

  • h^S∈H\hat h_S \in \mathcal Hh^S​∈H satisfies FS(h^S)≤FS(h)F_S(\hat h_S) \le F_S(h)FS​(h^S​)≤FS​(h) for all h∈Hh \in \mathcal Hh∈H.
  • h^S(i)∈H\hat h_S^{(i)} \in \mathcal Hh^S(i)​∈H satisfies FS(i)(h^S(i))≤FS(i)(h)F_{S^{(i)}}(\hat h_S^{(i)}) \le F_{S^{(i)}}(h)FS(i)​(h^S(i)​)≤FS(i)​(h) for all h∈Hh \in \mathcal Hh∈H.

Conclusion. For every z∈Zz \in Zz∈Z:

∣f(h^S;z)−f(h^S(i);z)∣≤4L2λm.\big|f(\hat h_S; z) - f(\hat h_S^{(i)}; z)\big| \le \frac{4L^2}{\lambda m}.​f(h^S​;z)−f(h^S(i)​;z)​≤λm4L2​.

Degenerate cases.

  • m=0m = 0m=0: excluded.
  • ZZZ nonempty: forced, because SSS exists with m≥1m \ge 1m≥1.
  • H\mathcal HH a single point: both minimizers coincide and the conclusion is 0≤4L2/(λm)0 \le 4L^2/(\lambda m)0≤4L2/(λm).
  • L=0L = 0L=0: the Lipschitz condition with constant 000 together with λ>0\lambda > 0λ>0 strong convexity forces H\mathcal HH to be a single point, so the statement reduces to the previous case.
  • zi′=Siz'_i = S_izi′​=Si​: S(i)=SS^{(i)} = SS(i)=S, but the two minimizers are still arbitrary minimizers of the same function.
  • Unused data: CCC enters only through the structure hypothesis. No measure appears.
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me