\documentclass[12pt]{article}
\usepackage{amssymb, amsmath}

\textheight 23cm
\textwidth 6.5in
\oddsidemargin -.1in
\evensidemargin -.1in
\topmargin -1.5cm

\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\labelenumi}{\theenumi)}

\newtheorem{exer}{Exercise}

\newcommand{\eqsyn}{=_{syn}}
\newcommand{\ra}{\rightarrow}
\newcommand{\SL}{{\cal L}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\underN}{\underline{\mathbb{N}}}
\newcommand{\stand}{\underline{\mathbb{N}}}
\newcommand{\calM}{{\cal M}}
\newcommand{\calL}{{\cal L}}
\newcommand{\LA}{{\cal L}_{A}}
\newcommand{\LAL}{{\cal L}_{A,\leq}}
\newcommand{\calP}{{\cal P}}
\newcommand{\ld}{{\overline{\:.\,}}}
\newcommand{\dl}{{\frac{\:.\:}{}}}
\newcommand{\emp}{\varnothing}
\newcommand{\RPA}{R_{PA}}


\def\Konig{K\"{o}nig}
\def\Godel{G\"{o}del}
\def\Equiv{\Longleftrightarrow}
\def\PA{{\bf PA}}
\def\TA{{\bf TA}}
\def\RA{{\bf RA}}
\def\RAL{{\bf RA_\leq}}

\input{prooftree}

\parskip 2ex
\parindent 0ex

\setcounter{page}{92}


\begin{document}

{\large\bf CS4995}\hspace{.8in}{\large\bf Notes} (S. Cook and T. Pitassi)
\hfill {\large\bf Fall, 2022}

\bigskip

\begin{center}
{\Large\bf \Godel's Incompleteness Theorems}
\end{center}

In the early 1900's there was a drive to find adequate axiomatic
foundations for mathematics.  Russell's paradox (If S is the set
of all sets that do not contain themselves, does S contain itself?)
helped to point out how difficult it is to find a good axiom system
for set theory.  David Hilbert, the most prominent mathematician
of the time, proposed a program of finding axiom systems, and proving
them consistent by ``finitary'' means; that is finite combinatorial methods
that do not involve questionable set-theoretic constructions.
\Godel's 1931 paper effectively destroyed hopes for the
success of this program.
\Godel\ proved that \PA\ cannot even prove its own consistency,
let alone the consistency of a more powerful system such as set theory.

In his 1931 paper \Godel\ proved two results (his two ``incompleteness
theorems'').   The second incompleteness theorem states that
the consistency of \PA\ cannot be proved in \PA.  Here we prove
the first incompleteness theorem, and outline the proof of the
second.  (In fact, \Godel\ did not include a complete proof of his
second theorem, but complete proofs now appear in text and reference books.)

Here we consider only the theory \PA, although the first incompleteness
theorem applies to any consistent
extension of \RA, and the second incompleteness
theorem applies to ``nice'' theories of arithmetic, which in general
must include some form of induction among their axioms.

The first theorem formulates a sentence $G$ which asserts ``I am not
provable'', and the theorem states that indeed $G$ is not provable
in \PA, so $G$ is true.  By soundness of \PA, $\neg G$ is also not
provable in \PA.  The method of constructing $G$ follows the method
of constructing the sentence ``I am false'' in the proof of
Tarski's Theorem.  (Historically, \Godel's theorems came first.)

Let $\Gamma$ be the set of axioms of \PA.  Thus $\Gamma$ consists of
P1,...,P6, together with the induction axioms. 
Let $Proof(x,y)$ be the recursive relation
``$y$ codes an $LK-\Gamma$ proof of the sentence coded by $x$''.
Thus $\exists y Proof(n,y)$ holds
iff $n = \#A$, where $A$ is a sentence provable in \PA.
Let $d(x)$ be the diagonal substitution function (defined on page 89).
Recall that $d(n) = sub(n,n) = \#A(s_n)$ when $\#A(x)=n$.
Then $d(x)$ is total and computable, so
the relation $S(x)$ is r.e., where
$$          S(x)=\exists yProof(d(x),y)         $$

Let $A(x)$ be an $\exists\Delta_0$ formula which represents $S(x)$
in \RA\ (and hence in \PA).  Then for all $n\in\NN$,
\begin{equation}
\label{first}
  \exists yProof(d(n),y) \quad   \Leftrightarrow \quad
  \PA\vdash A(s_n)
\end{equation}

Let $e=\#\neg A(x)$, so
\begin{equation}
\label{de}
  d(e) = \#\neg A(s_e)  
\end{equation}
Let
$$ G \eqsyn \neg A(s_e)  $$
so $\#G = d(e)$.  Since $A(x)$ represents the relation 
$\exists yProof(d(x),y)$,
it follows that the formula $\neg A(s_e)$ asserts that the formula
whose number is $d(e)$ is not provable in \PA.  But that formula
is $\neg A(s_e)$, so this formula, i.e. the formula $G$, asserts
``I am not provable''.

{\bf \Godel's First Incompleteness Theorem:}  If \PA\ is consistent,
then \PA\ does not prove $G$.

{\bf Remark:}
Note that in this course we take for granted that \PA\ is consistent.
The reason that \Godel\ did not, is that there is no known ``finitary''
proof that \PA\ is consistent.  Our proof of consistency involves the
assertion that \PA\ is sound.  That is,
all of the axioms of \PA\ are true in the standard
model $\underN$, and hence all logical consequences of these axioms
are true in $\underN$.  But this proof is not finitary, because
it involves an induction on a statement mentioning the infinite set $\NN$.

{\bf Proof:}  
We prove the contrapositive.  Suppose that $\PA\vdash G$, i.e.
$\PA\vdash \neg A(s_e)$.  Then sentence number $d(e)$ is provable, so
$\exists yProof(d(e),y)$ holds.  
Hence $\PA\vdash A(s_e)$, by the left-to-right direction of (\ref{first}).
Thus $\PA$ proves both a formula and its negation, so it is inconsistent.
$\Box$

The above proof is finitary, in that it involves only finite objects.
Later we will argue, as \Godel\ did, that the proof can be formalized
in \PA.  It is important that the proof only uses the left-to-right
direction of (\ref{first}), since this direction is finitary:  From
a proof of the sentence whose number is $d(n)$ one can construct a proof
of the sentence $A(s_n)$.  Our proof of the converse direction of
(\ref{first}) is not finitary, since it involves the soundness of \PA.
It is not clear that \PA\ can prove this converse direction.  However,
using the right-to-left direction we can prove the following:

{\bf Proposition:}  If \PA\ is sound, then \PA\ does not prove $\neg G$.

{\bf Proof:} Suppose \PA\ proves $\neg G$; i.e. \PA\ proves $A(s_e)$.
By the right-to-left direction of (\ref{first}), this
implies $\exists yProof(d(e),y)$; that is, \PA\ proves  sentence
number $d(e)$, so \PA\ proves $\neg A(s_e)$, so \PA\ proves $G$.  Thus
\PA\ is inconsistent, and hence unsound. $\Box$

{\bf Remark:} We say that a theory $\Sigma$ is
$\omega$-{\em consistent} provided that for each formula $C(x)$,
if $\Sigma$ proves $\neg C(s_n)$ for each $n\in\NN$, then $\Sigma$
does not prove $\exists xC(x)$.  Every sound theory is $\omega$-consistent,
but not conversely.  It is not hard to see the assumption that
\PA\ is $\omega$-consistent is sufficient to prove the right-to-left
direction in (\ref{first}), and hence this assumption can replace
the stronger assumption that \PA\ is sound, in the above Proposition.

\begin{exer}
Show that there is a consistent extension of \PA\ which is not
$\omega$-consistent.
\end{exer}

{\bf Formulating consistency in \PA}

Let $B(x,y)$ be an $\exists\Delta_0$ formula which represents
$Proof(x,y)$ in \RA\ (and hence in \PA). 
Thus for each sentence $C$,
\begin{equation}
\label{second}
\PA\vdash C \quad \Leftrightarrow \quad \PA \vdash \exists yB(\#C,y)  
\end{equation}
where here (and below) we write $B(\#C,y)$ for $B(s_{\#C},y)$.

We require that the formula $B(x,y)$ represent the relation $Proof(x,y)$
in a straightforward way, so that Lemma 2 and Lemma 3 below both hold.

Recall that $A(x)$ represents the relation $\exists yProof(d(x),y)$ in \PA.
By constructing the formula $A(x)$ from 
$B(x,y)$ in a straightforward manner,
we can insure that for each $n\in\NN$
\begin{equation}
\label{nice}
\PA \vdash \quad A(s_n)\supset \exists yB(s_{d(n)},y)
\end{equation}
Note that \PA\ is consistent iff \PA\ does not prove $0\neq 0$.  Thus
we make the definition
$$  con(PA) \eqsyn \neg \exists yB(\#0\neq 0,y)   $$

{\bf \Godel's Second Incompleteness Theorem:} If \PA\ is consistent,
then \PA\ does not prove $con(PA)$.

This follows from the following Lemma:

{\bf Lemma 1:} (\Godel) $\PA \vdash\ con(PA)\supset G$

The Second Incompleteness Theorem follows immediately from the Lemma
and the First Incompleteness Theorem.

The Lemma is proved by formalizing in \PA\ the proof of the First
Incompleteness Theorem.  To see that ``$con(PA)\supset G$'' is an
accurate translation of the First Incompleteness Theorem, note that
$G$ is $\neg A(s_e)$, which asserts that formula number $d(e)$ is
not provable in \PA; i.e. $G$ asserts that $G$ is not provable in \PA.

Now we formalize the proof of the First Incompleteness Theorem in \PA.
Thus we must show that \PA\ proves the contrapositive of the formula in
Lemma 1; that is we must show  
\begin{equation}
\label{contra}
\PA \vdash \quad A(s_e)\supset \exists yB(\#0\neq0,y)
\end{equation}  
We need to formalize the left-to-right direction of (\ref{first}),
which involves formalizing the proof of Corollary 2 to the MAIN LEMMA,
page 84.  This corollary states that every true $\exists\Delta_0$
sentence $C$ is provable in \RA\ (and hence in \PA).  Thus we must show

{\bf Lemma 2}:  For each $\exists\Delta_0$ sentence $C$,
$$   \PA \vdash \quad C\supset \exists zB(\#C,z)  $$
The proof of this Lemma is the main work in the proof of the Second
Incompleteness Theorem, and will not be given here.
However we note that Lemma 2 is immediate for the case in which
$C$ is true, since then by Corollary 2 (to the MAIN LEMMA) $C$ has
a proof $\pi$ in \RA, and hence
$$  \RA \vdash B(\#C,\#\pi)  $$
because $B(x,y)$ represents $Proof(x,y)$ in \RA.
Despite this easy argument, the proof of Lemma 2 for the case in which
$C$ is false
requires formalizing the proof of Corollary 2 (and the MAIN LEMMA
itself), as mentioned above.  (Note that there are false $\exists\Delta_0$
formulas $C$ such that $\neg C$ is not provable in \PA.)

If we take $C \eqsyn A(s_e)$ in Lemma 2 we obtain 
\begin{equation}
\label{lemma2}
\PA \vdash \quad A(s_e)\supset \exists zB(\#A(s_e),z) 
\end{equation}
Now from (\ref{nice}) with $n=e$ and (\ref{de}) we obtain
\begin{equation}
\label{fromnice}
\PA \vdash \quad A(s_e)\supset \exists zB(\#\neg A(s_e),z) 
\end{equation}
Finally, (\ref{contra}) follows from (\ref{fromnice}), (\ref{lemma2}),
and the following lemma:

{\bf Lemma 3:}  For any sentence $C$,
$$ \PA\vdash \forall x\forall z[(B(\#C,x)\wedge B(\#\neg C,z)) \supset
     \exists yB(\#0\not= 0,y)]  $$

\end{document}
