The LASSO: Sparsity, Oracle Inequalities, and the Irrepresentable Condition
Anchor (Master): Buhlmann & van de Geer 2011 Statistics for High-Dimensional Data (Springer) §6.2-§6.13 (the basic and oracle inequalities under the compatibility/restricted-eigenvalue condition, variable screening); Wainwright 2019 High-Dimensional Statistics: A Non-Asymptotic Viewpoint (Cambridge) Ch. 7 and §11.4 (the slow/fast-rate oracle bounds, the primal-dual witness and the irrepresentable condition for support recovery)
Intuition Beginner
Suppose you have hundreds of possible predictors and you suspect that only a handful actually matter, but you do not know which. You want a method that fits the data well and hands you a short list of the predictors it kept, switching the rest off entirely. Plain least squares will never do this: it gives every predictor some nonzero weight, because shaving a weight all the way to zero almost always costs a tiny bit of fit. You end up with a dense, hard-to-read model.
The lasso is least squares with a budget on the total absolute size of the weights. You minimize the squared error plus a charge proportional to the sum of the absolute values of the weights. That small change in the charge — absolute value instead of squared value — has a surprising effect. As you tighten the budget, weights do not merely shrink toward zero the way ridge shrinks them; many of them hit exactly zero and stay there. The lasso selects.
Why the difference? Picture the set of weight vectors you can afford. With a squared-size budget the affordable region is a smooth round ball. With an absolute-size budget it is a diamond with sharp corners poking out along the axes. The best affordable fit is where a growing contour of the error first touches that region. Touch a smooth ball and you land on its side, with every weight nonzero. Touch a diamond and you tend to land on a corner — and a corner sits exactly where some weights are zero.
So the lasso does two jobs at once: it stabilizes the fit, like ridge, and it performs variable selection, like an automatic short-list machine. The price of the budget is a little bias, the same bargain the previous units described, now buying sparsity as well as stability.
Visual Beginner
| Budget setting (penalty strength) | What happens to the weights | How many stay nonzero | Typical outcome |
|---|---|---|---|
| Zero | exactly the least-squares weights | all of them | dense, can overfit |
| Small | small weights snap to zero, large ones shrink a little | most of them | mild selection |
| Moderate | clear short-list, kept weights shrunk | a handful | often the sweet spot |
| Very large | almost everything is zero | very few or none | underfits, predicts the average |
The single picture to carry forward: the diamond has corners on the axes, and corners are where coordinates are zero. Ridge's round ball has no corners, so ridge shrinks but never selects. The lasso's sharp corners are the entire reason it produces short, readable models.
Worked example Beginner
Take one predictor with the columns already standardized so that the sum of equals one. Plain least squares would set the weight to the value (sum of ), call it the raw fit. Suppose . We add a lasso charge with strength .
The lasso minimizes over the single weight . Guess the answer is positive, so and we minimize . Its slope in is . Setting the slope to zero gives , so . Since , the positive guess holds.
The raw fit got pulled down to — it shrank by exactly . That is the lasso rule for a value above the threshold: lose .
Now try a small raw fit, , with the same . Shrinking by would carry it past zero, which is not allowed to flip the sign. The honest answer stops at zero: the lasso sets . You can check that any positive makes larger than its value at .
What this tells us: the lasso weight is "raw fit, shrunk toward zero by , and snapped to zero if it would overshoot." So , , . Ridge, by contrast, multiplies the raw fit by a factor like and never reaches zero. The snap-to-zero is the lasso's selection at work.
Check your understanding Beginner
Formal definition Intermediate+
Fix a design matrix with columns and response . Assume the predictors are centered and standardized (each column scaled so that ) and the intercept is fitted unpenalized. For a penalty parameter , the lasso (least absolute shrinkage and selection operator) estimator is the minimizer of the -penalized residual sum of squares,
The objective is convex but the term is nondifferentiable on the coordinate hyperplanes, so the solution is characterized by a subgradient (Karush-Kuhn-Tucker) condition rather than a gradient equation. Following Tibshirani [Tibshirani, R. — Regression Shrinkage and Selection via the Lasso] and the convex-analytic account in Bühlmann & van de Geer [Buhlmann, P. & van de Geer, S. — Statistics for High-Dimensional Data], is a minimizer if and only if there exists a vector with
The two regimes of this lasso KKT condition are the source of sparsity: an active coordinate () must equalize its correlation with the residual to , while an inactive coordinate () is permitted any residual correlation of magnitude at most . A coordinate is switched off precisely when its correlation with the residual fails to reach the threshold . The subgradient calculus is the instance of the subdifferential and proximal machinery of 44.06.02.
The orthonormal design makes the mechanism explicit. When , the criterion decouples across coordinates into with the OLS coordinate, and each coordinate is solved by the soft-thresholding operator
where . This is exactly the proximal operator of from 44.06.02: the lasso solution at orthonormal design is the soft-threshold of the least-squares solution. Ridge, by contrast, multiplies by — a contraction that never vanishes 45.06.03 — whereas soft-thresholding annihilates every coordinate with . The number of surviving coordinates, , is the support (or active set) .
Counterexamples to common slips
- The lasso solution need not be unique. When columns of are linearly dependent (always possible for ), the minimizer can be a polytope of solutions; the fitted values and the optimal objective are always unique (the loss is strictly convex in ), but the coefficient vector and even its support may not be. Uniqueness holds generically — e.g. when the active columns are in general position.
- Soft-thresholding is the orthonormal special case only. The clean formula holds when . For correlated designs the coordinates couple and the solution is computed by coordinate descent or the LARS path; no closed form survives.
- The lasso is biased on the signal it keeps. Soft-thresholding shrinks every surviving coefficient toward zero by (about) , so even correctly selected variables are underestimated. This shrinkage bias is what the debiased lasso later removes for inference, and what the adaptive lasso reduces by reweighting the penalty.
- Selection and prediction are different goals. A that minimizes prediction error generally selects too many variables (it keeps weak predictors to lower bias), while exact support recovery needs a larger and a stronger design condition. One estimator cannot in general be optimal for both at once.
Key theorem with proof Intermediate+
The signature result is the lasso oracle inequality: with the penalty set just above the noise level, the lasso predicts almost as well as if an oracle had revealed the true support, with an error that scales with the sparsity times rather than the ambient dimension .
Theorem (prediction-and-estimation oracle inequality). Let with , and let have cardinality . Define the noise level and suppose the penalty satisfies . Assume the compatibility condition holds on : there is a constant with
Then the lasso estimator with parameter obeys
In particular the prediction error is and the -estimation error is . The argument follows Bühlmann & van de Geer [Buhlmann, P. & van de Geer, S. — Statistics for High-Dimensional Data] §6.2.
Proof. Write . Since minimizes the objective, comparing its value with that at gives . Substituting and expanding the squares, the cross term appears, yielding the basic inequality
Bound the noise term by Hölder: , using . So
Decompose along the support. Because , we have , so . The reverse triangle inequality gives . And . Substituting these bounds,
Cancel from both sides and rearrange:
Two consequences follow. First, dropping the nonnegative prediction term gives , so lies in the cone where the compatibility condition applies. Second, add to both sides to bound the full error:
Apply compatibility, , to the right side, writing :
In particular , so and . Feed back into the inequality to get . Combining, ; tightening via the elementary applied to the original gives and , hence .
Bridge. The proof's engine is the basic inequality, which converts the optimality of into a comparison whose only stochastic ingredient is the inner product , controlled the moment exceeds the noise level . This builds toward the Master-tier rate calculation, where Bernstein/Gaussian concentration 45.05.01 pins with high probability, turning the deterministic bound into the rate , and it appears again in the support-recovery theory where the same KKT stationarity is run through the primal-dual witness. The foundational reason the lasso escapes the curse of dimensionality is that the cone restriction — produced for free by the penalty — confines the error to a thin set on which the design retains an effective eigenvalue , so the -dimensional problem behaves like an -dimensional one; this is exactly the geometric content the compatibility condition encodes. The result generalises the orthonormal soft-threshold picture rather than contradicting it: at orthonormal design and the bound recovers the per-coordinate thresholding error, and the central insight is that sparsity plus a restricted eigenvalue is what replaces the full-rank assumption ordinary least squares 45.06.01 needs. Putting these together, the oracle inequality is the high-dimensional analogue of the bias-variance bound of 45.06.02 with playing the role of the effective dimension.
Exercises Intermediate+
Lean formalization Intermediate+
Mathlib does not yet host the statistical lasso, so no module is wired in (lean_status: none). The intended statement of the KKT characterization and the soft-thresholding solution, once a penalized-empirical-risk API exists, would read roughly as follows.
-- Intended shape; not part of the current Babel Bible Lean build.
-- Requires: an ℓ₁-penalized least-squares functional and the subgradient of ‖·‖₁.
variable {n p : ℕ} (X : Matrix (Fin n) (Fin p) ℝ) (y : Fin n → ℝ) (lam : ℝ)
-- The lasso objective (1/(2n)) ‖y - X β‖² + lam ‖β‖₁.
noncomputable def lassoObj (β : Fin p → ℝ) : ℝ :=
(1 / (2 * n)) * ‖y - X *ᵥ β‖^2 + lam * ∑ j, |β j|
-- KKT characterization: β̂ minimizes iff a sign-subgradient s witnesses stationarity.
theorem lasso_kkt (hlam : 0 < lam) (βhat : Fin p → ℝ) :
IsMinOn (lassoObj X y lam) Set.univ βhat ↔
∃ s : Fin p → ℝ,
(∀ j, βhat j ≠ 0 → s j = Real.sign (βhat j)) ∧
(∀ j, βhat j = 0 → |s j| ≤ 1) ∧
(fun j => (1 / n) * (Xᵀ *ᵥ (y - X *ᵥ βhat)) j) = fun j => lam * s j := by
sorry
-- Orthonormal design ⇒ coordinatewise soft-thresholding.
theorem lasso_soft_threshold (hortho : (1 / n) • (Xᵀ * X) = 1) (j : Fin p) :
(lassoArgmin X y lam) j
= Real.sign ((1 / n) * (Xᵀ *ᵥ y) j) * max (|(1 / n) * (Xᵀ *ᵥ y) j| - lam) 0 := by
sorrythe Mathlib gap analysis records what is missing: the -penalized least-squares functional, the subgradient characterization of at coordinate hyperplanes, the soft-thresholding identity (the proximal operator), the compatibility/restricted-eigenvalue predicate, the basic and oracle inequalities, the concentration control of the event , and the primal-dual witness for sign consistency.
Advanced results Master
The oracle inequality is deterministic on the event ; the rate emerges once that event is shown to be likely. Suppose the columns satisfy and the noise is , or more generally -sub-Gaussian. Each is , hence -sub-Gaussian, and the maximal inequality for sub-Gaussian variables 45.05.01 gives . Choosing makes the bound , so with probability at least the noise level obeys . Setting then satisfies , and the oracle inequality yields the fast rate
with high probability. The factor is the entire cost of not knowing the support: an oracle told the true would pay , and the lasso pays only a logarithmic surcharge. This is the precise sense in which the lasso is near-oracle, and it is the high-dimensional successor to the bias-variance accounting of 45.06.02.
The restricted-eigenvalue (RE) and compatibility conditions are not vacuous. For a random Gaussian design with rows i.i.d. where is well-conditioned, the RE constant over the cone holds with bounded below by a constant once , by a concentration argument over the cone (Raskutti-Wainwright-Yu, Rudelson-Zhou). So the sample-size threshold for the fast rate is , far below the that ordinary least squares 45.06.01 requires. The cone is the geometric reason the curse of dimensionality 45.06.05 is lifted: the penalty forces the error into a low-effective-dimension set, and on that set the otherwise-singular Gram matrix is invertible enough.
Support recovery requires a strictly stronger condition than prediction, and the proof technique is the primal-dual witness (Wainwright). Suppose the true support with of full column rank, the mutual-incoherence / irrepresentable condition for some , a lower bound on the minimum eigenvalue of , and a beta-min condition keeping the nonzero coefficients above the noise floor. One constructs a candidate solution by solving the lasso restricted to (the primal), setting , and exhibiting a dual vector that satisfies the KKT condition with strictly. The strict inequality, guaranteed by the irrepresentable condition, certifies that this construction is the unique lasso solution and that it recovers the exact signed support: with high probability. Zhao & Yu (2006) and Meinshausen & Bühlmann (2006) established that the irrepresentable condition is essentially necessary as well as sufficient — when it fails the lasso selects spurious variables even with infinite data.
Two further structural results round out the theory. The degrees of freedom of the lasso (Zou-Hastie-Tibshirani 2007) equal the expected size of the active set: , an exact and unbiased identity proved via Stein's lemma applied to the piecewise-affine lasso solution map — a striking contrast with ridge's continuous 45.06.03. For inference, the lasso's selection bias makes naive confidence intervals invalid, so the debiased (desparsified) lasso (Zhang-Zhang, van de Geer-Bühlmann-Ritov-Dezeure 2014) adds a one-step correction using an approximate inverse of the Gram matrix, producing that is asymptotically and hence supports honest coordinatewise confidence intervals and -values in the high-dimensional regime.
Synthesis. The foundational reason the lasso unifies sparsity, prediction, and selection is that the single KKT stationarity condition , , controls all three: the inactive-coordinate clause is exactly what produces exact zeros, the basic inequality derived from optimality is exactly what yields the prediction oracle bound, and the strict version is exactly the primal-dual witness certificate for support recovery. This is exactly the specialization of the proximal/subgradient theory of 44.06.02: soft-thresholding is the prox of , the ISTA/FISTA iterations of that unit compute the lasso path, and the optimality condition is the lasso KKT system. The central insight is that the penalty generalises ridge's smooth contraction 45.06.03 into a threshold whose corner geometry both selects variables and, by confining the error to the cone , restores an effective eigenvalue that makes the -dimensional problem behave like an -dimensional one — which is the bridge from the curse of dimensionality 45.06.05 to a tractable sample complexity. Putting these together, prediction is dual to selection through the same dual vector : prediction needs only that exist (compatibility), while selection needs to be strictly feasible off the support (irrepresentability), and the concentration of 45.05.01 is what makes the governing event likely, converting the deterministic oracle inequality into the rate that is optimal up to the logarithm.
Full proof set Master
The KKT characterization, the soft-thresholding solution, the basic inequality, and the prediction-and-estimation oracle inequality are proved in full in the Formal definition, Key theorem, and Exercises sections. The remaining Master claims are recorded here.
Proposition 1 (high-probability control of the noise level). Let and for each . Then for any , with probability at least , .
Proof. For each , is a centered Gaussian with variance , hence -sub-Gaussian, so by the standard Gaussian tail (the Hoeffding/sub-Gaussian special case of 45.05.01). Union over the coordinates, . Set the right side to : . Complementing gives the claim. The same conclusion holds for -sub-Gaussian with the identical bound, using the sub-Gaussian maximal inequality of 45.05.01 instead of the exact Gaussian tail.
Proposition 2 (the fast rate). Under the hypotheses of the oracle inequality with the compatibility constant , and -sub-Gaussian with standardized columns, the choice gives, with probability at least , and .
Proof. On the event of Proposition 1, , so and the oracle inequality of the Key theorem applies, giving . Substituting into gives the prediction bound ; absorbing the constant gives the stated when the maximal inequality is run with the tighter constant for standardized columns. For the bound, gives .
Proposition 3 (the irrepresentable condition is necessary for sign recovery). If is invertible and there exists with , then for every the lasso fails to recover the signed support: no solution has , even in the noiseless limit .
Proof. Suppose toward a contradiction a solution has support exactly and correct signs. The KKT condition on reads . In the noiseless case , so , giving . The KKT condition on requires for each . Compute ; substituting, . By hypothesis this exceeds in absolute value for the offending , violating the inactive-coordinate KKT bound. Hence no such solution exists.
Proposition 4 (degrees of freedom equals expected support size). For the lasso with fixed and , the effective degrees of freedom satisfy .
Proof (sketch, following Zou-Hastie-Tibshirani). By Stein's identity (the Gaussian integration-by-parts of 45.06.04), for a weakly differentiable estimator , . The lasso fitted-value map is continuous and piecewise affine in ; on the open region where the active set and signs are locally constant, , whose Jacobian in is the projection of rank . The divergence (trace of the Jacobian) equals on each such region, and the boundaries between regions form a Lebesgue-null set, so the divergence is almost everywhere . Taking expectations and dividing by gives .
Proposition 5 (uniqueness of fitted values). For any , the lasso fitted value and the optimal objective value are the same for every minimizer .
Proof. The objective is convex, so its minimizers form a convex set . Suppose with . The data-fit term is strictly convex as a function of , and is convex, so for the midpoint , strict convexity of the quadratic in gives , contradicting optimality. Hence is constant on , and then the penalty is also constant on (both terms of are constant since their sum is and the data-fit term is fixed).
Connections Master
Ridge regression and shrinkage 45.06.03 is the counterpart: ridge multiplies each orthonormal coordinate by the smooth factor , a contraction that never reaches zero, whereas the lasso applies soft-thresholding with a dead-zone that produces exact zeros; the two are the and ends of the bridge penalty , and the elastic net combines ridge's grouping of correlated predictors with the lasso's selection.
Bernstein's inequality and sub-exponential concentration 45.05.01 supplies the tail bound that makes the governing event likely: the maximal inequality for sub-Gaussian variables controls at the level with high probability, which is precisely the penalty scale that turns the deterministic oracle inequality into the fast rate .
The proximal operator and proximal-gradient method 44.06.02 is the computational and convex-analytic engine: soft-thresholding is the proximal operator of , the lasso KKT system is the composite Fermat rule of that unit, and the ISTA/FISTA iterations there compute the lasso solution path; the subgradient sign condition that produces sparsity is the instance of its subdifferential calculus.
Subset selection and the curse of dimensionality 45.06.05 frames why the lasso is preferred over explicit best-subset search: the lasso is a continuous convex relaxation of the -penalized combinatorial problem, avoiding the blow-up and the discontinuity/instability of hard selection, and its cone restriction lifts the curse by reducing the effective dimension to where naive selection inflates noise by .
The Frank-Wolfe (conditional gradient) method 44.06.06 is the projection-free alternative for the constrained form subject to : each Frank-Wolfe step solves a linear program over the ball, whose solution is a single signed coordinate vertex, so the iterate is sparse by construction and the method builds the lasso path one active coordinate at a time, mirroring the LARS homotopy.
The James-Stein estimator and inadmissibility 45.06.04 supplies the Stein identity used to prove the degrees-of-freedom result of Proposition 4: the Gaussian integration-by-parts that gives James-Stein its risk gain is the same divergence formula that identifies lasso degrees of freedom with the expected support size, tying high-dimensional shrinkage to the decision-theoretic shrinkage of that unit.
Historical & philosophical context Master
The lasso was introduced by Robert Tibshirani in 1996 [Tibshirani, R. — Regression Shrinkage and Selection via the Lasso], who proposed minimizing the residual sum of squares subject to an budget and observed that the constraint's polyhedral geometry produces exactly-zero coefficients, combining the stability of ridge regression with the interpretability of subset selection in a single convex program. The name encodes the dual purpose: least absolute shrinkage and selection operator. The same idea had appeared in geophysics and signal processing — Claerbout and Muir in the 1970s, the basis-pursuit formulation of Chen, Donoho and Saunders — but Tibshirani placed it in the regression-and-model-selection frame where it became central to statistics.
The non-asymptotic theory developed over the following two decades. The prediction and estimation oracle inequalities under restricted-eigenvalue or compatibility conditions were established by Bickel, Ritov and Tsybakov (2009), Koltchinskii, and van de Geer, and consolidated by Bühlmann and van de Geer [Buhlmann, P. & van de Geer, S. — Statistics for High-Dimensional Data] and by Wainwright [Wainwright, M. J. — High-Dimensional Statistics: A Non-Asymptotic Viewpoint]. The condition governing exact variable selection — the irrepresentable or mutual-incoherence condition — was identified independently by Zhao and Yu (2006) and by Meinshausen and Bühlmann (2006), who proved it essentially necessary and sufficient for sign consistency; Wainwright's primal-dual witness gave the sharp sample-complexity threshold. The degrees-of-freedom identity is due to Zou, Hastie and Tibshirani (2007), and the debiased lasso for high-dimensional inference to Zhang and Zhang (2014) and van de Geer, Bühlmann, Ritov and Dezeure (2014). Hastie, Tibshirani and Wainwright's Statistical Learning with Sparsity (2015) is the integrated modern account.
Bibliography Master
@article{tibshirani1996lasso,
author = {Tibshirani, Robert},
title = {Regression Shrinkage and Selection via the Lasso},
journal = {Journal of the Royal Statistical Society, Series B},
volume = {58},
number = {1},
pages = {267--288},
year = {1996}
}
@book{buhlmann2011hdd,
author = {B{\"u}hlmann, Peter and van de Geer, Sara},
title = {Statistics for High-Dimensional Data: Methods, Theory and Applications},
series = {Springer Series in Statistics},
publisher = {Springer},
year = {2011}
}
@book{wainwright2019hds,
author = {Wainwright, Martin J.},
title = {High-Dimensional Statistics: A Non-Asymptotic Viewpoint},
series = {Cambridge Series in Statistical and Probabilistic Mathematics},
number = {48},
publisher = {Cambridge University Press},
year = {2019}
}
@article{bickel2009simultaneous,
author = {Bickel, Peter J. and Ritov, Ya'acov and Tsybakov, Alexandre B.},
title = {Simultaneous Analysis of Lasso and Dantzig Selector},
journal = {The Annals of Statistics},
volume = {37},
number = {4},
pages = {1705--1732},
year = {2009}
}
@article{zhaoyu2006model,
author = {Zhao, Peng and Yu, Bin},
title = {On Model Selection Consistency of Lasso},
journal = {Journal of Machine Learning Research},
volume = {7},
pages = {2541--2563},
year = {2006}
}
@article{meinshausen2006high,
author = {Meinshausen, Nicolai and B{\"u}hlmann, Peter},
title = {High-Dimensional Graphs and Variable Selection with the Lasso},
journal = {The Annals of Statistics},
volume = {34},
number = {3},
pages = {1436--1462},
year = {2006}
}
@article{zou2007degrees,
author = {Zou, Hui and Hastie, Trevor and Tibshirani, Robert},
title = {On the ``Degrees of Freedom'' of the Lasso},
journal = {The Annals of Statistics},
volume = {35},
number = {5},
pages = {2173--2192},
year = {2007}
}
@article{vandegeer2014asymptotically,
author = {van de Geer, Sara and B{\"u}hlmann, Peter and Ritov, Ya'acov and Dezeure, Ruben},
title = {On Asymptotically Optimal Confidence Regions and Tests for High-Dimensional Models},
journal = {The Annals of Statistics},
volume = {42},
number = {3},
pages = {1166--1202},
year = {2014}
}