# Counterexample that the arbitrary union of compact sets is compact

I want to show that it is not true that for any metric space $$(X,d)$$, the arbitrary union of compact subsets of $$X$$ is always compact.

For this I use the following counterexample: Consider the metric space $$(\mathbb{R},d)$$ with $$d$$ being the euclidean metric. Let $$\mathcal{A}=\left\{[a,a]:a\in\mathbb{R}\right\}$$, note that every element in $$\mathcal{A}$$ is a closed and bounded interval, then by the Heine-Borel theorem, each element of $$\mathcal{A}$$ is compact in this metric space.

Note that $$\cup\mathcal{A}=\bigcup_{a\in\mathbb{R}}[a,a]=\mathbb{R}$$, which is not compact. Then we found a metric space for which there is an arbitrary union of compact subsets that is not compact.

Is this counterexample right? I'm a bit dubious about the use I'm making of the notion of "arbitrary" union, since I'm not positive that $$\mathbb{R}$$ is actually an arbitrary index set (since at the end I'm choosing the index set). In other words, I think I'm implying that "arbitrary" and "uncountable" are equivalent notions in this context, fact that I'm not sure of. Thank you!

• "Arbitrary", in this context, doesn't really mean much. It's just included to distinguish from finite unions (or in other contexts, countable unions). The fact is, you provided a union of compact sets that is not compact. That is all that's required. Sep 26, 2022 at 3:10
• That counter example is fine albeit a bit of an overkill. But look. A compact set is closed and bounded (in $\mathbb R^n$ at least) so to get a counter example we need a union of closed and bounded sets that are either no closed or not bounded and if we apply a little brain juice we can come up with all sorts of simple counter example. For instance, an infinite union of unit intervals that are unbounded. Or $\cup_{n\in\mathbb Z} [\frac 1n, 1-\frac 1n] = (0,1)$ [Not closed!]. It's easy to see that our union must be infinite. Sep 26, 2022 at 3:54
• In fact, you can use this to produce a counterexample for any non-compact metric space. Singeltons are always compact in metric spaces (even in general Hausdorff spaces) and we can always write $X=\bigcup_{x\in X} \{ x\}$. Sep 26, 2022 at 5:18
• Any finite space is compact, and any space is the union of all of its finite sub-spaces. Sep 26, 2022 at 6:00
• A note: using Heine-Borel to prove that a one-point set is compact is way overkill, and also unnecessarily restricts you to Euclidean space. A direct proof is much simpler: consider any open cover of the set $\{a\}$. Then at least one of the sets in the cover necessarily contains $a$. That set by itself is an open cover of $\{a\}$, and one set is certainly a finite number of sets. Done. This works in any topological space whatsoever, and also extends directly to show that finite sets are always compact. Sep 26, 2022 at 12:01

The word "arbitrary" is an informal, and often misleading, terminology. It is usually a reference to the universal quantifier, and in this problem that's exactly what it refers to.

In this case, the statement one wants to disprove (using a counterexample) is the following universally quantified statement:

For any metric space $$(X,d)$$ and any collection $$\{C_i\}_{i \in I}$$ of compact subsets of $$X$$, the union $$\bigcup_{i \in I} C_i$$ is compact.

And your disproof is perfect, because all you have to do is produce one counterexample, consisting of one metric space and one collection of compact subsets, namely $$\mathbb R$$ and $$\{[a,a] \mid a \in \mathbb R\}$$, such that $$\bigcup_{a \in \mathbb R} [a,a]$$ is noncompact.

• Personally I think that in "arbitrary union", the word "arbitrary"'s main purpose is to draw attention to the fact that there was no restricting qualifier in front of "union". For instance, if students have been dealing with finite unions repeatedly, it makes sense to add an adjective to remind the students "please pay attention to the fact that we dropped the hypothesis that the union is finite".
– Stef
Sep 26, 2022 at 12:34

Your counterexample is correct. "Arbitrary" here means "for any index set", you gave one index set that doesn't work.

Others have pointed out rightly about the interpretation of the word "arbitray".

Here is my answer giving varieties of examples of unions not leading to compact sets.

Let me take indexing set consisting of integers $$\ge2$$. For such an integer take the closed (bounded interval) $$I_n=\big[-\frac{(n-1)}n, \frac{(n-1)}n\big]$$. We can easily check that their union is the open interval $$(-1,1)$$ which is not compact.

Take the same sets $$I_n$$, this time restrict to the indexing set consisting of prime numbers (or powers of 2, or powers of 3, or those integers with last digit 7). Now the union for each of the indexing set is still the same non-compact $$(-1,1)$$.

Moral: Indexing set can be any infinite subset of positive integers. The same conclusion is true.

• Indexing sets can be much larger than the positive integers. E.g. $\mathbb{R}$ as given in the question of OP. Sep 26, 2022 at 11:54
• @JannikPitt: yes. As OP had already given real numbers as an indexing set I wanted to say it is possible to have other sets as indexing sets. Sep 27, 2022 at 3:03

Think about this. In $$\mathbb R^n$$ a compact set is closed and bounded so we just need to find a union of closed and bounded sets where the union is either not closed or not bounded.

To make a union that is not bounded it is clear we must have an infinite union... but that is all we need. Say $$\cup_{n\in \mathbb N} [n, n+\frac 12]=[0,\frac 12] \cup [1,1\frac 12] \cup [2,2\frac 12] \cup ........$$ is closed and unbounded.

To come up with a sample of a union that is bounded but not closed we can have all the "end points" of the compact sets approach a limit point that is not in any of the compact sets. For example $$\cup_{n\in \mathbb N}[\frac 1n, 1] = (0, 1]$$ is not closed.

End your example is just jim-dandy too! If we have a compact set centered an $$x \in \mathbb R$$ and just do it for every single uncountably many $$x \in \mathbb R$$ we are going to have included all of $$\mathbb R$$ and that surely is not compact.

It may be worth trying to prove that any finite union of compact sets is compact. It's a good exercise. And not all that trivial.