%! TEX root = LST.tex
% vim: tw=50
% 15/02/2024 09AM

  \item \glsref[theory]{Theory} of
    \courseref[rings]{GRM} with $1$:
    \glsref[folang]{Language}:
    \[ \pOmega = \{+, 0, -, \times , 1\}, \quad
    \pPi = \emptyset ,\]
    with \glspl{arity} $2, 0, 1, 2, 0$.
    \glsref[theory]{Theory}:
    \begin{align*}
      &(\pforall x)(\pforall y)(\pforall z)((x +
      y + z = x + (y + z)) \\
      &(\pforall x)(x + 0 = x \pand 0 + x = x) \\
      &(\pforall x)((x + (-x) = 0) \pand
      ((-x) + x = 0)) \\
      &(\pforall x)(\pforall y) (x + y = y + x)
      \\
      &(\pforall x)(\pforall y)(\pforall
      z)((x \times y) \times z = x \times (y \times z)) \\
      &(\pforall x)(1 \times x \pand x \times 1 =
      x) \\
      &(\pforall x)(\pforall y)(\pforall z)((x
      \times (y + z) = x \times y + x \times z) \pand ((x + y)
      \times z = x \times z + y \times z))
    \end{align*}
    The \glspl{model} are exactly rings with
    $1$.
  \item Fields: \glsref[folang]{Language}: same as for rings with
    $1$. \glsref[theory]{Theory}: same as for
    rings with $1$, plus the additional
    \glspl{sent}:
    \begin{align*}
      &(\pforall x)(\pforall y)(x \times y = y
      \times x) \\
      &\pnot (0 = 1) \\
      &(\pforall x)(\pnot (x = 0) \pimpl
      (\pexists y)(xy = 1))
    \end{align*}
    The \glspl{model} are exactly fields.
  \item \courseref[Graph theory]{GT}: \glsref[folang]{Language}:
    \[ \pOmega = \emptyset, \quad \pPi = \{a\} \]
    with \gls{arity} $2$ ($a$ will mean ``is
    adjacent to''). \glsref[theory]{Theory}:
    \begin{align*}
      &(\pforall x)\pnot (a(x, x)) \\
      &(\pforall x)(\pforall y)(a(x, y) \pimpl a(y,
      x))
    \end{align*}
    The \glspl{model} are exactly graphs.
  \item Propositional theories:
    \glsref[folang]{Language}:
    \[ \pOmega = \emptyset, \quad \pPi =
    \text{some set} \]
    with $\arity(p) = 0 ~\forall p \in \pPi$. A
    \gls{struc} is a non-empty set $A$ together
    with $p_A \subset A^0$ for all $p \in \pPi$
    (equivalently $p_A : A^0 \to \{0, 1\}$,
    equivalently $p_A \in \{0, 1\}$, since $A^0$
    is a set of size $1$). A
    \gls{struc} is a non-empty set $A$ together
    with a function $v : \pPi \to \{0, 1\}$. Every
    $p \in \pPi$ is an \gls{atf}.
    \glsref[form]{Formulae} without \glspl{var} are
    precisely elements of $\propL(\pPi)$ as
    defined in \cref{sec1}, i.e. they are
    \glspl{prop} in $\pPi$.

    \glsref[interpf]{Interpreting} these in a
    \gls{struc} $A$ is just a function $v :
    \propL(\pPi) \to \{0, 1\}$ obtained from $v :
    \pPi \to \{0, 1\}$ as in \cref{sec1}, i.e. a
    \gls{vtion}. A \emph{propositional theory} is
    a set $S$ of \glspl{form} not using
    \glspl{var}. A \gls{model} for $S$ is a
    non-empty set $A$ with a \gls{vtion} $v :
    \propL(\pPi) \to \{0, 1\}$ such that
    $\propv(s) = 1 ~\forall s \in S$ (here $A$ is
    irrelevant).
\end{enumerate}

\begin{flashcard}[sementail-sentence-defn]
\begin{definition*}[Semantic entailment of
  sentences]
  \glssymboldefn{ssementails}{$\models$}{$\models$}
  \cloze{For a set $S$ of \glspl{sent} and a \gls{sent}
  $t$ (in a \glsref[folang]{first-order language} $L$), we say \emph{$S$
  (semantically) entails $t$} if $t$ is satisfied
  in every \gls{model} of $S$. In this case we
  write $S \models t$.}
\end{definition*}
\end{flashcard}

\begin{example*}
  \phantom{}
  \item Let $S$ be the \gls{theory} of groups (in
    the \gls{folang} of groups). Then
    \[ S \sementails ((\pforall x)(x \cdot x = e)
    \pimpl (\pforall x)(\pforall y)(xy = yx)) \]
  \item Let $S$ be the \gls{theory} of fields (in
    the \gls{folang} of rings with $1$). Then
    \[ S \sementails ((\pforall x)(\pnot (x = 0)
    \pimpl (\pforall y)(\pforall z)((xy = 1 \pand
    xz = 1) \pimpl (y = z))) \]
\end{example*}

\vspace{-1em}
Next, we want to define $S \sementails t$ for
\glspl{form}.

\begin{example*}
  Let $T$ be the \gls{theory} of fields (in the
  \gls{folang} of rings with $1$). Let $S = T \cup
  \{\pnot (x = 0)\}$, $t = (\pexists y)(xy = 1)$.
  Does $S \sementails t$? Yes.

  Suppose $F$ is a \gls{struc} in which all
  members of $S$ are true. So $F$ is a field and
  for $u = \pand (x = 0)$,
  \[ u_F = \{a \in F \mid a \neq 0_f\} = F ,\]
  contradiction. Also, we'll soon define ``$S
  \synentails t$'', then $S \synentails t$ if and
  only if $T \synentails \pnot(x = 0) \pimpl
  (\pexists y)(xy = 1)$.
\end{example*}

\begin{flashcard}[sementail-formula-defn]
\begin{definition*}[Semantic entailment of
  formulae]
  \glssymboldefn{fsementails}{$\models$}{$\models$}
  \cloze{Let $S$ be a set of \glspl{form} and $t$ be a
  \gls{form} in a \gls{folang} $L$. For every
  \gls{var} that occurs \gls{freev} in $S \cup
  \{t\}$, introduce a constant $c_x$ (add it to
  $\pOmega$). Let $L'$ be our new \gls{folang}.
  For a \gls{form} $p$, let $p'$ be the \gls{form}
  obtained from $p$ by replacing \gls{freev}
  occurences of $x$ in $p$ by $c_x$, for every
  $x$. Let $S' = \{s' \st s \in S\}$. Say
  \emph{$S$ (semantically) entails $t$}, written
  $S \models t$, if $S' \models t'$.}
\end{definition*}
\end{flashcard}

\begin{flashcard}[substitution-defn]
\begin{notation*}[Substitutions]
  \glssymboldefn{subst}{$p[t / x]$}{$p[t / x]$}
  \cloze{If $x$ occurs \gls{freev} in a \gls{form} $p$
  and $t$ is a \gls{term} that contains no
  \gls{var} that occurs \gls{bound} in $p$, we let
  $p[t / x]$ be the \gls{form} obtained from $p$
  by replacing \gls{free} occurences of $x$ in $p$
  by $t$.}
\end{notation*}
\end{flashcard}

\begin{example*}
  In the \gls{folang} of groups: let $p =
  (\pforall y)(mxx = y)$. Then:
  \begin{align*}
    &t = mzz
    && \subst p[t / x] = (\pforall y)(mmzzmzz = y)
    \\
    &t = mzy
    && \text{cannot be used} \\
    &t = mxx
    && \subst p[t / x] = (\pforall y)(mmxxmxx = y)
  \end{align*}
\end{example*}

\subsubsection*{Syntactic entailment}

\begin{flashcard}[fo-axioms-defn]
\begin{definition*}[Axioms of first-order logic]
  \phantom{}
  \cloze{
  \begin{enumerate}[(A1)]
    \item[(A1)] $p \impl (q \impl p)$ ($p, q$ are
      \glspl{form}).
    \item[(A2)] $(p \impl (q \impl r)) \impl ((p
      \impl q) \impl (p \impl r))$ ($p, q, r$ any
      \glspl{form}).
    \item[(A3)] $\pnot \pnot p \impl p$ ($p$ any
      \gls{form}).
    \item[(A4)] $(\pforall x)(x = x)$.
    \item[(A5)] $(\pforall x)(\pforall y)((x = y)
      \pimpl (p \pimpl \subst p[y / x]))$ ($x, y$
      distinct \glspl{var}, $p$ a \gls{form}, $x
      \in \FV(p)$, $y$ does not occur \gls{bound}
      in $p$).
    \item[(A6)] $((\pforall x) p) \pimpl \subst
      p[t / x]$ ($p$ \gls{form} $x \in \FV(p)$,
      $t$ a \gls{term}, no variable in $t$ occurs
      \gls{bound} in $p$).
    \item[(A7)] $(\pforall x)(p \pimpl q) \pimpl
      (p \impl (\pforall x) q)$ ($p, q$
      \glspl{form}, $x \notin \FV(p)$, $x \in
      \FV(q)$).
  \end{enumerate}}
\end{definition*}
\end{flashcard}

\begin{note*}
  Every axiom is a \gls{taut} ($t$ is a \gls{taut}
  if $\emptyset \fsementails t$, i.e. $t$ holds in
  every \gls{struc}).
\end{note*}

\begin{flashcard}[rules-of-deduc-first-order]
\subsubsection*{Rules of deduction}

\cloze{
\begin{enumerate}[Modus ponens (MP)]
  \item[Modus ponens (MP)] From $p$ and $p \impl
    q$, can deduce $q$.
  \item[Generalisation (Gen)] From $p$ such that
    $x \in \FV(p)$, can deduce $(\pforall x) p$
    provided $x$ did not occur \gls{free} in any
    of the premises used in the proof of $p$.
\end{enumerate}
}
\end{flashcard}
