Solution (source code)

= Solution

If the $B_k$ form the <eigenbasis> of $C_X$, then
$$
\langle C_XB_j,B_\ell\rangle
=\lambda_j\mathbf1_{\{j=\ell\}}.
$$
The retained <functional principal component scores> are therefore uncorrelated with every omitted score, so $g=0$. The least-squares estimates of $c_1,\ldots,c_K$ are consistent despite truncation. Fixed $K$ still estimates only the projection $\beta_K$; consistency for the complete function requires the truncation level to increase and the tail error to vanish.