What does the perfect set property really mean? In the book "Classical Descriptive Set Theory" by Kechris, we have the following definitions:

A topological space $X$ is called perfect if it has no isolated points.
A subset $P \subseteq X$ is called perfect in $X$ if it is closed in $X$ and is a perfect space with respect to its subspace topology.

Now I looked up in the internet that the perfect set property means the following:

A subset $A \subseteq X$ satisfies the perfect set property if it is either countable or contains a non-empty perfect subset.

Now, what is really meant hear? Does it mean $A$ has a subset $P$ that is closed in $A$ and perfect, or does $P$ even have to be closed in $X$?
Moreover, Kechris calls it the "perfect set theorem for analytic sets" that every uncountable analytic set in a polish space contains a homeomorphic image of the Cantor space. In which of the above sences is a homeomorphic image of the Cantor space a perfect subset?
Thank you for your help!
 A: (1) It requires that $P$ is closed in the original space $X$.
(Actually, say the subspace-psp is the "perfect set property" in the other sense you asked about. Then if $X$ has a countable base, every $A\subseteq X$ has the subspace-psp. For via the usual Cantor-Bendixson analysis, iteratively remove isolated points from $A$, leading to eventual set $A_\infty$. That is, set $A_0=A$, and given $A_\alpha$, set $A_{\alpha+1}=A_\alpha\backslash I_\alpha$ where $I_\alpha\subseteq A_\alpha$ is the set of elements of $A_\alpha$ which are isolated in $A_\alpha$, and $A_\beta=\bigcap_{\alpha<\beta}A_\alpha$ for limit $\beta$. Note for all countable ordinals $\alpha<\beta$, $A_{\alpha}\backslash A_\beta$ is countable (using that there is a countable base for the topology), and there is some countable $\alpha$ such that $A_\alpha=A_{\alpha+1}$. Set $A_\infty=$ this $A_\alpha$.
Now if $A_\infty=\emptyset$ then $A$ is countable. If $A_\infty\neq\emptyset$ then every point in $A_\infty$ is non-isolated in $A_\infty$, and $A_\infty$ is closed in $A$. For if $x\in A$ is in the closure of $A_\infty$ but $x\notin A_\infty$, then since $x\in A=A_0$,
there is some stage $\alpha$ such that $x\in A_\alpha\backslash A_{\alpha+1}$. So $x$ was isolated in $A_\alpha$. But $A_\infty\subseteq A_\alpha$, so $x$ is in the closure of $A_\alpha\backslash\{x\}$, a contradiction. Therefore $A_\infty$ is perfect in the subspace topology induced by $A$, so $A$ has the subspace-psp.)
(2) The homeomorphic image of Cantor space is a perfect subset in both senses (but one just implies the other: note that if $P\subseteq A\subseteq X$ and $P$ is a perfect subset of $X$ w.r.t. the $X$-topology, then $P$ is also a perfect subset of $A$ w.r.t. the subspace topology).
