TITLE: Generate the smallest $\sigma$-algebra containing a given family of sets
QUESTION [7 upvotes]: My teacher gave me an example of performing the subject:

Example
Let $\Omega = \Bbb R$ and $\mathcal R = \{(-\infty,-1),(1,+\infty)\}$.
  Then $\sigma(\mathcal R) = \{\emptyset, \Bbb R, (-\infty,-1),
 (1,+\infty), [-1, \infty), (-\infty,1],
 (-\infty,-1)\cup(1,+\infty),[-1,1]\}$.

There was a different example, where she also generated the smallest  $\sigma$-algebra for the family of sets $\mathcal A = \{A,B\} \subset 2^\Omega$ in the same way: $\sigma(\mathcal R) = 
\{\emptyset, \Omega, A, B, A^C,B^C,A\cup B, (A\cup B)^C\}$. 
I certainly understand why $\emptyset$, $\Omega $ and a family of sets itself are there, and I certainly know that $\sigma$-algebra is closed under the operations of complement and union. What I don't understand about the other elements of generated $\sigma$-algebras: why we are taking exactly them? Does this work in a general case?

REPLY [3 votes]: The sigma needs to contain $\varnothing$, $\Omega$, $A$ and $B$. Since a sigma algebra is closed under countable unions and complements it must contain $A \cup B$, $A^{C}$, and $B^{C}$.Since a sigma algebra is closed under complements it must contain $(A^{C} \cup B^{C})^{C} = A \cap B$. A more general construction of a sigma algebra from $\mathcal{A} \subseteq 2^{X}$ is a follows:
The construction is in stages indexed by the ordinals.
Stage $0$. $\sigma_{0} = \mathcal{A} \cup \{ \varnothing, X\} $.
Stage $\alpha + 1$. We suppose we have defined $\sigma_{\alpha}$. Then $\sigma_{\alpha + 1} = \sigma_{\alpha} \cup \{ \cup f(i)\colon f: \mathbb{N} \rightarrow \sigma_{\alpha} \} \cup \{ X \smallsetminus  \cup f(i)\colon f: \mathbb{N} \rightarrow \sigma_{\alpha} \}$.
Stage $\lambda$. Here $\lambda$ is a limit ordinal. We suppose that we have defined $\sigma_{\alpha}$ for all $\alpha < \lambda$. The $\sigma_{\lambda} = \cup \{ \sigma_{\alpha} \colon \alpha < \lambda \} $.
This step might require the axiom of choice. With this construction $\sigma_{\aleph_{1}}$ is the smallest sigma algebra containing $\mathcal{A}$. Stage $\alpha + 1$ guarantees if something is in the collection its complement is also in the collection. Suppose the for each $i \in \mathbb{N}$ we have $A_{i} \in \sigma_{\aleph_{1}}$. For each $i \ in \mathbb{N}$ there exists a least countable $\alpha_{i}$ with $A_{i} \in \sigma_{i}$. Possibly using the axiom of choice there is a countable ordinal $\alpha^{*}$ greater than any of the $\alpha_{i}$. We will have both $\cup \{A_{i} \colon i \in \mathbb{N} \} \in \sigma_{\alpha^{*}}$ and $X \smallsetminus \cup \{A_{i} \colon i \in \mathbb{N} \} \in \sigma_{\alpha^{*}}$.