Every analytic subset of $\Bbb{R}$ is the projection of a $G_\delta$ set $G \subset \Bbb{R} \times \Bbb{R}$ In the answer to this question, respectively in this post it is claimed that every analytic subset of $\Bbb{R}$ is the projection of a $G_\delta$ set.
My definition of an analytic set comes from Dudley, Real Analysis and Probability, Theorem 13.2.1. This theorem shows that for a Polish space $Y$ (e.g. $Y = \Bbb{R}$), the following conditions are equivalent (for $\emptyset \neq A \subset Y$):

*

*$A = f(\Bbb{N}^\infty)$ for some continuous $f$.

*$A = f(\Bbb{N}^\infty)$ for some Borel measurable $f$.

*$A = f(X)$ for some Polish space $X$ and continuous $f$.

*$A = f(X)$ for some Polish space $X$ and Borel measurable $f$.

*$A = f(B)$ for some Borel set $B$ in a Polish space $X$ and $f : B \to Y$ continuous.

*$A = f(B)$ for some Borel set $B$ in a Polish space $X$ and $f : B \to Y$ Borel measurable.

A set $A$ for which this is true is called an analytic subset $A$ of $Y$.
I can show that each analytic subset $\emptyset \neq A \subset \Bbb{R}$ is the projection of some Borel set $B \subset \Bbb{R}^2$, because we also know from Dudley, Theorem 13.1.1 that $\Bbb{N}^\infty$ is Borel-isomorphic to $\Bbb{R}$. Let $\Phi : \Bbb{R} \to \Bbb{N}^\infty$ denote the Borel-isomorphism.
So if $A = f(\Bbb{N}^\infty)$ for some Borel-measurable $f : \Bbb{N}^\infty \to \Bbb{R}$, then
$$
A = (f\circ \Phi)(\Bbb{R}) = \pi_2 (\mathrm{graph}(f \circ \Phi)).
$$
But Lemma 13.2.2 in Dudley shows that the graph of a Borel-measurable function is a Borel-measurable subset of the product space.
However, this only shows that $A$ is the projection of a Borel-set $B\subset \Bbb{R}^2$, it does not show that we can take $B$ to be a $G_\delta$ set.
So my question is: Is it indeed true that each analytic subset of $\Bbb{R}$ (or more generally of any polish space $X$) is the projection of a $G_\delta$ subset $G \subset \Bbb{R} \times \Bbb{R}$ (or of $X \times X$)? If so, can you provide a (more or less) elementary proof or a hint to a location, where I might find such a proof?
 A: Analytic sets in $\mathbb R$ are indeed projections of $G_\delta$ subsets of $\mathbb R\times \mathbb R$.  The proof takes a bit of work, and the key ingredient is this: For any Polish space $X$, the analytic subsets of $X$ are the images of closed subsets of the Baire space $\mathbb N^\infty$ under continuous maps.  This is in Moschovakis's book "Descriptive Set Theory" as Exercise 1G.5 for the case of Borel sets (in which case the continuous map can be taken to be injective), but it immediately follows for analytic sets (now with not-necessarily-injective maps). (Don't be frightened by the fact that it's an exercise; there's a long hint.) Once you have this key fact, it easily follows that analytic subsets of $\mathbb R$ are projections of closed subsets of $\mathbb R\times\mathbb N^\infty$.  The final step is to replace $\mathbb N^\infty$ with $\mathbb R$.  Here you use that $\mathbb N^\infty$ is homeomorphic to the subspace of irrational numbers in $\mathbb R$.  That subspace is a $G_\delta$, and that's why the final result has a $G_\delta$ set (rather than a closed set) in $\mathbb R\times\mathbb R$.
