\documentclass[a4paper,10pt,draft]{article}
\usepackage{amsmath}
\input{../../math/abbreviations}
\input{../../math/format}

\swapnumbers

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{axiom}[theorem]{Axiom}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{porism}[theorem]{Porism}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{examples}[theorem]{Examples}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{counter}[theorem]{Counter-Example}
\newtheorem{non}[theorem]{Non-Example}

\newcommand{\bref}[1]{\textbf{\ref{#1}}}

%\input{../../math/article-theorems}
\renewcommand{\tuple}[1]{\vec{#1}\,}


\title{Dense total orders without endpoints}
\author{David Pierce}
\date{2004.11.01}


\begin{document}
\maketitle

These notes repeat and supplement the 2004.10.26 lecture of Math 406
(Introduction to mathematical logic and model-theory).

If $\lang$ is a signature (of first-order logic), $\str A$ is an
$\lang$-structure, and $\sigma$ is a sentence of $\lang$, then we have
defined what it means if $\sigma$ is \emph{true} in $\str A$.  In this
case, we write
\begin{equation*}
  \str A\models\sigma.
\end{equation*}
Having defined truth, we can define \tech{logical consequence}.  Let
$\Sn$ be the set of sentences of $\lang$.
The $\lang$-structure $\str A$ is a \defn{model} of a subset $\Sigma$ of
$\Sn$ if each sentence in $\Sigma$ is true in $\str A$; then we
can write
\begin{equation*}
  \str A\models\Sigma.
\end{equation*}
If a sentence $\sigma$ is true in every model of $\Sigma$, then
$\sigma$ is a \defn{(logical) consequence} of $\Sigma$, and we can write
\begin{equation*}
  \Sigma\models\sigma.
\end{equation*}
If $\emptyset\models\sigma$, then we can write just
\begin{equation*}
  \models\sigma;
\end{equation*}
in this case, $\sigma$ is a \defn{validity}.

Two sentences are \defn{(logically) equivalent} if
each is a logical consequence of the other.  

\begin{lemma}
Let $\sigma$ and $\tau$ be sentences of $\lang$.
\begin{mylist}
  \item
  $\{\sigma\}\models\tau$ if and only if ${}\models(\sigma\to\tau)$,
  for all $\sigma$ and $\tau$ in $\Sn$.
\item
$\sigma$ and $\tau$ are equivalent if and only if
  ${}\models(\sigma\to\tau)\land(\tau\to\sigma)$. 
\item
Logical equivalence is an equivalence-relation on $\Sn$.
\end{mylist}
\end{lemma}

\begin{proof}
  \textbf{Exercise}.
\end{proof}

Instead of the formula
$(\phi\to\chi)\land(\chi\to\phi)$, let us write
\begin{equation*}
  \phi\iff\chi.
\end{equation*}
By the lemma, $\sigma$ and $\tau$ are logically equivalent if and only
if $(\sigma\iff\tau)$ is a validity.
We may blur the
distinction between logically equivalent sentences, identifying
$\sigma$ with $\lnot\lnot\sigma$ for example.

Instead of $\lnot\Exists v\lnot\phi$, we may write
\begin{equation*}
  \Forall v\phi.
\end{equation*}
Then $\lnot\Forall v\phi$ is (equivalent to) $\Exists v\lnot\phi$.

If $\fv\phi=\{u_0,\dots,u_{n-1}\}$, and $\str
A\models\Forall{u_0}\dotsb\Forall{u_{n-1}}\phi$, we may write just
\begin{equation*}
  \str A\models\phi.
\end{equation*}
Here, the sentence $\Forall{u_0}\dotsb\Forall{u_{n-1}}\phi$ is the
\defn{(universal) generalization} of $\phi$.  Now we can define
$\Sigma\models\phi$ for arbitrary formulas $\phi$ (although $\Sigma$
should still be a set of \emph{sentences}); we can also say that
arbitrary formulas $\phi$ and $\chi$ are \defn{(logically) equivalent}
if
\begin{equation*}
  \models(\phi\iff\chi).
\end{equation*}
For the formula $\phi$ with free variables $x_0$, \dots,
$x_{n-1}$, if we have
\begin{equation*}
  \str A\models\Exists{u_0}\dotsb\Exists{u_{n-1}}\phi,
\end{equation*}
then we can say that $\phi$ is \defn{satisfied} in $\str A$.

It can happen then that $\str A\not\models\phi$ and $\str
A\not\models\lnot\phi$.  However, if $\sigma$ is a \emph{sentence}, then
either $\sigma$ or $\lnot\sigma$ is true in $\str A$.

\begin{example}
  Each of the following formulas is true in every group:
  \begin{gather*}
    x\cdot(y\cdot z)=(x\cdot y)\cdot z,\\
    \begin{aligned}
      x\cdot 1&=x,\\
1\cdot x&=x,
    \end{aligned} \qquad
    \begin{aligned}
      x\cdot x\inv=1,\\
x\inv\cdot x=1.
    \end{aligned}
  \end{gather*}
\end{example}

If $\Sigma\included\Sn$, let
\begin{equation*}
  \Cn \Sigma=\{\sigma\in\Sn:\Sigma\models\sigma\}.
\end{equation*}

\begin{lemma}
  $\Cn{\Cn\Sigma}=\Cn\Sigma$.
\end{lemma}

\begin{proof}
Since  $\Sigma\included\Cn\Sigma$, we have $\Cn\Sigma\included\Cn{\Cn\Sigma}$.
  Suppose $\sigma\in\Cn{\Cn\Sigma}$.  Then $\Cn\Sigma\models\sigma$.
  But if $\str A\models\Sigma$, then $\str A\models\Cn\Sigma$, so in
  this case $\str A\models\sigma$.  Thus $\sigma\in\Cn\Sigma$.
\end{proof}

A subset $T$ of $\Sn$ is a \defn{theory} of $\lang$ if $\Cn T=T$.  A
subset $\Sigma$ of a theory $T$ is a set of \defn{axioms} for $T$ if 
\begin{equation*}
  T=\Cn\Sigma;
\end{equation*}
we may also say then that $\Sigma$ \defn{axiomatizes} $T$.

\begin{example}\label{examp:groups}
  The theory of groups is axiomatized by
  \begin{gather*}
   \Forall x\Forall y \Forall z x\cdot(y\cdot z)=(x\cdot y)\cdot z,\\
    \begin{aligned}
    \Forall x  x\cdot 1&=x,\\
\Forall x 1\cdot x&=x,
    \end{aligned} \qquad
    \begin{aligned}
    \Forall x  x\cdot x\inv=1,\\
\Forall x x\inv\cdot x=1.
    \end{aligned}
  \end{gather*}
\end{example}

If $\str A$ is an $\lang$-structure, let
\begin{equation*}
  \Th{\str A}=\{\sigma\in\Sn:\str A\models\sigma\}.
\end{equation*}

\begin{lemma}
  $\Th{\str A}$ is a theory.
\end{lemma}

\begin{proof}
  Say $\Th{\str A}\models\sigma$.  Since $\str A\models\Th{\str A}$,
  we have $\str A\models\sigma$, so $\sigma\in\Th{\str A}$.
\end{proof}

We can now call $\Th{\str A}$ the \defn{theory of} $\str A$.  Note
that, if $T$ is $\Th{\str A}$, then
\begin{equation*}
  T\models\sigma\Iff T\not\models\lnot\sigma
\end{equation*}
for all sentences $\sigma$.
An arbitrary theory $T$ need not have this property; if it does,
then $T$ is \defn{complete}.  So, the theory \emph{of} a structure is
always complete.  The set $\Sn$ is a theory, but it is not
complete by this definition.  Complete theories are `maximal' in the
following sense:

\begin{lemma}\label{lem:complete}
Let $T$ be a theory of $\lang$.
\begin{mylist}
  \item
If $T$ has no model, then $T$ is $\Sn$ itself.  
\item
If $T$ has a model, namely $\str A$, then $T$ is included in a complete
theory, namely~$\Th{\str A}$.
\item
If $T$ has a model, then
\begin{equation*}
  T\models\sigma\implies T\not\models\lnot\sigma
\end{equation*}
for all $\sigma$ in $\Sn$.  
\item
Hence, to prove that $T$ is complete,
it is enough to show that $T$ has models and 
\begin{equation*}
  T\not\models\sigma\implies  T\models\lnot\sigma
\end{equation*}
for all $\sigma$ in $\Sn$.
\end{mylist}
\end{lemma}

\begin{proof}
If $T$ is a theory with no models, and $\sigma$ is a sentence, then
  $\sigma$ is true in every model of $T$, so $T\models\sigma$, whence
  $\sigma\in T$.  The second statement is obvious.  The third
  statement follows since $\{\sigma,\lnot\sigma\}$ has no models.  The
  last statement is now obvious.
\end{proof}

We can also speak of the theory of a \emph{class} of
$\lang$-structures.  If $K$ is such a class, then
$\Th K$ is the set of sentences of $\lang$ that are true in
\emph{every} structure in $K$.

In particular, if $\Sigma\included\Sn$, then we can define
\begin{equation*}
  \Mod \Sigma
\end{equation*}
to be the class of all models of $\Sigma$.  Then
\begin{equation*}
  \Th{\Mod\Sigma}=\Cn\Sigma.
\end{equation*}

\begin{example}
By definition, a group is just a model of the theory of groups, as
  axiomatized in \bref{examp:groups}.  Hence this theory
  is $\Th K$, where $K$ is the class of all groups.
\end{example}

In general, if we have some sentences, how might we show that the theory
that they axiomatize is complete?  If the theory is \emph{not}
complete, this is easy to show:

\begin{example}
  The theory of groups is not complete, since the sentence 
  \begin{equation*}
    \Forall x\Forall y xy=yx
  \end{equation*}
is true (by definition) only in abelian groups, but there are
non-abelian groups (such as the group of permutations of three
objects).  The theory of abelian groups is not complete either, since
(in the signature $\{+,-,0\}$) the sentence
  \begin{equation*}
      \Forall x (x+x=0\to x=0) 
  \end{equation*}
is true in $(\Z,+,-,0)$, but false in $(\Z/2\Z,+,-,0)$.
\end{example}

Let $\TO$ be the theory of \emph{strict} total orders; this is
axiomatized by the universal generalizations of:
\begin{gather*}
  \lnot(x< x),\\
x< y\to\lnot(y< x),\\
x< y\land y< z\to x< z,\\
x< y\lor y< x\lor x=y.
\end{gather*}
This theory is not complete, since $(\varN,<)$ and $(\Z,<)$ are
models of $\TO$ with different complete theories (\textbf{exercise}).

Let $\TO^*$ be the theory of \defn{dense total orders without
  endpoints}, namely, $\TO^*$ has the axioms of $\TO$, along with the
  universal generalizations of:
\begin{gather*}
  \Exists z (x<z\land z<y),\\
\Exists y y<x,\\
\Exists y x<y.
\end{gather*}
The theory $\TO^*$ has a model, namely $(\Q,<)$.
We shall show that $\TO^*$ is complete.  In order to do this, we shall
first show that the theory admits \tech{(full) elimination of quantifiers}.

An arbitrary theory $T$ admits
 \defn{(full) elimination of quantifiers} if, for every formula $\phi$
 of $\lang$, there is an \emph{open} formula $\chi$ of $\lang$ such that
 \begin{equation*}
   T\models(\phi\iff\chi)
 \end{equation*}
---in words, \defn{$\phi$ is equivalent to $\chi$ \emph{modulo} $T$}.

\begin{lemma}\label{lem:QE}
  An $\lang$-theory $T$ admits quantifier-elimination, provided that,
  if $\phi$ is an open formula, and $v$ is a variable, then $\Exists
  v\phi$ is equivalent \emph{modulo} $T$ to an open formula.
\end{lemma}

\begin{proof}
  Use induction on formulas.  Specifically:

Every atomic formula is equivalent \emph{modulo} $T$ to an open
formula, namely itself.

Suppose $\phi$ is equivalent \emph{modulo} $T$ to an open
formula $\alpha$.  Then $T\models(\lnot\phi\iff\lnot\alpha)$; but
$\lnot\alpha$ is open.

Suppose also $\chi$ is equivalent \emph{modulo} $T$ to an open formula
$\beta$.  Then 
\begin{equation*}
  T\models((\phi\to\chi)\iff(\alpha\to\beta));
\end{equation*}
but $(\alpha\to\beta)$ is open.

Finally, $T\models(\Exists v\phi\iff\Exists v\alpha)$
(\textbf{exercise}); but by
assumption, $\Exists v\alpha$ is equivalent to an open formula
$\gamma$; so $T\models(\Exists v\phi\iff\gamma)$ (\textbf{exercise}).
This completes the induction. 
\end{proof}

The lemma can be improved slightly.  Every open formula is logically
equivalent to a formula
in \emph{disjunctive normal form}:
\begin{equation*}
  \bigvee_{i<m}\bigwedge_{j<n}\alpha_i^{(j)},
\end{equation*}
where each $\alpha_i^{(j)}$ is either an atomic or a negated atomic
formula.  (See \S~2.6 of this year's notes for Math 111.)  This
formula in disjunctive normal form can also be written
\begin{equation*}
  \bigvee_{i<m}\bigwedge \Sigma_i
\end{equation*}
where $\Sigma_i=\{a_i^{(j)}:j<n\}$.  Note that
\begin{equation}\label{eqn:Ednf}
\models  (\Exists v\bigvee_{i<m}\bigwedge \Sigma_i \iff
\bigvee_{i<m}\Exists v\bigwedge \Sigma_i)
\end{equation}
(\textbf{exercise}).
The formulas $\Exists v\bigwedge\Sigma_i$ are said to be
\tech{primitive}.  In general, a \defn{primitive} formula is a formula
\begin{equation*}
  \Exists {u_0}\dotsb\Exists{u_{n-1}}\bigwedge \Sigma,
\end{equation*}
where $\Sigma$ is a \emph{finite} non-empty set of atomic and negated atomic
formulas.  (Remember that $\bigwedge\Sigma$ is just an abbreviation
for $\phi_0\land\dots\land\phi_{n-1}$, where the formulas $\phi_i$
compose $\Sigma$; so $\Sigma$ must be finite since formulas must have
finite length.  Also, formulas have \emph{positive} length, so
$\Sigma$ must be non-empty.  However, the notation
$\bigwedge\emptyset$ could be understood to stand for a validity.)

Using \eqref{eqn:Ednf}, we can adjust the induction above to show that
\emph{$T$ admits quantifier-elimination, provided that
every primitive formula with one (existential) quantifier is equivalent
\emph{modulo} $T$ to an open formula.}

Henceforth suppose $\lang$ is $\{<\}$, and $\TO\included T$; so $T$ is
\emph{a} theory of total orders.  Then we can
improve \bref{lem:QE} even more.
Indeed, the atomic formulas of $\lang$ now are $x=y$ and $x<y$, where
$x$ and $y$ are variables.  Moreover,
\begin{gather*}
  \TO\models (\lnot (x<y)\iff (x=y\lor y<x)),\\
\TO\models (\lnot(x=y)\iff (x<y\lor y<x)).
\end{gather*}
Hence, in $\lang$, any formula is equivalent, \emph{modulo} $\TO$, to
the result of replacing each negated atomic sub-formula with the
appropriate disjunction of atomic formulas.  If this replacement is
done to a formula in disjunctive normal form, then the new formula
will have a disjunctive
normal form that involves no negations.  So $T$ admits
quantifier-elimination, 
provided that every formula
\begin{equation*}
  \Exists v\bigwedge\Sigma
\end{equation*}
is equivalent, \emph{modulo} $T$, to an open formula, where now
$\Sigma$ is a set of atomic formulas.

Using this criterion, we shall show that $\TO^*$ admits
quantifier-elimination:

\begin{theorem}
  $\TO^*$ admits full elimination of quantifiers.
\end{theorem}

\begin{proof}
Let $\Sigma$ be a finite, non-empty set of atomic formulas (in the
signature $\{<\}$).
Let $X$ be the set of variables appearing in
formulas in $\Sigma$; that is,
\begin{equation*}
  X=\bigcup_{\alpha\in\Sigma}\fv{\alpha}.
\end{equation*}
  Then $X$ is a finite non-empty set; say 
\begin{equation*}
  X=\{x_0,\dots,x_{n}\}.
\end{equation*}
Suppose $\str A$ is an $\lang$-structure, and $\tuple a\in A^{n+1}$.  If
$\alpha$ is an atomic formula of $\lang$ with variables from $X$,
we can let $\alpha(\tuple a)$ be the result of replacing each $x_i$ in
$\alpha$ with $a_i$.  Then we can let
\begin{equation*}
  \Sigma(\tuple a)=\{\alpha(\tuple a):\alpha\in\Sigma\}.
\end{equation*}
Suppose in fact 
\begin{equation*}
  \str A\models\TO\cup\{\bigwedge\Sigma(\tuple a)\}.
\end{equation*}
Let us define
  $\Sigma_{(\str A,\tuple a)}$ as the set of atomic formulas $\alpha$
  such that $\fv{\alpha}\included X$ and $\str A\models\alpha(\tuple
  a)$.  Then
  \begin{equation*}
    \Sigma\included\Sigma_{(\str A,\tuple a)}.
  \end{equation*}
Moreover, once $\Sigma$ has been chosen, \emph{there are only finitely
  many possibilities for the set $\Sigma_{(\str A,\tuple a)}$.}  Let
  us list these possibilities as
  \begin{equation*}
    \Sigma_0,\dots,\Sigma_{m-1}.
  \end{equation*}
Now, possibly $m=0$ here.  In this case,
\begin{equation*}
  \TO\models(\Exists v\bigwedge\Sigma\iff v\neq v),
\end{equation*}
so we are done.
Henceforth we may assume $m>0$.
If $\str B\models\TO\cup\{\bigwedge\Sigma(\tuple b)\}$, then
\begin{equation*}
  \str B\models\bigwedge\Sigma_i(\tuple b)
\end{equation*}
for some $i$ in $m$.
Therefore
\begin{equation*}
  \TO\models(\bigwedge\Sigma\iff\bigvee_{i<m}\bigwedge\Sigma_{i}),
\end{equation*}
and hence
\begin{equation*}
  \TO\models(\Exists v\bigwedge\Sigma\iff \bigvee_{i<m}\Exists
  v\bigwedge\Sigma_i). 
\end{equation*}
Therefore, for our proof of quantifier-elimination, we may assume that
$\Sigma$ \emph{is} one of the sets $\Sigma_{(\str A,\tuple a)}$ (so
that, in particular, $m=1$).

Now partition $\Sigma$ as $\Gamma\cup\Delta$, where no formula in
$\Gamma$, but every formula in $\Delta$, contains $v$.  
There are two extreme possibilities:
\begin{mylist}
  \item
Suppose $\Gamma=\emptyset$.  Then $X=\{v\}$ (since if $x\in
X\setminus\{v\}$, then $(x=x)\in\Gamma$).   Also,
$\Sigma=\Delta=\{v=v\}$, so
\begin{equation*}
  \models(\Exists v\bigwedge\Sigma\iff v=v),
\end{equation*}
and we are done in this case.
\item
Suppose $\Delta=\emptyset$.  Then $v\notin X$, and
\begin{equation*}
  \models(\Exists v\bigwedge\Sigma\iff\bigwedge\Sigma),
\end{equation*}
so we are done in \emph{this} case.
\end{mylist}
Henceforth, suppose neither $\Gamma$ nor $\Delta$ is empty.
Then
\begin{equation*}
  \models(\Exists v\bigwedge\Sigma\iff\bigwedge\Gamma\land\Exists
  v\bigwedge\Delta). 
\end{equation*}
We shall show that 
\begin{equation}\label{eqn:goal}
  \TO^*\models(\Exists
v\bigwedge\Sigma\iff\bigwedge\Gamma),
\end{equation}
 which will complete the proof.  To show \eqref{eqn:goal}, it is
 enough to show
 \begin{equation*}
   \TO^*\models(\bigwedge\Gamma\to\Exists v\bigwedge\Delta).
 \end{equation*}
But this follows from the definition of $\TO^*$:

Indeed, remember
that $\Sigma$ is $\Sigma_{(\str A,\tuple a)}$.  Hence, for all $i$ and
$j$ in $n+1$, we have
\begin{gather*}
  a_i<a_j\Iff (x_i<x_j)\in\Sigma;\\
a_i=a_j\Iff (x_i=x_j)\in\Sigma.
\end{gather*}


We have $v\in X$.  We can relabel the elements of $X$ as necessary so
that $v$ is $x_{n}$ and
\begin{equation*}
  a_0\leq\dots\leq a_{n-1}.
\end{equation*}
(Here, $a_i\leq a_{i+1}$ means $a_i<a_{i+1}$ or $a_i=a_{i+1}$ as
usual.)  Suppose $\str 
B\models\TO^*$, and $B^n$ contains $\tuple b$ such that $\str
B\models\bigwedge\Gamma(\tuple b)$.  We have to show that there is $c$
in $B$ such that $\str B\models\bigwedge\Delta(\tuple b,c)$.
Now, for all $i$ and $j$ in $n$, we have
\begin{gather*}
  b_i<b_j\Iff a_i<a_j;\\
b_i=b_j\Iff a_i=a_j.
\end{gather*}
Because $\str B$ is a model of $\TO^*$ (and not just $\TO$), we can
find $c$ as needed according to the relation of $a_n$ with the other
$a_i$: 
\begin{mylist}
  \item
If $a_n=a_i$ for some $i$ in $n$, then let $c=b_i$.
\item
If $a_{n-1}<a_n$, then let $c$ be greater than $b_{n-1}$.
\item
If $a_n<a_0$, then let $c$ be less than $b_0$.
\item
If $a_k<a_n<a_{k+1}$, then we can let $c$ be such
that $b_k<c<b_{k+1}$.
\end{mylist}
This completes the proof that $\TO^*$ admits quantifier-elimination.
\end{proof}

We have proved more than quantifier-elimination: we have
shown that, \emph{modulo} $\TO^*$, the formula $\Exists
v\bigwedge\Sigma$ is equivalent to $v\neq v$ or $v=v$ or an open
formula \emph{with the same free variables as $\Exists
  v\bigwedge\Sigma$}.  In the proof, we introduced $v\neq v$ simply
as a formula $\phi$ such that $\str A\not\models\phi$ for every
structure $\str A$.  Such a formula corresponds to a nullary Boolean
connective, namely an \defn{absurdity} (the negation of a validity).
We used $0$ as such a connective; but let us now use $\bot$.

Likewise, instead of $v=v$, we can use, as a validity, the nullary
Boolean connective $\top$.  From the last proof, therefore, we have: 

\begin{porism}
In the signature $\{<\}$, with the nullary connectives $\bot$ and
  $\top$ allowed, every formula is equivalent \emph{modulo} $\TO^*$ to
an open formula with the same free variables.
\end{porism}

In a signature of first-order logic without constants, an open
\emph{sentence} consists
entirely of Boolean connectives, with no propositional variables; so
it is either an absurdity or a validity.
As a consequence, we have:

\begin{theorem}
  $\TO^*$ is a complete theory.
\end{theorem}

\begin{proof}
  By the porism, every \emph{sentence} is equivalent to an open
  \emph{sentence}; as just noted, such a sentence is an absurdity or a
  validity.  Suppose $\TO^*\models(\sigma\iff\bot)$.  But
  $\models(\sigma\iff\bot)\iff \lnot\sigma$; so
  $\TO^*\models\lnot\sigma$.  Similarly, if
  $\TO^*\models(\sigma\iff\top)$, then $\TO^*\models\sigma$.  Hence,
  for all sentences $\sigma$, if $\TO^*\not\models\sigma$, then
  $\TO^*\models\lnot\sigma$.  Therefore $\TO^*$ is complete by
  \bref{lem:complete}. 
\end{proof}

\end{document}

