Neighborhoods Record Finitely Many Values
A function can be tested at many inputs, but a basic open neighborhood in the pointwise topology only restricts its values at finitely many of them. The restrictions are imposed simultaneously: a function belongs to the neighborhood only if it satisfies every one of those finite constraints. This description gives a practical way to test whether a proposed function is in the closure of a family.
Let \(X\) be a set, with no topology required on \(X\), and let \((Y,\mathcal{T}_Y)\) be a topological space. Write \(Y^X\) for the set of all functions \(f:X\to Y\). For each \(x\in X\), the coordinate projection is the map \(\pi_x:Y^X\to Y\) given by \(\pi_x(f)=f(x)\). The pointwise topology on \(Y^X\) is the product topology of these coordinate spaces.
Thus, a neighborhood can require a function to take values in specified open sets at specified inputs, while leaving all other inputs unrestricted. It need not require exact equality at the constrained inputs: the sets \(U_i\) may be any open neighborhoods of the corresponding values \(f(x_i)\). Conversely, every open neighborhood of \(f\) contains a basic open neighborhood of \(f\). These basic sets therefore suffice for testing whether every neighborhood of \(f\) meets a given family.
Proof. Suppose \(f\in\overline{A}\). The set \(\bigcap_{i=1}^{n}\{g:g(x_i)\in U_i\}\) is a basic open neighborhood of \(f\). By the neighborhood test for closure, it intersects \(A\). A function \(g\) in that intersection belongs to \(A\) and satisfies all the stated constraints.
Conversely, suppose every such finite collection of constraints can be satisfied by some \(g\in A\). Every open neighborhood \(V\) of \(f\) contains a basic open neighborhood of \(f\), specified by some finite list and open sets \(U_i\). By the assumption, that basic neighborhood contains a member of \(A\). Hence \(V\cap A\ne\varnothing\). Since every open neighborhood of \(f\) meets \(A\), the neighborhood test gives \(f\in\overline{A}\). \(\square\)
The empty cases are included in this statement. If \(A=\varnothing\), no basic neighborhood meets \(A\), including the whole space, so its closure is empty. If \(X=\varnothing\), there is exactly one function from \(X\) to \(Y\), and the only finite constraint list is the empty one. The condition then says precisely that \(A\) is nonempty, as required for that unique function to belong to \(\overline{A}\).
Using the Finite-Constraint Test
Worked Example: Finite-Support Functions Are Dense
Let \(X\) be any set and give \(\mathbb{R}\) its standard topology. Let \(A\subseteq\mathbb{R}^X\) consist of the functions \(g\) that are zero except at finitely many points. We show that \(\overline{A}=\mathbb{R}^X\), including when \(X\) is empty.
Take any \(f\in\mathbb{R}^X\) and any basic neighborhood of \(f\), specified by distinct inputs \(x_1,\ldots,x_n\) and open sets \(U_i\) with \(f(x_i)\in U_i\). Define \(g:X\to\mathbb{R}\) by $$ g(x)= \begin{cases} f(x),&x\in\{x_1,\ldots,x_n\},\\ 0,&x\notin\{x_1,\ldots,x_n\}. \end{cases} $$ The function \(g\) is zero outside a finite set, so \(g\in A\). For every \(i\), \(g(x_i)=f(x_i)\in U_i\). Therefore \(g\) lies in the chosen neighborhood. The finite-constraint test shows \(f\in\overline{A}\).
This works for every \(f\in\mathbb{R}^X\), so \(\overline{A}=\mathbb{R}^X\). If the constraint list is empty, the same construction gives the zero function, which belongs to \(A\). If \(X=\varnothing\), the unique function has empty support and is itself in \(A\). These cases agree with the conclusion.
Check: At every constrained input, the constructed function equals the target exactly. Thus it satisfies the original open-set requirement, not merely an approximate version of it.
Worked Example: The Closure of the Constant Functions
Give \(X=\mathbb{R}\) no role other than as a set of inputs, and give the output space \(\mathbb{R}\) its standard topology. Let \(A\subseteq\mathbb{R}^{\mathbb{R}}\) be the family of constant functions. We show that \(\overline{A}=A\).
Every member \(f\in A\) belongs to its own closure, since every open neighborhood of \(f\) contains \(f\), which is in \(A\). Now let \(f\) be nonconstant. There are inputs \(x,y\in\mathbb{R}\) with \(f(x)\ne f(y)\). Set \(d=|f(x)-f(y)|\), so \(d>0\), and let \(r=d/3\). Consider the basic neighborhood of \(f\) requiring $$ |g(x)-f(x)|<r \quad\hbox{and}\quad |g(y)-f(y)|<r. $$ These are open interval constraints at two distinct inputs. If a constant function \(g\) belonged to this neighborhood, then \(g(x)=g(y)\). But the triangle inequality would give $$ d=|f(x)-f(y)| \le |f(x)-g(x)|+|g(y)-f(y)| <2r=\frac{2d}{3}<d, $$ which is impossible. This neighborhood misses \(A\), so \(f\notin\overline{A}\). Hence the closure contains exactly the constant functions.
For a numerical instance, take \(f(t)=t\), with constraints at \(0\) and \(1\), each of radius \(1/3\). A constant \(g\) in the proposed neighborhood would have \(|g(0)|<1/3\) and \(|g(1)-1|<1/3\). Since \(g(0)=g(1)\), the triangle inequality would imply \(1<2/3\), a contradiction. This verifies the separation directly in this case.
A Finite Witness Can Force a Whole Function
Sometimes a small number of evaluations determines enough about a function to exclude every member of a family from a neighborhood. The next example shows that the finite-constraint test can prove a family is closed, even though its members are functions on an infinite set.
Worked Example: The Affine Functions Are Closed
Give \(\mathbb{R}\) its standard topology, and consider the family \(A\subseteq\mathbb{R}^{\mathbb{R}}\) of affine functions \(g(t)=a+bt\), where \(a,b\in\mathbb{R}\). We prove \(\overline{A}=A\).
Every \(f\in A\) belongs to \(\overline{A}\), because \(f\in A\). For the reverse inclusion, take \(f\notin A\). The values \(f(0)\) and \(f(1)\) determine a candidate affine function $$ h(t)=f(0)+(f(1)-f(0))t. $$ Because \(f\) is not affine, there is some \(t\in\mathbb{R}\) for which \(f(t)\ne h(t)\). This \(t\) is different from \(0\) and \(1\), since \(h(0)=f(0)\) and \(h(1)=f(1)\). Write \(\delta=|f(t)-h(t)|>0\), and set \(C=|1-t|+|t|\). In particular \(C\ge 1\), since \(|1-t|+|t|\ge |(1-t)+t|=1\). Choose \(r=\delta/(2(C+1))>0\).
Take the basic neighborhood of \(f\) requiring \(|g(s)-f(s)|<r\) at each of the three inputs \(s=0,1,t\). Any affine function satisfies \(g(t)=(1-t)g(0)+tg(1)\). Thus, if \(g\) belonged to this neighborhood, then $$ \begin{aligned} |g(t)-h(t)| &=\left|(1-t)(g(0)-f(0))+t(g(1)-f(1))\right|\\ &<\bigl(|1-t|+|t|\bigr)r=Cr. \end{aligned} $$ Also \(|f(t)-g(t)|<r\). Consequently, $$ \delta=|f(t)-h(t)| \le |f(t)-g(t)|+|g(t)-h(t)| <(C+1)r=\frac{\delta}{2}, $$ which is impossible because \(\delta>0\). The neighborhood therefore misses \(A\), and \(f\notin\overline{A}\). We have proved \(\overline{A}=A\).
For a concrete calculation, let \(f(t)=t^2\) and constrain values at \(0,1,2\) to within \(1/10\) of \(0,1,4\), respectively. If an affine \(g\) met the first two constraints, then \(g(2)=2g(1)-g(0)\), so $$ |g(2)-2| =|2(g(1)-1)-g(0)| \le 2|g(1)-1|+|g(0)| <\frac{3}{10}. $$ But the third constraint gives \(|g(2)-4|<1/10\), and hence $$ |g(2)-2|\ge 2-|g(2)-4|>\frac{19}{10}. $$ The bounds \( |g(2)-2|<3/10\) and \( |g(2)-2|>19/10\) cannot both hold. Thus this finite-coordinate neighborhood of \(t^2\) contains no affine function.
A Common Pitfall: Checking Inputs Separately
To test whether \(f\in\overline{A}\), it is not enough to show that for each individual input \(x\), some member of \(A\) takes a value near \(f(x)\). The same member must meet all the constraints in a chosen finite list.
For example, let \(A\) again be all constant real-valued functions on \(\mathbb{R}\), and let \(f(t)=t\). At the input \(0\), the constant function \(g_0(t)=0\) agrees exactly with \(f\); at the input \(1\), the constant function \(g_1(t)=1\) agrees exactly with \(f\). The incorrect conclusion would be that these separate matches show \(f\in\overline{A}\). They do not: \(g_0\) and \(g_1\) are different functions.
The correction is to test a single neighborhood with both constraints. Require \(|g(0)-0|<1/3\) and \(|g(1)-1|<1/3\). A constant \(g\) satisfying both would imply $$ 1=|0-1| \le |g(0)-0|+|g(1)-1| <\frac{2}{3}, $$ which is impossible. Thus this one basic neighborhood misses all of \(A\), and \(f\notin\overline{A}\).
Check Your Understanding
For each question, distinguish a constraint at one input from a simultaneous finite list of constraints.
- Write a basic neighborhood of \(f\in Y^X\) that constrains \(f\)'s values at three distinct inputs.
- Let \(A\) be the functions on \(\mathbb{R}\) that vanish outside a finite set. Which construction shows that every \(f\in\mathbb{R}^{\mathbb{R}}\) belongs to \(\overline{A}\)?
- For the constant functions on \(\mathbb{R}\), explain why a nonconstant \(f\) can be excluded from their closure using two inputs.
- Show that the function \(t\mapsto t^2\) is not in the closure of the affine functions by choosing finitely many inputs and open interval constraints.
- If \(X=\varnothing\), how does the finite-constraint closure test decide whether the unique function \(X\to Y\) belongs to \(\overline{A}\)?