I'm working through G. de Barra's book on measure theory, and have come across this question. The only information the book gives on generated $\sigma$-algebras is:
Let $\mathcal{A}$ be a class of subsets of a space $X$. We call the smallest $\sigma$-algebra containing $\mathcal{A}$ the $\sigma$-algebra generated by $\mathcal{A}$.
So far so good. Now to the question. Let $\mathcal{A}=\{A_1,\dots,A_n\}$ be our subclass of $n$ sets. Now I know, from other questions on the site, that the next step is to consider the set $\mathcal{K}$ containing elements of the form:
$$A_{1}^{\gamma_1}\cap\dots\cap A_{n}^{\gamma_n}$$ where $\gamma_i\in \{0,1\}$ to be interpreted that $A_i^1=A_i$ and $A_i^0=A_i^c$. We then take all possible unions of the elements of $\mathcal{K}$ to generate the $\sigma$-algebra generated by $\mathcal{A}$. This gives an upper bound of $2^{2^{n}}$ distinct sets. What I don't quite get is the motivation for taking the elements of $\mathcal{K}$ as the "atoms" of the correct $\sigma$-algebra. Intuitively I sense that this does ensure that the gnerated sub-class is closed under complements and countable unions but I'd like a more rigorous reason as to why we first construct $\mathcal{K}$ and then look at its unions. All the answers I've seen on the site treat this step as trivial, but it did not seem to me the obvious place to start. Maybe there's a well-known proof showing that this method generates a $\sigma$-algebra containing $\mathcal{A}$ that I'm not aware of?
EDIT: To be clear I'm asking why do other posts choose the set of all possible intersections and complements as their atoms. Is there a pretty way to see that this works, or is it just used because it can be proven (laboriously) that using them as your atoms will lead to the desired $\sigma$-algebra. I am not asking how they get to the upper bound after that step, as that is quite simple.
Given a $\sigma$-algebra, we can obtain another $\sigma$-algebra by "forgetting" the distinction between any two elements $x,y\in X$, that is, by removing all sets that contain exactly one of $x$ and $y$: Taking complements, unions and intersections can't lead from a set with either neither or both of them to a set with only one of them. It follows by minimality that if none of $A_1,\ldots,A_n$ distinguish between $x$ and $y$, then neither does the $\sigma$-algebra generated by them. Thus each element of the $\sigma$-algebra generated by $\mathcal A$ contains either all or none of the elements with a given membership signature $\gamma$, and is therefore a union of your atoms, which are precisely the sets of elements with a given signature.
Alternatively, note that these atoms clearly must be in the $\sigma$-algebra (since they arise from the $A_i$ using complements and intersections), hence so must be their unions, so you only have to prove (though this is a bit tedious) that these unions are closed under complements, intersections and unions.