Skip to content

Level Set and Level Curve

Definition

Let f ⁣:X→Rf\colon X \to \mathbb{R} be a real-valued function defined on a set X⊆RnX\subseteq \mathbb{R}^n. A level set is defined as the preimage of a singleton set {k}\{k\}, i.e.,

Lk(f)=f−1({k})={(x1,x2,…,xn)∈X ⁣:f(x1,x2,…,xn)=k}.L_k(f)=f^{-1}(\{k\}) =\{(x_1,x_2,\ldots,x_n)\in X\colon f(x_1,x_2,\ldots,x_n)=k\}.

When the number of independent variables is two, a level set is called a level curve, also known as contour line.


Interpretation

A level set collects all inputs at which ff takes one prescribed value kk: it answers the question "where is ff equal to kk?". For a function of two variables these sets are usually curves in the plane, like contour lines on a map, where all points on one line have the same height.

As the preimage of {k}\{k\}, the level set Lk(f)L_k(f) lies in the domain X⊆RnX\subseteq\mathbb{R}^n, not on the graph. For n=2n=2 it is the horizontal cut of the graph at height z=kz=k, projected onto the plane of the inputs. Despite the name, a level set need not be a curve: it is empty when kk is not a value of ff, a single point for x2+y2=0x^2+y^2=0, and all of XX when ff is constant and kk is its value.

A family of level curves can be read like a contour map. For equally spaced values of kk, level curves that lie close together mean that ff changes quickly there. For f(x,y)=x2+y2f(x,y)=x^2+y^2 the curves for k=1,2,3,4k=1,2,3,4 are circles with radii 1,2,3,21,\sqrt{2},\sqrt{3},2, so the gaps 0.410.41, 0.320.32, 0.270.27 shrink as ff grows faster further out.

In economics, indifference curves of a utility function and isoquants of a production function are level curves. This idea returns later in optimization with an equality constraint g(x)=cg(\boldsymbol{x})=c: the feasible points form a level set of gg (method of Lagrange).


Key Results

  • Different level sets for distinct values are disjoint, and the union over all possible values covers the entire domain where the function is defined.

Examples

  • Let f ⁣:R2→Rf\colon \mathbb{R}^2\to\mathbb{R} be f(x,y)=x2+y2f(x,y)=x^2+y^2. Level sets are circles centred at the origin for k>0k>0, a single point (0,0)(0,0) for k=0k=0, and empty for k<0k<0.

    The surface z = x squared plus y squared with horizontal circles drawn on it at several heights, and the same circles projected onto the xy-plane as level curves.

    The level curves x2+y2=kx^2+y^2=k are circles of radius k\sqrt k for k>0k>0. They appear in red on the graph of ff and in blue in the xyxy-plane.

  • Let f ⁣:R2→Rf\colon \mathbb{R}^2\to\mathbb{R} be f(x,y)=x+yf(x,y)=x+y. Level sets are straight lines of slope −1-1: x+y=kx+y=k. All level sets are parallel lines.


Prerequisites

Sources

Aliases: level set, level curve, contour line Symbols: element of, real numbers, square root, subset

Last updated: 27 October 2026 11:52