An open subset $U\subseteq R^n$ is the countable union of increasing compact sets.

Why is this true?

I think I can find a countable union of compact sets $\cup_{k=1}^\infty X_k$ such that $\cup X_k \subseteq U$ and the lebesgue measure of $U \setminus \cup X_k$ is zero.

(for any $k\in \mathbb{N}$, we can find a closed set $Y_k \subset U$ such that $\lambda(U\setminus Y_k)<\frac{1}{k}$. (Take $X_k=B(k)\cap Y_k$ where $B(k)$ is the ball of radius $k$.)

But that doesn’t solve the problem.

Solutions Collecting From Web of "An open subset $U\subseteq R^n$ is the countable union of increasing compact sets."

Let
$$X_k:=\left\{x\in \mathbb R^n,\left\lVert x\right\rVert\leqslant k\}\cap \{x,d\left(x,U^c\right)\geqslant k^{-1}\right\}.$$
Then $X_k$ is closed (as an intersection of such sets) and bounded in $\mathbb R^n$ hence compact. We have $U=\bigcup_{k\geqslant 1}X_k$. Indeed, by definition $X_k\subset U$ for all $k$, and if $x\in U$, we can find $n$ such that
$\lVert x\rVert\leqslant n$. As $U^c$ is closed and $x\notin U^c$, $d\left(x,U^c\right)$ is positive. So take $k$ such that $d\left(x,U^c\right)\geqslant k^{-1}$ and $N:=\max\left\{n,k\right\}$. Then $x$ belongs to $X_N$.