Why Boundary Regularity Matters
A density level set at threshold \(\lambda\) is the region where the density is at least \(\lambda\). Its boundary separates locations classified above the threshold from those below it. The shape of that boundary depends on more than the continuity of the density: at a critical threshold, the boundary can pinch, collapse, or fail to look locally like a smooth surface.
The central regularity condition is that the density changes in a nonzero direction at every point on the threshold boundary. Together with differentiability and compactness, this condition gives a precise local picture: the boundary is a smooth hypersurface, and moving a small distance normally to it changes the density to first order by the gradient magnitude times that distance.
Definitions and Regularity Conditions
For the results below, assume \(f\) is twice continuously differentiable on an open neighborhood of \(S_\lambda\), and that \(S_\lambda\) is compact. The key condition is \(\nabla f(x)\neq 0\) for every \(x\in S_\lambda\). Since the gradient is continuous and \(S_\lambda\) is compact, this condition implies a uniform lower bound: there is a constant \(c>0\) such that \(\|\nabla f(x)\|\geq c\) throughout \(S_\lambda\). Compactness also gives a finite upper bound \(C\) on \(\|\nabla f(x)\|\) there.
The nonvanishing-gradient condition says that the threshold is a regular value of \(f\). In dimension \(d\), a regular level set is locally a \((d-1)\)-dimensional surface. The density gradient is perpendicular to that surface, so the unit normal pointing toward increasing density is \(n(x)=\nabla f(x)/\|\nabla f(x)\|\).
Worked Examples at Regular and Critical Thresholds
Worked Example: A Standard Normal Density at a Regular Threshold
Let \(X\sim N(0,1)\), so \(f(x)=(2\pi)^{-1/2}\exp(-x^2/2)\). Choose \(\lambda=f(1)=(2\pi)^{-1/2}e^{-1/2}\). Solving \(f(x)=\lambda\) gives \(\exp(-x^2/2)=\exp(-1/2)\), hence \(x^2=1\) and \(S_\lambda=\{-1,1\}\).
Since \(f'(x)=-xf(x)\), the derivative at the two level-set points is \(f'(-1)=\lambda\) and \(f'(1)=-\lambda\). Both are nonzero. The superlevel set is the interval \([-1,1]\), whose boundary consists exactly of these two points. At either boundary point, moving a small distance \(t\) in the direction of increasing density raises the density by approximately \(\lambda t\); moving in the opposite direction lowers it by approximately the same amount.
Worked Example: An Elliptical Boundary in Two Dimensions
Consider the bivariate normal density \(f(x_1,x_2)=(4\pi)^{-1}\exp[-(x_1^2/2+x_2^2/8)]\). Set \(\lambda=e^{-1}/(4\pi)\). The equation \(f(x_1,x_2)=\lambda\) is equivalent to \(x_1^2/2+x_2^2/8=1\), an ellipse. Its gradient is \(\nabla f=-f(x_1,x_2)(x_1,x_2/4)\).
On the ellipse, \(f=\lambda\). To check that the gradient does not vanish, calculate \(\|\nabla f\|=\lambda\sqrt{x_1^2+x_2^2/16}\). The ellipse equation gives \(x_1^2=2-x_2^2/4\), so \(x_1^2+x_2^2/16=2-3x_2^2/16\). Because \(0\leq x_2^2\leq 8\), this quantity is at least \(2-24/16=1/2\). Thus \(\|\nabla f\|\geq\lambda/\sqrt{2}>0\) everywhere on the ellipse. The level boundary is regular, even though it is not circular.
Worked Example: A Critical Threshold Where Regularity Fails
For the same bivariate normal density, take the maximum threshold \(\lambda=f(0,0)=1/(4\pi)\). The superlevel set is now just \(\{(0,0)\}\), because the exponential factor is at most one and equals one only at the origin. Its level set is that same singleton.
At the origin, \(\nabla f(0,0)=(0,0)\), so the nonvanishing-gradient condition fails. The boundary is not a one-dimensional curve locally separating points with density above the threshold from points below it; there are no points with density strictly above this maximum. This example shows why differentiability alone does not guarantee regular boundary geometry.
Regular Level Sets Are Smooth Boundaries
Proof. Since at least one partial derivative of \(f\) at \(p\) is nonzero, relabel the coordinates so that \(\partial f/\partial x_d(p)\neq0\). The implicit function theorem then gives a neighborhood in which the equation \(f(x)=\lambda\) is the graph \(x_d=g(x_1,\ldots,x_{d-1})\) of a continuously differentiable function. Thus the level set is locally a hypersurface.
To establish the boundary claim, use \(x_d\) as the coordinate in which the partial derivative is nonzero. By continuity, in a smaller neighborhood that derivative keeps a fixed sign. For fixed \(x_1,\ldots,x_{d-1}\) near the corresponding coordinates of \(p\), the function of \(x_d\) is therefore strictly monotone and takes the value \(\lambda\) at the graph. Values on the two sides of that graph lie on opposite sides of \(\lambda\). Every neighborhood of a point on the graph consequently contains points with \(f>\lambda\) and points with \(f<\lambda\), making that point a boundary point of \(L_\lambda\). Conversely, continuity implies that a boundary point of \(L_\lambda\) must have \(f=\lambda\): if \(f>\lambda\), a neighborhood remains above \(\lambda\); if \(f<\lambda\), a neighborhood remains below it. This proves the local claim. \(\square\)
If every point of \(S_\lambda\) has nonzero gradient, this argument applies at every point. The compactness assumption is not needed for the local implicit-function conclusion, but it becomes important for making the geometric bounds uniform over the whole boundary.
Uniform First-Order Geometry Near the Boundary
Proof. Because \(S_\lambda\) is compact and lies in the open region where \(f\) is twice continuously differentiable, choose a closed neighborhood of \(S_\lambda\) on which the Hessian is bounded in operator norm by some finite \(M\). For any \(x\) sufficiently close to \(S_\lambda\), compactness ensures there is a nearest point \(p\in S_\lambda\); write \(r=\|x-p\|=\operatorname{dist}(x,S_\lambda)\).
The level set is a smooth hypersurface by the preceding theorem. At a nearest point, the vector \(x-p\) is perpendicular to its tangent space. That tangent space is perpendicular to \(\nabla f(p)\), so \(x-p=t\,n(p)\) for some signed \(t\), with \(|t|=r\). Taylor's theorem along the segment from \(p\) to \(x\), using \(f(p)=\lambda\), gives
The lower gradient bound and the triangle inequality now imply \(|f(x)-\lambda|\geq cr-(M/2)r^2\). Choose \(\delta\) small enough that \(M\delta/2\leq c/2\) (if \(M=0\), this restriction is unnecessary). Then the lower bound is at least \((c/2)r\). For the upper bound, let \(C=\sup_{p\in S_\lambda}\|\nabla f(p)\|\), which is finite by compactness. Taylor's theorem gives \(|f(x)-\lambda|\leq Cr+(M/2)r^2\leq (C+M\delta/2)r\). Thus the result holds with \(a=c/2\) and \(b=C+M\delta/2\). \(\square\)
This comparison has a direct geometric interpretation: sufficiently close to a regular compact boundary, a point's density difference from the threshold is proportional to its distance from the boundary, up to fixed multiplicative constants. The constants can be chosen uniformly along the boundary because the gradient cannot approach zero there and the curvature-producing second derivatives remain bounded nearby.
What Compactness Does—and Does Not—Provide
Compactness turns pointwise regularity into uniform control. On a compact level set, a continuous, everywhere nonzero gradient has a strictly positive minimum magnitude, while continuity of the Hessian gives a finite bound in a small closed neighborhood. These uniform constants are what allow a single distance range and a single pair of comparison constants to work all along the boundary.
The result is local to a neighborhood of \(S_\lambda\). It does not assert that every point in the entire domain with density close to \(\lambda\) must be close to the level set. Such a global assertion would require an additional condition excluding distant points whose density values approach \(\lambda\). Keeping that distinction clear prevents local boundary geometry from being mistaken for a global statement about all near-threshold locations.
Common Mistake
- Assuming a smooth density always has a smooth level boundary. Smoothness of \(f\) alone does not rule out critical points on the level set. At the maximum of the bivariate normal in the worked example, the gradient vanishes and the superlevel set collapses to a point.
- Using a pointwise gradient bound as if it were automatically uniform. The lower bound used in the theorem relies on continuity and compactness of the level set. Without compactness, a nonzero gradient at every individual point need not have a positive global lower bound.
- Applying a local comparison globally. The distance comparison is proved only when \(x\) is sufficiently close to \(S_\lambda\). It does not, by itself, exclude distant near-threshold points.
Check Your Understanding
Use the definitions and results above to answer the following questions.
- Why does compactness turn an everywhere nonzero continuous gradient on \(S_\lambda\) into a uniform positive lower bound?
- What role does the implicit function theorem play in showing that a regular level set is locally a hypersurface?
- In the Taylor expansion near the boundary, why is the first-order term equal to \(t\|\nabla f(p)\|\)?
- Which condition fails at the maximum-density threshold in the bivariate normal example, and what happens to its superlevel set?
- Why does the distance comparison theorem not imply that every point with density close to \(\lambda\), anywhere in the domain, is close to \(S_\lambda\)?