**Definitions:** Let $\omega^{<\omega}$ be the set of all finite sequences of natural numbers. For $u, v \in \omega^{<\omega}$, let $u \prec v$ denote that $u$ is a prefix of $v$. We call a subset $T \subseteq \omega^{<\omega}$ a *tree*, if $v \in T$ and $u \prec v$ imply $u \in T$. We say that $T$ contains an infinite path $p \in \omega^\omega$, if each finite prefix of $p$ is in $T$.


Let $\mathcal{T}$ denote the set of trees. We define a metrix $d$ on $\mathcal{T}$ by $d(T, S) = 2^{- n}$ if $n$ is the smallest number s.t. there is some $v \in \omega^n$ with $v \in (T \setminus S) \cap (S \setminus T)$ for $T \neq S$.


**Question:** Is there a continuous function $R : \mathcal{T} \to \mathcal{T}$ such that:


* $R(T)$ contains an infinite path for each $T \in \mathcal{T}$;
* whenever $T$ has infinite paths, then each infinite path through $R(T)$ is an infinite path through T ?


**Remark**: If in the second case, coincide of the set of infinite paths would be required, then there could not even be a Borel map.



Illfounded trees as "retract" of all trees
Suppose, toward a contradiction, that $R$ is a function of the sort you asked about. Then, for any tree $T$, we have the equivalence "$T$ has an infinite path $\iff$ every infinite path through $R(T)$ is a path through $T$." The implication from left to right is the second of your requirements for $R$. The converse is a consequence of your first requirement: $R(T)$ always has a path, so, if all paths through $R(T)$ are also paths through $T$, then there is a path through $T$. But "every infinite path through $R(T)$ is a path through $T$" is a $\Pi^1\_1$ (boldface, with a code for $R$ as a parameter) statement, whereas "$T$ has an infinite path" is complete $\Sigma^1\_1$, so they can't be equivalent.


