A level set of a function is the set of points at which the function has a specified constant value. For a function and a number , its level set at level is
Here denotes the inverse image of the singleton , not an inverse function. Level sets describe geometric objects implicitly, through an equation, rather than by an explicit parametrization. They are fundamental in calculus, geometry, optimization, and the numerical representation of moving boundaries.
Definition and terminology
The definition does not require continuity or differentiability. A level set may be empty, contain isolated points, consist of several separate components, or occupy an entire region.
For real-valued functions on Euclidean space, terminology often reflects the dimension:
- In two dimensions, a level set is commonly called a level curve or contour line.
- In three dimensions, it is commonly called a level surface or isosurface.
- A set defined by is called a zero level set or zero set.
These names do not guarantee that the set is actually a smooth curve or surface.
More generally, for a map , the inverse image is called the fiber over . Level sets are thus fibers of scalar-valued functions, although the term is also used for vector-valued maps.
The nonempty level sets of a function form a partition of its domain: every point belongs to exactly one of them. Equivalently, the rule
defines an equivalence relation, whose equivalence classes are the nonempty level sets.
Elementary examples
Linear and affine functions
For
the equation defines a hyperplane perpendicular to . In two dimensions these are parallel straight lines; in three dimensions they are parallel planes.
If , the function is constant. Its level set at is the entire domain, and all other level sets are empty.
Distance and quadratic functions
For
the level set at is a circle of radius . At , it is the single point ; at , it is empty. In , the corresponding positive levels are spheres.
By contrast,
has hyperbolas as its nonzero level sets. Its zero level set is
two lines crossing at the origin. This illustrates how a special level can fail to be a smooth curve.
Level sets versus graphs
The graph of a function lies in :
A level set lies in the original input space . Intersecting the graph with the horizontal plane of height , then projecting onto the input space, produces .
Smoothness, gradients, and tangent spaces
Suppose is continuously differentiable on an open set . A point is a regular point if its gradient satisfies
Otherwise it is a critical point. A number is a regular value if every point of is regular.
The implicit function theorem implies that near a regular point, the level set can be expressed as the graph of one coordinate as a function of the other coordinates. Consequently, a nonempty level set at a regular value is an -dimensional submanifold of .
At a regular point , its tangent space is
Thus the gradient is normal to the level set. To see this, let be a differentiable curve contained in . The chain rule gives
For a continuously differentiable map , if its Jacobian matrix has rank at every point of a nonempty fiber , that fiber is an -dimensional submanifold.
Critical points and singular behavior
At a critical point, the regular-level-set conclusion is no longer guaranteed. A level set may have a crossing, collapse to a point, or have another singularity. However, a vanishing gradient does not prove that the set itself is singular.
For example, has zero gradient everywhere on its zero level set, yet that set is the smooth line . The same line is defined by , whose gradient never vanishes. Regularity of a defining function is therefore a sufficient condition for smoothness, not a necessary property of every representation of a smooth set.
Sublevel sets, topology, and convexity
Closely related constructions use inequalities:
These are the sublevel set and strict sublevel set. Superlevel sets are defined using or .
If is a continuous function on a topological space, then:
- Every level set is a closed subset of .
- Every non-strict sublevel and superlevel set is closed in .
- Every strict sublevel and superlevel set is open in .
Closedness is relative to the domain; it does not necessarily mean closedness in a larger ambient space.
For continuous ,
but equality need not hold. A point at which may lie in the interior of the sublevel set, as happens on a constant region. If is continuously differentiable on an open Euclidean domain and is a regular value, then
A convex function on a convex domain has convex sublevel sets. More generally, a function is called quasiconvex precisely when all its sublevel sets are convex. The level sets themselves need not be convex: the positive level sets of are circles, whereas its sublevel sets are disks.
As the level changes, level sets and sublevel sets can change their topology. Critical values are central to studying such changes, although precise global results require additional hypotheses.
Applications in optimization and physical fields
In mathematical optimization, level sets describe points with equal objective value. Their geometry helps explain why algorithms behave differently on nearly circular contours and on long, narrow contours.
An equality constraint
restricts a problem to a level set of . At a differentiable constrained local extremum satisfying , the method of Lagrange multipliers yields
Geometrically, the objective cannot change to first order along any feasible tangent direction.
Compact sublevel sets also provide an existence criterion. If is continuous and a sublevel set is nonempty and compact, then attains a global minimum: it attains a minimum on , while every point outside has value greater than .
In physical and geographical applications, level sets identify locations with equal measured or modeled quantities. Examples include elevation contours, isotherms for temperature, isobars for pressure, and equipotential surfaces. A single contour can have multiple disconnected components.
The level set method
The level set method represents a moving interface as the zero level set of a time-dependent function:
This computational method is distinct from the general mathematical concept of a level set. Its influential modern formulation was introduced by Stanley Osher and James Sethian in 1988.
Where , choose the unit normal
If the interface moves with normal speed in this direction, its defining function satisfies the partial differential equation
The sign convention depends on the chosen normal orientation.
This implicit representation allows interfaces to merge or split without explicitly reconnecting a parametrized boundary. Applications include fluid interfaces, image segmentation, and shape optimization.
Numerical limitations include computational cost, loss of small features on a grid, and distortion of the defining function. Implementations often keep close to a signed-distance function, whose magnitude measures distance to the interface, but reinitializing this representation can introduce error.
Dependence on the defining function
Different functions can describe the same family of geometric sets. If is injective on the range of , then
Such a transformation relabels the levels without changing their point sets. A noninjective transformation can instead combine several levels into one.
Consequently, a level set alone does not determine the gradient magnitude, the spacing of nearby levels, or a unique scalar field. These depend on the chosen defining function, even when the represented curve or surface is unchanged.