What a Compact Neighborhood Tests
Local compactness asks for compactness near each point, not necessarily for the whole space to be compact. This distinction is visible in familiar examples: the real line and an infinite discrete space are not compact, yet each has compact neighborhoods at every point. By contrast, the rationals with their usual topology have no compact neighborhood at any point.
Throughout, compactness means that every open cover has a finite subcover. A neighborhood here means an open set containing the point; when the neighborhood itself is compact, we will say so explicitly.
The compact neighborhood need not be open. This is useful in \(\mathbb{R}\): a closed interval can be compact while its interior supplies an open neighborhood of the point. A space that is itself compact is locally compact, since \(X\) is an open set in its own topology and is a compact neighborhood of every point.
Two Basic Tests
Proof. If \(X\) is compact, then \(X\) itself is compact and open and contains each \(x\in X\), so it is a compact neighborhood of each point. If \(X\) has the discrete topology, every singleton \(\{x\}\) is open. It is compact: any open cover of \(\{x\}\) contains a member covering \(x\), and that one member is a finite subcover. Thus \(\{x\}\) is a compact neighborhood of \(x\). If \(X\) is empty, the definition of locally compact is vacuously satisfied because there are no points to test. \(\square\)
For metric spaces, compact neighborhoods can be tested using closed balls. Write \(\overline{B}(x,r)=\{y\in X:d(x,y)\le r\}\) for the closed ball of radius \(r>0\).
Proof. Suppose first that every \(x\) has such a compact closed ball. The open ball \(B(x,r)\) is contained in \(\overline{B}(x,r)\), so the closed ball is a compact neighborhood of \(x\). Hence \(X\) is locally compact.
Conversely, let \(x\in X\) have a compact neighborhood \(K\). By definition, there is an open set \(U\) with \(x\in U\subseteq K\). Since \(U\) is open, there is \(\rho>0\) with \(B(x,\rho)\subseteq U\). Set \(r=\rho/2\). Then \(\overline{B}(x,r)\subseteq B(x,\rho)\subseteq K\), because \(d(x,y)\le\rho/2<\rho\) for every \(y\in\overline{B}(x,r)\). The closed ball is closed in \(X\): if \(d(x,y)>r\), then the ball about \(y\) of radius \((d(x,y)-r)/2\) misses \(\overline{B}(x,r)\), by the triangle inequality. A closed subset of a compact space is compact, so \(\overline{B}(x,r)\) is compact and the required radius exists.
For completeness, the compactness fact used in this proof follows directly from the definitions. If \(F\) is closed in a compact space \(K\), take any open cover of \(F\) by sets open in \(F\), express each as the intersection of \(F\) with an open set of \(K\), and add \(K\setminus F\). This gives an open cover of \(K\). A finite subcover of \(K\), with \(K\setminus F\) discarded if it occurs, gives a finite subcover of \(F\). \(\square\)
Worked Examples
Worked Example: The Real Line
Give a compact neighborhood of an arbitrary \(x\in\mathbb{R}\), where \(\mathbb{R}\) has its standard topology. Take \(K=[x-1,x+1]\). It contains the open interval \(U=(x-1,x+1)\), which contains \(x\), so it remains to check compactness.
The interval \(K\) is closed and bounded in \(\mathbb{R}\), hence compact by the Heine–Borel theorem. Thus \(K\) is a compact neighborhood of \(x\). Since the argument applies to every real \(x\), \(\mathbb{R}\) is locally compact.
Check: the chosen interval really contains an open neighborhood: \(x\in(x-1,x+1)\subseteq[x-1,x+1]\). The endpoints are included in \(K\), while they are not needed in \(U\).
Worked Example: The Rationals
Give \(\mathbb{Q}\) the subspace topology inherited from \(\mathbb{R}\). We show that it is not locally compact, by proving that no \(q\in\mathbb{Q}\) has a compact neighborhood.
Suppose, to the contrary, that \(K\subseteq\mathbb{Q}\) is a compact neighborhood of some \(q\). There is an open set \(U\) in \(\mathbb{Q}\) with \(q\in U\subseteq K\). By the definition of the subspace topology, there is an open set \(V\subseteq\mathbb{R}\) such that \(U=V\cap\mathbb{Q}\). Because \(q\in V\) and \(V\) is open, some interval \((a,b)\) satisfies \(q\in(a,b)\subseteq V\). Consequently, \((a,b)\cap\mathbb{Q}\subseteq K\).
The inclusion map \(i:\mathbb{Q}\to\mathbb{R}\), given by \(i(t)=t\), is continuous: the preimage of an open set \(W\subseteq\mathbb{R}\) is \(W\cap\mathbb{Q}\), open in the subspace topology. Continuous images of compact spaces are compact, so \(K\), viewed as a subset of \(\mathbb{R}\), would be compact. Every compact subset of the Hausdorff space \(\mathbb{R}\) is closed in \(\mathbb{R}\). But \(K\) contains every rational in \((a,b)\), and those rationals are dense in \((a,b)\). Therefore its closure in \(\mathbb{R}\) contains all of \((a,b)\), including an irrational point in that interval. This contradicts \(K\subseteq\mathbb{Q}\) and the fact that \(K\) is closed in \(\mathbb{R}\). Thus \(\mathbb{Q}\) is not locally compact.
The two facts about compact sets just used have short proofs. For a continuous image, pull an open cover of the image back to an open cover of the compact domain and then take a finite subcover. For the closedness assertion, let \(K\) be compact in a Hausdorff space and \(y\notin K\). For each \(x\in K\), choose disjoint open neighborhoods \(U_x\) of \(x\) and \(V_x\) of \(y\). Finitely many \(U_x\) cover \(K\); the intersection of the corresponding finitely many \(V_x\) is an open neighborhood of \(y\) disjoint from \(K\). Hence the complement of \(K\) is open.
Check: the contradiction uses a neighborhood of an arbitrary rational \(q\), not a special point. The interval \((a,b)\) exists around each such \(q\), so the argument rules out compact neighborhoods everywhere.
Worked Example: The Cantor Set
Let \(C\subseteq\mathbb{R}\) be the standard Cantor set, with its subspace topology. The compactness of \(C\) is established by the earlier material on the Cantor set and products. Since \(C\) is compact, it is a compact neighborhood of each of its points: in the space \(C\), the set \(C\) is open, contains every point, and is compact. Therefore the Cantor set is locally compact.
This argument is internal to the space \(C\). It does not claim that \(C\) is an open subset of \(\mathbb{R}\); local compactness asks for neighborhoods in the topology of the space being tested.
Check: for each \(x\in C\), choose \(K=C\) and \(U=C\). Then \(x\in U\subseteq K\), and \(K\) is compact by the stated compactness result.
Worked Example: An Infinite Discrete Space
Let \(X=\mathbb{N}\) with the discrete topology. For each \(n\in\mathbb{N}\), the singleton \(\{n\}\) is open and compact, so it is a compact neighborhood of \(n\). Thus \(X\) is locally compact.
It is not compact. The family \(\{\{n\}:n\in\mathbb{N}\}\) is an open cover of \(X\). A finite selection covers only finitely many natural numbers, so it cannot cover \(X\). This example verifies that local compactness does not imply compactness.
Check: the same singleton family works for any infinite discrete set: each singleton is open, but finitely many singletons cannot cover an infinite set.
Why the Rationals Fail and a Common Pitfall
The failure for \(\mathbb{Q}\) is not caused merely by its being noncompact; the real line is also noncompact and is locally compact. The decisive issue is that any open neighborhood in \(\mathbb{Q}\) contains the rationals from a real interval, whose closure reaches irrational points. A compact subset of \(\mathbb{Q}\), however, must also be compact under inclusion into \(\mathbb{R}\), and therefore closed in \(\mathbb{R}\). It cannot contain all those nearby rationals while remaining a subset of \(\mathbb{Q}\).
Common pitfall. One might take \(K=[q-1,q+1]\cap\mathbb{Q}\) and call it compact because it is bounded and closed relative to \(\mathbb{Q}\). Boundedness and relative closedness do not imply compactness in \(\mathbb{Q}\). Indeed, choose an irrational \(y\in(q-1,q+1)\). Rational density gives a sequence \((r_n)\) of rationals in that interval with \(r_n\to y\). If \(K\) were compact in \(\mathbb{Q}\), its image in \(\mathbb{R}\) would be compact and hence closed in \(\mathbb{R}\); since \(r_n\in K\) for every \(n\), closedness would force \(y\in K\), contradicting \(K\subseteq\mathbb{Q}\). The correction is to check compactness in the actual topology, not to infer it from boundedness and relative closedness.
| Space and topology | Locally compact? | Reason |
|---|---|---|
| \(\mathbb{R}\), standard topology | Yes | Each point lies inside a compact closed interval. |
| \(\mathbb{Q}\), subspace topology from \(\mathbb{R}\) | No | A compact neighborhood would be closed in \(\mathbb{R}\) but contain rationals from an interval. |
| Cantor set, subspace topology | Yes | It is compact, hence is a compact neighborhood of each of its points. |
| Infinite discrete space | Yes | Each singleton is open and compact, although the space is not compact. |
Check Your Understanding
For each question, identify the topology and distinguish a compact neighborhood from compactness of the whole space.
- In \(\mathbb{R}\) with its standard topology, give a compact neighborhood of \(x=3\) and specify its open subset containing \(3\).
- Why does a compact subset of \(\mathbb{Q}\), included in \(\mathbb{R}\), have to be closed in \(\mathbb{R}\)?
- Explain why the Cantor set is locally compact in its subspace topology, even though it is not open in \(\mathbb{R}\).
- Give an open cover proving that an infinite discrete space is not compact, and a compact neighborhood for each point.
- In the metric-space test, explain why choosing \(r=\rho/2\) ensures \(\overline{B}(x,r)\subseteq B(x,\rho)\).