While working on an exercise in Jech's Set Theory, I tried to prove that if $V=L$, then $\forall X \in L_{\kappa}: P(X) \subset L_{\kappa}$, where $k$ is any cardinal. I was hoping someone could verify that this is true, or else help me find the error in my argument.
PROOF: Let $Y \subset X \in L_{\kappa}$. Then, $X \in L_{\alpha}$ for some $\alpha < \kappa$. Since $V=L$, $Y \in L_{\gamma}$ for some limit ordinal $\gamma \geq \alpha$. We can find an elementary substructure $M \prec L_{\gamma}$ s.t. $Y \in M$, $L_{\alpha} \subset M$ and $|M|<k$. Let $\pi$ be the transitive collapsing function on $M$; then $\pi[M]=L_{\beta}$ by the condensation lemma. Therefore, $|\beta|=|L_{\beta}|=|M|<\kappa$, so $\beta < \kappa$ and $L_{\beta} \subset L_{\kappa}$. Since $L_{\alpha}$ is a transitive subset of $M$, it can be shown (by $\in$-induction on the elements of $L_{\alpha}$) that $\pi$ is the identity on $L_{\alpha}$. Since, $Y \subset L_{\alpha}$, $Y=\pi(Y) \in L_{\beta}$. Thus, $Y \in L_{\kappa}$. By generality of $Y$, $P(X) \subset L_{\kappa}$.