Diagonal $\Delta = \{x \times x : x \in X \}$ closed in $X \times X$ implies that $X$ is Hausdorff I think I have solved a problem in Topology by Munkres, but there is a small detail that is bugging me. The problem is stated in this question's title. I will write down the proof and will highlight what is troubling me.
We prove by contradiction: Assume $X$ is not Hausdorff. Then there exist points $x,y$ where $x$ is different from $y$ such that no neighbourhoods $U$, $V$ about $x$ and $y$ respectively have trivial intersection. Now consider the point $(x,y)$ that is in the complement of $\Delta$. Now let $U \times V$ be any basis element that contains $(x,y)$ (such an element exists by definition of the product topology being generated by the basis $\mathcal{B}$ consisting of elements of the form $W \times Z$, where $W$ is open in $X$ and $Z$ is open in $Y$). Consider $(U \times V ) \cap \Delta$, which I claim to be $(U \cap X) \times (V \cap X)$.
By our choice of $x$ and $y$ there is $z \in U \cap V$, implying that the intersection $(U \times V ) \cap \Delta$ is not trivial.
Since $U \times V$ was any basis element containing $(x,y)$, this means that $(x,y) \in \overline{\Delta}$, which means that there exists a limit point of $\Delta$ that is not in it, contradicting $\Delta$ being closed.
The problem comes is in the way I have decomposed $\Delta$; the way I have put it seems I am saying that $\Delta$ is equal to $X \times X$, which is not the case. How  can I get round this?
Thanks.
Edit: Martin Sleziak has pointed out some mistakes, $(U \times V ) \cap \Delta$ should be $\{ (x,x) : x \in U \cap V\}$ and not as claimed.
 A: Your claim that $(U\times V)\cap \Delta=(U\cap X)\times(V\cap X)$ is incorrect. Since $U,V\subseteq X$, this is the same as claiming
$(U\times V)\cap \Delta=U\times V$.
If you use
$(U\times V)\cap \Delta = \{(x,x); x\in U\cap V\}$ instead, the rest of your proof should work fine, but there are still several minor details. 

Minor nitpicks:


*

*Wouldn't a direct proof (instead of using contradiction) more clear? I don't think you would have to change the proof much to do this. But perhaps this is a matter of taste.

*If you're using proof by contradiction, you cannot choose $x$, $y$ arbitrarily, but you should choose $x,y\in X$, $x\ne y$, which witness that this space is not Hausdorff. (I.e., for any neighborhoods $U\ni x$, $V\ni y$ the intersection $U\cap V$ is non-empty.)
One more nitpick considering formatting:


*

*It's not good to write two formulas after each other. If you write "$x,y$ $x \neq y$ such that..." this is quite difficult to read. You should separate such things at least with a little, e.g. "$x$, $y$; $x \neq y$ such that..."; in my opinion it is much better to separate them with text, e.g. "$x$, $y$ such that $x \neq y$ and..."

A: A straightforward proof is a bit simpler:
If the diagonal is closed, then for $x\ne y$ in $X$, the point $(x,y)$ is not on the diagonal. So, there is an nhood of $(x,y)$ in $X\times X$ containing $(x,y)$ disjoint from the diagonal. But, then,  this nhood is of the form $U\times V$ where $U$ and $V$ are open disjoint sets containing $x$ and $y$ respectively.

Actually, contraposition would be best as you started in my opinion. If $X$ is not Hausdorf then there are $x$ and $y$ with $x\ne y$ such that for every open set $U$ containing $x$ and for every open set $V$ containing $y$ we have $U\cap V\ne\emptyset$ . Then, as you show, $(x,y)$ is in the closure of the diagonal. So, as $(x,y)$ is not on the diagonal but is in its closure, the diagonal is not closed.


The answer to your actual question is nicely explained in the other posts here. But I wanted to emphasise that an nhood $U\times V$ in $X\times X$ (which is as you describe) intersects the diagonal if and only if $U\cap V\ne\emptyset$. This follows from the relevant definitions is the key to the whole problem...
A: The definition of Hausdorff is that for all distinct pairs $x,y \in X$ there exist disjoint open $U \ni x$ and $V \ni y$. Hence the negative is that there exist $x,y \in X$ each of whose open neighbourhoods $U \ni x$, $V \ni y$ have nonempty intersection. You seem to have said that this is the case for all $x,y \in X$, which isn't true.
Also your claim $(U \times V) \cap \Delta = (U \cap X) \times (V \cap X)$ seems to assume $\Delta = X \times X$, which could be the cause of your problems.
A: You made the statement "Since $X$ is not Hausdorff, for any neighbourhoods $U$ and $V$ about $x,y$ respectively the intersection of $U$ and $V$ is not trivial." This actually has to only be true for a single $(x,y)$, not all $x$ and $y$.
It's probably best to not use proof by contradiction... If $\Delta$ is closed, then for any $(x,y) \notin \Delta$, there are open $U$ and $V$ such that $(x,y) \in U \times V$ and $U \times V$ is disjoint from $\Delta$. If you translate this correctly, you're done.
