advanced29 min studyLesson 47 in Mathematics

Proximal and projected methods

Handle hard feasible sets and nonsmooth penalties by solving a local regularized subproblem instead of differentiating a kink.

On this page

What you’ll understand

  • Compute projections onto intervals and interpret their optimality.
  • Derive scalar soft thresholding as a proximal operation.
  • Distinguish proximal gradient from ordinary gradient descent.

Many useful objectives contain a term that cannot be handled by an ordinary derivative: an absolute-value penalty, a hard nonnegativity constraint, or an indicator of a feasible set. These are not defects to smooth away automatically. A proximal step keeps the difficult term intact and replaces only the smooth part by a simple local model. The resulting small optimization problem can often be solved exactly, giving meaningful zeros or guaranteed feasibility.

Projection is a well-posed subproblem

Euclidean projection finds the feasible point closest to a proposed vector. In finite dimensions, every point has a unique projection onto a nonempty closed convex set. Closedness prevents the nearest boundary point from being missing; convexity, together with strict convexity of squared distance, gives uniqueness. Projection onto an interval clips the proposal to its endpoints. Projection onto a complicated convex set may itself require significant computation, so it should not be treated as free.

Projected gradient descent first makes an unconstrained gradient proposal and then projects it. At a constrained optimum, this combined update can remain fixed even when the raw gradient is nonzero. Its displacement divided by step size defines a gradient mapping, a more suitable stationarity residual for this setting. Under convexity, a fixed point of the exact projected step satisfies the feasible first-order condition; merely having a small raw gradient is unnecessary at a boundary solution.

ΠC(v)=argmin⁡z∈C 12∥z−v∥2,x+=ΠC(x−η∇f(x))\Pi_C(v)=\underset{z\in C}{\operatorname{argmin}}\,\tfrac12\|z-v\|^2,\qquad x^+=\Pi_C(x-\eta\nabla f(x))
C is assumed nonempty, closed, and convex in Euclidean finite-dimensional space. The projection is unique; x⁺ denotes the next projected-gradient iterate.↔ Scroll wide equations horizontally.

A proximal operator generalizes projection

For a proper lower-semicontinuous convex function h and positive step size, the proximal operator minimizes h plus a squared distance cost. The quadratic makes the subproblem strongly convex and coercive enough for a unique solution in finite dimensions. Choosing h to be zero on a closed convex set and positive infinity outside it recovers projection. Extended values encode a hard constraint without pretending it is a differentiable finite penalty.

For h(z)=λ∣z∣h(z)=\lambda|z|, the scalar answer is soft thresholding: subtract the threshold from positive proposals, add it to negative proposals, and send proposals within the threshold interval exactly to zero. The kink at zero is handled by the subgradient interval, not by arbitrarily assigning one ordinary derivative. This explains why absolute-value regularization can produce exact sparse coordinates, whereas a smooth quadratic penalty generally shrinks them without setting them exactly to zero.

prox⁡ηh(v)=argmin⁡z[h(z)+∥z−v∥22η],prox⁡ηλ∣⋅∣(v)=sign⁡(v)max⁡(∣v∣−ηλ,0)\operatorname{prox}_{\eta h}(v)=\underset{z}{\operatorname{argmin}}\left[h(z)+\frac{\|z-v\|^2}{2\eta}\right],\qquad\operatorname{prox}_{\eta\lambda|\cdot|}(v)=\operatorname{sign}(v)\max(|v|-\eta\lambda,0)
The convention includes η in the quadratic denominator. The sign at zero may be taken as zero; the resulting thresholded value is unambiguous.↔ Scroll wide equations horizontally.

Split smooth and nonsmooth structure

For an objective f+hf+h, proximal gradient applies the proximal operator of h to a gradient proposal from f. When f is convex with L-Lipschitz gradient, h is proper closed convex, a minimizer exists, and the operations are exact, positive fixed steps no larger than 1/L1/L support convergence guarantees. Those guarantees concern this composite iteration; they cannot be imported unchanged if the proximal subproblem is solved inaccurately or the smooth gradient is replaced by biased data.

The lab uses only h=0 and unconstrained unit-curvature f, so its proximal operation would be the identity. Compare steps 0.5 and 1, then calculate the nontrivial threshold manually in the example. No clipping or thresholding occurs in the animation. Keeping the decomposition explicit lets you determine which part is cheap, which part encodes a hard modeling choice, and which numerical residual actually measures progress toward the composite problem's solution.

A sparse estimate from one exact proximal step

Minimize F(x)=12(x−3)2+∣x∣F(x)=\tfrac12(x-3)^2+|x|. Start at zero and take a proximal-gradient step with η=1\eta=1, treating the square as f and absolute value as h.

  1. The smooth gradient is f′(x)=x−3f'(x)=x-3, so at zero it equals −3. The gradient proposal is v=0−1(−3)=3v=0-1(-3)=3. The smooth curvature is one, making this a reciprocal-curvature step.

  2. Apply soft thresholding with threshold ηλ=1\eta\lambda=1. Since v=3 exceeds the threshold, the proximal result is x+=3−1=2x^+=3-1=2. The composite value drops from F(0)=4.5F(0)=4.5 to F(2)=0.5+2=2.5F(2)=0.5+2=2.5.

  3. At positive x=2, the subgradient of |x| is one, and stationarity is (2−3)+1=0(2-3)+1=0. Convexity certifies a global optimum. The quadratic component is strongly convex, so the minimizer is unique.

The result

The answer is 2 rather than the unregularized estimate 3. The exact sparse threshold mechanism comes from the proximal subproblem, not the gradient animation.

Explore the model

Interactive lab

Interactive lab · optimization

The smooth part before a proximal correction

Compare η=0.5 and η=1 from a nonzero x₀ on f(x)=x²/2. Predict the unconstrained gradient proposal. The lab has h=0, so it does not perform interval projection, soft thresholding, or any other nontrivial proximal operation.

The smooth part before a proximal correctionGradient descent on f(x) = x²/2: xₙ = (1 − η)ⁿx₀. Playback advances two discrete iterations per second. Values outside |x| ≤ 4 are explicitly reported. Current readings: Position x0: 2; Objective x²/2: 2; Iteration behavior: Stable step. All parameters are adjustable with the labeled controls below.−4−202402.174.356.528.7Parameter xf(x) = x²/2n = 0
ObjectiveDiscrete iterate
Position x0
2
Objective x²/2
2
Iteration behavior
Stable step
n = 0 · t = 0 s

Gradient descent on f(x) = x²/2: xₙ = (1 − η)ⁿx₀. Playback advances two discrete iterations per second. Values outside |x| ≤ 4 are explicitly reported. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA proximal-gradient method adds a specified proximal subproblem to a gradient proposal; that extra operation must be computed explicitly.

Check your understanding

What is the proximal value of 0.4 for h(x)=|x| with step size η=0.5?

Try it yourself

For f(x)=12(x−3)2f(x)=\tfrac12(x-3)^2 on C=[0,1]C=[0,1], compute the projected-gradient update from x=0 with η=1 and verify why the result stays fixed on another update.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

The first unconstrained proposal is three. Projection onto an interval clips values beyond the upper endpoint.

Compare with the solution

The gradient at zero is −3, so the proposal is three and its projection is one. At x=1 the gradient is −2, making the next proposal three again; projection again gives one. The gradient mapping is zero there despite the raw gradient −2, correctly detecting the boundary optimum.

Take it with you

  • Projection enforces a closed convex feasible set through a nearest-point subproblem.
  • Proximal operators handle nonsmooth structure without inventing a derivative at a kink.
  • The gradient mapping measures composite or constrained stationarity more appropriately than a raw gradient.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.