I'm reading through a text about integral operators and I've come across the following theorem:
Let $k:\mathbb{R}^2\rightarrow\mathbb{C}$ be a kernel, $T:L^2(\mathbb{R})\rightarrow L^2(\mathbb{R})$ be a bounded operator given by $$Tf(y) = \int_{-\infty}^{\infty} k(x,y)f(x)\,dx.$$ Then the adjoint, $T^*$, of $T$ is given by $$T^*f(y) = \int_{-\infty}^{\infty}\overline{k(y,x)}f(x)\,dx.$$
The proof is as follows:
$$\begin{align} \langle Tf,g\rangle & \stackrel{\text{def}}{=} \langle f,T^*g\rangle \\ &= \int_{-\infty}^{\infty} Tf(y)\overline{g(y)}\,dy \\ &= \int_{-\infty}^{\infty}\int_{-\infty}^{\infty} k(x,y)f(x)\,dx\, \overline{g(y)}\,dy \tag{1} \\ &= \int_{-\infty}^{\infty} f(x) \int_{-\infty}^{\infty} k(x,y)\overline{g(y)}\,dy\,dx \tag{2} \\ &= \int_{-\infty}^{\infty} f(x)\overline{\int_{-\infty}^{\infty}\overline{k(x,y)}g(y)\,dy}\,dx \end{align}$$
From there, you can easily identify that the second piece in the integral would be the adjoint, by definition. My question is: how is the change of integral justified from $(1)$ to $(2)$? I'm sure it's some Fubini-type argument incorporating boundedness of the operator but I don't see how to make it precise.
Thanks!