Why is this set a Borel set on $R^2$? Consider a measurable space $([0,1]\times [0,1], \mathcal{B}([0,1]) \times \mathcal{B}([0,1]))$, and a subset $A:=\{(x,y):x=y\}$ (the diagonal). According to the text book, $A \in \mathcal{B}([0,1]) \times \mathcal{B}([0,1])$. Can any body tell me the reason and in general, how do we check if a given set is a Borel set? Thanks:)
PS: what I cannot see is, since $\mathcal{[0,1]} \times \mathcal{[0,1]}$ by definition is generated by the class $\mathcal{C}=\{I_1 \times I_2\}$, where $I_1, I_2$ are intervals on $[0,1]$, I cannot express $A$ as any countable union/intersection, complement of any $I_1 \times I_2$.
 A: By the definition of the product $\sigma$-algebra, $\mathcal{B}([0,1]) \times \mathcal{B}([0,1])$ is generated by sets of the form $X \times Y$ where $X,Y \in \mathcal{B}([0,1])$.  If $x$ and $y$ are distinct real numbers in the interval $[0,1]$ then we can find disjoint subintervals $X$ and $Y$ of $[0,1]$ containing $x$ and $y$ respectively, with rational endpoints. 
We have $X,Y \in \mathcal{B}([0,1])$ and the rectangle $X \times Y$ is disjoint from the diagonal.
Therefore the complement of the diagonal is the union of countably many elements of the product $\sigma$-algebra $\mathcal{B}([0,1]) \times \mathcal{B}([0,1])$, so the diagonal itself is in this $\sigma$-algebra.
A: $[0,1]^2\setminus A$ is a union of countably many open rectangles, since the open rectangles are a base for the topology. Open rectangles are clearly in the product $\sigma$-algebra, so $[0,1]^2\setminus A$ is, and so is its complement $A$.
For more information see the answers to this question.
A: Every closed set is a Borel set, and $A$ is a closed subset of $[0,1]\times [0,1]$. (The map $A\to [0,1]$ given by $(x,y)\mapsto x$ is a homeomorphism, so $A$ is compact.)
