From Set Separation to Function Separation
Separating two sets by disjoint open neighborhoods is a geometric form of separation: each set lies in its own open region. A continuous real-valued function gives a different encoding. It can assign value \(0\) on one closed set and value \(1\) on the other, with intermediate values describing how points lie between the two sides. Urysohn’s lemma identifies a broad condition under which this is always possible.
Recall that a space \(X\) is normal if every pair of disjoint closed subsets of \(X\) has disjoint open neighborhoods. This definition does not include the \(T_1\) condition. Some texts use “normal” with an additional \(T_1\) requirement; the separation argument below needs only the stated open-neighborhood property. A space that is normal and \(T_1\) is often called \(T_4\).
The interval \([0,1]\) has its usual subspace topology from \(\mathbb{R}\). The theorem asserts existence; it does not say that the function is unique. We prove the result by building open sets at dyadic rational numbers in \([0,1]\), then defining \(f(x)\) from the first levels at which \(x\) enters those sets.
A Refinement Supplied by Normality
We first record the one-step use of normality needed in the construction. If \(F\) is closed, \(G\) is open and \(F\subseteq G\), normality gives an open set \(V\) such that
Proof. The sets \(F\) and \(X\setminus G\) are closed and disjoint. Choose disjoint open sets \(V,W\) with \(F\subseteq V\) and \(X\setminus G\subseteq W\). Since \(V\cap W=\varnothing\) and \(W\) is open, no point of \(W\) belongs to \(\overline{V}\): each such point has the open neighborhood \(W\), which misses \(V\). Thus \(\overline{V}\subseteq X\setminus W\). From \(X\setminus G\subseteq W\) we get \(X\setminus W\subseteq G\). Combining these inclusions gives the claim. \(\square\)
Proof of Urysohn’s Lemma
Let \(D\) be the set of dyadic rationals in \([0,1]\), that is, the numbers \(k/2^n\) in that interval, where \(k,n\) are nonnegative integers. Put \(U_1=X\setminus B\), which is open and contains \(A\). Apply the refinement just proved to the closed set \(A\subseteq U_1\), obtaining an open set \(U_0\) with \(A\subseteq U_0\subseteq\overline{U_0}\subseteq U_1\).
For each \(n\geq 0\), the dyadics with denominator \(2^n\) divide \([0,1]\) into adjacent pairs. Between each adjacent pair \(r<s\) for which \(U_r\) and \(U_s\) have already been defined, insert the midpoint \(t=(r+s)/2\). Apply the refinement to the closed set \(\overline{U_r}\subseteq U_s\). This gives an open \(U_t\) satisfying \(\overline{U_r}\subseteq U_t\subseteq\overline{U_t}\subseteq U_s\). Repeating this at each finite level defines \(U_r\) for every \(r\in D\). At each level the adjacent inclusions hold; chaining them shows that \(\overline{U_r}\subseteq U_s\) whenever \(r,s\in D\) and \(r<s\). In particular, every \(U_r\) is contained in \(U_1\), so every \(U_r\) misses \(B\).
For \(x\in X\), define \(S_x=\{r\in D:x\in U_r\}\), and set \(f(x)=\inf S_x\) if \(S_x\ne\varnothing\), while \(f(x)=1\) if \(S_x=\varnothing\). This defines a value in \([0,1]\). Since \(A\subseteq U_0\), every \(x\in A\) has \(0\in S_x\) and therefore \(f(x)=0\). Since all the \(U_r\) miss \(B\), every \(x\in B\) has \(S_x=\varnothing\) and therefore \(f(x)=1\).
It remains to prove continuity. For \(0<a\leq 1\), the definition of infimum gives \(\{x:f(x)<a\}=\bigcup_{r\in D,\ r<a}U_r\): an infimum below \(a\) means that some member of \(S_x\) is below \(a\), and membership in \(U_r\) gives \(f(x)\leq r<a\). For \(a\leq0\) this strict sublevel set is empty, and for \(a>1\) it is all of \(X\). Thus every strict sublevel set is open.
For \(0\leq a<1\), we also have \(\{x:f(x)>a\}=\bigcup_{r\in D,\ a<r<1}(X\setminus\overline{U_r})\). To verify the forward inclusion, suppose \(f(x)>a\). Choose dyadics \(r,s\) with \(a<r<s<f(x)\); such choices exist because dyadic rationals occur between any two distinct real numbers. If \(x\in\overline{U_r}\), then \(\overline{U_r}\subseteq U_s\), so \(x\in U_s\), which would imply \(f(x)\leq s\), a contradiction. Hence \(x\notin\overline{U_r}\). Conversely, if \(x\notin\overline{U_r}\) for some \(r>a\), then \(x\notin U_t\) for every dyadic \(t\leq r\), since \(U_t\subseteq U_r\subseteq\overline{U_r}\). Thus \(f(x)\geq r>a\), including the case \(S_x=\varnothing\). For \(a<0\) the strict superlevel set is all of \(X\), and for \(a\geq1\) it is empty. Each strict superlevel set is therefore open. Every open subset of \(\mathbb{R}\) is a union of open intervals, and open intervals are intersections of strict sublevel and superlevel rays. Their preimages are open by what we have proved, so \(f\) is continuous as a real-valued function. Its range lies in \([0,1]\), so it is continuous into \([0,1]\) with the subspace topology as well. \(\square\)
Worked Examples
Worked Example: Two Closed Rays in the Real Line
Take \(X=\mathbb{R}\) with its standard topology, \(A=(-\infty,0]\), and \(B=[2,\infty)\). These sets are disjoint and closed. The real line is normal: for any two disjoint nonempty closed sets, the distance between each point and the other closed set is positive, and disjoint sufficiently small metric neighborhoods give open neighborhoods separating the sets. (If either set is empty, the separation condition is immediate.) Define \(f(x)=0\) for \(x\leq0\), \(f(x)=x/2\) for \(0\leq x\leq2\), and \(f(x)=1\) for \(x\geq2\).
On \(A\), the first formula gives \(f(x)=0\); on \(B\), the last gives \(f(x)=1\). The formulas agree at the breakpoints: at \(x=0\), both applicable formulas give \(0\), and at \(x=2\), both give \(1\). Each piece is continuous, and agreement at the two joining points makes the piecewise function continuous there. Thus \(f\) separates the closed sets as required.
Check: at \(x=1\), the middle formula gives \(f(1)=1/2\), which lies in \([0,1]\). At \(x=-3\in A\), the first formula gives \(0\); at \(x=5\in B\), the last gives \(1\).
Worked Example: Separating Points in a Finite Discrete Space
Let \(X=\{p,q,r\}\) have the discrete topology, in which every subset is open. Every subset is also closed, since its complement is open. Set \(A=\{p\}\) and \(B=\{q,r\}\). Define \(f(p)=0\), \(f(q)=1\), and \(f(r)=1\). This function is continuous: for any open set \(O\subseteq[0,1]\), its preimage \(f^{-1}(O)\) is a subset of \(X\), hence is open in the discrete topology. The values on \(A\) and \(B\) are exactly the required values.
Check: \(f^{-1}(\{0\})=\{p\}\) and \(f^{-1}(\{1\})=\{q,r\}\), both open. This example also shows that the function need not take intermediate values when the space has isolated points.
Why the Normality Hypothesis Matters
Normality is a sufficient condition for every disjoint closed pair to be separated by a continuous function of this kind. It cannot simply be omitted from that general assertion. The next example verifies a space and a closed pair for which no such function exists.
Worked Example: A Closed Pair in a Cofinite Space
Let \(X=\mathbb{N}\) with the finite-complement topology: the open sets are \(\varnothing\) and the subsets whose complements in \(X\) are finite. The closed sets are \(X\) and the finite subsets, so the disjoint sets \(A=\{1\}\) and \(B=\{2\}\) are closed. Any two nonempty open sets intersect: each has finite complement, so the complement of their intersection is a union of two finite sets and is finite; their intersection cannot be empty because \(X=\mathbb{N}\) is infinite. In particular, \(A\) and \(B\) cannot have disjoint open neighborhoods, so \(X\) is not normal.
There is also no continuous \(f:X\to[0,1]\) with \(f(1)=0\) and \(f(2)=1\). If such an \(f\) existed, the disjoint open intervals \((-1/4,1/4)\) and \((3/4,5/4)\) in \(\mathbb{R}\) would have disjoint, nonempty open preimages in \(X\), contradicting the intersection property just proved. Thus the conclusion of Urysohn’s lemma can fail when normality is absent.
Common pitfall. The incorrect calculation \(f(1)=0\) and \(f(n)=1\) for every \(n\ne1\) does assign the desired values at \(1\) and \(2\), but it is not continuous: the preimage of the open interval \((-1/4,1/4)\) is \(\{1\}\), which is not open in the finite-complement topology on the infinite set \(\mathbb{N}\). More generally, the preimage argument above proves that no alternative continuous separator exists. Assigning the endpoint values is not enough; continuity depends on the topology of the domain.
Normality is the hypothesis that lets the proof insert open sets while keeping their closures inside prescribed larger open sets. The dyadic construction uses this control at every stage; the infimum then turns the nested family into a continuous real-valued function. In a particular space or for a particular pair, a separator may exist for other reasons, but Urysohn’s lemma guarantees one uniformly for every disjoint closed pair in a normal space.
Check Your Understanding
Use the definition of normality and the construction in the proof to answer these questions.
- In the statement of Urysohn’s lemma, which values must the function take on \(A\) and \(B\)?
- Why does normality give an open \(V\) with \(F\subseteq V\subseteq\overline{V}\subseteq G\) when \(F\) is closed and \(G\) is open with \(F\subseteq G\)?
- Why does \(x\in\overline{U_r}\subseteq U_s\), for \(r<s\), imply \(f(x)\leq s\)?
- In the finite-complement example, why must any two nonempty open sets intersect?
- Does the lemma assert that the separating function is unique, or that every continuous function with values in \([0,1]\) separates the given pair?