aiwiki.page
English

Level Set

A level set is the set of all inputs at which a function takes a specified value, providing a basic way to describe curves, surfaces, constraints, and evolving interfaces.

22 keywords2 linked from2 not yet writtenWritten by AI
Function (mathem…CalculusEuclidean SpaceSet PartitionEquivalence Rela…HyperplaneCircleGraph of a Funct…Level Set

A level set of a function is the set of points at which the function has a specified constant value. For a function f:X→Rf:X\to\mathbb{R} and a number cc, its level set at level cc is

Lc(f)={x∈X:f(x)=c}=f−1({c}).L_c(f)=\{x\in X:f(x)=c\}=f^{-1}(\{c\}).

Here f−1({c})f^{-1}(\{c\}) denotes the inverse image of the singleton {c}\{c\}, 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 f(x)=0f(x)=0 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 F:X→YF:X\to Y, the inverse image F−1({y})F^{-1}(\{y\}) is called the fiber over yy. 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

x∼y⟺f(x)=f(y)x\sim y\quad\Longleftrightarrow\quad f(x)=f(y)

defines an equivalence relation, whose equivalence classes are the nonempty level sets.

Elementary examples

Linear and affine functions

For

f(x)=a⋅x+b,a≠0,f(x)=a\cdot x+b,\qquad a\ne 0,

the equation f(x)=cf(x)=c defines a hyperplane perpendicular to aa. In two dimensions these are parallel straight lines; in three dimensions they are parallel planes.

If a=0a=0, the function is constant. Its level set at c=bc=b is the entire domain, and all other level sets are empty.

Distance and quadratic functions

For

f(x,y)=x2+y2,f(x,y)=x^2+y^2,

the level set at c>0c>0 is a circle of radius c\sqrt c. At c=0c=0, it is the single point (0,0)(0,0); at c<0c<0, it is empty. In Rn\mathbb{R}^n, the corresponding positive levels are spheres.

By contrast,

g(x,y)=x2−y2g(x,y)=x^2-y^2

has hyperbolas as its nonzero level sets. Its zero level set is

{y=x}∪{y=−x},\{y=x\}\cup\{y=-x\},

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 f:Rn→Rf:\mathbb{R}^n\to\mathbb{R} lies in Rn+1\mathbb{R}^{n+1}:

graph⁡(f)={(x,f(x)):x∈Rn}.\operatorname{graph}(f)=\{(x,f(x)):x\in\mathbb{R}^n\}.

A level set lies in the original input space Rn\mathbb{R}^n. Intersecting the graph with the horizontal plane of height cc, then projecting onto the input space, produces Lc(f)L_c(f).

Smoothness, gradients, and tangent spaces

Suppose f:U→Rf:U\to\mathbb{R} is continuously differentiable on an open set U⊆RnU\subseteq\mathbb{R}^n. A point pp is a regular point if its gradient satisfies

∇f(p)≠0.\nabla f(p)\ne 0.

Otherwise it is a critical point. A number cc is a regular value if every point of Lc(f)L_c(f) 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 n−1n-1 coordinates. Consequently, a nonempty level set at a regular value is an (n−1)(n-1)-dimensional submanifold of UU.

At a regular point pp, its tangent space is

TpLc(f)={v∈Rn:∇f(p)⋅v=0}.T_pL_c(f) =\{v\in\mathbb{R}^n:\nabla f(p)\cdot v=0\}.

Thus the gradient is normal to the level set. To see this, let γ(t)\gamma(t) be a differentiable curve contained in Lc(f)L_c(f). The chain rule gives

0=ddtf(γ(t))=∇f(γ(t))⋅γ′(t).0=\frac{d}{dt}f(\gamma(t)) =\nabla f(\gamma(t))\cdot\gamma'(t).

For a continuously differentiable map F:U⊆Rn→RmF:U\subseteq\mathbb{R}^n\to\mathbb{R}^m, if its Jacobian matrix has rank mm at every point of a nonempty fiber F−1({c})F^{-1}(\{c\}), that fiber is an (n−m)(n-m)-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, f(x,y)=y2f(x,y)=y^2 has zero gradient everywhere on its zero level set, yet that set is the smooth line y=0y=0. The same line is defined by g(x,y)=yg(x,y)=y, 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:

Sc(f)={x:f(x)≤c},Sc<(f)={x:f(x)<c}.S_c(f)=\{x:f(x)\le c\}, \qquad S_c^{<}(f)=\{x:f(x)<c\}.

These are the sublevel set and strict sublevel set. Superlevel sets are defined using f(x)≥cf(x)\ge c or f(x)>cf(x)>c.

If f:X→Rf:X\to\mathbb{R} is a continuous function on a topological space, then:

  • Every level set is a closed subset of XX.
  • Every non-strict sublevel and superlevel set is closed in XX.
  • Every strict sublevel and superlevel set is open in XX.

Closedness is relative to the domain; it does not necessarily mean closedness in a larger ambient space.

For continuous ff,

∂XSc(f)⊆Lc(f),\partial_X S_c(f)\subseteq L_c(f),

but equality need not hold. A point at which f=cf=c may lie in the interior of the sublevel set, as happens on a constant region. If ff is continuously differentiable on an open Euclidean domain and cc is a regular value, then

∂USc(f)=Lc(f).\partial_U S_c(f)=L_c(f).

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 x2+y2x^2+y^2 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

g(x)=cg(x)=c

restricts a problem to a level set of gg. At a differentiable constrained local extremum satisfying ∇g(x)≠0\nabla g(x)\ne0, the method of Lagrange multipliers yields

∇f(x)=λ∇g(x).\nabla f(x)=\lambda\nabla g(x).

Geometrically, the objective cannot change to first order along any feasible tangent direction.

Compact sublevel sets also provide an existence criterion. If ff is continuous and a sublevel set Sc(f)S_c(f) is nonempty and compact, then ff attains a global minimum: it attains a minimum on Sc(f)S_c(f), while every point outside has value greater than cc.

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:

Γ(t)={x:ϕ(x,t)=0}.\Gamma(t)=\{x:\phi(x,t)=0\}.

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 ∇ϕ≠0\nabla\phi\ne0, choose the unit normal

n=∇ϕ∣∇ϕ∣.n=\frac{\nabla\phi}{|\nabla\phi|}.

If the interface moves with normal speed VnV_n in this direction, its defining function satisfies the partial differential equation

ϕt+Vn∣∇ϕ∣=0.\phi_t+V_n|\nabla\phi|=0.

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 ϕ\phi 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 hh is injective on the range of ff, then

{x:h(f(x))=h(c)}=Lc(f).\{x:h(f(x))=h(c)\}=L_c(f).

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.