Is the leftmost branch function $\text{UB}\rightarrow \omega^\omega$ Borel? Let's denote by $\text{UB}$ the set of ill-founded trees over $\omega$ having a unique branch.
Consider now the function $b: \text{UB} \rightarrow \omega^\omega$, that associates to each tree $T$ in $\text{UB}$ its unique branch $b_T$. Is this function Borel?
This function is the restriction of the left-most branch function defined over ill-founded trees (possibly with multiple branches), which is $\sigma(\boldsymbol{\Sigma}_1^1)$-measurable, to $\text{UB}$. Can we in some way prove that this restriction is indeed Borel? Otherwise, do we a sort of counterexample?
Thanks
 A: This is not a complete answer, but it's too long for a comment. So, yeah, sorry.
I think the more subtle issue here is the complexity of $\text{UB}$.
First of, the set of trees is itself Borel, so that's not a problem. Indeed, one can describe it as
$$
\{T\subset \omega^{<\omega}: \forall s\in T\forall n (s\upharpoonright n\in T)\}
$$
Ignore this nonsense:

Now, $\text{UB}$ is easily seen to be analytic:


$$
T\in\text{UB}\iff \exists x\left[ \forall n (x\upharpoonright n\in T)\wedge \forall n\forall m (m\neq x(n)\to (x\upharpoonright n)^\frown m\not\in T\right]
$$


(I left out a bunch of $\in \omega$ after the quantifiers to make the formula more readable. Also, $\exists x$ really should be $\exists x\in\omega^\omega$, but that made the formatting awkward).

However, it is not obvious to me that it is coanalytic. "There is at most one branch" is clearly a coanalytic condition, but I don't think the same is true of the condition "There exists a branch". Indeed, if it where, then the set $\text{WF}$ of reals which code a well-founded relation would be analytic, which is known to be false (see Jech, Set Theory, third edition, Corollary 25.13, page 487).
One can always describe $b$ by
$$
b(T)=x\iff \forall n (x\upharpoonright n\in T)
$$
which is obviously a Borel description.
Now, $\text{UB}$ is a subset of the Polish space of all trees on $\omega^{<\omega}$, so it has its own topology, but the Borel $\sigma$-algebra in that topology could differ from the restriction of ambient Borel $\sigma$-algebra.
TL;DR: What do you mean by Borel?
