Solution (source code)

= Solution

The <Stone topology on a type space> has basic open sets
$$
\boxed{[\varphi]=\{p\in S_n^{\mathcal M}(A):\varphi(\bar x)\in p\},}
$$
where $\varphi$ ranges over formulas with parameters in $A$ and $n$ free variables. Here points are <complete types> consistent with $T_A=\operatorname{Th}(\mathcal M,a)_{a\in A}$. Arbitrary open sets are unions of these basic sets.

The identities
$$
[\varphi]\cap[\psi]=[\varphi\wedge\psi],\qquad
S_n^{\mathcal M}(A)\setminus[\varphi]=[\neg\varphi]
$$
show that the basic sets are <clopen sets> and form a basis. Distinct <complete types> contain opposite choices for some formula, so this topology is Hausdorff. The <compactness theorem> gives compactness: a family of basic closed sets with the <finite intersection property> determines a consistent set of formulas, which extends to a <complete type>. Thus logical formulas provide a basis of clopen tests for distinguishing points of the <type space>.