Is it valid to interchange scalar product and integration for the derivation of kernel mean embedding via reproducing property?

43 Views Asked by At

I started to read up on the embedding of RKHS, e.g. see this nice review. For simplicity suppose we have a probability measure $P$ and a RKHS $\mathcal{H}$. One defines the kernel mean embedding as

$$\mu_P = \int k(x,\cdot) dP(x)$$ for the kernel $k$ of $\mathcal{H}$. I know the reproducing property, that is

$$f(x) = \langle f, k(x,\cdot)\rangle$$ where the inner product is taken in $\mathcal{H}$. They claim in the introduction that due to the reproducing property one has for all $f\in\mathcal{H}$

$$ E[f] = \langle f,\mu_P\rangle$$

I tried to verify this by myself:

$$E[f] = \int f(x)dP(x) = \int \langle f, k(x,\cdot)\rangle dP(x) = \langle f, \int k(x,\cdot)dP(x)\rangle = \langle f, \mu_p\rangle$$

However, the question is: Why is valid to interchange the scalar product and integration? If this is not valid how to show the quality?