Finite union of compact sets is compact

Let $(X,d)$ be a metric space and $Y_1,\ldots,Y_n \subseteq X$ compact subsets. Then I want to show that $Y:=\bigcup_i Y_i$ is compact only using the definition of a compact set.

My attempt: Let $(y_n)$ be a sequence in $Y$. If $\exists 1 \leq i \leq n\; \exists N \in \mathbb N \; \forall j \geq N\; y_j \in Y_i$ then $(y_n)$ has a convergent subsequence because $Y_i$ is compact. Otherwise, $$\forall 1 \leq i \leq n \; \forall N \in \mathbb N\; \exists j \geq N\; y_j \notin Y_i$$ Assuming for the moment that $n = 2$ and using induction later we have that $$\forall N \in \mathbb N \; \exists j \geq N \; y_j \in Y_1 \backslash Y_2$$ With this we can make a subsequence $\bigl(y_{n_j}\bigr)_{j=0}^\infty$ in $Y_1 \backslash Y_2$. This sequence lies in $Y_1$ and thus has a convergent subsequence. This convergent subsequence of the subsequence will then also be a convergence subsequence of the original sequence. Now we may use induction on $n$.

• @CameronBuie Of course; I should have realized that... Jun 23 '13 at 23:26

Let $\mathcal{O}$ be an open cover of $Y$. Since $\mathcal{O}$ is an open cover of each $Y_i$, there exists a finite subcover $\mathcal{O}_i \subset \mathcal{O}$ that covers each $Y_i$. Then $\bigcup_{i=1}^n \mathcal{O}_i \subset \mathcal{O}$ is a finite subcover. That's it; no need to deal with sequences.

• I think that brevity is one of your qualities.
– user230283
Jan 26 '16 at 1:24
• @J.G: While this is shorter and a simpler approach, it doesn't help the OP if they have not yet encountered the finite subcover definition of compactness (as seems to have been the case). Jan 28 '16 at 12:08
• Wow, this method is Brilliant. Nov 25 '16 at 23:37
• I was wondering why this answer is not set as the best answer . :-) Nov 25 '16 at 23:38
• @Schrödinger'sCat: I suspect that this was not the accepted answer (despite being excellent, brief, and correct) because it didn't address the OP's question at the OP's level. I note that it still doesn't, but frankly, Ink has no real incentive to adjust. More upvotes might be garnered, and the downvote might be reversed, but this is already a highly successful answer, and the OP has already chosen my answer as the (most) helpful answer for his/her purposes. May 2 '17 at 22:37

It looks like your definition of compactness is that every sequence has a convergent subsequence. There is something you need to be cautious about, here: you are using $n$ for two different things! You use it first as the highest index of your $Y_i$s, and then as the index variable of your arbitrary sequence. Instead, let's go with $Y_1,...,Y_k$ as your compact sets.

Now, your proof gets the job done, but your detour into the "all but finitely many $y_n$ lie in some $Y_i$" possibility (how you start your proof) is unnecessary, as is induction. We can get there more simply if we recall that a union of finitely-many finite sets is again a finite set.

For $1\le i\le k,$ let $$\mathcal I_i=\{n\in\Bbb N:y_n\in Y_i\}.$$ (That is, $\mathcal I_i$ is the set of indices of sequence elements lying in $Y_i$.) Since the $y_n$ are all in $Y=\bigcup_{i=1}^kY_i,$ then $\bigcup_{i=1}^k\mathcal I_i=\Bbb N,$ whence at least one of the $\mathcal I_i$ is infinite (by the fact we recalled earlier). Without loss of generality, suppose $\mathcal I_1$ is infinite, so that the points $y_n$ lying in $Y_1$ form a subsequence of $\{y_n\}_{n=0}^\infty.$ Then we can proceed as you did.

• This argument is no different from the OP's. You're still using the Pigeonhole principal. You've just phrased it differently. May 2 '17 at 23:26
• @DWiggles: I'm glad you agree with me! My intention was to help the OP fix his/her argument. Now, if you feel that my correction is insufficient, please feel free to let me know, so that I can address it. Of course, if there is nothing wrong with my correction, please feel free to upvote. May 2 '17 at 23:58
• @DWiggles: For what it's worth, your phrasing suggests to me that you think that you disagree with me. If that is the case, please point out what you believe to be wrong with my argument. May 3 '17 at 0:01
• Your argument seems totally fine to me. May 3 '17 at 1:57