Let $(S_n)$ a martingale refer to $(X_n)$ and let $T$ a stopping time. Prove that $$\mathbb E[S_{T\wedge n}]=\mathbb E[S_1],$$ where $a\wedge b:=\min\{a,b\}$.
I have proved that
$$\mathbb E[S_1]=\mathbb E[S_T\boldsymbol 1_{\{T\leq n\}}]+\mathbb E[S_n\boldsymbol 1_{\{T>n\}}]$$
but then, I don't understand why $$\mathbb E[S_T\boldsymbol 1_{\{T\leq n\}}]+\mathbb E[S_n\boldsymbol 1_{\{T>n\}}]=\mathbb E[S_{T\wedge n}\boldsymbol 1_{\{T\leq n\}}]+\mathbb E[S_{T\wedge n}\boldsymbol 1_{\{T>n\}}].$$