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

\begin{proof}
  \phantom{}
  \begin{enumerate}[(1)]
    \item Give $H_{\pnot \pnot} \defeq \{x \in H :
      \pnot \pnot x = x\}$ the inherited order, so
      that $\meet$, $\himplies$, $\bot$ and $\top$
      (which are preserved by $\pnot \pnot$)
      remain the same. We just need to define
      disjunctions in $H_{\pnot \pnot}$ properly.

      Define $a \vee_{\pnot \pnot} b \defeq \pnot
      \pnot (a \join b)$ in $H$. It is easy to
      show that this gives $\sup \{a, b\}$ in
      $H_{\pnot \pnot}$ (as $\pnot \pnot$
      preserves order), so $H_{\pnot \pnot}$ is a
      \gls{ha}.

      As every element of $H_{\pnot \pnot}$ is
      regular (i.e. $\pnot \pnot x = x$), it is a
      \gls{ba} (see Example Sheet 2).
    \item Given a \gls{hh} $g : H \to B$, where
      $B$ is a \gls{ba}, define $g_{\pnot \pnot} :
      H \to B$ as $g_{H_{\pnot \pnot}}$. It
      clearly preserves $\bot, \top, \meet,
      \himplies$, as those operations in $H_{\pnot
      \pnot}$ are inherited from $H$.

      But we also have
      \begin{align*}
        g_{\pnot \pnot}(a \join_{\pnot \pnot} b)
        &= g|_{H_{\pnot \pnot}} (\pnot \pnot (a
        \join b)) \\
        &= \pnot \pnot (g(a) \join g(b)) \\
        &= g(a) \join g(b)
        &&\text{$B$ is \glsref[ba]{Boolean}} \\
        &= g_{\pnot \pnot} (a) \join
        g_{\pnot\pnot}(b)
      \end{align*}
      Thus $g_{\pnot \pnot}$ is a morphism of
      \glspl{ba}. Note that any $x \in H$ provides
      an element $\pnot \pnot x \in H_{\pnot
      \pnot}$, since $\pnot \pnot \pnot \pnot x =
      \pnot \pnot x$ in $H$. Additionally,
      \begin{align*}
        g_{\pnot \pnot}(\pnot \pnot x)
        &= g(\pnot \pnot x) \\
        &= \pnot \pnot g(x) \\
        &= g(x)
      \end{align*}
      for all $x \in H$ (as $g(x)$ is in a
      \gls{ba}).

      Now, if $h : H_{\pnot \pnot} \to
      B$ is a morphism of \glspl{ba} with $g(x) =
      h(\pnot \pnot x)$ for all $x \in H$, then
      $h(a) = h(\pnot \pnot a) = g(a) = g_{\pnot
      \pnot}(a)$ for all $a \in H$. So $g_{\pnot
      \pnot}$ is unique with this property.
      \qedhere
  \end{enumerate}
\end{proof}

In particular, if $S$ is a set, then
$\F^{\text{Heyt}}(S)_{\pnot \pnot} \cong
\F^{\text{Bool}}(S)$.

\begin{fcthm}[Glivenko's Theorem]
  % Theorem 1.5.4
  Assuming:
  - $\varphi$ and $\psi$ are propositions
  Then:
  \begin{iffc}
    \lhs
    $\syn_{\text{CPC}} \varphi \to \psi$
    \rhs
    $\syn_{\text{\gls{ipc}}} \pnot \pnot \varphi
    \to \pnot \pnot \psi$.
  \end{iffc}
\end{fcthm}

\begin{iffproof}
  \rightimpl If $\syn_{\text{CPC}} \varphi \to \psi$, then
    $\top \le \varphi \to \psi$ in
    $\F^{\text{Bool}}(L) =
    \F^{\text{Heyt}}(L)_{\pnot \pnot}$. As the
    inclusion $i : \F^{\text{Heyt}}(L)_{\pnot \pnot}
    \to \F^{\text{Heyt}}(L)$ strictly preserves
    $\le$ and $\to$, it follows that
    \begin{align*}
      i(\top)
      &\le i(\varphi \to \psi) \\
      &= \varphi \to \psi \\
      &= \pnot \pnot (\varphi \to \psi)
      &&\text{as $\varphi \to \psi \in
      \F^{\text{Heyt}}(L)_{\pnot \pnot}$} \\
      &= \pnot \pnot \varphi \to \pnot \pnot \psi
    \end{align*}
    in $\F^{\text{Heyt}}(L)$, so
    $\syn_{\text{\gls{ipc}}} \pnot \pnot \varphi \to
    \pnot \pnot \psi$.
  \leftimpl Obvious.
\end{iffproof}

\begin{fccoro}[]
  % Corollary 1.5.5
  Assuming:
  - $\varphi$ a proposition
  Then:
  \begin{iffc}
    \lhs
    $\syn_{\text{CPC}} \varphi$
    \rhs
    $\syn_{\text{\gls{ipc}}} \varphi^N$.
  \end{iffc}
\end{fccoro}

\begin{proof}
  Induction over the complexity of formulae.
\end{proof}

\begin{fccoro}[]
  % Corollary 1.5.6
  \begin{iffc}
    \lhs
    CPC is inconsistent
    \rhs
    \gls{ipc} is inconsistent.
  \end{iffc}
\end{fccoro}

\begin{iffproof}
  \rightimpl If CPC is inconsistent, then there is $\varphi$
    such that $\syn_{\text{CPC}} \varphi$ and
    $\syn_{\text{\gls{ipc}}} \pnot \varphi$. But
    then $\syn_{\text{\gls{ipc}}} \pnot \pnot
    \varphi$ and $\syn_{\text{\gls{ipc}}} \pnot
    \varphi$, so $\syn_{\text{\gls{ipc}}} \bot$.
  \leftimpl Obvious. \qedhere
\end{iffproof}

\newpage
\section{Computability}

``If a `religion' is defined to be a system of
ideas that contains improvable statements, then
G\"odel taught us that mathematics is not only a
religion; it is the only religion that can prove
itself to be on.'' -- John Barrow

\subsection{Recursive functions and
\texorpdfstring{$\lambda$}{λ}-computability}

\begin{fcdefn}[Partial recursive function]
  \glsnoundefn{prf}{partial recursive
  function}{partial recursive functions}%
  \glsadjdefn{pr}{partial recursive}{function}%
  \glsadjdefn{tr}{total recursive}{function}%
  \glsnoundefn{proj}{projection}{projections}%
  \glsnoundefn{succ}{successor}{successors}%
  \glsnoundefn{zero}{zero}{NA}%
  \glsnoundefn{compon}{composition}{compositions}%
  \glsnoundefn{primrec}{primitive
  recursion}{primitive recursions}%
  \glsnoundefn{primrecive}{primitive
  recursive}{primitive}%
  \glsnoundefn{minon}{minimisation}{minimisations}%
  % Definition 2.1.1
  The class of recursive functions is the smallest
  class of partial functions of the form $\Nbb^k \to \Nbb$
  that contains the basic functions:
  \begin{citems}
    \item Projections: $\Pi_i^m : (n_1, \ldots,
      n_m) \mapsto n_i$;
    \item Successor: $S^+ : n \mapsto n + 1$;
    \item Zero: $z : n \mapsto 0$
  \end{citems}
  and is closed under:
  \begin{citems}
    \item Compositions: if $g : \Nbb^k \to \Nbb$
      is partial recursive and so are $h_1, \ldots, h_k :
      \Nbb^m \to \Nbb$, then the function $f :
      \Nbb^m \to \Nbb$ given by $f(\ol{n}) =
      g(h_1(\ol{n}), \ldots, h_k(\ol{n}))$ is
      partial recursive.
    \item Primitive recursion: Given partial
      recursive functions $g : \Nbb^m \to \Nbb$
      and $h : \Nbb^{m + 2} \to \Nbb$, the
      function $f : \Nbb^{m + 1} \to \Nbb$ defined
      by
      \[
        \begin{cases}
          f(0, \ol{n}) \defeq g(\ol{n}) \\
          f(k + 1, \ol{n}) \defeq h(f(k, \ol{n}),
          k, \ol{n})
        \end{cases}
      \]
    \item Minimisation: Suppose $g : \Nbb^{m + 1} \to \Nbb$
      is partial recursive. Then the
      function $f : \Nbb^m \to \Nbb$ that maps
      $\ol{n}$ to the least $n$ such that $g(n,
      \ol{n}) = 0$ (if it exists) is partial recursive.

      Notation: $f(\ol{n}) = \mu n . g(n, \ol{n})
      = 0$.
  \end{citems}
  The class of functions produced by the same
  conditions but excluding minimisation is called
  the class of \emph{primitive recursive} functions.

  A partial recursive function that is defined
  everywhere is called a \emph{total recursive}
  function.
\end{fcdefn}
