TITLE: Borel algebra is generated by the collection of all half-open intervals
QUESTION [10 upvotes]: This question is based on the following from Elements of Integration and Lebesgue Measure by Bartle. We are given the following example and exercise:

Let X be the set ${\mathbf R}$ of real numbers. The Borel algebra is the $\sigma$-algebra generated by all open intervals $(a,b)$ in ${\mathbf R}$. Observe that the Borel algebra ${\mathbf B}$ is also the $\sigma$-algebra generated by all closed intervals $[a,b]$ in ${\mathbf R}$
Exercise 2.B. Show that the Borel algebra ${\mathbf B}$ is also generated by the collection of all half-open intervals $(a,b]=\{x\in {\mathbf R}: a<x\leqslant b\}$

The definition of sigma algebras we are given is that they are unions and complements of a family of sets on a universal set $X$.
My thought on the way to solve this was to use something like
$$
(a,b)=\cup_{n=1}^\infty[a+1/n,b-1/n]
$$
and similarly
$$
(a,b)=\cup_{n=1}^\infty(a,b-1/n]
$$
to show that we can construct $(a,b)$ as a union of either the closed or the half-open intervals.
What I'm wondering about is, first I would like to check that the above is a correct answer of course, and also I wonder whether I've missed some other trick which doesn't involve these constructions.

REPLY [4 votes]: You showed that the $\sigma$-algebra generated by the closed (resp. half-open) intervals is a superset of the Borel algebra. The other inclusion is still missing: Obtain $[a,b]$ using nothing but countable unions and complements of open intervals. A straight-forward possiblity is
$$[a,b]=\mathbb R\setminus\left(\bigcup_{n=1}^\infty\left(\mathbb R\setminus(a-1/n,b+1/n)\right)\right)\text.$$
Reusing this representation, we obtain
$$(a,b]=(a,(a+b)/2)\cup[(a+b)/2,b]$$
for half-open intervals.