What statement do I use here to get this equation $\Bbb{E}\left(S_k \cdot \Bbb{1}_{\{T=k\}}\right)=\Bbb{E}(S_k)\Bbb{E}(\Bbb{1}_{\{T=k\}})$? 
Let $X_1,...$ be an i.i.d. sequence of $L^1$ random variables taking values in $\{0,1,...\}$. Let $T\in L^1$ be a random variable also taking values in $\{0,1,...\}$ such that $(X_1,X_2,...)$ and $T$ are independent. Let us define $S_n(\omega)=\sum_{i=1}^n X_i(\omega)$ for all $n\in \Bbb{N_0}$. (If $n=0$ then we set $S_n(\omega)=0)$.

I need to compute some expectation values but this is not the problem. The problem appears in the computations. Let me fix $k\in \Bbb{N}$ then at some point I get to the expression $$\Bbb{E}\left(S_k \cdot \Bbb{1}_{\{T=k\}}\right)$$ Now I don't see why we can write this as $\Bbb{E}(S_k)\Bbb{E}(\Bbb{1}_{\{T=k\}})$.
In my opinion we need the following statement we had in class:

Let $X_1,...,X_n$ be random variables with values in $M$ then all the $X_i$'s are independent iff for all bounded functions $f_i:M\rightarrow \Bbb{R}$ we have $$\Bbb{E}(f_1(X_1)\cdot \cdot \cdot f_n(X_n))=\Bbb{E}(f_1(X_1))\cdot \cdot \cdot\Bbb{E}(f_n(X_n))$$

But in order to use this we first need independence of the sum $S_k$ and $\Bbb{1}_{\{T=k\}}$. Why is this given? Because we only have independence of the random variable vector $(X_1,...)$ and $T$ if I understood this correctly. And furthermore what are this bounded functions form the theorem in our case?
Thanks for your help.
 A: The reason is that the $X_k$ and $T$ are independent, therefore the $S_k$ and the $\mathbf{1}_{\{T=k\}}$ are also independent, as both are functions of the $X_k$, in one side, and of $T$ in the other side.
To clarify a bit more: if the family $\{X_n\}_{n\in\mathbb{N}}$ and $T$ are independent it means that, for any chosen $A\in \sigma (X_1,X_2,\ldots )$ and $B\in \sigma (T)$ we have that $\Pr [A\cap B]=\Pr [A]\cdot \Pr [B]$. But this implies that if $X$ is $\sigma (X_1,X_2,\ldots )$ measurable and $Y$ is $\sigma (T)$ measurable then $X$ and $Y$ are independent, and this is what happen with $S_k$ and $\mathbf{1}_{\{T=k\}}$
A: You can see T as a stopping time. That is, you compute the average up to time T. The key idea, and in my opinion the easiest way to compute this, is to use the Law of Total Probability as follows,
$$ 
\mathbf{E} [S_k \mathbf{1}_{\{T=k\}}] = \mathbf{E}_{T} [\mathbf{E} [S_k | k]]
$$
We can go ahead and explicitely compute this expected value as follows,
$$ 
\mathbf{E}_{T} [\mathbf{E} [S_k | k]] = \sum_{t=1}^\infty \mathbf{E} [S_t] Pr(t=T)
$$
Now, it is clear that as $\mathbf{E}[S_t]=t\mathbf{E}[X_t]$ given the i.i.d. assumption, which gives us,
$$ 
\mathbf{E}_{T} [\mathbf{E} [S_k | k]] =  \mathbf{E} [X]\sum_{t=1}^\infty t Pr(t=T) = \mathbf{E} [X] \mathbf{E} [T]
$$
Completing the proof.
