Tutorials › Topology (Undergraduate) › Continuous Bump Functions Around Closed Sets

Urysohn's Lemma and the Tietze Extension Theorem · Tutorial 344 of 799

Continuous Bump Functions Around Closed Sets

Construct continuous functions that are one on a closed set and vanish outside a chosen open neighborhood, and understand how normality can place their support strictly inside it.

Advanced 10 min read

What You'll Learn

  • State the bump-function conclusion for a closed set contained in an open set in a normal space.
  • Distinguish vanishing outside an open set from having support contained in that open set.
  • Prove the open-set shrinking step that gives support containment.
  • Build and check explicit bump functions on the real line and in the Euclidean plane.
  • Identify why a simple piecewise-linear function may fail the support requirement.

From Separation to a Bump Function

A continuous function can encode the separation of sets: it can take the value \(1\) on one set and \(0\) on another. In a normal space, Urysohn’s lemma makes this possible for disjoint closed sets. A useful application is to a closed set \(F\) lying inside an open set \(U\): we want a continuous function that is \(1\) on \(F\) and vanishes wherever we are outside \(U\). There is a stronger version, too: the function can be chosen so that its support is contained in \(U\). The distinction between these conclusions matters at the boundary of \(U\).

Throughout, \((X,\mathcal{T})\) is a topological space. We use the convention that \(X\) is normal if any two disjoint closed subsets of \(X\) are contained in disjoint open subsets. The Urysohn lemma applies with this separation condition: if \(C\) and \(D\) are disjoint closed subsets of \(X\), there is a continuous \(g:X\to[0,1]\) with \(g=0\) on \(C\) and \(g=1\) on \(D\). We use this lemma as established in the earlier material on continuous separation of disjoint closed sets.

Definition: For a function \(f:X\to\mathbb{R}\), its support is \(\operatorname{supp}(f)=\overline{\{x\in X:f(x)\ne 0\}}\), where the closure is taken in \(X\). Thus \(f\) vanishing on \(X\setminus U\) means \(\{x:f(x)\ne0\}\subseteq U\); it does not, by itself, assert that the closure of this set is contained in \(U\).

The Bump-Function Theorem

Theorem: Let \((X,\mathcal{T})\) be normal, let \(F\subseteq X\) be closed, and let \(U\subseteq X\) be open with \(F\subseteq U\). There is a continuous function \(f:X\to[0,1]\) such that \(f(x)=1\) for every \(x\in F\) and \(f(x)=0\) for every \(x\in X\setminus U\). Moreover, \(f\) can be chosen so that \(\operatorname{supp}(f)\subseteq U\).

The first conclusion is an immediate application of Urysohn’s lemma to the disjoint closed sets \(F\) and \(X\setminus U\), followed by replacing \(g\) with \(1-g\) if necessary. The support conclusion requires an extra step: first shrink the open set around \(F\).

Lemma (Open-set shrinking): If \(X\) is normal, \(F\) is closed, \(U\) is open, and \(F\subseteq U\), then there is an open set \(V\) such that \(F\subseteq V\subseteq\overline{V}\subseteq U\).

Proof. If \(F=\varnothing\), take \(V=\varnothing\). Otherwise, the closed sets \(F\) and \(X\setminus U\) are disjoint. By normality, there are disjoint open sets \(V\) and \(W\) with \(F\subseteq V\) and \(X\setminus U\subseteq W\). Since \(W\) is open and disjoint from \(V\), no point of \(W\) belongs to \(\overline{V}\): if a point of \(W\) were in \(\overline{V}\), its open neighborhood \(W\) would have to intersect \(V\). Hence \(\overline{V}\subseteq X\setminus W\). Also \(X\setminus U\subseteq W\), so \(X\setminus W\subseteq U\). Combining these inclusions gives \(F\subseteq V\subseteq\overline{V}\subseteq U\). \(\square\)

Proof of the theorem. If \(F=\varnothing\), take \(f\) to be the constant zero function; it satisfies both conclusions. Now suppose \(F\ne\varnothing\), and choose \(V\) from the shrinking lemma. The sets \(F\) and \(X\setminus V\) are closed and disjoint. Urysohn’s lemma, with its values reversed if needed, gives a continuous \(f:X\to[0,1]\) equal to \(1\) on \(F\) and \(0\) on \(X\setminus V\). Since \(V\subseteq U\), we have \(X\setminus U\subseteq X\setminus V\), so \(f=0\) on \(X\setminus U\). Further, \(\{x:f(x)\ne0\}\subseteq V\), and therefore \(\operatorname{supp}(f)\subseteq\overline{V}\subseteq U\). This proves both assertions. \(\square\)

Notice what the shrinking step accomplishes. Applying Urysohn’s lemma directly to \(F\) and \(X\setminus U\) proves that \(f\) vanishes outside \(U\). It does not necessarily keep the closure of the nonzero set away from the boundary of \(U\). Applying the lemma instead to \(F\) and the larger closed set \(X\setminus V\) forces the nonzero set into \(V\), whose closure is already inside \(U\).

Worked Functions in Familiar Spaces

Worked Example: A Bump Function on the Real Line

Give an explicit continuous function on \(\mathbb{R}\) that equals \(1\) on \(F=[-1,1]\) and has support contained in \(U=(-3,3)\). Here \(\mathbb{R}\) has its standard topology.

Define \(f:\mathbb{R}\to[0,1]\) by \[ f(x)= \begin{cases} 1,& |x|\le 1,\\ 2-|x|,& 1<|x|<2,\\ 0,& |x|\ge 2. \end{cases} \]

On \(F\), the first case gives \(f(x)=1\). For \(1<|x|<2\), the number \(2-|x|\) lies strictly between \(0\) and \(1\); outside that range the function is zero. At \(|x|=1\), the middle formula would give \(2-1=1\), matching the first formula. At \(|x|=2\), it would give \(2-2=0\), matching the third. Each formula is continuous on its region, and the values match at both breakpoints, so \(f\) is continuous.

The nonzero set is \(\{x:|x|<2\}=(-2,2)\), so \(\operatorname{supp}(f)=[-2,2]\). Since \(-3<-2\) and \(2<3\), this support is contained in \((-3,3)\). Check: \(f(0)=1\), \(f(1)=2-1=1\) at the matching endpoint, and \(f(2)=0\); the formula therefore has the required plateau and vanishes before the boundary of \(U\).

Worked Example: A Radial Bump in the Plane

Let \(\mathbb{R}^2\) have its Euclidean topology, let \(F=\{(x,y):x^2+y^2\le1\}\), and let \(U=\{(x,y):x^2+y^2<9\}\). Construct a continuous function equal to \(1\) on \(F\) with support contained in \(U\).

Write \(r=\sqrt{x^2+y^2}\), the Euclidean distance from \((x,y)\) to the origin, and define \[ f(x,y)= \begin{cases} 1,&0\le r\le1,\\ 2-r,&1<r<2,\\ 0,&r\ge2. \end{cases} \]

The scalar function of \(r\) has matching values at the two breakpoints: at \(r=1\), both formulas give \(1\), and at \(r=2\), both give \(0\). It is continuous, and \(r=\sqrt{x^2+y^2}\) is continuous, so their composition \(f\) is continuous on the plane. If \((x,y)\in F\), then \(r\le1\) and \(f(x,y)=1\). The function is nonzero exactly when \(r<2\), so its support is the closed disk \(\{(x,y):r\le2\}\). This disk lies in \(U\), since \(r\le2\) implies \(x^2+y^2=r^2\le4<9\). Check: at \((0,0)\), \(r=0\) and \(f=1\); at \((1,0)\), \(r=1\) and \(f=1\); at \((2,0)\), \(r=2\) and \(f=0\). The support stays strictly inside the radius-three open disk.

Worked Example: Vanishing Does Not Guarantee Support Containment

In \(\mathbb{R}\) with its standard topology, take \(F=\{0\}\), \(U=(-1,1)\), and \(h(x)=\max(0,1-|x|)\). This is continuous, equals \(1\) at \(0\), and vanishes for every \(x\notin U\): if \(|x|\ge1\), then \(1-|x|\le0\), so \(h(x)=0\).

However, \(h(x)\ne0\) exactly when \(|x|<1\). Thus \(\{x:h(x)\ne0\}=(-1,1)\), whose closure is \([-1,1]\). Consequently \(\operatorname{supp}(h)=[-1,1]\not\subseteq(-1,1)\). The function meets the direct vanishing conclusion but not the stronger support conclusion.

To correct it, define \(k(x)=\max(0,1-2|x|)\). Then \(k(0)=1\), and \(k(x)\ne0\) exactly when \(1-2|x|>0\), or \(|x|<1/2\). Hence \(\operatorname{supp}(k)=[-1/2,1/2]\subseteq(-1,1)\). Check: \(k(1/2)=\max(0,1-2(1/2))=0\), while \(k(0)=\max(0,1)=1\). Moving the zero boundary inward makes the support fit inside \(U\).

What the Construction Does—and Does Not—Say

The theorem is a separation tool with a local geometric interpretation. The function is fixed at \(1\) on the closed set, while the surrounding open set provides room for it to decrease continuously to zero. Normality supplies the topological separation needed to carry out that interpolation, even when the space has no metric or coordinate formula. In \(\mathbb{R}\) and \(\mathbb{R}^2\), piecewise-linear radial formulas make the same idea visible by hand.

Support containment is a statement about a closure, not just pointwise values. In general, the set where a continuous function is nonzero may approach points where the function is zero. The support includes those limit points. The shrinking lemma makes the stronger assertion possible by ensuring that all nonzero values occur in an open set whose closure remains inside \(U\). This argument does not assert that the support is compact: compactness would require additional hypotheses on the space and on the chosen neighborhood.

Common pitfall. Do not infer \(\operatorname{supp}(f)\subseteq U\) merely from “\(f=0\) on \(X\setminus U\).” The calculation in the third example shows the gap exactly: the function is zero at both endpoints of \(U=(-1,1)\), but nonzero values approach those endpoints, so they belong to the support. To obtain support containment, shrink \(U\) around \(F\) first, then apply Urysohn’s lemma using the complement of the smaller neighborhood.

Check Your Understanding

Use the definitions of vanishing and support, and identify where normality or the shrinking step enters.

  1. For \(F=[0,2]\) and \(U=(-2,4)\) in the standard real line, propose a piecewise-linear function equal to \(1\) on \(F\) whose support is contained in \(U\). State its support.
  2. Explain why \(f=0\) on \(X\setminus U\) implies \(\{x:f(x)\ne0\}\subseteq U\), but does not by itself imply \(\operatorname{supp}(f)\subseteq U\).
  3. In the open-set shrinking lemma, why does disjointness of \(V\) and the open set \(W\) imply \(\overline{V}\subseteq X\setminus W\)?
  4. For the plane example, find the value of the radial function at a point whose distance from the origin is \(3/2\), and determine whether that point lies in the support.
  5. If \(F=\varnothing\), give a continuous function satisfying both conclusions of the bump-function theorem, for any open \(U\).