The collection of all compact perfect subsets is $G_\delta$ in the hyperspace of all compact subsets Let $X$ be metrizable (not necessarily Polish), and consider the hyperspace of all compact subsets of $X$, $K(X)$, endowed with the Vietoris topology (subbasic opens: $\{K\in K(X):K\subset U\}$ and $\{K\in K(X):K\cap U\neq\emptyset\}$ for $U\subset X$ open), or equivalently, the Hausdorff metric. We want to show that $K_p(X)=\{K\in K(X):K \text{ is perfect}\}$ is $G_\delta$ in $K(X)$. (This is another question from Kechris, Classical Descriptive Set Theory, Exercise 4.31.)
A possible approach: $K_p(X) = \bigcap_{n=1}^\infty \{K\in K(X): \forall x\in K, (B(x,1/n)\setminus\{x\})\cap K\neq\emptyset\}$. What can we say about the complexity of $\{K\in K(X): \forall x\in K, (B(x,1/n)\setminus\{x\})\cap K\neq\emptyset\}$? Note that for fixed $x$, the set $\{K\in K(X): (B(x,1/n)\setminus\{x\})\cap K\neq\emptyset\}$ is open in $K(X)$. Also, the set $\{(x,K)\in X\times K(X):x\in K\}$ is closed in $X\times K(X)$, but I don't think this helps since the projection of a $G_\delta$ set need not be $G_\delta$.
Any ideas?
 A: For any $n\in\Bbb Z^+$ and open $U_1,\dots,U_n$ in $X$ define
$$B(U_1,\dots,U_n)=\left\{K\in\mathscr{K}(X):K\subseteq\bigcup_{k=1}^nU_k\text{ and }K\cap U_k\ne\varnothing\text{ for }k=1,\dots n\right\}\;;$$
the collection $\mathscr{B}$ of these sets is a base for the topology of $\mathscr{K}(X)$.
For $n\in\omega$ let $\mathfrak{U}_n$ be the collection of all finite families of open sets of diameter less than $2^{-n}$. For each $\mathscr{U}\in\mathfrak{U}$ and $p,q:\mathscr{U}\to\bigcup\mathscr{U}$ such that for each $U\in\mathscr{U}$, $p(U)$ and $q(U)$ are distinct points of $U$, fix disjoint open sets $V_{\mathscr{U},p,q}(U)$ and $W_{\mathscr{U},p,q}(U)$ for $U\in\mathscr{U}$ such that $p\in V_{\mathscr{U},p,q}(U)\subseteq U$ and $q\in W_{\mathscr{U},p,q}(U)\subseteq U$. Then let 
$$G(\mathscr{U},p,q)=B(\mathscr{U})\cap\bigcap_{U\in\mathscr{U}}B\big(V_{\mathscr{U},p,q}(U),W_{\mathscr{U},p,q}(U),X\big)\;,$$
let $\mathscr{G}_n$ be the set of all such $G(\mathscr{U},p,q)$ for $\mathscr{U}\in\mathfrak{U}_n$, and let $G_n=\bigcup\mathscr{G}_n$; clearly each $G_n$ is open in $\mathscr{K}(X)$.
Let $K\subseteq X$ be a non-empty compact set without isolated points. Fix $n\in\omega$. Let $\mathscr{U}$ be a finite open cover of $K$ by sets of diameter less than $2^{-n}$. Pick distinct points $p(U),q(U)\in K\cap U$ for each $U\in\mathscr{U}$. Then $G(\mathscr{U},p,q)\in\mathscr{G}_n$ is an open nbhd of $K$ in $\mathscr{K}(X)$, so $K\in G_n$.
Now suppose that $K\subseteq X$ is compact but has an isolated point $x$. Fix $m\in\omega$ such that $$B(x,2^{-m})\cap K=\{x\}\;,$$ where $B(x,\epsilon)$ is the open ball of radius $\epsilon$ centred at $x$. 
Suppose that $n\ge m$ and $K\in G(\mathscr{U},p,q)\in\mathscr{G}_n$. Some $U\in\mathscr{U}$ contains $x$, and $$K\in B\big(V_{\mathscr{U},p,q}(U),W_{\mathscr{U},p,q}(U),X\big)\;,$$ so there are distinct points $y\in K\cap V_{\mathscr{U},p,q}(U)$ and $z\in K\cap W_{\mathscr{U},p,q}(U)$. But $$y,z\in U\subseteq B(x,2^{-n})\subseteq B(x,2^{-m})\;,$$ so $y,z\in B(x,2^{-m})\cap K=\{x\}$, which is impossible. Thus, $K\notin G_n$ for $n\ge m$.
Finally, let $G=\bigcap_{n\in\omega}G_n$. Clearly $G$ is a $G_\delta$-set in $\mathscr{K}(X)$, and we’ve just shown that $G=\{K\in\mathscr{K}:K\text{ is perfect}\}$.
