So there is this part in the argument for the Ihoda-Shelah theorem on measurability of $\Delta^1_2(a)$ sets in Kanamori's book which I don't understand. Below I will try to give the relevant parts of the proof which lead to the point that I don't understand.
14.6 Theorem (Ihoda-Shelah). Suppose that $a \in {^\omega\omega}$. Then every $\Delta^1_2(a)$ set of reals is Lebesgue measurable iff there is a real random over $L[a]$.
Proof. [We go straight to the converse.] Suppose that there is a real random over $L[a]$ and that $A \subseteq {^k(^\omega\omega)}$ is $\Delta^1_2(a)$. Taking $k = 1$ for simplicity, there are consequently $\Sigma^1_2(a)$ relations $R_0, R_1 \subseteq {^\omega\omega}$ such that for any $x \in {^\omega\omega}$, $$A(x) \leftrightarrow R_0(x) \leftrightarrow \neg R_1(x).$$ As usual, if $M$ is a transitive class containing all recursive relations, then $R^M_i$ denotes the relativization of (the normal form of) $R_i$ to $M$.
Let $P = (\mathcal{B}^∗)^{L[a]}$, the random real forcing in the sense of $L[a]$, and $\dot{r}$ a $P\text{-name}$ for the random real. [Here $\mathcal{B}^* = \{A : A \text{ is Borel and is not null}\}$]
Then $$D = \{p \in P : p \Vdash R^{L[a][\dot{r}]}_i(\dot{r}) \text{ for exactly one } i \lt 2\} \in L[a]$$ is dense in $P$. [Here he goes on to show the density of $D$.]
Since $D$ is dense open in $P$, there is in $L[a]$ a maximal antichain $E \subseteq D$ consisting of closed sets, which by the $\omega_1\text{-c.c.}$ is countable. For $i \lt 2$, set $$Y_i = \{c \in {^\omega\omega} : c \in L[a] \text{ is a closed code } \wedge A^{L[a]}_c \in E \wedge A^{L[a]}_c \Vdash R^{L[a][\dot{r}]}_i(\dot{r})\},$$ $$Z_i = \bigcup\{A_c : c \in Y_i \}.$$ [Now the crucial part of the proof is showing that $Z_i - R_i$ is null and the rest will follow easily.]
To verify that $Z_i − R_i$ is null for $i \lt 2$, let $M \in L[a]$ be a countable transitive $\in$-model of enough of ZFC with $Y_0, Y_1 \in M$. (It will suffice to take $M \prec L_\lambda[a]$ for some sufficiently large regular $\lambda$, and such $M$ model ZFC except possibly for the Power Set Axiom. In what follows, pretend that $M \models \text{ZFC}$ for the use of established terminology.) Since $M$ is countable, the set of reals not random over $M$ is null. If on the other hand $x \in {^\omega\omega}$ is random over $M$ and $x \in Z_i$, then $x \in A_c$ for some $c \in Y_i$ and so $x \in A^{M[x]}_c$. Hence, $R^{M[x]}_i(x)$ by genericity.
[After this point he finishes the proof with shoenfield absoluteness theorem.]
Now my confusion arises from the last assertion: "Hence, $R^{M[x]}_i(x)$ by genericity.". Now what I am thinking is that since $c \in Y_i$ and so $A^{L[a]}_c \Vdash R^{L[a][\dot{r}]}_i(\dot{r})$, I should somehow deduce $A^M_c \Vdash R^{M[\dot{r}]}_i(\dot{r})$ and put that together with $x \in A^{M[x]}_c$ and $M[x] = M[G]$ which yields $A^M_c \in G$ and use genericity. But I don't see how I could make the above deduction since the forcing relations although absolute, are between different objects and formulas. And the only assumption which seems to do the trick, is to assume the randomness of the above $x$ on $L[a]$ too, but I don't think that it might be true.
So to make the question clear, Why can we deduce $R^{M[x]}_i(x)$ by genericity?
I hope someone could help me out. Sorry for the long post.
EDIT I:
So after thinking for a bit I came to this: Let $p \Vdash^{\mathbb{P}^N}_N \varphi$ denote the forcing relation for $\mathbb{P}^N$ in the model $N$. Now by assumption we have that: $$A^{L[a]}_c \Vdash^{(\mathcal{B}^*)^{L[a]}}_{L[a]} R^{L[a][\dot{r}]}_i(\dot{r})$$
Now by abosluteness of "being a closed set" and "having positive measure" we have that $A^M_c \in (\mathcal{B}^*)^{L[a]}$ and that $A^M_c \subset A^{L[a]}_c$
so we have (in $L[a]$) that:
$$A^{M}_c \Vdash^{(\mathcal{B}^*)^{L[a]}}_{L[a]} R^{L[a][\dot{r}]}_i(\dot{r})$$
Now seeing as the information in $E$ and hence $Y_0$ and $Y_1$ is sufficient$(*)$ to determine the truth of $R^{L[a][\dot{r}]}_i(\dot{r})$ in the extension and since they are in $M$, and hence in $(\mathcal{B}^*)^M$, we have that:
$$A^{M}_c \Vdash^{(\mathcal{B}^*)^M}_{L[a]} R^{L[a][\dot{r}]}_i(\dot{r})$$
And now since all the parameters of the above formula are in $M$, we relativize it. And we get to$(**)$:
$$A^{M}_c \Vdash^{(\mathcal{B}^*)^M}_M (R^{L[a][\dot{r}]}_i(\dot{r}))^{M[\dot{r}]}$$
And relativizing again:
$$A^{M}_c \Vdash^{(\mathcal{B}^*)^M}_M R^{M[\dot{r}]}_i(\dot{r})$$
Now the above argument seems to work but there are two gaps in it which I am not able to account for:
$(*). $ Speaking from intuition it should be correct, but I don't know how I can formalize it.
$(**). $ When relativizing the whole forcing relation, should I even relativize the formula on the right side to the generic extension of $M$? If not, then does it even make sense? If yes, can you please give a small explanation on it?
I think I have narrowed down the question enough and I hope what I have written here isn't utter nonsense. If it's all wrong, I would really appreciate any other clue.
EDIT II:
Now thinking more about this, I see that the argument in EDIT I, is half (trivially) incorrect. So here I try to refine it(?):
Suppose $N \prec L_\lambda[a]$ for some sufficiently large regular $\lambda$ such that $Y_0 \cup Y_1 \cup \{Y_0, Y_1\} \subset N$. And let $\pi: N \rightarrow M$ be the collapsing isomorphism. Now by definability $A^{L[a]}_c$ and $(\mathcal{B}^*)^{L[a]}$ are in $N$ and since
$$L_\lambda[a] \models A^{L[a]}_c \Vdash^{(\mathcal{B}^*)^{L[a]}}_{L[a]} R^{L[a][\dot{r}]}_i(\dot{r}),$$
by elementarity we have:
$$N \models A^{L[a]}_c \Vdash^{(\mathcal{B}^*)^{L[a]}}_{L[a]} R^{L[a][\dot{r}]}_i(\dot{r})$$
And through $\pi$ we have that:
$$M \models \pi(A^{L[a]}_c) \pi(\Vdash^{(\mathcal{B}^*)^{L[a]}}_{L[a]}) \pi(R^{L[a][\dot{r}]}_i(\dot{r}))$$
which amounts to$(*)$:
$$M \models A^{M}_c \Vdash^{(\mathcal{B}^*)^{M}}_{M} R^{M[\dot{r}]}_i(\dot{r})$$
And again there is a gap here which I don't know what to do with:
$(*). $ So in this version all this comes down to is what does $\pi$ take the above terms to and why?
I think this version is cleaner but again I doubt it being correct. I hope somebody can help me out.