Let $X$ be a topological space and let $\Delta = \{(x,x) : x\in X \}$ be the diagonal of $X\times X$ (with the product topology).
I was asked to prove that $X$ is ${\rm T}_1$ if and only if $\Delta$ can be written as intersection of open subsets of $X\times X$.
I think is better (maybe easier) to use the well-known result "$X$ is ${\rm T}_1$ if and only if $\{x\}$ is a closed set $\forall x\in X$".
What I've done:
Assuming that $X$ is ${\rm T}_1$, let $Y=(X\times X) \setminus\Delta$ and note that (trivially) $$Y = \bigcup_{y\in Y} \{y\}.$$ Then $$\Delta = (X\times X) \setminus Y = (X\times X) \setminus \left(\bigcup_{y\in Y} \{y\} \right) = \bigcap_{y\in Y} (X\times X)\setminus \{y\},$$ where $(X\times X)\setminus\{y\}$ is open since each $\{y\}$ is closed.
The other direction seems be a bit harder, I've tried unsuccessfully. Any ideas?
Thanks in advance.
Suppose that
$$\Delta = \bigcap \{O_i: i\in I\}$$ for some index set $I$, and all $O_i$ open in $X \times X$.
Let $x\neq y$, to show $T_1$-ness, we need to find an open set $O$ of $X$ that contains $x$ but misses $y$. So consider $(x,y)$, which is not in $\Delta$, so there is an $i \in I$ such that $(x,y)\notin O_i$.
Now $(x,x) \in \Delta \subseteq O_i$, so by using the product base we can find an open set of the form $U\times V$ that contains $(x,x)$ and sits inside $O_i$.
But then $O=U \cap V$ contains $x$ but not $y$, as $y \in U \cap V$ would imply $(x,y) \in U \times V \subseteq O_i$, while we had $(x,y) \notin O_i$ by choice of $i$. So we have our open set as required.