TITLE: Most astonishing applications of compactness theorem outside logic
QUESTION [16 upvotes]: The compactness theorem has a lot of applications to logic and model theory. I'm looking for applications. I'm looking for theorems in other areas of mathematics which seem at first sight to have nothing to do with logic but which allow a fairly simple proof with Compactness. For example, the existence of the algebraic closure can easily be proved in that manner (see JDH's answer in this MO question), and Marker shows in his book on model theory that every injective polynomial map $\Bbb C^n \rightarrow \Bbb C^n$ is surjective.
Do you know any other examples? I would be especially grateful for an application outside of algebra, if there is any.

REPLY [9 votes]: There is a very nice proof from compactness that every set can be linearly ordered.
For a set $A$ define the language $\mathcal L_A$ to have the binary relation symbol $<$, and a constant symbol $c_a$, for every $a\in A$.
Let $T$ be the theory stating that $<$ is a linear order, and for every distinct $a,b\in A$ add an axiom $c_a\neq c_b$. It is not hard to show that every finite $T_0\subseteq T$ has a model. By compactness $T$ has a model $M$, which $<^M$ linearly orders. The function $a\mapsto c_a^M$ is an injection, therefore $A$ can be linearly ordered.