%! TEX root = LC.tex
% vim: tw=50
% 20/11/2024 11AM

\begin{fcdefn}[Godel numbering]
  \glsnoundefn{Gn}{G\"odel numbering}{G\"odel
  numberings}%
  \label{defn:2.1.23}
  % Definition 2.1.23
  Let $L$ be a first-order language. A G\"odel
  numbering is an injection $L \injto \Nbb$ that
  is:
  \begin{cenum}[(1)]
    \item Computable (assuming some notion of
      computability for strings of symbols over a
      finite alphabet);
    \item Its image is a recursive subset of
      $\Nbb$;
    \item Its inverse (where defined) is also
      computable.
  \end{cenum}
\end{fcdefn}

\begin{notation*}
  \glssymboldefn{Gn}%
  We will use $\left\lceil \varphi
  \right\rceil$ to be the \gls{Gn} of an element
  of $L$, for some fixed choice of \gls{Gn}.
\end{notation*}

One way: assign a unique number $n_s$ to each
symbol $s$ in your finite alphabet $\sigma$. We
can then define
\[
  \Gn{s_0 \ldots s_k}
  \defeq \sum_{i = 0}^{k} (n_{s_i} + 1)
.\]

\begin{remark*}
  We can also encode proofs: add a symbol $\#$ to
  the alphabet and code a proof with lines
  $\varphi_0, \ldots, \varphi_k$ as $\Gn{\varphi_0
  \# \varphi_1 \# \cdots \# \varphi_k}$.
\end{remark*}

\begin{fcthm}[]
  \label{thm:2.1.24}
  % Theorem 2.1.24
  Assuming:
  - $f$ is \gls{ldef}
  Then:
  $f$ is \gls{pr}.
\end{fcthm}

\begin{proof}[Proof (sketch)]
  Assign \glsref[Gn]{G\"odel numbers} $\Gn{\tau}$
  to \glspl{ulterm} $\tau$. We can then consider a
  \gls{prf} in $N(t)$ that on input $t$ checks if
  $t$ is the \gls{Gn} of a \gls{ulterm} $\tau$,
  and returns the \gls{Gn} of its \gls{bnf} if it
  exists (undefined otherwise).

  We also have \glspl{prf} that convert $n$ to
  $\Gn{c_n}$ and vice-versa. Finally, say $f$ is a
  partial function defined by a \gls{ulterm} $F$.
  We can compute $f(\ol{m})$ by first converting
  \glspl{cn} to their \glsref[Gn]{G\"odel
  numbers}, then append the result to $\Gn{F}$ in
  order to get $\Gn{F \cn_{n_1} \ldots \cn_{n_k}}$,
  then apply $N$.

  If $f$ is defined on $\ol{n}$, then $F \cn_{n_1}
  \ldots \cn_{n_k}$ has a \gls{bnf}, and what we
  get is $\Gn{\cn_{f(\ol{n})}}$. Otherwise
  $N(\Gn{F\cn_{n_1} \ldots \cn_{n_k}})$ is not
  defined.

  We finish by going back from $\Gn{c_{f(\ol{n})}}$
  to $f(\ol{n})$.
\end{proof}

\subsection{Decidability in Logic}

\glsadjdefn{rec}{recursive}{set}%
\glsadjdefn{decle}{decidable}{set}%
\glsnoundefn{dec}{decide}{decides}%
Recall that a subset $X \subseteq \Nbb$ is
\emph{recursive} (or \emph{decidable}) if its
characteristic map is \gls{tr}.

\begin{fcdefn}[Recursively enumerable]
  \glsadjdefn{renum}{recursively enumerable}{set}%
  We say that $X \subseteq \Nbb$ is
  \emph{recursively enumerable} if any of the
  following are true:
  \begin{cenum}[(1)]
    \item $X$ is the image of some \gls{pr} $f :
      \Nbb \to \Nbb$;
    \item $X$ is the image of some \gls{tr} $f :
      \Nbb \to \Nbb$;
    \item $X = \dom f$, for $f$ a \gls{pr} $f :
      \Nbb \to \Nbb$.
  \end{cenum}
\end{fcdefn}

Note, if $X$ and $\Nbb \setminus X$ are both
\gls{renum}, then $X$ is \gls{rec}. Note that the
set of \gls{prf} is countable, so we can fix an
enumeration $\{f_0, f_1, \ldots\}$.

\begin{example}
  \label{eg:2.2.2}
  % Example 2.2.2
  The subset $W = \{(i, x) : \text{$f_i$ is
  defined on $x$}\} \subseteq \Nbb^2$ is
  \gls{renum}, but not \gls{rec}.
\end{example}

\begin{fcdefn}[Recursive / decidable language]
  \glsadjdefn{recl}{recursive}{language}%
  \glsadjdefn{dect}{decidable}{theory}%
  \label{defn:2.2.3}
  % Definition 2.2.3
  A language $L$ is \emph{recursive} if there is
  an algorithm that \glspl{dec} whether a string of
  symbols is an $L$-formula.

  An $L$-theory $T$ is
  \emph{recursive} if membership in $T$ is
  \gls{decle} (for $L$-sentences).

  An $L$-theory $T$ is decidable if there is an algorithm for
  \glsref[dec]{deciding} whether $T \models
  \varphi$.
\end{fcdefn}

We will work with \gls{recl} from now on.

\begin{fcthm}[Craig]
  \label{thm:2.2.4}
  Assuming:
  - $T$ is a first order theory with a \gls{renum}
  set of axioms
  Then:
  $T$ admits a \gls{rec} axiomatisation.
\end{fcthm}

\begin{proof}
  By hypothesis, there is a \gls{tr} $f$ such that
  the axioms of $T$ are exactly $\{f(n) : n \in
  \Nbb\}$.

  \textbf{Idea:} Replace $f(n)$ with something
  equivalent, but with a shape that lets us
  retrieve $n$. Let
  \[
    \psi_n = \bigwedge_{k = 1}^n (f(n))
  \]
  for each $n$ and
  \[
    T^* \defeq \{\psi_n : n \in \Nbb\}
  .\]
  Then $T^*$ has the same deductive closure as
  $T$. As formulae have finite length, we can
  check in finite time whether some $\chi$ is
  $f(0)$ or some $\bigwedge_{k = 1}^n A_n$. By
  appropriate use of brackets, we can make sure
  that such an $n$ is ``unique'' if we are working
  with some $\psi_n$.
