TITLE: Complexity of the set of surjective continuous functions
QUESTION [8 upvotes]: Let $X,Y$ be complete separable metric spaces, with $X$ locally compact, and $C(X,Y)$ the space of continuous functions from $X$ to $Y$, equipped with the topology of uniform convergence on compact sets.  If I am not  mistaken, $C(X,Y)$ is Polish.
Let $S \subset C(X,Y)$ be the set of functions in $C(X,Y)$ which are surjective.

Is $S$ Borel?  If not, what can we say about its complexity?

If $X$ is compact, it is easy to show that $S$ is closed.  But the locally compact case seems harder.
In particular, I have in mind something like $X = \mathbb{R} \times [0,1]^2$ and $Y = \mathbb{R}^d$.
Thanks!

REPLY [3 votes]: Thanks to a suggestion from Clinton Conley, we can show that this set is $\Pi_1^1$, i.e. co-analytic.
$X$ is $\sigma$-compact, so we can write $X = \bigcup K_n$ for compact $K_n$.  Then it is easy to check that
$$B_n := \{(f,y) \in C(X,Y) \times Y : y \notin f(K_n)\}$$
is open in $C(X,Y) \times Y$.  Thus $$B := \bigcap_n B_n = \{(f,y) \in C(X,Y) \times Y: y \notin f(X)\}$$
is $G_\delta$ and in particular Polish.  The projection of $B$ onto $C(X,Y)$ is thus analytic, but this projection is exactly the complement of $S$.
This leaves open the question of whether $S$ is necessarily Borel.  However, it does guarantee that $S$ is universally measurable.  Moreover, and this is what I really wanted, for any Polish $Z$ and any continuous $g : Z \to C(X,Y)$, $g^{-1}(S)$ is again $\Pi_1^1$ and hence universally measurable.