[Math] Every Closed Set In $R^1$ is intersection of countable collection of open set.

general-topologymetric-spacesreal-analysis

This is question I tried to solve as follows
Consider $A$ be closed set in $\Bbb R$ Therefore $\Bbb{R}\smallsetminus A$ is Open set .Now By Representation theorem of open set ,Every open set in $\Bbb R$ can be written as union of countable collection of disjoint open interval.
$\Bbb{R}\smallsetminus A=\bigcup I_n$ Where $I_n$ is open interval where n is form countable index set.
$\Bbb{R}\smallsetminus(\Bbb{R}\smallsetminus A)=A$ $=\Bbb{R}\smallsetminus\cup I_n $ $=\bigcap (\Bbb{R}\smallsetminus I_n)$ which implies $A$ is countable intersection of Closed set .
I had to prove that it is intersection of countable intersection of open set but I got other answer Where is my mistake in argument ? Any Help will be appreciated

Best Answer

This works in every metric space $(X, d) $:

Hints: Let $A$ be closed in $X$, then

  1. $A=\{x:d(x, A) =0\} $
  2. Consider $A_n:=\{x:d(x, A) <\frac1n\} $.

where $d(x, A) $ denotes the distance of point $x$ to set $A$, i.e. $$d(x, A) =\inf_{a\in A} d(x, a) $$ And specifically for $\Bbb R$, the distance function is given by $d(x, y) :=\vert y-x\vert$.