# Prove that a topological space $(X, \tau)$ is $T_2$ if and only if the diagonal $D=\{(x,x):x \in X\}$ is closed subset of $X\times X$ [duplicate]

Prove that a topological space $(X, \tau)$ is $T_2$ if and only if the diagonal $D=\{(x,x):x \in X\}$ is closed subset of the product space $X\times X$

=> assume that $(X, \tau)$ is $T_2$, I know that $\forall x,y \in X$, there exists $U,V \subset X$ are open and disjoint sets such that $x\in U$ and $y \in V$. I think that $U \times U= \{(x,x):x\in U\}$ but I'm not sure this is correct, I don't know how to continue from here

for the converse, I can't see how the hypothesis help me prove $(X, \tau)$ is $T_2$

## marked as duplicate by Asaf Karagila♦, Daniel Fischer, M Turgeon, Omnomnomnom, Pedro Tamaroff♦Mar 14 '14 at 14:08

• One extra detail that I didn't respond to: $U\times V$ is the cartesian product of $U$ and $V$, and is the set of ordered pairs $\langle u,v\rangle$ such that $u\in U$ and $v\in V$. The set $U\times U$ is the set of ordered pairs of elements of $U$, and properly contains the set $\{\langle u,u\rangle \vert u\in U\}$, which is actually $(U\times U)\cap D$. For example, if $U=\{u_1,u_2\}$, then $$U\times U=\big\{\langle u_1,u_1\rangle,\langle u_1,u_2\rangle,\langle u_2,u_1\rangle,\langle u_2,u_2\rangle\big\}.$$ – Unwisdom Mar 14 '14 at 16:20

Note that saying that $U\cap V=\emptyset$ is equivalent to saying that $(U\times V)\cap D=\emptyset$.
To prove that $T_2$ implies that the diagonal is closed, prove that for every $x\neq y$, the point $\langle x,y\rangle$ has a neighborhood that is disjoint from the diagonal.
For the reverse direction, suppose that $\langle X,\tau\rangle$ is not $T_2$. Then there exists $x\neq y$ such that every neighborhood of $x$ intersects some neighborhood of $y$. Prove that $\langle x,y\rangle$ is in the closure of the diagonal.
Let $X$ be $T_2.$ Choose $(a,b)$ from $X\times X$ with $a\ne b.$ Then for any two disjoint open neighborhoods $U_a$ of $a$ and $U_b$ of $b,$ $(U_a\times U_b)\cap D=\emptyset.$
A similar argument yields the reverse implication. Just note for distinct $a,b\in X~\exists$ a basic open neighborhood $N_{(a,b)}=U_a\times U_b$ of $(a,b)$ having an empty intersection with $D.$