Solution (source code)

= Solution

Under $H_0$, the <Hilbert-space central limit theorem> gives
$$
\sqrt n(\widehat\mu-\mu_0)\xrightarrow dG,
$$
where $G$ is a centered <Gaussian random element> with covariance $C_X$. Distinct leading eigenvalues imply consistency of the empirical eigenvalues and eigenfunctions, up to irrelevant signs. The first $K$ standardized <functional principal component scores> of $G$ are independent $N(0,1)$ variables, so <Slutsky theorem> yields
$$
T_{PC}\xrightarrow d\chi_K^2.
$$
An asymptotic level-$\alpha$ test rejects above the $(1-\alpha)$ quantile of the <chi-squared distribution>.

Under a fixed alternative, put $\delta=\mu-\mu_0$. The <weak law of large numbers> and eigenpair consistency give
$$
\frac{T_{PC}}n\xrightarrow p
\sum_{k=1}^K\frac{\langle\delta,\phi_k\rangle^2}{\lambda_k}.
$$
Thus the statistic diverges and the test is consistent whenever at least one retained projection is nonzero. A fixed alternative orthogonal to the first $K$ eigenfunctions is invisible to this fixed-$K$ statistic.