Q:

Question about a proof that $X$ is Hausdorff $\iff$ the diagonal is closed

I was reading some proofs that $X$ is a Hausdorff space $\iff$ the diagonal $\Delta = \{x\times x; x\in X\}$ is closed. I've found this one, that says:

Let X be Hausdorff, then if $x\ne y$ there are neighborhoods $V_x$ and
   $V_y$ such that $V_x \cap V_y = \emptyset$. Therefore $V_x\times V_y
 \cap D=\emptyset$ and the complement of $D$ is open. Now, assume that
  the latter is true. Then, for any point $(x,y)$, $x\ne y$, there is an
  open set around it that does not intersect $D$. Therefore, there are
  two sets $x\in V_x$ and $y\in V_y$ such that $V_x\times V_y$ doesn't
  intersect $D$, therefore $V_x \cap V_y = \emptyset$.

My first question is: in the second line, when he concludes that the complementar is open, why? For me, in order for a complement of $D$ to be open, I have to prove that $X-D$ is open. How to prove that? Also, is he considering $V_x\times V_y$ an open? Why? Because an open in the cartesian product is an union of $U\times V$, where $U$ is open in $X$ and $V$ is open in $X$.

A:

Why is $V_x\times V_y$ open?

Because it is a union of sets of the form $U\times V$, where $U$ is open in $X$ and $V$ is open in $X$. Namely, it is the union of the single set $V_x\times V_y$, with $V_x$ and $V_y$ both open in $X$.

Why is the complement $X\times X - D$ open?

They are using the following lemma: $E$ is open if and only if, for all $x\in E$, there exists an open set $U$ such that $x\in U\subset E$. 
Specifically, they showed that for all $(x,y)\in X\times X-D$ (meaning $x\neq y$), there exists an open set (namely, $V_x\times V_y$) such that $(x,y)\in V_x\times V_y\subset X\times X-D$. Note that saying $V_x\times V_y\subset X\times X-D$ is equivalent to saying $V_x\times V_y\cap D=\varnothing$.

