Doob’s Optional Stopping Theorem in the case of the Wald Identity As a actuarial sciences student with an Economics background, I've never learnt how to prove things mathematically in the "pure way". I need to proof the following things:
Let $X_i$ be i.i.d r.v where $E[|X|] < \infty $ and let $T$ be a stopping time (with respect to the filtration $F_n$ generated by $(X_1,\dots, X_n)$ . 
Assume $E[T] < \infty $, and $E[X_i] = μ$. 
Firstly, I need to show that $S_n = \sum_{i=1}^{n} X_i - n\mu$, which is rather simple.
Then that $E[\sum_{i=1}^{T}X_i] = E[T]\mu$. As hint, I know that I should consider non-negative random variables $X_i$ and "fix" n by using $T\wedge n $
I know as well that I can use when $n \rightarrow \infty$, $T\wedge n = T$
Any help will be kindly appreciated !
 A: To use Doob's optional stopping theorem, you need to show that the sequence of random variables you are considering is a martingale with respect to the filtration for which your stopping time is defined. Here I show that $(S_i)_i$ is a martingale with respect to $(X_i)_i$, i.e. that $\mathbb{E}(S_{n+1}|X_1\ldots X_n)=S_n$. To show this, we note that
\begin{align*}
\mathbb{E}(S_{n+1}|X_1\ldots X_n)-S_n&=\mathbb{E}(\sum_{i=1}^{n+1}X_i-(n+1)\mu|X_1\ldots X_n)-\sum_{i=1}^{n}X_i-n\mu\\
&=\mathbb{E}(X_{n+1}|X_1\ldots X_n)-\mu\\
&=\mathbb{E}(X_{n+1})-\mu\\
&=0
\end{align*}
To get the second line, I used that the expectation value is linear, specifically that $\mathbb{E}(A+B)=\mathbb{E}(A)+\mathbb{E}(B)$, and that $\mathbb{E}(A|A)=A$. The third line follows from the fact that the $X_i$ are independent and the last from the definition of $\mu$.
We now know that $(S_i)_i$ is a martingale with respect to $(X_i)_i$, i.e. to the filtration with respect to which the stopping time $T$ is defined.
We can define the stopped process $\bar{S}_n=S_{\min(n,T)}$. From Doob's optional stopping theorem, we know that if $(S_i)_i$ is a martingale with respect to $(X_i)_i$, then so is $(\bar{S}_i)_i$, and that
$$\mathbb{E}(\bar{S}_n)=\mathbb{E}(\bar{S}_1)\quad\forall n$$ 
This leads to
\begin{align*}
\mathbb{E}(\sum_{i=1}^{\min(T,n)}X_i)-\mathbb{E}(\min(T,n))\mu&=\mathbb{E}(\bar{S}_n)\\
&=\mathbb{E}(\bar{S}_1)\\
&=\mathbb{E}(X_1)-\mu\\
&=0
\end{align*}
for all $n$. Taking the limit of $n\to\infty$ and using that $\lim_{n\to\infty}\min(n,T)=T$, we thus have
\begin{align*}
\mathbb{E}(\sum_{i=1}^{T}X_i)-\mathbb{E}(T)\mu=0
\end{align*}
which is what we wanted to prove.
