Projection onto locally constant function I am asking a question which looks very elementary to experts.
Let $F$ be a number field and $\mathbb{A}_F$ its adele ring. Let $\omega$ be a unitary central character of $GL_2(\mathbb{A}_F)$, 
$X_{GL_2}=GL_2(F) \backslash GL_2(\mathbb{A}_F)$, and
$C^{\infty}_{\omega}(X_{GL_2})=\{f:X_{GL_2} \to \mathbb{C} \ | \ f(zg)=\omega(z)f(g) \text{ for $z\in$ center of $GL_2$ } \text{ and } \ g\mapsto f(xg) \text { is } C^{\infty}(F_{\infty}) \text{ for each } x\in X_{GL_2}\}$.
Define a projection map $P:C^{\infty}_{\omega}(X_{GL_2})\to C^{\infty}_{\omega}(X_{GL_2})$ by 
$$Pf(x):=\int_{h \in SL_2(F)\backslash SL_2(\mathbb{A}_F)}f(hx)\,dh.$$
Then how can we prove 
$$Pf(x)=\sum_{\chi^2=\omega} \chi(x) \cdot \left(\int_{PGL_2(F)\backslash PGL_2(\mathbb{A}_F)} f(y)\overline{\chi(y)}\,dy\right)?$$
Here, $\chi$ is a unitary character of $\mathbb{A}_F^{\times}/F^{\times}$, and $\chi^2=\omega$ if we think of $\chi$ as a character of $X_{GL_2}$ via $\chi(g)=\chi(\det g)$ for $g\in GL_2(\mathbb{A}_F)$.
Any comments will be highly appreciated!
 A: It is clear from the definition and right-invariance of the measure $dh$ that $Pf$ is left-invariant under $SL_2(\mathbb{A}_F)$. As Paul Garrett kindly explained, $Pf$ is also left-invariant under $GL_2(F)$, because $f$ is left-invariant under $GL_2(F)$ and $GL_2(F)$ normalizes the coset space $SL_2(F)\backslash SL_2(\mathbb{A}_F)$. As a result, for any $g\in GL_2(\mathbb{A}_F)$, we have
$$ Pf(g)=Pf\left(g\begin{pmatrix}\det g^{-1}&\\&1\end{pmatrix}\begin{pmatrix}\det g&\\&1\end{pmatrix}\right)=Pf\left(\begin{pmatrix}\det g&\\&1\end{pmatrix}\right).$$
This motivates the definition
$$\widetilde{Pf}(a):=Pf\left(\begin{pmatrix}a&\\&1\end{pmatrix}\right),\qquad a\in\mathbb{A}_F^\times.$$
The function $\widetilde{Pf}$ is clearly invariant under $F^\times$. Moreover, it satisfies the identity
$$\tag{$\ast$}\widetilde{Pf}(ab^2)=\omega(b)\widetilde{Pf}(a),\qquad a,b\in\mathbb{A}_F^\times,$$
since
$$Pf\left(\begin{pmatrix}ab^2&\\&1\end{pmatrix}\right)=Pf\left(\begin{pmatrix}b&\\&b\end{pmatrix}\begin{pmatrix}a&\\&1\end{pmatrix}\right)=\omega(b)\,Pf\left(\begin{pmatrix}a&\\&1\end{pmatrix}\right).$$
Now let us fix a decomposition $\mathbb{A}_F^\times=\mathbb{R}_{>0}\times \mathbb{A}_F^1$ and focus on the compact quotient $\mathbb{A}_F^1/F^\times$. We have a spectral decomposition
$$ \widetilde{Pf}(a)=\sum_\chi c_\chi \chi(a),\qquad a\in\mathbb{A}_F^1,$$
where $\chi$ runs through the (discrete set of) characters of $\mathbb{A}_F^1/F^\times$. Then ($\ast$) yields, by the uniqueness of the spectral coefficients, that $c_\chi\chi^2(b)=c_\chi\omega(b)$ holds for any $b\in\mathbb{A}_F^1$. That is, $c_\chi=0$ unless $\chi^2=\omega$ on $\mathbb{A}_F^1$. Any such $\chi$ extends uniquely to a character of $\mathbb{A}_F^\times/F^\times$ maintaining the property $\chi^2=\omega$, and one can verify, using ($\ast$) and existence of square-roots in $\mathbb{R}_{>0}$, that these extended idele class characters satisfy
$$ \widetilde{Pf}(a)=\sum_{\chi^2=\omega} c_\chi \chi(a),\qquad a\in\mathbb{A}_F^\times.$$
The coefficients $c_\chi$ can be evaluated by the orthogonality of characters,
\begin{align*} c_\chi&=\int_{\mathbb{A}_F^1/F^\times}\widetilde{Pf}(a)\,\overline{\chi(a)}\,da\\
&=\int_{\mathbb{A}_F^1/F^\times}\int_{h \in SL_2(F)\backslash SL_2(\mathbb{A}_F)}f\left(h\begin{pmatrix}a&\\&1\end{pmatrix}\right)\overline{\chi(a)}\,dh\,da\\
&=\int_{GL_2(F)\backslash GL_2^{(1)}(\mathbb{A}_F)}f(g)\,\overline{\chi(\det g)}\,dg,
\end{align*}
where $GL_2^{(1)}(\mathbb{A}_F)$ denotes the subgroup of adelic matrices whose determinant lies in $\mathbb{A}_F^1$. The result is immediate from here, since $f(g)\,\overline{\chi(\det g)}$ as a function on $GL_2(\mathbb{A}_F)$ is invariant under the center (recalling that $\chi^2=\omega$).
