Minimization Methods for Non-Differentiable Functions VI: Almost-Sure Convergence of the Stochastic Subgradient MethodTextbook
Motivation
Many optimization problems in operations research are posed on an expectation: a two-stage or multistage stochastic program minimizes , where is convex but nonsmooth and the expectation cannot be computed exactly. What can be computed is a stochastic subgradient, a random vector whose mean is a subgradient of . The stochastic subgradient method replaces the exact subgradient in the classical method by such a random vector. It was introduced by Yu. M. Ermoliev and N. Z. Shor in 1968 and developed by Ermoliev, Nurminski and others into a standard tool of stochastic programming; the same scheme, under the name stochastic (sub)gradient descent, underlies most of large-scale machine learning.
This mission formalizes Section 2.6 of N. Z. Shor, Minimization Methods for Non-Differentiable Functions (Springer 1985): the almost-sure convergence theorem for the stochastic subgradient method (Theorem 2.19), together with two deterministic results of the same section on perturbed and restarted variants of the subgradient method (Theorems 2.18 and 2.20).
Timeline, as recorded in the book:
- 1968, Ermoliev and Shor: the notion of a stochastic subgradient, introduced for a random search method for two-stage stochastic programs; the convergence theorem reproduced as Theorem 2.19.
- 1972, Bazhenov: convergence of a subgradient method with restarts for almost differentiable (in general nonconvex) functions, Theorem 2.18.
- 1976, Shepilov: stability of the subgradient method with respect to errors in the point where the subgradient is computed, Theorem 2.20.
Setting
is -dimensional Euclidean space with inner product . A vector is a subgradient of at if for all ; is the set of minimum points of .
Stochastic subgradient method. Fix a probability space with a filtration , a deterministic starting point , stepsize rules and random vectors . The iterates are
In the book's notation : a random vector whose expectation, given the state at step , is a subgradient of at . In the Lean development the iterates are stochIter h G x₀ k ω.
Perturbed subgradient method (Shepilov). Given a subgradient selection , points with , and steps : .
Restarted method (Bazhenov). For a function that is almost differentiable (Lipschitz on bounded sets, differentiable almost everywhere, with gradient continuous where it exists) and a selection of almost-gradients (limit points of gradients at nearby points of differentiability), with : take the normalized step and restart from whenever leaves (resetIter).
Formalization targets
Goal: Theorem 2.19 (p. 46)
Let be convex with a unique minimum point . Suppose is a subgradient of at , , and almost surely , , . Then
Milestones
- Eq. (2.42), the conditional one-step inequality
- Proof of Theorem 2.19, pp. 46–47: with probability one converges to a finite limit (no divergence condition on the steps).
- Theorem 2.20 (Shepilov): under , , , , the perturbed method converges to a point of .
- Theorem 2.18 (Bazhenov): if and for every , the restarted method with , converges to from any .
Significance
Theorem 2.19 is the basic justification of stochastic subgradient methods: without computing or any exact subgradient, the method reaches the minimizer with probability one, under stepsize conditions that are met by . It is the nonsmooth convex counterpart of the Robbins–Monro theorem and the prototype of the almost-sure convergence results for stochastic quasi-gradient methods used in stochastic programming. Theorem 2.20 shows that the deterministic method tolerates summable errors in the point where the subgradient is evaluated, which is what allows subgradients to be approximated by finite differences (Section 1.3). Theorem 2.18 extends the convergence of the normalized method to local minima of a class of nonconvex functions.
All four results are proved in the literature. To the best of the platform search (September 2026), none is machine-checked: the platform has almost-sure convergence theorems for smooth stochastic approximation under ODE-type hypotheses (Borkar–Meyn) and in-expectation bounds for stochastic gradient descent, neither of which covers this recursion. A formal proof of the goal would give a reusable almost-sure convergence argument for nonsmooth stochastic methods on top of Mathlib's martingale theory.
Difficulty
The deterministic proof of convergence of the subgradient method compares with along the whole trajectory. With random directions this comparison holds only in conditional expectation, and the term is not controlled pathwise. Taking expectations of the one-step inequality and summing gives only bounds on , which do not yield almost-sure convergence. Moreover the stepsize depends on the random iterate, so the conditions and hold only almost surely, not uniformly, and the iterates need not be square-integrable. Identifying the almost-sure limit as requires using the uniqueness of the minimizer to bound away from zero outside a neighbourhood of .
In Theorems 2.18 and 2.20 the difficulty is that the distance to is not monotone: steps taken near the solution, or with a perturbed subgradient, can increase it, and a restart can move the iterate far away.
Formalization scope
- is
EuclideanSpace ℝ (Fin n); is real-valued (finite everywhere); convexity isConvexOn ℝ Set.univ f; uniqueness of is a separate hypothesis. - Probabilistic model. The book assumes the distribution of is determined by and independent of the past, and remarks this is inessential. The formalization uses a filtration: is -measurable, each is Borel measurable, is deterministic, and the hypotheses are on conditional expectations given . This contains the book's model.
- Condition (iii) is printed as ; the proof uses the conditional bound in (2.42), and the formalization assumes the conditional bound almost surely.
- Every expectation carries an integrability hypothesis ( and integrable), so no conditional expectation defaults to Lean's junk value . The one-step milestone assumes integrable and a bounded stepsize rule at that step, and concludes integrability of .
- Conditions (i)–(ii) on the random stepsizes are required almost surely. "With probability one " is
∀ᵐ ω ∂μ, Tendsto (fun k => ‖x k ω - x*‖) atTop (𝓝 0). - Division by zero. In Theorems 2.18 and 2.20 the normalized step is undefined when the subgradient vanishes; the formalization skips the step (the iterate is repeated) by an explicit branch, not through Lean's convention . When the subgradient never vanishes the sequences are exactly the book's.
- The printed display (2.42) has where is meant on its left-hand side; the corrected inequality is stated.
- A trivializing formalization, for instance dropping the integrability hypotheses so that the conditional expectations vanish, or quantifying the stepsize conditions so that they cannot hold, is excluded by the hypotheses above; the hypotheses are satisfiable (deterministic subgradients of with ).
- Mathlib supplies conditional expectation (
MeasureTheory.condExp), filtrations, and almost-sure convergence of -bounded (sub/super)martingales; the supermartingale convergence theorem the book cites from Doob is used from Mathlib, not restated. A Robbins–Siegmund-type lemma for nonnegative almost-supermartingales would be the natural reusable contribution. The almost-differentiability and subgradient definitions duplicate drafts of other missions in this series.
Selected references
- N. Z. Shor, Minimization Methods for Non-Differentiable Functions, Springer Series in Computational Mathematics 3, Springer, 1985, Section 2.6, pp. 44–47. https://doi.org/10.1007/978-3-642-82118-9
- Yu. M. Ermoliev and N. Z. Shor, A random search method for two-stage problems of stochastic programming and its generalization, Kibernetika (Kiev), no. 1, 90–92, 1968.
- L. G. Bazhenov, On the conditions for convergence of methods for minimizing almost differentiable functions, Kibernetika (Kiev), no. 4, 71–72, 1972.
- M. A. Shepilov, On a method of generalized gradient for finding the absolute minimum of a convex function, Kibernetika (Kiev), no. 4, 52–57, 1976.
- Yu. M. Ermoliev, Methods of Stochastic Programming, Nauka, Moscow, 1976.
- H. Robbins and D. Siegmund, A convergence theorem for non negative almost supermartingales and some applications, in Optimizing Methods in Statistics, Academic Press, 1971, pp. 233–257. https://doi.org/10.1016/B978-0-12-604550-5.50015-8
- J. L. Doob, Stochastic Processes, Wiley, New York, 1953 (supermartingale convergence theorem).