The collection of all compact perfect subsets is $G_\delta$ in the hyperspace of all compact subsets

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}\}$.