Let $X$ a metric space, $A\subseteq X$. For each $n \in \mathbb{N}$ define : $$A_n =\{ x\in X \mid d(x;X-A)\geq \frac{1}{n} \}$$ where $d(x;X-A)$ is the distance from $x$ to the set $X-A$.
Prove that $A_n$ is closed for each $n \in \mathbb{N}$.
Mi proof, for $n \in \mathbb{N}$ :
Consider $x_0 \in X-A$ and the set : $C_{x_0} = \{ x \in X\mid d(x,x_o) \geq \frac{1}{n} \}$. It is immediate to see that:
$$ X-C_{x_0} = B_{(x_0,\frac{1}{n})} $$
where $ B_{(x_0,\frac{1}{n})} = \{x \in X \mid d(x,x_0)<\frac{1}{n} \} $. Since the open ball is open, we have to $C_{x_0}$ is closed. Finally :
$$ A_n = \bigcap_{x_0 \in X-A} C_{x_0} $$
is closed because it is an arbitrary intersection of closed sets.
The equality $$A_n = \bigcap_{x_0 \in X-A} C_{x_0} $$ is true because :
If $x\in A_n$ :
$\implies \frac{1}{n} \leq d(x,X-A) \leq d(x,x_0), \forall x_0 \in X-A$
$ \implies x \in C_{x_0}, \forall x_0 \in X-A $.
$\implies x\in \bigcap C_{x_0}$
Conversely if $x \in \bigcap C_{x_0}$
$ \implies x \in C_{x_0}, \forall x_0 \in X-A $
$\implies d(x,x_0)\geq \frac{1}{n}, \forall x_0 \in X-A $
$\implies d(x,X-A)\geq \frac{1}{n}$
$\implies x\in A_n$
Is my proof correct? Thanks!
NOTE : If $A$ is compact is true that $$A = \bigcup_{n \in \mathbb{N}} A_n ?$$
Here's an alternative to that brute force proof.
f:X -> R, x -> d(x,X - A) is continuous.
I = { x in R : 1/n <= x } is closed.
$A_n = f^{-1}(I)$
is the inverse image of a closed set by a continuous function,
hence closed.