Borel set of $\mathbb R^n$ with $n > 1$ According to various sources, the Borel set over $\mathbb{R}^n$ can be defined in several equivalent ways: 
For instance, it can be defined as the smallest sigma-algebra containing every open set of $\mathbb{R}^n$ or the smallest sigma-algebra containing the sets  $(a_1, b_1) \times ... \times (a_n, b_n)$ for $a_1, ..., a_n, b_1, ..., b_n \in \mathbb{R}$.
I did not manage to find any demonstration for this equivalence, and to me it seems to be false so I would like to know where is the flaw in my reasoning.
I assumed $n = 2$ and thanks to the  properties of a sigma algebra, I restated the problem with closed sets.
If the above definitions are equivalent then
the smallest sigma-algebra containing every closed set of $\mathbb{R}^2$ must be the same as as the one generated by the rectangles $[a_1, b_1] \times [a_2, b_2]$.
While it is obvious that the second sigma algebra is  included in the first, I think there are closed sets that can't be expressed as a countable union of rectangles.
For example if you take a closed triangle $A(0,0)$ $B(1, 0)$ $C(1, 1)$ and consider the side $[AC]$, it is neither horizontal nor vertical therefore every point of $[AC]$ must be a corner of a rectangle, which means at least as much rectangles are needed to fill the triangle as there are points in $[AC]$ which is not a countable set AFAIK.
I think my idea can be easily generalized for any $n \geq 2$.
I believe I either made a mistake somewhere in my proof or I did not understand the definition for the borel set over $\mathbb{R}^n$. 
In any case I'd be happy to know where the flaw is.
Thank you.
 A: We show directly that the two definitions are equivalent: We need only to show that all open sets in $\mathbb R^n$ can be written as a countable union of open rectangles. 
Let $V \in \mathbb R^n$ be open. Let $C$ be its complement. Let $Q$ be a countable dense subset in $V$. For each $p \in Q$, define 
$$r_p = \sup \{r >0 : (p_1-r, p_1+r) \times \cdots \times (p_n-r,p_n+r) \subset V\}$$
Note that $r_p >0$. Also the square 
$$S_p(r_p) = (p_1-r_p, p_1+r_p) \times \cdots \times (p_n-r_p,p_n+r_p)$$
is contained in $V$
Claim: $V = \bigcup _{p\in Q} S_p(r_p)$. 
To see this, let $v\in V$. Then similarly define $r_v$. Then $S_v(r_v)$ is contained in $V$. As $Q$ is dense in $V$, there is $p\in Q$ so that $|v_i-p_i|< r_v/3$ for all $i$. Then the square $S_p(r_v/2)$ is contained in $S_v(r_v)$. Thus $r_p >r_v$. Also $v \in S_p(r_v)$. Thus $v \in S_p(r_p)$. 
A: Any open set $U\subset\mathbb R^2$ is a countable union of open rectangles $(a,b)\times(c,d)$.
Not every closed set $C\subset\mathbb R^2$ is a countable union of closed rectangles $[a,b]\times[c,d]$.
The same thing happens with open and closed balls, too.
In an open set you always have a little bit of room to find a rectangle around any point, but in a closed set this is not possible around boundary points.
