Solution (source code)

= Solution

A complete $n$-type over $X\subseteq M$ is a maximal set $p(\bar x)$ of $L(X)$-formulas consistent with the theory of $M$ with parameters from $X$. Equivalently, for every formula $\varphi(\bar x)$, exactly one of $\varphi,\neg\varphi$ belongs to $p$.

The <type space> $S_n^M(X)$ has these types as points and basic open sets
$$
[\varphi]=\{p:\varphi\in p\}.
$$
Since $[\varphi]^c=[\neg\varphi]$, these sets are clopen. An <isolated type> is a point $\{p\}=[\varphi]$ for some formula $\varphi\in p$.