Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Thanks for answering~ I didn't expect different $r$ would make a difference. Your construction gives a $Q$ for $r=2$ as following. Put $(X,Y)$ in $Q$ where $Y=(\emptyset,\emptyset), (\emptyset,\omega), (\omega,\emptyset)\in (2^\omega)^2$ depending on $f(X)=0,1,2$ respectively. Where $(\emptyset,\emptyset)$ denotes such $(Y_0,Y_1)\in (2^\omega)^2$ that $Y_0^{-1}(1)=Y_1^{-1}(1)=\emptyset$ (similarly for $(\emptyset,\omega), (\omega,\emptyset)$). So $Q$ could be $\Pi_1^1$ for $r=3$ by Jonathan's comment.