{
  "id": "level-set",
  "title": "Level Set",
  "lang": "en",
  "source_lang": "en",
  "summary": "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.",
  "category": "mathematics",
  "subcategory": "analysis",
  "type": "concept",
  "aliases": [
    "Level surface",
    "Isovalue set"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/level-set/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/level-set/",
      "json": "https://aiwiki.page/zh/level-set.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "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\\to\\mathbb{R}\\) and a number \\(c\\), its level set at level \\(c\\) is\n\n\\[L_c(f)=\\{x\\in X:f(x)=c\\}=f^{-1}(\\{c\\}).\\]\n\nHere \\(f^{-1}(\\{c\\})\\) denotes the inverse image of the singleton \\(\\{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."
    },
    {
      "heading": "Definition and terminology",
      "text": "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.\n\nFor real-valued functions on Euclidean space, terminology often reflects the dimension:\n\n- In two dimensions, a level set is commonly called a level curve or contour line.\n- In three dimensions, it is commonly called a level surface or isosurface.\n- A set defined by \\(f(x)=0\\) is called a zero level set or zero set.\n\nThese names do not guarantee that the set is actually a smooth curve or surface.\n\nMore generally, for a map \\(F:X\\to Y\\), the inverse image \\(F^{-1}(\\{y\\})\\) is called the fiber over \\(y\\). Level sets are thus fibers of scalar-valued functions, although the term is also used for vector-valued maps.\n\nThe nonempty level sets of a function form a partition of its domain: every point belongs to exactly one of them. Equivalently, the rule\n\n\\[x\\sim y\\quad\\Longleftrightarrow\\quad f(x)=f(y)\\]\n\ndefines an equivalence relation, whose equivalence classes are the nonempty level sets."
    },
    {
      "heading": "Elementary examples",
      "text": "Linear and affine functions\n\nFor\n\n\\[f(x)=a\\cdot x+b,\\qquad a\\ne 0,\\]\n\nthe equation \\(f(x)=c\\) defines a hyperplane perpendicular to \\(a\\). In two dimensions these are parallel straight lines; in three dimensions they are parallel planes.\n\nIf \\(a=0\\), the function is constant. Its level set at \\(c=b\\) is the entire domain, and all other level sets are empty.\n\nDistance and quadratic functions\n\nFor\n\n\\[f(x,y)=x^2+y^2,\\]\n\nthe level set at \\(c>0\\) is a circle of radius \\(\\sqrt c\\). At \\(c=0\\), it is the single point \\((0,0)\\); at \\(c<0\\), it is empty. In \\(\\mathbb{R}^n\\), the corresponding positive levels are spheres.\n\nBy contrast,\n\n\\[g(x,y)=x^2-y^2\\]\n\nhas hyperbolas as its nonzero level sets. Its zero level set is\n\n\\[\\{y=x\\}\\cup\\{y=-x\\},\\]\n\ntwo lines crossing at the origin. This illustrates how a special level can fail to be a smooth curve.\n\nLevel sets versus graphs\n\nThe graph of a function \\(f:\\mathbb{R}^n\\to\\mathbb{R}\\) lies in \\(\\mathbb{R}^{n+1}\\):\n\n\\[\\operatorname{graph}(f)=\\{(x,f(x)):x\\in\\mathbb{R}^n\\}.\\]\n\nA level set lies in the original input space \\(\\mathbb{R}^n\\). Intersecting the graph with the horizontal plane of height \\(c\\), then projecting onto the input space, produces \\(L_c(f)\\)."
    },
    {
      "heading": "Smoothness, gradients, and tangent spaces",
      "text": "Suppose \\(f:U\\to\\mathbb{R}\\) is continuously differentiable on an open set \\(U\\subseteq\\mathbb{R}^n\\). A point \\(p\\) is a regular point if its gradient satisfies\n\n\\[\\nabla f(p)\\ne 0.\\]\n\nOtherwise it is a critical point. A number \\(c\\) is a regular value if every point of \\(L_c(f)\\) is regular.\n\nThe 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-1\\) coordinates. Consequently, a nonempty level set at a regular value is an \\((n-1)\\)-dimensional submanifold of \\(U\\).\n\nAt a regular point \\(p\\), its tangent space is\n\n\\[T_pL_c(f) =\\{v\\in\\mathbb{R}^n:\\nabla f(p)\\cdot v=0\\}.\\]\n\nThus the gradient is normal to the level set. To see this, let \\(\\gamma(t)\\) be a differentiable curve contained in \\(L_c(f)\\). The chain rule gives\n\n\\[0=\\frac{d}{dt}f(\\gamma(t)) =\\nabla f(\\gamma(t))\\cdot\\gamma'(t).\\]\n\nFor a continuously differentiable map \\(F:U\\subseteq\\mathbb{R}^n\\to\\mathbb{R}^m\\), if its Jacobian matrix has rank \\(m\\) at every point of a nonempty fiber \\(F^{-1}(\\{c\\})\\), that fiber is an \\((n-m)\\)-dimensional submanifold.\n\nCritical points and singular behavior\n\nAt 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.\n\nFor example, \\(f(x,y)=y^2\\) has zero gradient everywhere on its zero level set, yet that set is the smooth line \\(y=0\\). The same line is defined by \\(g(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."
    },
    {
      "heading": "Sublevel sets, topology, and convexity",
      "text": "Closely related constructions use inequalities:\n\n\\[S_c(f)=\\{x:f(x)\\le c\\}, \\qquad S_c^{<}(f)=\\{x:f(x)<c\\}.\\]\n\nThese are the sublevel set and strict sublevel set. Superlevel sets are defined using \\(f(x)\\ge c\\) or \\(f(x)>c\\).\n\nIf \\(f:X\\to\\mathbb{R}\\) is a continuous function on a topological space, then:\n\n- Every level set is a closed subset of \\(X\\).\n- Every non-strict sublevel and superlevel set is closed in \\(X\\).\n- Every strict sublevel and superlevel set is open in \\(X\\).\n\nClosedness is relative to the domain; it does not necessarily mean closedness in a larger ambient space.\n\nFor continuous \\(f\\),\n\n\\[\\partial_X S_c(f)\\subseteq L_c(f),\\]\n\nbut equality need not hold. A point at which \\(f=c\\) may lie in the interior of the sublevel set, as happens on a constant region. If \\(f\\) is continuously differentiable on an open Euclidean domain and \\(c\\) is a regular value, then\n\n\\[\\partial_U S_c(f)=L_c(f).\\]\n\nA 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 \\(x^2+y^2\\) are circles, whereas its sublevel sets are disks.\n\nAs 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."
    },
    {
      "heading": "Applications in optimization and physical fields",
      "text": "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.\n\nAn equality constraint\n\n\\[g(x)=c\\]\n\nrestricts a problem to a level set of \\(g\\). At a differentiable constrained local extremum satisfying \\(\\nabla g(x)\\ne0\\), the method of Lagrange multipliers yields\n\n\\[\\nabla f(x)=\\lambda\\nabla g(x).\\]\n\nGeometrically, the objective cannot change to first order along any feasible tangent direction.\n\nCompact sublevel sets also provide an existence criterion. If \\(f\\) is continuous and a sublevel set \\(S_c(f)\\) is nonempty and compact, then \\(f\\) attains a global minimum: it attains a minimum on \\(S_c(f)\\), while every point outside has value greater than \\(c\\).\n\nIn 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."
    },
    {
      "heading": "The level set method",
      "text": "The level set method represents a moving interface as the zero level set of a time-dependent function:\n\n\\[\\Gamma(t)=\\{x:\\phi(x,t)=0\\}.\\]\n\nThis 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.\n\nWhere \\(\\nabla\\phi\\ne0\\), choose the unit normal\n\n\\[n=\\frac{\\nabla\\phi}{|\\nabla\\phi|}.\\]\n\nIf the interface moves with normal speed \\(V_n\\) in this direction, its defining function satisfies the partial differential equation\n\n\\[\\phi_t+V_n|\\nabla\\phi|=0.\\]\n\nThe sign convention depends on the chosen normal orientation.\n\nThis implicit representation allows interfaces to merge or split without explicitly reconnecting a parametrized boundary. Applications include fluid interfaces, image segmentation, and shape optimization.\n\nNumerical 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."
    },
    {
      "heading": "Dependence on the defining function",
      "text": "Different functions can describe the same family of geometric sets. If \\(h\\) is injective on the range of \\(f\\), then\n\n\\[\\{x:h(f(x))=h(c)\\}=L_c(f).\\]\n\nSuch a transformation relabels the levels without changing their point sets. A noninjective transformation can instead combine several levels into one.\n\nConsequently, 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."
    }
  ],
  "links": [
    "mathematical-function",
    "calculus",
    "euclidean-space",
    "set-partition",
    "equivalence-relation",
    "hyperplane",
    "circle",
    "graph-of-a-function",
    "gradient",
    "manifold",
    "tangent-space",
    "chain-rule",
    "jacobian-matrix",
    "continuous-function",
    "closed-set",
    "convex-function",
    "mathematical-optimization",
    "lagrange-multipliers",
    "temperature",
    "partial-differential-equation"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}