# Show that $X$ is Hausdorff if and only if the diagonal $\Delta = \{(x, x):x \in X\}$ is closed in $X \times X$ [duplicate]

This question already has an answer here:

I am aware that there is a similar question elsewhere, but I need help with my proof in particular. Can someone please verify it or offer suggestions for improvement?

Show that $X$ is Hausdorff if and only if the diagonal $\Delta = \{(x, x):x \in X\}$ is closed in $X \times X$

The proof is trivial if $|X|=1$. So, assume that $|X|>1$.

Suppose $X$ is Hausdorff. Let $(a, b) \in X \times X - \Delta$. Note that such an element exists, since $|X|>1$. Then, $a \neq b$. Since $X$ is Hausdorff, we can pick open sets $U_a$ and $U_b$ such that $a \in U_a$, $b \in U_b$, and $U_a \cap U_b = \varnothing$. Now, note that $(U_a \times U_b) \cap \Delta = \varnothing$ (Assume $(p, q) \in (U_a \times U_b) \cap \Delta.$ Then, $(p,q) \in \Delta$ implies that $p = q$. But then, $p \in U_a$ and $p \in U_b$, contradicting the fact that $U_a \cap U_b = \varnothing$). This implies that the set $X \times X - \Delta$ is open in $X \times X$. So, $\Delta$ is closed in $X \times X$.

Now, suppose $\Delta$ is closed in $X \times X$. Then, $X \times X - \Delta$ is open in $X \times X$. So, there exists a basis element $U \times V$ of $X \times X$ such that $(a, b) \in U \times V$ and $U \times V \subseteq X \times X - \Delta$. This implies that $(U \times V) \cap \Delta = \varnothing$. Then, $a \in U$ and $b \in V$. Note that $U \cap V = \varnothing$. If such were not the case, then there exists a $y \in U \cap V$. This implies that $(y, y) \in U \times V$, contradicting the fact that $(U \times V) \cap \Delta = \varnothing$. This shows that $X$ is Hausdorff.

## marked as duplicate by Najib Idrissi, kingW3, Jack D'Aurizio, N. F. Taussig, DarioFeb 21 '15 at 14:33

The proof is basically correct, but the second part needs a little improvement: you start talking about $(a,b)$ without ever saying what it is. You also speak of $U\times V$ as an element of $X\times X$, which of course it is not: it’s a subset. All of this is easily fixed:
Now suppose $\Delta$ is closed in $X\times X$, and let $a$ and $b$ be distinct points of $X$; clearly $\langle a,b\rangle\in(X\times X)\setminus\Delta$, which is open in $X\times X$, so there is a basic open set $U\times V$ in $X\times X$ such that $\langle a,b\rangle\in U\times V\subseteq(X\times X)\setminus\Delta$.