# How to prove that $\{(x,y) \in \mathbb{R}^2 \mid x \neq y\}$ is open?

Prove that the subset $S := \{(x,y) \in \mathbb{R}^2 \mid x \neq y\}$ is open, with respect to a topology induced by the usual Euclidean distance.

I'm not even sure how to begin. Can anybody help me prove this?

• The way to begin is to draw a picture. Let ${\bf x} \in \mathbb{R}^2$ be an arbitrary point. How should we choose $r$ so that $B({\bf x}, r)$ doesn't leave $S$; equivalently, doesn't meet the line $x = y$? – Michael Albanese Sep 24 '13 at 22:46
• Actually, I did get that far. (Perhaps I should have said so.) I just don't know how to proceed from there. – John Jacobson Sep 24 '13 at 22:52
• So if you proved that every point in $S$ has some open ball around it contained in $S$, then you're done. – Ian Coley Sep 24 '13 at 23:21

Hint: What is its complement $S^c$? Do you know how to show that this one is closed?

Here's the two ways I'd think of:

1 - Show that the complement is closed, using the sequence criterion (that a subset of a metric space is closed if and only if it contains all it's limit points).

Details: suppose $z_n = (x_n,y_n) \rightarrow z=(x,y)$, and $z_n \in S^c$ for all $n$. We see $x_n\rightarrow x$, $y_n \rightarrow y$, and as $x_n=y_n$ for all $n$, $x=y$, so $z \in S^c$.

2 - Show that it's the pre-image under a continuous map of an open set. Notice if $f:\mathbb{R}^2\rightarrow \mathbb{R}$ is defined by $f(x,y)=x-y$, $S=f^{-1}( (-\infty,0)\cup (0,\infty) )$.

$\newcommand{\R}{\mathbb R}$As Ian Coley noted in the comments (referring to a comment of yours indicating your progress), you just need to apply one of the rules regarding open sets: $U$ is open in a topological space if and only if for every $x\in U$, there is an open set $V\subseteq U$ such that $x\in V$.

I would also like to mention that all you need from your original topological space $X$ is that it satisfies the Hausdorff axiom. I will give a proof here. We will work in $\R^2$, but secretly the proof applies to any Hausdorff space.

Suppose $S$ were not open. Then there would be a point $(x,y)$ where every neighborhood $U$ of $(x,y)$ contained a point of the diagonal $\Delta=\{(a,b)\in \R^2\colon a=b\}$. Then in particular, for any neighborhood $V_1$ of $x$ and any neighborhood $V_2$ of $y$ in $\R$ we have $(V_1\times V_2)\cap\Delta\ne\emptyset$. Say $(z,z)$ is in this intersection. Then $z\in V_1$ and $z\in V_2$. However, you know you can always make $V_1$ smaller so that it does not contain $z$ while still containing $x$ (and keeping it open). This is a contradiction, which means that $S$ is open.

If you know about continuous functions, then $S$ is the inverse image of the open set $\mathbb R\setminus\{0\}$ under the continuous function $(x,y)\in\mathbb R^2\mapsto x-y\in\mathbb R$, and so is open.

Consider the function $f: \mathbb{R}^2\to \mathbb{R}$ given by $f(x,y)=|x-y|$. Now, $f(x,y)>0$ if and only if $x\neq y$ and $f$ is obviously continuous, and we have $$S = f^{-1}((0,\infty))$$ so $S$ must be open since $(0,\infty)$ is open and $f$ is continuous.

HINT: Choose any point in $\mathbb{R}^2$ and show there's a bigger point using the triangle inequality for all points in $\mathbb{R}^2$.