# Calculate $\mathbf{E} \left( \sum_{k=1}^{\infty}\xi_k \langle e_k,h\rangle \right) \left( \sum_{j=1}^{\infty}\xi_j \langle e_j,g\rangle \right)$

Assume that $H$ is a separable Hilbert space and $\{e_k\}$ is an orthonormal and complete basis of $H$.

$\{\xi_k\}$ is a sequence of normal Gaussian random variables that are independent.

We know that $\sum_{k=1}^{\infty}\xi_k \langle e_k,h\rangle,\ h\in H$ is square-integrable, so $\mathbf{E}\left[ \left( \sum_{k=1}^{\infty}\xi_k \langle e_k,h\rangle \right) \left( \sum_{j=1}^{\infty}\xi_j \langle e_j,g\rangle \right) \right]$ is meaningful.

I want to prove $$\mathbf{E}\left[ \left( \sum_{k=1}^{\infty}\xi_k \langle e_k,h\rangle \right) \left( \sum_{j=1}^{\infty}\xi_j \langle e_j,g\rangle \right) \right]=\langle h,g \rangle$$

Is the following right?

$\ \ \ \ \ \mathbf{E}\left[ \left( \sum_{k=1}^{\infty}\xi_k \langle e_k,h\rangle \right) \left( \sum_{j=1}^{\infty}\xi_j \langle e_j,g\rangle \right) \right]\\= \mathbf{E}\left[ \sum_{k=1}^{\infty}\sum_{j=1}^{\infty} \xi_k \langle e_k,h\rangle \xi_j \langle e_j,g\rangle \right]\\= \sum_{k=1}^{\infty}\sum_{j=1}^{\infty}\mathbf{E}\left[ \xi_k \langle e_k,h\rangle \xi_j \langle e_j,g\rangle \right]\\= \sum_{k=1}^{\infty}\mathbf{E}\left[ \xi_k \langle e_k,h\rangle \xi_k \langle e_k,g\rangle \right]=\langle h,g\rangle$

But I am not sure why the first and the second "=" are valid?

Which theorems can guarantee the first and the second "="?

I think it's easier than you are making it. Let $X_n(h) = \sum_{k=1}^n \xi_k \langle e_k, h \rangle$. You seem to know that $X_n(h) \to X_\infty(h)$ in $L^2$ for each $h$. Since the variance of $X_n(h)$ is clearly $\sum_{k=1}^n |\langle e_k, h \rangle|^2$, by $L^2$ convergence the variance of $X_\infty(h)$ is $\sum_{k=1}^\infty |\langle e_k, h \rangle|^2 = \|h\|^2$. So the map $h \mapsto X_\infty(h)$ is a linear isometry from $H$ to $L^2(P)$; it preserves the norm, and hence the inner product (use polarization).