How to prove that this set is closed?

The set $$U = \{(y_1, y_2) \in Y \times Y \mid\, y_1 \leq y_2 \,\}$$ is closed in $Y \times Y\,$:

Suppose $(z_1, z_2) \in Y \times Y\,$ is not in it, so that $z_1 > z_2$.

If there is some $z_3 \in Y$ such that $z_1 > z_3 > z_2$, the basic open set $(z_3, \rightarrow) \times (\leftarrow, z_3)$ contains $(z_1, z_2)$ and misses $U$, otherwise $z_1$ and $z_2$ are neighbours and $(z_2, \rightarrow) \times (\leftarrow, z_1)$ has this property. Note that all used subsets in $Y$ are open in the order topology.

Now $f \nabla g: X \rightarrow Y \times Y$ is continuous (standard in the product topology) when $f$ and $g$ are, and your set is exactly

$$(f \times g)^{-1}[U]$$

and thus closed as the inverse image of a closed set under a continuous function.


The complement of $\{x : f(x) \leq g(x)\}$ is $\{x : f(x) > g(x)\}$. Part of the latter set is $$\bigcup_{y\in Y} \{x : f(x) > y > g(x)\},$$ which is open because each set is the intersection of two open sets. What is missing?