It is well known that:
Theorem. For a locale (resp. topological space) $X$, the following are equivalent:
$X$ is compact, i.e. every open cover of $X$ has a finite subcover.
For every locale (resp. topological space) $Y$, the projection $X \times Y \to Y$ is closed.
Question. Is there a "natural" locale (resp. topological space) $Y$ constructed from $X$ such that the projection $X \times Y \to Y$ is closed if and only if $X$ is compact? In other words, instead of checking universal closedness, does it suffice to check closedness of a particular morphism?
For topological spaces, there is a canonical choice (if you believe in the ultrafilter theorem, at least): take $Y$ to be the space of ultrafilters on $X$ and consider the convergence relation; closedness immediately implies that every ultrafilter on $X$ converges, which implies $X$ is compact. What about locales? Is there an intuitionistic proof?
It seems to me possible to improve the proof mentioned above, for topological spaces at least. Instead of the space of ultrafilters on $X$, take $Y$ to be the space of ideals of $\Omega (X)$, where $\Omega (X)$ is the frame of open subspaces of $X$ and "ideal" means downward-closed upward-directed subset. The basic open subsets of $Y$ are of the form ${\uparrow} \{ {\downarrow} \{ u \} \}$ (i.e. $\{ U \in Y : u \in U \}$) for $u \in \Omega (X)$. Consider the following open subspace $e$ of the product $X \times Y$: $$e = \bigvee \{ u \otimes {\uparrow} \{ {\downarrow} \{ u \} \} : u \in \Omega (X) \}$$
In the case $X$ is a topological space, $e$ corresponds to the following open subset: $$E = \{ (x, U) \in X \times Y : \exists u \in U . x \in u \}$$ Put it even more simply, $(x, U) \in E$ if and only if $x \in \bigcup U$. Define: $$\forall_\pi (E) = \{ U \in Y : \forall x \in X . (x, U) \in E \}$$ If $\forall_\pi (E)$ contains a basic open subset ${\uparrow} \{ {\downarrow} \{ u \} \}$, then $u$ must be $\top_X$, so the interior of $\forall_\pi (E)$ is just $\{ {\downarrow} \{ \top_X \} \}$. But if the projection $\pi : X \times Y \to Y$ is closed, then $\forall_\pi (E)$ is open, therefore any ideal of $\Omega (X)$ that is also an open cover of $X$ must be the trivial ideal – in other words, $X$ is compact. (Notice this argument makes no appeal to the ultrafilter characterisation of compactness – it even avoids the double-negations that frequently appear when working with closed subsets by working only with open subsets.)
Adapting the above argument for the case where $X$ is a locale is trickier: in the localic context, $\forall_\pi (e)$ is open by definition but does not immediately tell us anything about ideals of $\Omega (X)$ that are open covers. We have to instead consider the following pullback square, $$\require{AMScd} \begin{CD} X \times 1 @>{\operatorname{id} \times y}>> X \times Y \\ @V{X}VV @VV{\pi}V \\ 1 @>>{y}> Y \end{CD}$$ where $y : 1 \to Y$ is the morphism corresponding to the point $U \in Y$. Then, by definition, $${\uparrow} \{ {\downarrow} \{ u \} \} \cdot y \text{ is inhabited if and only if } u \in U$$ and therefore: $$e \cdot (\operatorname{id} \times y) = \bigvee \{ u \otimes ({\uparrow} \{ {\downarrow} \{ u \} \} \cdot y) : u \in \Omega (X) \} = \left( \bigvee U \right) \otimes \top$$ To show $X$ is compact, it suffices to verify: $$\forall_X (e \cdot (\operatorname{id} \times y)) = \forall_\pi (e) \cdot y$$ Unfortunately, this equality – which comes for free in the point set context because $\forall$ is defined differently – is itself a non-trivial consequence of properness! So this argument appears to beg the question...