These notes (pg 2) say that
A set $C \subseteq \omega^\omega$ is closed if and only if there is an $z \in \omega^\omega$ and a recursive predicate $R \subseteq \omega^{<\omega}\times\omega^{<\omega}$, such that for all $x$,
$$x \in A \iff \forall n R(x_{|n}, z_{|n})$$
I am garbage at recursion theory; can someone elucidate on how we obtain this result?
Bonus:
We know that an analytic set $A \subset \omega^\omega$ is a projection of a closed set $C \subset \omega^\omega\times\omega^\omega$.
An alternate formulation would be that a set $A \subseteq \omega^\omega$ is analytic if there is $z \in \omega^\omega$ and a recursive $R \subseteq \omega^{<\omega} \times \omega^{<\omega} \times \omega^{<\omega}$, such that $$x \in A \iff \exists y \in \omega^\omega \forall n\in \omega R(x_{|n}, y_{|n}, z_{|n})$$
Proving the result above would easily give us the equivalence between these two formulations.
The idea is that we can replace "arbitrary relation" with "recursive relation equipped with appropriate oracle." Specifically:
It may be easier to prove this first without the recursivity condition - the $R$ you produce in the proof of the weaker result will actually have a good chance of already being recursive!
HINT: think about a way to "code" subsets of $\omega^{<\omega}$ by reals.
With this in hand we can in fact prove a stronger result: