When are all subsets intersections of countably many open sets?

(Motivated by a comment by Jeppe Stig Nelson to this question)

In what topological spaces $X$ can every subset $A$ be written as the intersection of countably many open sets, i.e., $A=\bigcap_{n=1}^\infty U_n$ with $U_n$ open?

Without demanding countability, $T_1$ is enough. If we even demanded finite intersections, we end up with discrete spaces, of course.

What property would guarantee countable intersections? For example, does it hold for metric spaces, even though a “straightforward” approach like $A\stackrel?=\bigcap_{n=1}^\infty\bigcup_{a\in A}B(a;\frac1n)$ does not work?

Solutions Collecting From Web of "When are all subsets intersections of countably many open sets?"

In fact, if $A \subset (X,d)$ and $$O_n = \bigcup \{B(a, \frac{1}{n}): a \in A\}$$ then $$\bigcap_n O_n = \overline{A}\text{.}$$

To see this: suppose $x \in \overline{A}$, and let $n \in \mathbb{N}$. Then there is some $a \in A \cap B(x, \frac{1}{n}$ which means $x \in B(a, \frac{1}{n}) \subseteq O_n$. As this holds for all $n$, the inclusion from right to left has been shown.

If, on the other hand, $x \in \bigcap_n O_n$, let $r>0$ and pick $n$ large enough that $\frac{1}{n} < r$. Then $x \in O_n$ so for some $a \in A$, $x \in B(a, \frac{1}{n})$. Now, $a \in B(x, r) \cap A$ and as $r$ was arbitrary, $x \in \overline{A}$ showing the other inclusion.

In particular all closed sets $A$ in a metric space are a countable intersection of open sets (such spaces are called “perfect”, and if they’re also normal and $T_1$, as metric spaces are, they are called “perfectly normal” (or $T_6$)).

But metric spaces where all sets are a $G_\delta$ (i.e. a countable intersection of open sets) are rare.

Of course countable $T_1$ spaces $X$ in general work, because $$A = \bigcap \{ X\setminus \{x\}: x \notin A\}$$ is then a countable intersection of open sets for any $A \subseteq X$. In any-sized discrete space all subsets are already open. So these obey it.

There are also other (non-discrete, uncountable) spaces that obey it: the rational sequence topology on the reals, and Mrówka $\Psi$-space to name two famous examples.