Proof by contradiction that compact sets are closed I have started on the following attempt that if a set $E \subseteq \mathbb{R}^{k}$ is compact, then it is closed (I have yet to cover my second case). Am I on the right track?
Suppose $E$ is compact, but it is open. Then, for each $x\in E$, $\exists$ $r_{x}>0$ s.t. $B(x, r_{x})\subseteq E$. $E \subseteq \bigcup_{x\in E}\{B(x,r_x)\}$, and so $\{B(x, r_{x})\}_{x\in E}$ is an open cover of $E$. We now show that, from $\{B(x, r_{x})\}_{x\in E}$, can be derived an open cover of $E$ that does not have a finite subcover.
Consider all $y\in E$ which are such that there does not exist an $x\in E$, $x\neq y$, such that $y\in B(x, r_x)$. Let $\Phi$ be the set containing all balls with such centres.
Now, remove some arbitrarily chosen ball from $\Phi$. Call this ball $B(x_{1}, r_{x_1})$. Note that $\{B(x, r_{x})\}_{x\in E \setminus \{x_{1}\}}$ is an open cover of $E$. Now, choose some ball $B(x_{2}, r_{x_{2}})$ in $\Phi \setminus \{B(x_{1}, r_{x_1})\}$ which satisfies the following two conditions:

*

*It is not the only set in $\{B(x, r_{x})\}_{x\in E \setminus \{x_1\} }$ that contains $x_{1}$


*$\exists B(a, r_{a})$ such that $a \neq x_{2}$, and $B(a, r_{a}) \in \{B(x, r_x)\}_{x\in E \setminus \{x_{1}\}}$, such that $x_{2} \in B(a, r_{a})$
First, consider the case in which there does not exist any such $B(x_{2}, r_{x_{2}})$ in $\Phi \setminus \{B(x_{1}, r_{x_1})\}$. Then, each ball in $\{B(x, r_{x})\}_{x\in E \setminus \{x_1\} }$ is of at least one of the following types:

*

*It is the only ball in that collection which contains $x_{1}$.


*It is the only ball in that collection which contains the point which is at its centre.
A ball of the first type cannot be removed to form a subcover of $\{B(x, r_x)\}_{x\in E \setminus \{x_{1}\}}$, because then the presumptive subcover would not include $x_{1}$.
A ball of the second type cannot be removed to form a subcover of $\{B(x, r_x)\}_{x\in E \setminus \{x_{1}\}}$, because then the presumptive subcover would not include any such ball's central point.
So, if there does not exist a ball in $\Phi \setminus \{B(x_{1}, r_{x_1})\}$ that satisfies both condition (1) and (2), then no balls in $\Phi \setminus \{B(x_{1}, r_{x_1})\}$ can be removed to form a finite subcover of $\{B(x, r_{x})\}_{x\in E \setminus \{x_{1}\}}$. But, neither can any balls in $\{B(x, r_x)\}\setminus \Phi$. So $\{B(x, r_{x})\}_{x\in E \setminus \{x_{1}\}}$ does not have a finite subcover, contradicting the compactness of $\{B(x, r_{x})\}_{x\in E}$
Second, consider the case in which there exists at least one ball in $\Phi \setminus \{B(x_{1}, r_{x_1})\}$ that satisfies conditions (1) and (2).
 A: Let $E$ be compact. If $E^c$ is empty, then $E$ is closed because the empty set is open and the complement of an open set is closed.
If $E^c$ is not empty then there exists some $p\in E^c$. Let $\{U_i\}$ be a family of open sets defined by $U_i=\{x\in\mathbb R^k: |x-p|\gt\frac{1}{i}\}$, for $i\in\mathbb N$. Note that I am defining the natural numbers as the counting numbers so division by zero is not an issue.
Every element $e\in E$ is some positive distance from $p$ and we can always find $i$ such that $\frac{1}{i}\lt |e-p|$. Therefore, the $\{U_i\}$ form an open cover for $E$. But $E$ is compact so there exists a finite subcover $\{U_{i_1},...,U_{i_n}\}\subset\{U_i\}$ of $E$. Since this collection is finite, there is an index $i_r$ for which $\frac{1}{i_{r}}$ is minimum.
Then $p$ is contained in an open ball of radius $\frac{1}{2I_r}$ which does not intersect $E$. Since this construction can be carried out for each $p\in E^c$, $E^c$ is open and, therefore, $E$ is closed.
A: Let $(\mathbb{R}^{n},d)$ be the Euclidean metric space.
We say a subset $X\subseteq\mathbb{R}^{n}$ is compact iff every sequence in $X$ admits a convergent subsequence in $X$.
Suppose by contradiction that $X$ is not closed. This means $X\not\supseteq\partial X$.  Consider then that $x\in\partial X\backslash X$.
Since $x$ is an adherent point of $X$, there is a sequence of points in $(x_{n})_{n\in\mathbb{N}}$ in $X$ which converges to $x$.
Due to the compactness of $X$, we conclude that there is a subsequence $(x_{s(n)})_{n\in\mathbb{N}}$ which converges to $x\in X$. But we also know that a sequence of points in a metric space converges to some point iff every subsequence converges to the same point. Thus we deduce that $x_{n}\to x\in X$, which is a contradiction.
Hopefully this helps!
