Surjection from $On\times\mathbb{R}$ to $L(\mathbb{R})$. I'm trying to construct a surjeciton from $On\times\mathbb{R}$ to $L(\mathbb{R})$. (This apparently is the definable clousure of the transitive clousure of the reals, which I do not know if it differs from the definable clousure of the reals.) 
The text I'm says to proceed by transfinite induction, but this is in part of a proof that is only supposed to use dependent choice and not the full axiom of choice.
My best bet is to fix a real $x$ and get a well-ordering of $L(x)$ based on the usual way of getting a well-ordering of $L$, which seems plausible but I'm unsure.
And anyway I'm also unsure that $L(\mathbb{R})$ is in fact equal $\cup_{x\in\mathbb{R}}L(x)$, which I would need to make the proposed proof work.
I also need this surjection to satisfy that for any $\alpha\in On$ its restriction to $\alpha\times\mathbb{R}$ is an element of $L(\mathbb{R})$.
Thank you for any help.
 A: First, $L(\mathbb R)$ is not always equal to $\bigcup_{x\in\mathbb R}L(x)$.  For example, this union might not contain $\mathbb R$ as an element.
Now to get the surjection you want, notice first that, by definition of $L(\mathbb R)$, each of its elements is either in the transitive closure of $\mathbb R$ or in $L_{\alpha+1}(\mathbb R)$ for some $\alpha$ and therefore has the form 
$$
\{x\in L_\alpha(\mathbb R):(L_\alpha(\mathbb R),\in)\models\phi(x,p_1,\dots,p_k)\}
$$
for some formula $\phi$ and some parameters $p_i$ from earlier levels of the hierarchy. Such a description of $x$ can be coded by listing $\alpha$, the Gödel number of $\phi$, and similar descriptions of the $p_i$'s. All of this can be coded as finitely many ordinals and reals. (Note that, with a set-theorist's definition of $\mathbb R=\mathcal P(\omega)$, the elements of the transitive closure of $\mathbb R$ are reals and natural numbers.) Pairing functions let you code finitely many ordinals as a single ordinal, and finitely many reals as a single real. So every element of $L(\mathbb R)$ can be coded by an ordinal and a real; hence your surjection.
