I am using the formal definition of conditional expectations: $E[X|\mathscr{F}]$ is any RV $Y$ such that $Y\in\mathscr{F}$ and $\int_AXdP=\int_AYdP$ for all $A\in\mathscr{F}$.
Suppose that $\xi_1,\xi_2,\dots$ are iid RV with mean $p$, and they are independent of RV $N$. How do I show rigorously by definition that $E[\sum_{i=1}^{N}\xi_i|\sigma(N)]=pN$?
I understand the intuitive saying that conditioned on $\{N=n\}$, $E[\sum_{i=1}^{N}\xi_i]=E[\sum_{i=1}^{n}\xi_i]=\sum_{i=1}^{n}E[\xi_i]=pn=pN$. But it seems too far away from the formal definition for me.
Note that $\sigma(N)$ is the $\sigma$-algebra generated by sets of the form $N^{-1}(B)$ where $B$ is Borel; thus you can check $$\int_A \sum_{i=1}^N \xi_i dP = \int_A Np$$ on sets that look just like $A = \{ \omega \mid N(\omega) = n\}$, since everything else will be just unions of these sets. But on $A = \{\omega \mid N(\omega) = n \}$, $$\int_A \sum_{i=1}^N \xi_i dP = \sum_{i=1}^n \int_A \xi_i dP = n E[\xi_1 \cdot 1_{A}] = n p \cdot P(A)$$ and $$\int_A Np = np\cdot P(A)$$ as well so be definition of the conditional expectation you may conclude.