Foundations to Frontier
Tests
A. Mathematical Foundations › A6 Optimization › Convex optimization

Subgradients and Proximal Methods

Many of the most useful objectives have kinks: the L1 norm that promotes sparsity, hinge losses, constraints written as indicator functions. Gradients don't exist at the kinks, but subgradients do, and proximal operators handle the non-smooth part exactly. You will learn subdifferentials and the condition 0 ∈ ∂f(x*), the subgradient method and its slow O(1/√k) rate, proximal operators (soft-thresholding, projections), ISTA and accelerated FISTA, and discover the governing equations of an oscillator from data with sparse regression (SINDy).

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

When the slope has a corner

The function |x| has a sharp corner at 0. There’s no single slope there; anything between −1 and +1 “fits under” the corner. Optimizing functions with corners needs special care. The payoff is huge, because corners are what make a model choose exactly zero for unimportant things. That’s how sparse models pick out the few terms that matter.

A proximal step says: take a normal step for the smooth part, then “snap” to the best nearby point for the cornered part. For |x|, snapping means shrinking toward zero and landing exactly on zero if you’re close enough.

Non-smooth optimization: subgradients vs proximal steps
λ|x| + ½(x − v)², minimizer = proxsoft-threshold S_λ(v) (identity dashed)
proxλ|·|(1.60) = Sλ(v) = 0.800 — shrunk by λ = 0.80
The proximal operator asks for a point that makes λ|x| small while staying close to v. For |x| the answer is soft-thresholding: shift toward zero by λ, and snap to exactly zero inside the dead zone. Proximal gradient (ISTA) alternates a gradient step on the smooth part with this prox, so lasso iterates are genuinely sparse.
Why engineers care

Sparse models identify which few physical terms govern a system (SINDy), which sensors have failed, and which features matter. Compressed sensing reconstructs images from few measurements. Constraints become indicator functions handled by projections. All of these rely on non-smooth optimization done right.

📝 Quick check (Level 0)
0/3 answered
  1. 1. At its corner, |x| has…
  2. 2. Snapping small values to exactly zero produces…
  3. 3. A proximal step handles the cornered part…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

Subgradients

For convex ff, gg is a subgradient at xx if f(y)≥f(x)+g⊤(y−x)f(y)\ge f(x) + g^\top(y - x) for all yy. The set of them is the subdifferential ∂f(x)\partial f(x). If ff is differentiable, ∂f(x)={∇f(x)}\partial f(x) = \{\nabla f(x)\}. For ∣x∣|x|: ∂∣x∣={sign⁡x}\partial|x| = \{\operatorname{sign}x\} if x≠0x\ne0, and [−1,1][-1, 1] at 0.

Optimality: x⋆x^\star minimizes convex ff iff 0∈∂f(x⋆)0\in\partial f(x^\star).

The proximal operator

prox⁡λh(v)=arg⁡min⁡x(h(x)+12λ∥x−v∥2)\operatorname{prox}_{\lambda h}(v) = \arg\min_x\Big(h(x) + \frac1{2\lambda}\|x - v\|^2\Big)
  • h=∣x∣h = |x| (or ∥x∥1\|x\|_1): soft-thresholding Sλ(v)=sign⁡(v)max⁡(∣v∣−λ,0)S_\lambda(v) = \operatorname{sign}(v)\max(|v| - \lambda, 0).
  • h=12∥x∥2h = \frac12\|x\|^2: v/(1+λ)v/(1 + \lambda).
  • h=h = the indicator of a convex set CC: projection PC(v)P_C(v).
📝 Quick check (Level 1)
0/3 answered
  1. 1. ∂|x| at x = 0 is…
  2. 2. S₁(3) =
  3. 3. The prox of a set's indicator function is…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

The subgradient method

xk+1=xk−ηkgkx_{k+1} = x_k - \eta_kg_k with gk∈∂f(xk)g_k\in\partial f(x_k). It’s not a descent method, so track the best value. With diminishing steps ηk∝1/k\eta_k\propto1/\sqrt k, fbest−f⋆=O(1/k)f_{\text{best}} - f^\star = O(1/\sqrt k). That’s slow, and it can’t produce exact zeros.

Proximal gradient (ISTA) for composite problems

For min⁡f(x)+h(x)\min f(x) + h(x) with ff L-smooth and hh convex with a cheap prox:

xk+1=prox⁡h/L(xk−1L∇f(xk))x_{k+1} = \operatorname{prox}_{h/L}\big(x_k - \tfrac1L\nabla f(x_k)\big)

This converges at O(1/k)O(1/k), like GD on smooth problems. The non-smooth part costs nothing extra. For the lasso, 12∥Ax−b∥2+λ∥x∥1\frac12\|Ax - b\|^2 + \lambda\|x\|_1, each step is a gradient step followed by soft-thresholding at λ/L\lambda/L. Projected gradient is the special case where hh is an indicator function.

FISTA (Beck and Teboulle, 2009)

Add Nesterov momentum: evaluate the prox-gradient step at an extrapolated point yk=xk+tk−1−1tk(xk−xk−1)y_k = x_k + \frac{t_{k-1} - 1}{t_k}(x_k - x_{k-1}), with tk+1=1+1+4tk22t_{k+1} = \frac{1 + \sqrt{1 + 4t_k^2}}2. The rate becomes O(1/k2)O(1/k^2), which is optimal for first-order methods on this class.

🐍 Exercise 1: subgradient vs ISTA vs FISTA on the lasso
Implement soft-thresholding, ISTA, FISTA and the subgradient method for a sparse recovery problem. Compare suboptimality after 300 iterations, count exact zeros, and check support recovery.
📝 Quick check (Level 2)
0/3 answered
  1. 1. The subgradient method's rate is…
  2. 2. ISTA's rate on the lasso is…
  3. 3. FISTA improves the rate to…

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

Deriving soft-thresholding

Minimize λ∣x∣+12(x−v)2\lambda|x| + \frac12(x - v)^2. The optimality condition is 0∈λ∂∣x∣+x−v0\in\lambda\partial|x| + x - v.

  • If x>0x > 0: x=v−λx = v - \lambda, valid when v>λv > \lambda.
  • If x<0x < 0: x=v+λx = v + \lambda, valid when v<−λv < -\lambda.
  • If x=0x = 0: we need v∈[−λ,λ]v\in[-\lambda, \lambda].

Together this is Sλ(v)S_\lambda(v). ∎

Why ISTA works

The step minimizes the upper model f(xk)+∇f(xk)⊤(x−xk)+L2∥x−xk∥2+h(x)f(x_k) + \nabla f(x_k)^\top(x - x_k) + \frac L2\|x - x_k\|^2 + h(x), which majorizes f+hf + h by the descent lemma. So F(xk+1)≤F(xk)F(x_{k+1})\le F(x_k), and a telescoping argument gives F(xk)−F⋆≤L∥x0−x⋆∥22kF(x_k) - F^\star\le\frac{L\|x_0 - x^\star\|^2}{2k}. ∎ A fixed point satisfies 0∈∇f(x)+∂h(x)0\in\nabla f(x) + \partial h(x), the optimality condition.

Moreau envelope

Mλh(v)=min⁡xh(x)+12λ∥x−v∥2M_{\lambda h}(v) = \min_xh(x) + \frac1{2\lambda}\|x - v\|^2 is a smooth approximation of hh with gradient (v−prox⁡λh(v))/λ(v - \operatorname{prox}_{\lambda h}(v))/\lambda. For h=∣x∣h = |x| it’s the Huber function: v2/(2λ)v^2/(2\lambda) for ∣v∣≤λ|v|\le\lambda, else ∣v∣−λ/2|v| - \lambda/2.

Exercise 3.1: Show 0 ∈ ∂f(x*) characterizes minimizers of convex f

If 0∈∂f(x⋆)0\in\partial f(x^\star), the subgradient inequality with g=0g = 0 gives f(y)≥f(x⋆)f(y)\ge f(x^\star) for all yy. Conversely, if x⋆x^\star is a minimizer, then g=0g = 0 satisfies the inequality.

📝 Quick check (Level 3)
0/3 answered
  1. 1. S_λ(v) = 0 exactly when…
  2. 2. The Moreau envelope of |x| is…
  3. 3. ISTA's step minimizes…

Level 4: Expert

★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.

Discovering an oscillator’s equations from data

A flexible appendage or sloshing mode with stiffening behaves like a Duffing oscillator. Measure states and derivatives, build a library of 10 candidate polynomial terms per equation, and solve a lasso per state. That’s SINDy, sparse identification of nonlinear dynamics (Brunton, Proctor and Kutz, 2016). FISTA picks exactly the four true terms, x˙=y\dot x = y and y˙=−x−0.1y−0.5x3\dot y = -x - 0.1y - 0.5x^3. Plain least squares gives every term a small spurious coefficient. Interpretable, physically meaningful models fall out of non-smooth optimization.

🐍 Exercise 2 (research): sparse identification of dynamics (SINDy)
Build a polynomial library, solve one lasso per state with FISTA (plus least-squares refitting on the support), and recover the Duffing oscillator's equations. Compare with dense least squares.

Non-smooth optimization in AI, robotics and aerospace

  • SINDy and its variants discover models of fluid flows, spacecraft dynamics and robot mechanics (Brunton et al., 2016; Kaiser, Kutz and Brunton, 2018, SINDy-MPC).
  • Compressed sensing recovers MRI images, radar returns and hyperspectral cubes from few measurements (Candès, Romberg and Tao, 2006; Donoho, 2006).
  • Fault isolation: sparse residual vectors pinpoint the few failed sensors or thrusters.
  • Proximal policy and network pruning: L1/group-lasso penalties prune neural networks for embedded flight computers.

References

  1. N. Parikh, S. Boyd (2014). “Proximal algorithms.” Foundations and Trends in Optimization, 1(3).
  2. A. Beck, M. Teboulle (2009). “A fast iterative shrinkage-thresholding algorithm for linear inverse problems.” SIAM Journal on Imaging Sciences, 2(1).
  3. R. Tibshirani (1996). “Regression shrinkage and selection via the lasso.” JRSS B, 58(1).
  4. I. Daubechies, M. Defrise, C. De Mol (2004). “An iterative thresholding algorithm for linear inverse problems with a sparsity constraint.” Communications on Pure and Applied Mathematics, 57(11).
  5. N. Shor (1985). Minimization Methods for Non-Differentiable Functions. Springer.
  6. S. Brunton, J. Proctor, J. N. Kutz (2016). “Discovering governing equations from data by sparse identification of nonlinear dynamical systems.” PNAS, 113(15).
  7. E. Kaiser, J. N. Kutz, S. Brunton (2018). “Sparse identification of nonlinear dynamics for model predictive control in the low-data limit.” Proceedings of the Royal Society A, 474.
  8. E. Candès, J. Romberg, T. Tao (2006). “Robust uncertainty principles: exact signal reconstruction from highly incomplete frequency information.” IEEE Transactions on Information Theory, 52(2).
  9. D. Donoho (2006). “Compressed sensing.” IEEE Transactions on Information Theory, 52(4).
  10. J.-J. Moreau (1965). “Proximité et dualité dans un espace hilbertien.” Bulletin de la SMF, 93.