Basis of the topology of a Stone space I'm trying to understand the general idea of Stone Representation Theorem (or, at least, the existence of a functor from the category of boolean algebras to the category of compact totally disconnected spaces) with the example $B=\{0,1,2,3\}$.
The corresponding Stone space contains all ultrafilters on $B$ (which are all subsets of $B$ that contains $1$ and exactly $a$ or $¬a$, $a \in B$), so $S(B)=\{ \{1,2\},\{1,3\} \}$.
Also, the basis of the space is $\beta_{S(B)}= \{ U \in S(B) \mid b \in U\} = \{ \emptyset,\{1,2\},\{1,3\}   \}$. But that makes no sense, since the union of all elements of $\beta_{S(B)}$ is not an element of $S(B)$. 
What am I missing, or misunderstanding?

You seem to be confusing elements of $S(B)$ with subsets of $S(B)$.  Specifically, your basis should consist of four subsets of $S(B)$, one for each $b\in B$.  For $b=0,1,2,3$, the corresponding subsets are $\varnothing$, $S(B)$, $\{\{1,2\}\}$, and $\{\{1,3\}\}$, respectively.
