%! TEX root = MT.tex
% vim: tw=50
% 18/02/2025 11AM

\begin{fcdefn}[Diagram]
  \label{defn:10.2}
  \glsnoundefn{diag}{diagram}{diagrams}%
  \glsnoundefn{ediag}{elementary
  diagram}{elementary diagrams}%
  \glssymboldefn{diag}%
  The \emph{diagram} of $\mathcal{M}$
  (respectively \emph{elementary diagram}),
  $\mathcal{D}(\mathcal{M})$, is the set of
  quantifier-free $\mathcal{L}_M$-sentences (respectively
  all $\mathcal{L}_M$-sentences) true in $\mathcal{M}$.
\end{fcdefn}

\begin{fcprop}[]
  \label{prop:10.3}
  Assuming:
  - $\mathcal{M}$ is an $\mathcal{L}$-structure
  - $N^*$ an $\mathcal{L}_M$-structure such that
  $N^* \models \mathcal{D}(\mathcal{M})$
  - let $N$ be the $\mathcal{L}$-reduct of $N^*$
  to $\mathcal{L}$ (means throw away
  $\mathcal{L}_M \setminus \mathcal{L}$ sentences)
  - define $h : \mathcal{M}  \to \mathcal{N}$ such
  that $h(a) = \ul{a} = a^N$.
  Then:
  $h$ is an $\mathcal{L}$-\gls{em}.
  Moreover, if $N^* \models
  \Th_{M}(\mathcal{M})$ then $h$ is an
  \glsref[eemb]{elementary
  $\mathcal{L}$-embedding}.
\end{fcprop}

\begin{proof}
  We use \cref{coro:2.4}. Let $\varphi(x_1,
  \ldots, x_n)$ be a quantifier-free
  $\mathcal{L}$-formula, and fix $a_1, \ldots, a_n
  \in M$. Then
  \begin{align*}
    M \models \varphi(a_1, \ldots, a_n)
    &\iff \varphi(\ul{a_1}, \ldots, \ul{a_n})
    \in \Diag(\mathcal{M}) \\
    &\iff N^* \models \varphi(\ul{a_1}, \ldots,
    \ul{a_n}) \\
    &\iff N \models \varphi(h(a_1), \ldots, h(a_n))
  \end{align*}
  Therefore $h$ is an $\mathcal{L}$-\gls{em}.

  ``Moreover'' is similar.
\end{proof}

\begin{remark*}
  You can use this to show that any torsion free
  abelian group is orderable (\es{2}).
\end{remark*}

\newpage
\section{Introduction to Quantifier Elimination}

\begin{fcdefnstar}[Definable set]
  \glsadjdefn{defable}{definable}{set}%
  Let $T$ be an $\mathcal{L}$-theory and $M
  \models T$. Then $X \subseteq M^n$ is
  \emph{definable} is there is some
  $\mathcal{L}$-formula $\varphi(x_1, \ldots,
  x_n)$ such that
  \[
    X
    = \{\ol{a} \in M^n : M \models \varphi(\ol{a})\}
  .\]
\end{fcdefnstar}

\begin{fcdefn}[Theory has quantifier elimination]
  \glsadjdefn{qe}{quantifier elimination}{theory}%
  \label{defn:11.1}
  An $\mathcal{L}$-theory $T$ has \emph{quantifier
  elimination (QE)} if for any
  $\mathcal{L}$-formula $\varphi(x_1, \ldots,
  x_n)$ ther eis a quantifier free formula
  $\psi(x_1, \ldots, x_n)$ such that
  \[
    T \models \forall \ol{x}(\varphi(\ol{x})
    \leftrightarrow \psi(\ol{x}))
  .\]
  (i.e. they define the same set in all models).
\end{fcdefn}

\begin{example}
  \label{eg:11.2}
  \phantom{}
  \begin{enumerate}[(1)]
    \item Let $T = \Th(F)$, $F$ a field in
      $\mathcal{L}_{\text{rings}}$. Let
      $\varphi(w, x, y, z)$ be the formula saying
      \[
        \text{``}
        \begin{pmatrix}
          w & x \\
          y & z
        \end{pmatrix}
        \text{ has an inverse''}
      ,\]
      i.e.
      \[
        \exists s, t, u, v \left[
          \begin{pmatrix}
            s & t \\
            u & v
          \end{pmatrix}
          \begin{pmatrix}
            w & x \\
            y & z
          \end{pmatrix}
          =
          \begin{pmatrix}
            1 & 0 \\
            0 & 1
          \end{pmatrix}
        \right]
      .\]
      Then
      \[
        T \models \forall x, w, y, z (\varphi(w,
        x, y, z) \iff wz - xy \neq 0)
      .\]
    \item Let $T = \Th(\Rbb, \cdot, +, 0, 1)$.
      Consider $\varphi(x) = \exists y(y^2 = x)$
      (this defines $\Rbb_{\ge 0}$).

      Quantifier free formulas in one variable are
      boolean combinations of polynomial
      equations, i.e. define sets of size finite
      or cofinite. But $\Rbb^{\ge 0}$ is
      infinite-co-infinite, so cannot be defined
      by a quantifier free formula.

      Remark: $\Th(\Rbb, \cdot, +, 0, 1)$ does
      have \gls{qe}.

      We can show $\Th(\Rbb, \cdot, +, 0, 1)$
      and $\Th(\Rbb, \cdot, +, 0, 1, <)$ have the
      same \gls{defable} sets.

      This is because we can define $<$ in
      $\mathcal{L}_{\text{rings}}$ in $T$ by
      noting $x < y$ if and only if
      \[
        \exists z (z \neq 0 \wedge y - z^2 = x)
      .\]
      Note: you can always find a language in
      which the theory of a structure has
      \gls{qe}: just add a relation symbol for
      each non quantifier-free formula. This is
      called the ``Morleyisation'' of a structure,
      but isn't particularly informative.
  \end{enumerate}
\end{example}

\begin{fclemma}[]
  \label{lemma:11.3}
  Assuming:
  - $T$ is an $\mathcal{L}$-theory
  - for any quantifier-free formula $\varphi(x_1,
  \ldots, x_n, y)$ there is a quantifier-free
  formula $\psi(x_1, \ldots, x_n)$ such that
  \[
    T \models \forall \ol{x} (\exists y
    \varphi(\ol{x}, y) \leftrightarrow
    \psi(\ol{x}))
  .\]
  Then:
  $T$ has \gls{qe}.
\end{fclemma}

\begin{proof}
  Exercise: induction on the complexity of
  formulas.
\end{proof}

\begin{fcthm}[]
  \label{thm:11.4}
  Assuming:
  - $T$ an $\mathcal{L}$-theory
  Thens:[(i)]tfae
  - $T$ has \gls{qe}
  - Let $M, N \models T$, $A \subseteq
  \mathcal{M}$, $A \subseteq \mathcal{N}$
  (\glspl{substruc}). For any quantifier-free
  formula $\varphi(x_1, \ldots, x_n, y)$ and tuple
  $\ol{a} \in A$, if $\mathcal{M} \models \exists
  y, \varphi(\ol{a}, y)$ then $\mathcal{N} \models
  \exists y, \varphi(\ol{a}, y)$.
  - For any $\mathcal{L}$-structure $\mathcal{A}$,
  $T \cup \Diag(\mathcal{A})$ is a
  \gls{compt} $\mathcal{L}_A$-theory.
\end{fcthm}

\begin{proof}
  \phantom{}
  \begin{enumerate}[{(i) $\implies$ (i)}]
    \item[(i) $\implies$ (iii)] Assume $T$ has
      \gls{qe}, and let $\mathcal{A}$ be an
      $\mathcal{L}$-structure. Suppose
      $\mathcal{M}, \mathcal{N} \models T \cup
      \Diag(\mathcal{A})$. We want to show $M
      \ee_{\mathcal{L}_{\mathcal{A}}} \mathcal{N}$.

      Let $\sigma$ be an $\mathcal{L}_A$-sentence,
      and suppose that $M \models \sigma$. Then
      $\sigma$ can be written as $\varphi(\ol{a})$
      where $\varphi(\ol{x})$ is an
      $\mathcal{L}$-formula and $\ol{a} \in A$.

      By \gls{qe}, we have $\psi(\ol{x})$ such
      that
      \[
        T \models \forall \ol{x} (\varphi(\ol{x})
        \leftrightarrow \psi(\ol{x}))
      .\]
      Now $\mathcal{M} \models T$, so $\mathcal{M}
      \models \forall \ol{x}(\varphi(\ol{x})
      \leftrightarrow \psi(\ol{x}))$, and
      $\mathcal{M} \models \varphi(\ol{a})$. So
      $\mathcal{M} \models \psi(\ol{a})$. Now
      $\psi(\ol{a}) \in \Diag(\mathcal{A})$ as
      $\mathcal{M} \models \Diag(\mathcal{A})$. So
      $N \models \psi(\ol{a})$, as $\mathcal{N}
      \models \Diag(\mathcal{A})$. Hence
      $\mathcal{N} \models \varphi(\ol{a})$ as
      $\mathcal{N} \models T$ (i.e. $\mathcal{N}
      \models \forall \ol{x} (\varphi(\ol{x})
      \leftrightarrow \psi(\ol{x}))$). So $N
      \models \sigma$.
