# Sigma algebra generated by random variables

Im currently studying for an exam in probability theory and one example in the lecture notes stated the following: Let $$X_1,X_2,...$$ be i.i.d. random variables. Then $$\sigma(\{X_i:i\leq n\}) = \sigma(\{S_i:i\leq n\})$$, where $$S_n:= \sum_{i=1}^{n} X_i$$. I don't see why this statement is true, maybe its some measure theoretic standard argument, but I just don't see it. Any help is really appreciated, thank you in advance!

Write $$S_i=f_i(X_1,\ldots,X_n)$$ where $$f_i:(x_1\ldots,x_n)\mapsto \sum_{k=1}^i x_k$$ and note that $$S_i^{-1}(A) = (X_1,\ldots,X_n)^{-1}(f_i^{-1}(A))$$, so that $$\sigma(\{S_i:i\leq n\}) \subset \sigma(\{X_i:i\leq n\})$$.
For the other inclusion, note that $$X_1=S_1$$ and for $$i\geq 2$$, $$X_i=g_i(S_1,\ldots,S_n)$$ where $$g_i:(s_1,\ldots,s_n)\mapsto s_i-s_{i-1}$$.