[proofplan]
We prove that any two distinct complete types can be separated by a clopen basic set. The separation comes from completeness of types: if $p \ne q$, then some formula belongs to one type and its negation belongs to the other. That clopen set disconnects any subspace containing both points, so no connected subset contains two distinct points.
[/proofplan]
[step:Separate two distinct types by a formula]
Let $p,q \in S_n(A)$ satisfy $p \ne q$. Since $p$ and $q$ are distinct sets of $\mathcal{L}(A)$-formulas in the free variables $x = (x_1,\dots,x_n)$, there exists an $\mathcal{L}(A)$-formula $\varphi(x)$ such that $\varphi \in p$ and $\varphi \notin q$, after interchanging $p$ and $q$ if necessary. Since $q$ is complete, exactly one of $\varphi$ and $\neg \varphi$ belongs to $q$; hence $\neg \varphi \in q$.
Define
\begin{align*}
U := [\varphi] = \{r \in S_n(A) : \varphi \in r\}.
\end{align*}
Then $p \in U$ and $q \notin U$.
[guided]
We start with two different points of the type space. A point of $S_n(A)$ is a complete type, so it is a maximal consistent collection of $\mathcal{L}(A)$-formulas in the variables $x = (x_1,\dots,x_n)$. Thus, if $p,q \in S_n(A)$ and $p \ne q$, then the two collections of formulas are not equal.
Therefore there is an $\mathcal{L}(A)$-formula $\varphi(x)$ whose membership differs between $p$ and $q$. If necessary, we exchange the names of $p$ and $q$, and arrange that
\begin{align*}
\varphi \in p
\quad\text{and}\quad
\varphi \notin q.
\end{align*}
Because $q$ is complete, it decides every $\mathcal{L}(A)$-formula: for the formula $\varphi$, exactly one of $\varphi$ and $\neg \varphi$ belongs to $q$. Since $\varphi \notin q$, we get $\neg \varphi \in q$.
Now define the basic Stone-[open set](/page/Open%20Set)
\begin{align*}
U := [\varphi] = \{r \in S_n(A) : \varphi \in r\}.
\end{align*}
The membership statements above translate directly into topology: since $\varphi \in p$, we have $p \in U$; since $\varphi \notin q$, we have $q \notin U$.
[/guided]
[/step]
[step:Show that the separating basic set is clopen]
The set $U = [\varphi]$ is open by the definition of the Stone topology. Its complement is
\begin{align*}
S_n(A) \setminus U
&= \{r \in S_n(A) : \varphi \notin r\} \\
&= \{r \in S_n(A) : \neg \varphi \in r\} \\
&= [\neg \varphi],
\end{align*}
where the second equality uses completeness of each $r \in S_n(A)$. Since $[\neg \varphi]$ is also basic open, $U$ is closed as well as open.
[/step]
[step:Use the clopen separation to rule out connected subsets with two points]
Let $C \subseteq S_n(A)$ be a connected subset. Suppose, for contradiction, that $C$ contains two distinct points $p,q \in C$. By the previous steps, there is a clopen set $U \subseteq S_n(A)$ such that $p \in U$ and $q \notin U$.
Consider the two subsets of $C$
\begin{align*}
C_1 &:= C \cap U, \\
C_2 &:= C \cap (S_n(A) \setminus U).
\end{align*}
Because $U$ and $S_n(A)\setminus U$ are open in $S_n(A)$, the sets $C_1$ and $C_2$ are open in the [subspace topology](/page/Subspace%20Topology) on $C$. Because $U$ and $S_n(A)\setminus U$ are also closed and complementary, $C_1$ and $C_2$ are disjoint, complementary subsets of $C$. Moreover $p \in C_1$ and $q \in C_2$, so both are nonempty. Thus
\begin{align*}
C = C_1 \cup C_2
\end{align*}
is a separation of $C$, contradicting connectedness.
[/step]
[step:Conclude that all connected components are singletons]
The contradiction shows that no connected subset of $S_n(A)$ contains two distinct points. Hence every connected subset of $S_n(A)$ has at most one point. Therefore every connected component of $S_n(A)$ is a singleton, and $S_n(A)$ is totally disconnected.
[/step]