A Set of Maps Is Not Yet a Topological Space
It is natural to collect continuous maps from one space to another and ask whether the resulting collection is compact. But compactness is a property of a topological space, not of a set alone. A set of functions has no compactness answer until a topology on that set is specified. Different choices can give different answers, even when the functions themselves are unchanged.
Recall that a topological space is compact if every open cover has a finite subcover. In this definition, “open” refers to the topology of the space being covered. An open cover of \(C(X,Y)\) therefore cannot be discussed until its topology has been chosen.
One common choice is the pointwise topology. Regard a function \(f:X\to Y\) as the list of all its values \(f(x)\), one for each \(x\in X\). The product space \(Y^X=\prod_{x\in X}Y\) has the product topology: a basic open set restricts the values at only finitely many inputs. The set \(C(X,Y)\) is a subset of \(Y^X\), and its pointwise topology is the subspace topology it inherits from that product. Thus, a basic restriction in \(C(X,Y)\) has the form $$ \{f\in C(X,Y): f(x_i)\in U_i\text{ for }1\le i\le k\}, $$ where \(k\) is finite, the \(x_i\) are points of \(X\), and each \(U_i\) is open in \(Y\). These sets form a basis after allowing finite intersections.
Worked Example: The Domain Topology Changes the Set of Maps
Let \(X=\{a,b\}\) and \(Y=\{0,1\}\), with the discrete topology on \(Y\). Compare the discrete and indiscrete topologies on \(X\). The discrete topology on \(X\) consists of all four subsets; the indiscrete topology consists only of \(\varnothing\) and \(X\).
If \(X\) is discrete, every map \(f:X\to Y\) is continuous: the preimage of any open set in \(Y\) is a subset of \(X\), and every subset of this discrete \(X\) is open. The four maps are determined by the ordered value pairs \((f(a),f(b))=(0,0),(0,1),(1,0),(1,1)\).
Now give \(X\) the indiscrete topology. For a map to the discrete space \(Y\) to be continuous, the preimages \(f^{-1}(\{0\})\) and \(f^{-1}(\{1\})\) must be open in \(X\). The only possible open preimages are \(\varnothing\) and \(X\), so exactly one of these fibers is \(X\) and the other is empty. Those two possibilities give exactly the two constant maps. Conversely, each constant map is continuous, since the preimage of any open subset of \(Y\) is either \(\varnothing\) or \(X\), both open in the indiscrete topology.
Check: the map with values \(f(a)=0\), \(f(b)=1\) is continuous for discrete \(X\), since its two nonempty fibers \(\{a\}\) and \(\{b\}\) are open there. It is not continuous for indiscrete \(X\), since \(\{a\}=f^{-1}(\{0\})\) is not open there. Thus even before choosing a topology on \(C(X,Y)\), the topologies on \(X\) and \(Y\) matter.
Finite Function Spaces
A finite set with the discrete topology is compact: from any open cover, choose one covering set for each point. There are only finitely many points, so the chosen sets give a finite subcover. This observation makes finite examples useful for separating the two questions: first, which maps are in \(C(X,Y)\); second, how that set is topologized.
Worked Example: Eight Maps and a Compact Function Space
Let \(X=\{a,b,c\}\) and \(Y=\{0,1\}\), both with the discrete topology. Every map \(X\to Y\) is continuous, since every subset of \(X\) is open. Each of the three inputs has two possible values, so there are \(2\cdot2\cdot2=8\) maps in \(C(X,Y)\).
Give \(C(X,Y)\) the pointwise topology. For any \(f\in C(X,Y)\), impose the three restrictions \(g(a)=f(a)\), \(g(b)=f(b)\), and \(g(c)=f(c)\). Each restriction uses an open singleton in \(Y\), and together they define the singleton \(\{f\}\). Hence every singleton in \(C(X,Y)\) is open, so this function space is discrete.
It is compact: given any open cover, choose one member containing each of the eight functions. These eight choices, or fewer if some sets cover multiple functions, form a finite subcover. The pointwise topology here is also the discrete topology because the full set of three input restrictions isolates every function. In particular, it is not a claim that every function-space topology is compact merely because the domain and codomain are finite; this calculation relies on the actual finite set and the topology just specified.
Pointwise Compactness for Binary-Valued Functions
Let \(\mathbb{N}=\{1,2,\dots\}\) have the discrete topology, and let \(D=\{0,1\}\) have the discrete topology. Every map from \(\mathbb{N}\) to \(D\) is continuous, so \(C(\mathbb{N},D)=D^{\mathbb{N}}\). For a finite list \(s=(s_1,\dots,s_n)\) of zeros and ones, define its cylinder $$ [s]=\{f\in D^{\mathbb{N}}: f(1)=s_1,\dots,f(n)=s_n\}. $$ The empty list has cylinder \(D^{\mathbb{N}}\). Cylinders form a basis for the pointwise topology: any finite set of coordinate restrictions can be extended to an initial segment of the coordinates, and the corresponding initial-segment cylinder is contained in those restrictions.
Proof. Let \(\mathcal{U}\) be an open cover of \(D^{\mathbb{N}}\). Suppose, for contradiction, that it has no finite subcover. Call a cylinder finitely coverable if some finite collection of members of \(\mathcal{U}\) covers that cylinder. The cylinder of the empty list is not finitely coverable, by the supposition. Each cylinder \([s]\) is the union of its two child cylinders \([s,0]\) and \([s,1]\). If both children were finitely coverable, the union of the two finite collections covering them would be a finite collection covering \([s]\). Thus, whenever \([s]\) is not finitely coverable, at least one child is not finitely coverable. Choose such a child at each stage. This constructs an infinite sequence \(x\in D^{\mathbb{N}}\) such that, for every \(n\in\mathbb{N}\), the cylinder \([x_1,\dots,x_n]\) is not finitely coverable. Some \(U\in\mathcal{U}\) contains \(x\). Since cylinders are a basis, there is a cylinder specified by finitely many coordinates of \(x\) and contained in \(U\). Choose \(n\ge1\) at least as large as all those coordinate indices (or choose \(n=1\) if there are no restrictions). Then \([x_1,\dots,x_n]\subseteq U\). The single set \(U\) covers this cylinder, contradicting its construction as not finitely coverable. Therefore every open cover has a finite subcover, and \(D^{\mathbb{N}}\) is compact. \(\square\)
The proof uses the finite-coordinate basis directly: a neighborhood of a function can test only finitely many values. This property is important in the argument, because the finite initial segment of the constructed sequence eventually satisfies all the restrictions defining a basis neighborhood.
Worked Example: A Compact Set of All Binary Sequences
Define \(f\in D^{\mathbb{N}}\) by \(f(n)=1\) when \(n\) is even and \(f(n)=0\) when \(n\) is odd. A basic pointwise neighborhood of \(f\) can, for example, require \(g(2)=1\) and \(g(5)=0\); it leaves every other coordinate unrestricted. Its members include all functions agreeing with \(f\) at those two inputs. More generally, any finite set of coordinate requirements that agrees with \(f\) describes a neighborhood of \(f\).
The theorem proves compactness of the entire space, not just of this neighborhood: every open cover of \(D^{\mathbb{N}}\), no matter how many cover sets it has, has a finite subcover. This statement concerns the pointwise topology, in which open restrictions involve finitely many coordinates. The underlying set is the same set of binary sequences used in the next example.
The Same Maps with the Uniform Topology
There is another natural topology when the codomain is a metric space. For bounded real-valued functions, the uniform distance is the supremum of the pointwise distances. In our binary example, use the usual metric on \(D=\{0,1\}\), where the distance between distinct values is \(1\), and define $$ d_{\infty}(f,g)=\sup_{n\in\mathbb{N}}|f(n)-g(n)|. $$ This is a metric on \(D^{\mathbb{N}}\): it is nonnegative and symmetric; it is zero exactly when \(f(n)=g(n)\) for every \(n\); and the triangle inequality follows from \(|f(n)-h(n)|\le |f(n)-g(n)|+|g(n)-h(n)|\) for every \(n\), followed by taking suprema. The topology generated by its open balls is the uniform topology.
Worked Example: Uniform Distance Destroys Compactness
Keep \(X=\mathbb{N}\), \(Y=D\), and the same underlying set \(C(\mathbb{N},D)=D^{\mathbb{N}}\), but now use the uniform metric. If \(f\ne g\), there is an index \(n\) with \(f(n)\ne g(n)\), so \(|f(n)-g(n)|=1\). At every index the difference is either \(0\) or \(1\), so its supremum is \(1\). Therefore \(d_{\infty}(f,g)=1\) whenever \(f\ne g\).
For every \(f\), the open ball of radius \(1/2\) around \(f\) contains only \(f\): the distance to itself is \(0<1/2\), while the distance to any distinct function is \(1\), which is not less than \(1/2\). Hence the uniform topology is discrete.
For each \(n\in\mathbb{N}\), let \(f_n\) be the function that is \(1\) at \(n\) and \(0\) at every other input. These functions are distinct: if \(m\ne n\), then \(f_n(n)=1\) and \(f_m(n)=0\). The family of all singleton sets \(\{\{f\}:f\in D^{\mathbb{N}}\}\) is an open cover in the uniform topology, because every singleton is open. A finite collection of these singletons contains only finitely many functions and cannot cover the infinitely many distinct functions \(f_n\). Thus there is no finite subcover, and \(D^{\mathbb{N}}\) is not compact in the uniform topology.
Check: the pointwise topology makes \(D^{\mathbb{N}}\) compact by the theorem; the uniform topology on that same set is not compact. The compactness answer changed because the topology changed, not because the set of continuous functions changed.
A Common Pitfall
Common pitfall. One might argue: “The value space \(D\) is finite and compact, so the space of maps \(D^{\mathbb{N}}\) is compact.” That conclusion silently assumes a topology on the function set. It is correct for the pointwise topology in this example, but false for the uniform topology: the open cover by singletons just computed has no finite subcover. The relevant distinction is not whether each individual function has values in a compact space; it is how open sets in the collection of functions are defined.
When asking a compactness question about a function space, specify the spaces \(X\) and \(Y\), the set \(C(X,Y)\), and the topology on that set. Pointwise topology tests finitely many values at a time. Uniform topology controls the greatest pointwise discrepancy across the entire domain. They answer different questions about what it means for functions to be close, and they can produce different compactness outcomes.
Check Your Understanding
In each question, identify the topology on the function set before deciding compactness.
- If \(X\) is discrete and \(Y=\{0,1\}\) is discrete, why is every map \(X\to Y\) continuous?
- For \(X=\{a,b\}\) and \(Y=\{0,1\}\), both discrete, how many elements does \(C(X,Y)\) have, and why is its pointwise topology discrete?
- In the pointwise topology on \(D^{\mathbb{N}}\), what finite data specify a basic neighborhood of a function?
- For distinct \(f,g\in D^{\mathbb{N}}\), compute \(d_{\infty}(f,g)\). Why does this imply that the uniform topology is discrete?
- Why does the cover by singleton sets show that \(D^{\mathbb{N}}\) is not compact in the uniform topology?