What properties of $X$ guarantee that every open subset can be written as an increasing union of clopen sets

Let $X$ be a Cantor set. Then it is know that for any open subset $U$ of $X$, we can write $U$ as an increasing union of clopen subsets (in $X$). The same holds for any compact, metric, zero-dimensional space.

What does one need to assume on $X$ to have this property?

Is it still true if one assumes that $X$ is a zero-dimensional, metric space? (not necessarily compact)?

Thanks for any answer

• What proof do you know for the compact case, and where does it make use of compactness? – Torsten Schoeneberg Sep 6 '18 at 17:47
• What do you mean by "an increasing union of clopen sets"? If $U=\bigcup_{\alpha\lt\omega_1}A_\alpha$ where each $A_\alpha$ is clopen and $A_\alpha\subset A_\beta$ when $\alpha\lt\beta$, is that an "increasing union of clopen sets"? Or does it have to be a countable union? (If it has to be a countable union, then the space $\omega_1+1$ (all ordinals less than or equal to the first uncountable ordinal) with the order topology is the obvious counterexample.) – bof Sep 7 '18 at 2:14

Being hereditarily Lindelöf is not necessary in general: any discrete space obeys the condition and only countable ones are hereditarily Lindelöf. It is necessary to be perfect (in the sense that closed sets are $G_\delta$'s or equivalently that open sets are $F_\sigma$'s). If locally compact, this reduces to being herediarily Lindelöf again.
I'm not sure (but I don't think so) that all zero-dimensional metric spaces will have the property, e.g. $D(\kappa)^\omega$, where $(D(\kappa)$ is a discrete space of uncountable size $\kappa$, seems a natural counterexample.