%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The Lebesgue Integral}
\label{sec:lebesgue-integral}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{intro}
  This section introduces the Lebesgue integral mostly following the
  presentation in the monograph by Riesz and
  Sz.-Nagy~\cite{RieszNagy}. We deviate from this work only in two
  respects: first, we restrict the presentation to the results
  pertaining to the definition and properties of $L^p$-spaces. Second,
  we elaborate more on higher-dimensional integrals and modify the
  development of the one-dimensional case in order to be closer to
  higher dimensions.
\end{intro}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Sets of measure zero}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{intro}
  Sets of measure zero constitute one of the most important concepts
  in integration and measure theory. Odd enough, it is possible to
  define them in an elementary way, which does not require any
  advanced measure theory.
\end{intro}

\begin{definition}
  \label{def:zero-set-1}
  A subset $Z\subset \R$ is called a \textbf{set of measure zero}, if
  for any $\epsilon > 0$ there exist a finite or countable set of
  intervals $I_{k}$ such that
  \begin{gather*}
    Z \subset \bigcup_k I_{k}
    \quad\text{and}\quad
    \sum_k |I_{k}| < \epsilon.
  \end{gather*}
  We also say that the set $Z$ can be \define{covered} by a finite or
  countable union of intervals with total length less than $\epsilon$.
\end{definition}

\begin{definition}
  \label{def:zero-set-2}
  Sets of meazure zero in higher dimensions are defined in a similar
  way, replacing the set of intervals $I_k$ by cubes $Q_k$ such that
  their total volume is less than $\epsilon$.
\end{definition}

\begin{example}
  A set consisting of a single number $x\in\R$ is of measure zero,
  since for any $\epsilon>0$:
  \begin{gather*}
    \{x\} \subset \left[x-\tfrac\epsilon2,x+\tfrac\epsilon2\right].
  \end{gather*}
\end{example}

\begin{lemma}
  The finite or countable union of sets of measure zero is of measure
  zero.
\end{lemma}

\begin{proof}
  Let $\{Z_j\}_{j=1,2,\dots}$ be a finite or countable sequence of
  sets of measure zero. For each $Z_j$, let $\{I_{jk}\}$ be a set of
  intervals covering $Z_j$ and having total length less than
  $2^{-k}\epsilon$. Such a set exists according to the definition of
  a set of measure zero. Then,
  \begin{gather*}
    Z = \bigcup_j Z_j \subset \bigcup_{jk} I_{jk}
    \quad\text{and}\quad
    \sum_{jk} |I_{jk}| < \epsilon.
  \end{gather*}
  It remains to note that the index set $jk$ is at most countable.
\end{proof}

\begin{corollary}
  The set $\Q\subset \R$ of rational numbers is of measure zero, since
  it is a countable union of points.
\end{corollary}

\begin{note}
  The preceding corollary implies that a dense subset of an interval
  in $\R$ can be covered by a system of intervals without covering the
  whole interval. Definitely, a remarkable statement.
\end{note}

\begin{definition}
  \label{def:almost-everywhere}
  A property is said to hold \define{almost everywhere} on a set $M$,
  if it holds on $M$, or at least on a set $M\setminus Z$, where $Z$
  is of measure zero.
\end{definition}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Step functions and their integrals}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{definition}
  \defindex{lattice} We introduce \textbf{lattices}
  $\Q_n$\footnote{The letter $\Q$ with index always refers to a
    lattice and never to the rational numbers} of $\R^d$ consisting of
  half open cubes
  \begin{gather*}
    Q^{(n)}_{i_1,\dots,i_d} =
    \left]\tfrac{i_1}{2^n},\tfrac{i_1+1}{2^n}\right]
    \times
    \left]\tfrac{i_2}{2^n},\tfrac{i_2+1}{2^n}\right]
    \times\dots\times
    \left]\tfrac{i_d}{2^n},\tfrac{i_d+1}{2^n}\right],
    \qquad i_k\in\mathbb Z.
  \end{gather*}
  The lattice is said to be of width $2^{-n}$.
\end{definition}

\begin{note}
  Independent on the dimension $d$, the number of cubes in $\Q_n$ is
  countable. Thus, we can replace the multiple indices indicating the
  position of a cube in the lattice by a single enumeration index
  $k$. Furthermore, it is easy to see that the number of cubes in
  $\Q_n$ contained in a bounded set is finite, albeit depending on $n$.
\end{note}

\begin{definition}
  A function $f$ is called a \define{step function} on the lattice
  $\Q_n$, if $f$ is constant on each cube $Q_k$, and if $f$ is
  different from zero only on a finite number of cubes.  We refer to
  the value of $f$ on $Q_k$ as $f(Q_k)$ or short $f_k$.

  \index{S@$\mathcal S$}
  We denote by $\mathcal S$ the space of step functions.
\end{definition}

\begin{note}
  A step function $f$ on a lattice $\Q_n$ is also a step function on
  any lattice $\Q_m$ with $m>n$, by simply choosing it to be the same
  constant on all the cubes of $\Q_m$ which are subsets of the same
  cube of $\Q_n$.

  Therefore, further on, we can always compare two step functions by
  comparing them on the finer lattice used for their definition.
\end{note}

\begin{definition}
  \index{integral!of a step function}
  The \textbf{integral} of a step function $f$ on $\Q_n$ is
  defined in the obvious way as
  \begin{gather*}
    \int_{\R^d} f(x) \dx = \sum_{Q_k} f(q_k) |Q_k|,
  \end{gather*}
  where $|Q_k|$ denotes the volume of the cube $Q_k$. Since the sum in
  this definition is finite, the integral is finite.
\end{definition}

\begin{lemma}[Properties of the integral]
  The integral of step functions is a linear operator,
  that is, for two step functions $f$ and $g$ and numbers $a,b\in
  \R$ holds
  \begin{gather*}
    \int_{\R^d}\bigl(a f(x)+b g(x)\bigr) \dx
    = a\int_{\R^d} f(x) + b \int_{\R^d} g(x).
  \end{gather*}
  Furthermore, the integral is monotonic, that is, if for all $x\in
  \R^d$ holds $f(x) \le g(x)$, then holds
  \begin{gather*}
    \int_{\R^d} f(x) \le \int_{\R^d} g(x).
  \end{gather*}
\end{lemma}

\begin{proof}
  Both properties follow from the fact that they hold for the values
  $f(Q_k)$ and $g(Q_k)$ and the summation operator.
\end{proof}

\begin{definition}
  The \define{support} of a function is the set
  \begin{gather}
    \supp f = \overline{
      \bigl\{x\in \R^d\big| f(x) \neq 0 \bigr\}}.
  \end{gather}
  A function $f$ is said to have \define{finite support} or
  synonymously \define{compact support} if $\supp f$ is a bounded set.
\end{definition}

\begin{note}
  Since the support of a step function $f$ consists of finitely many
  cubes, its support is finite.
\end{note}

The following two lemmas establish the close connection between the
convergence of step functions almost everywhere and convergence of
their integrals.

\begin{lemma}
  \label{lemma:integral:1}
  Let $\{\phi_n\}_{n=1,\dots}$ be a monotonically decreasing sequence
  of nonnegative step functions on lattices $\Q_n$ converging to zero almost
  everywhere. Then,
  \begin{gather*}
    \lim_{n\to \infty}\int_{\R^d} \phi_n(x) \dx = 0.
  \end{gather*}
\end{lemma}

\begin{proof}
  First, we note that the assumptions imply that for all $n>1$ holds
  \begin{gather*}
    S:= \supp \phi_1 \supset \supp \phi_n.
  \end{gather*}
  and thus the volume of the support of $\phi_n$ is bounded by that of
  $S$; let the volume of $S$ be $V$.

  Let now $\epsilon>0$ be arbitrarily small. Let $Z$ be the set of
  measure zero, where the sequence does either not converge to zero,
  or where any of the functions $\phi_n$ is discontinuous. Let
  $\mathcal J_\epsilon$ be an at most countable covering of this set
  of total volume less than $\epsilon$ according to
  Definitions~\ref{def:zero-set-1} and~\ref{def:zero-set-2}.

  Let $J$ be the union of all elements in $\mathcal J_\epsilon$. We
  note that, since the sequence is decreasing, for any $x\in S$ holds
  $\phi_n(x) \le \phi_1(x) \le M$ and thus
  \begin{gather*}
    \int_J \phi_n(x) \le \epsilon M.
  \end{gather*}

  For any point $x\in \R^d\setminus J$ holds $\phi_n(x)\to 0$ as
  $n\to\infty$. In particular, for $n$ sufficiently large, $\phi_n(x)
  \le \epsilon$. Since $\phi_n$ is a step function, this holds not
  only for $x$, but for the whole cube containing $x$. By varying
  $x\in \R^d\setminus J$, we obtain an infinite set of such cubes,
  which we call $\mathcal U_\epsilon$.

  By their definition, the sets in the union of $\mathcal J_\epsilon$
  and $\mathcal U_\epsilon$ cover the set $S$. And since $S$ is
  compact, the Heine-Borel theorem says, that we can choose a finite
  subset from both of these systems, say $\breve{\mathcal U_\epsilon}
  \cup \breve{\mathcal J_\epsilon}$ to cover $S$. Let $U$ be the union
  of all cubes in $\breve{\mathcal U_\epsilon}$. Then, there is an
  index $n_0$, such that $\phi_{n_0}(x) \le \epsilon$ for all $x\in
  U$. Thus,
  \begin{gather*}
    \int_{U} \phi_n(x) < \epsilon V,
    \qquad \forall n\ge n_0.
  \end{gather*}
  We conclude the proof by noting that for $n\ge n_0$
  \begin{gather*}
    \int_{S} \phi_n(x)\dx
    \le \int_{U} \phi_n(x)\dx + \int_{J} \phi_n(x)\dx
    < \epsilon(M+V),
  \end{gather*}
  which can be made arbitrarily small by choosing $\epsilon$ small.
\end{proof}

\begin{lemma}
  \label{lemma:integral:2}
  Let $\{\phi_n\}_{n=1,\dots}$ be a monotonically increasing sequence
  of step functions on lattices $\Q_n$ such that their integrals are
  uniformly bounded by a constant $C$:
  \begin{gather}
    \label{eq:integral:1}
    \int_{\R^d} \phi_n(x) \dx \le C.
  \end{gather}
  Then, the functions $\phi_n$ converge to a finite limit function
  $\phi$ almost everywhere in $\R^d$.
\end{lemma}

\begin{proof}
  First, we observe that it is sufficient to consider sequences of
  nonnegative functions and thus positive constants $C$: otherwise, we
  consider the lemma for the sequence consisting of the functions
  $\phi_n-\phi_1$.

  Let $E_\epsilon$ be the set of points $x$, where $\phi_n(x) >
  C/\epsilon$ for some $n$, and $E_0$ the set of points $x$, where
  $\phi_n(x) \to \infty$. Obviously, $E_0\subset E_\epsilon$ for any
  $\epsilon > 0$.

  The set $E_\epsilon$ by its definition is an at most countable
  sequence of the cubes on which the step functions are
  defined. Therefore, the integral of $\phi_n$ over $E_\epsilon$ is
  defined and there holds
  \begin{gather*}
    \frac{C}{\epsilon}\sum_{Q_{k}\subset E_\epsilon} |Q_{k}|
    \le \int_{E\epsilon} \phi_n(x) \dx
    \le \int_{\R^d} \phi_n(x) \dx \le C.
  \end{gather*}
  From this, we deduce that the total volume of the cubes in
  $E_\epsilon$ does not exceed epsilon. Since this set of cubes
  covers $E_0$, we conclude that $E_0$ is of measure zero.
\end{proof}

\begin{remark}
  \label{remark:integral:1}
  Due to the monotonicity of the integral, the sequence on the left
  hand side of inequality~\eqref{eq:integral:1} is monotonically
  increasing. Therefore, the integrals are actually converging to a
  finite value.
\end{remark}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Definition of the integral}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{intro}
  In the previous section, we defined the integral of step functions
  and investigated some limits. The goal of this section is the
  extension of the integral to a wider class of functions. A first
  extension is almost immediately suggested by
  Lemma~\ref{lemma:integral:2} and
  Remark~\ref{remark:integral:1}. Namely, assigning as value of the
  integral of a function, which is the limit of an increasing sequence
  of step functions almost everywhere, the limit of their
  integrals. Nevertheless, it remains to prove that this yields a well
  defined integral, in particular, that its definition is independent
  of the actual choice of the sequence of step functions.
\end{intro}

\begin{lemma}
  Let $\{\phi_n\}$ be a monotonically increasing sequence of step
  functions with uniformly bounded integrals, converging to a function
  $f$ almost everywhere. Let the same hold for a second sequence
  $\{\psi_n\}$ and the function $g$. Furthermore, let
  \begin{gather*}
    f(x) \le g(x) \quad\text{almost everywhere in $\R^d$.}
  \end{gather*}
  Then,
  \begin{gather}
    \label{eq:integral:4}
    \lim_{n\to\infty} \int_{\R^d}\phi_n(x)\dx
    \le
    \lim_{n\to\infty} \int_{\R^d}\psi_n(x)\dx.
  \end{gather}
\end{lemma}

\begin{proof}
  First, we introduce the abbreviations
  \begin{gather*}
    M_1 = \lim_{n\to\infty} \int_{\R^d}\phi_n(x)\dx
    \quad\text{and}\quad
    M_2 = \lim_{n\to\infty} \int_{\R^d}\psi_n(x)\dx.
  \end{gather*}
  Let $\phi_m$ be an arbitrary function in the first sequence. Then,
  by the assumptions, $h_n^+ = \phi_m-\psi_n$, the positive part of
  the difference, converges to zero almost everywhere and decreases
  monotonically. Thus, by Lemma~\ref{lemma:integral:1}, its integrals
  tend to zero as well. We conclude
  \begin{gather*}
    \int_{\R^d}\phi_n(x)\dx - M_2 \le 0
    \quad\text{or}\quad
    \int_{\R^d}\phi_n(x)\dx \le M_2.
  \end{gather*}
  If now we let $n\to\infty$, we obtain $M_1 \le M_2$.
\end{proof}

\begin{note}
  For two functions $f$ and $g$ as in the preceding Lemma with $f(x) =
  g(x)$ almost everywhere, we can repeat the argument of the proof and
  interchange the sequences. Thus, $M_1 = M_2$.
  This means in particular, that the limit process in this lemma
  uniquely defines the integral of the limit functions. Furthermore,
  it means that we can always modify a function on a set of measure
  zero without affecting its integral.
\end{note}

\begin{definition}
  \label{definition:integral:Splus}
  Let $\mathcal S^+$ be the set of functions which equal the limit of
  a sequence of monotonically increasing step functions with uniformly
  bounded
  integrals almost everywhere. For any function $f\in \mathcal S^+$, we
  define the integral as
  \begin{gather*}
    \int_{\R^d} f(x) \,dx := \lim_{n\to\infty} \int_{\R^d}\phi_n(x)\dx,
  \end{gather*}
  where $\{\phi_n\}$ is any monotonically increasing sequence of step
  functions converging to $f$ almost everywhere.
\end{definition}

\begin{example}
  The function
  \begin{gather*}
    f(x) =
    \begin{cases}
      1 & x\in \Q \\
      0 & x\in \R\setminus \Q
    \end{cases}
  \end{gather*}
  is in $\mathcal S^+$ and its integral is zero. This is due to the fact that
  it is equal to the zero function almost everywhere.
\end{example}

\begin{lemma}
  Let $h$ be a function which is the difference of two functions in
  $\mathcal S^+$, namely $h(x) = f_1(x)-f_2(x)$ almost everywhere. If
  for two other functions in $\mathcal S^+$ holds $h(x) =
  g_1(x)-g_2(x)$ almost everywhere, then
  \begin{gather}
    \label{eq:integral:2}
    \int_{\R^d} f_1(x)\dx
    -\int_{\R^d} f_2(x)\dx
    =\int_{\R^d} g_1(x)\dx
    -\int_{\R^d} g_2(x)\dx,
  \end{gather}
  that is, the difference of the integral does not depend on the
  actual choice of the two functions in the difference.
\end{lemma}

\begin{definition}
  Let $\mathcal L$ be the class of functions\footnote{Here, the letter
    $\mathcal L$ is used in reference to the Lebesgue integral. We
    note that Lebesgue used the term ``summable'' instead of
    ``integrable''.} which can be written as a difference of two
  functions in $\mathcal S^+$ almost everywhere. For any function
  $h\in \mathcal L$, the \define{integral} is defined as
  \begin{gather*}
    \int_{\R^d} h(x)\dx = \int_{\R^d} f(x)\dx - \int_{\R^d} g(x)\dx,
  \end{gather*}
  where $f$ and $g$ are any two functions such that $h(x) = f(x) -
  g(x)$ almost everywhere.

  The class $\mathcal L$ is called the set of \define{integrable functions}.
\end{definition}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Structure of the class of integrable functions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{intro}
  The next question we will have to address is, which functions are
  integrable, and whether we are allowed to interchange limits of
  sequences of functions and their integrals. In particular, we will
  see that suitably bounded sequences of integrable functions have
  integrable limits.
\end{intro}

\begin{lemma}
  For every integrable function $f$ there exists a sequence of step
  functions $\{\phi_n(x)\}$ converging to $f$ almost everywhere, such
  that
  \begin{gather*}
    \int_{\R^d} \bigl|f(x)-\phi_n(x)\bigr|\dx \to 0
    \quad\text{as}\quad n\to \infty.
  \end{gather*}
\end{lemma}

\begin{proof}
  This lemma is an immediate consequence of the definition of the
  class $\mathcal L$ as differences of functions in $\mathcal S^+$. In
  fact, let $f(x) = h(x)-g(x)$ with both functions in $\mathcal
  S^+$ and let $\{\psi_n(x)\}$ and $\{\rho_n(x)\}$ be increasing
  sequences of step functions converging to $h(x)$ and $g(x)$
  almost everywhere, respectively. By definition,
  \begin{gather*}
    \int_{\R^d} \bigl|f(x)-\phi_n(x)\bigr|\dx
    \le \int_{\R^d} \bigl(h(x)-\psi_n(x)\bigr)\dx
    + \int_{\R^d} \bigl(g(x)-\rho_n(x)\bigr)\dx
    \to 0.
  \end{gather*}
\end{proof}

\begin{theorem}
  \label{theorem:integral:linearity}
  \index{linearity}
  The class $\mathcal L$ of integrable functions is a vector space and
  the integral is linear, namely for functions $f,g\in \mathcal L$ and
  numbers $\alpha,\beta\in \R$ holds
  \begin{gather}
    \label{eq:integral:3}
    \int_{\R^d} \bigl(\alpha f(x)+\beta g(x) \bigr)\dx
    =\alpha \int_{\R^d} f(x)\dx
    +\beta\int_{\R^d} g(x)\dx.
  \end{gather}
  For functions $g(x)$ and $h(x)$ in $\mathcal S+$ are
  $\sup(g(x),h(x)$ and  $\inf(g(x),h(x)$ in $\mathcal S+$.
  Furthermore, for a function $f\in \mathcal L$, its positive part
  $f^+$, its negative part $f^-$, and its absolute value $|f|$ are in
  $\mathcal L$.
\end{theorem}

\begin{proof}
  The linerarity of the integral follows immediately by taking
  corresponding linear combinations of step function sequences. Thus,
  $\mathcal L$ is a vector space. The same argument holds for the
  infimum and supremum of two functions in $\mathcal S^+$.

  For the second part, we write $f(x)=h(x)-g(x)$ with both functions
  in $\mathcal S^+$, and note
  \begin{alignat*}{2}
    |f| &= \sup(g,h) - \inf(g,h) \\
    f^+ &= \sup(g,h) - g &&= h - \inf(g,h) \\
    f^- &= \sup(g,h) - h &&= g - \inf(g,h).
  \end{alignat*}
\end{proof}

\begin{definition}
  The \define{characteristic function} of a subset $\Omega\subset\R^d$ is
  $\chi_{\Omega}$. It is defined as
  \begin{gather*}
    \chi_{\Omega}(x) =
    \begin{cases}
      1 & x\in \Omega \\
      0 & x\not\in \Omega
    \end{cases}
  \end{gather*}
  \defindex{integral!subset|textbf}
  The function $f$ is said to be \textbf{integrable} on the set
  $\Omega$, if $f\chi_\Omega$ is integrable (on $\R^d$). The
  \textbf{integral} over $\Omega$ of a function $f$ is defined as
  \begin{gather*}
    \int_\Omega f(x)\dx = \int_{\R^d} f(x) \chi_\Omega(x)\dx.
  \end{gather*}
  The \define{measure} of a bounded domain $\Omega$ is the integral of
  $\chi_\Omega$.
\end{definition}

\begin{corollary}
  The integral is additive, namely for two disjoint and not
  necessarily bounded domains
  $\Omega_1\subset\R^d$ and $\Omega_2\subset\R^d$ and a
  function $f$ such that $f\chi_{\Omega_1}$ and $f\chi_{\Omega_2}$ are
  integrable holds
  \begin{gather*}
    \int_{\Omega_1\cup\Omega_2} f(x)\dx
    = \int_{\Omega_1} f(x)\dx + \int_{\Omega_2} f(x)\dx.
  \end{gather*}
\end{corollary}

\begin{proof}
  This follows immediately from the linearity of the integral by
  observing $f(x)\chi_{\Omega_1\cup\Omega_2}(x) =
  f(x)\chi_{\Omega_1}(x)+f(x)\chi_{\Omega_2}(x)$.
\end{proof}

\begin{remark}
  The space $\mathcal S^+$ and thus the space of integrable functions
  have been obtained by a \putindex{completion} process. We started
  out from the space of all test functions and then added to this
  space all monotonically increasing limits with respect to the
  topology ``convergent almost everywhere''. An important
  characteristic of this process is, that it is \putindex{idempotent},
  that is, its repeated application does not change the result. We
  first verify this statement for $\mathcal S^+$. It is extended to
  integrable functions by the Beppo-Levi
  Theorem~\ref{theorem:Beppo-Levi} below.
\end{remark}

\begin{lemma}
  Let $f_n$ be an increasing sequence of functions in $\mathcal
  S^+$. Assume further that the integrals of $f_n$ are uniformly
  bounded by a number $M$. Then, the sequence $f_n$ converges almost
  everywhere to a function $f\in\mathcal S^+$ and there holds
  \begin{gather*}
    \lim_{n\to\infty} \int_{\R^d} f_n \dx = \int_{\R^d} f \dx.
  \end{gather*}
\end{lemma}

\begin{proof}
  For each $n$, let $\{\phi_{nk}\}_{k=1,,2,\dots}$ be a sequence of
  step functions converging monotonically to $f_n$ almost
  everywhere. We generate a type of diagonal sequence in
  $\{\phi_{nk}\}$ by assigning
  \begin{gather*}
    \psi_n(x) = \sup_{i\le n} \phi_{in}(x).
  \end{gather*}
  Since each of the sequences $\{\phi_{nk}\}$ is increasing with
  respect to $k$, $\psi_n$ must be increasing. Since they furthermore
  increase towards $f_n$, we have almost everywhere $\psi_n(x) \le
  f_n(x)$. Thus,
  \begin{gather*}
    \int_{\R^d} \psi_n \dx \le \int_{\R^d} f_n\dx \le M.
  \end{gather*}
  By Lemma~\ref{lemma:integral:2}, the sequence $\psi_n$ converges
  towards a limit function $f$ almost everywhere. On the other
  hand, for $n\le k$,
  \begin{gather*}
    \psi_n \ge \phi_{nk}.
  \end{gather*}
  Therefore, by allowing $k\to\infty$, we obtain that
  \begin{gather*}
    f_n(x) \le f(x) \quad\text{almost everywhere}.
  \end{gather*}
  Hence, we have $\psi_n \le f_n \le f$ and $\psi_n \nearrow f$ almost
  everywhere, thus the limit of $f_n$ must be equal to the one of
  $\psi_n$, namely $f_n$. The same argument holds for the integrals,
  and since
  \begin{gather*}
    \int_{\R^d} \psi_n \dx \le \int_{\R^d} f_n \dx \le \int_{\R^d} f \dx,
  \end{gather*}
  and since the first integral converges to the last, so does the one
  in the center.
\end{proof}

\begin{theorem}[Beppo-Levi]
  \label{theorem:Beppo-Levi}
  \index{Beppo-Levi Theorem}
  Every monotonically increasing sequence $\{f_n(x)\}$
  of integrable functions whose
  integrals have a common bound, converges almost everywhere to an
  integrable function $f(x)$, and the order of taking the limit and
  integrating can be reversed, that is
  \begin{gather}
    \int_{\R^d} f(x)\dx
    = \lim_{n\to\infty} \int_{\R^d} f_n(x)\dx
  \end{gather}
\end{theorem}

\begin{proof}
  Let us first rewrite the problem as
  \begin{gather*}
    f_n(x) = f_0(x) + \sum_{k=1}^n g_k(x),
  \end{gather*}
  where $g_k(x) = f_k(x) - f_{k-1}(x)$. By the assumptions, the
  elements $g_k$ of the series are nonnegative and
  integrable. Furthermore, since the integrals of $f_n$ have a common
  bound, say $M$, the sequence of integrals is bounded by
  \begin{gather*}
    \sum_{n=1}^\infty \int_{\R^d} g_n(x)\dx
    \le M + \int_{\R^d} |f_0(x)|\dx,
  \end{gather*}
  and thus convergent.
  \begin{todo}
    ...
  \end{todo}
\end{proof}

\begin{theorem}[Lebesgue]
  \index{Lebesgue Theorem}
  If the sequence of integrable functions $\{f_n(x)\}$ converges
  to a function $f(x)$ almost everywhere, and if there exists an
  integrable function such that for all $n$
  \begin{gather}
    \label{eq:integral:5}
    \bigl|f_n(x)\bigr| \le g(x),
  \end{gather}
  holds almost everywhere, then the function $f(x)$ is integrable and
  \begin{gather*}
    \int_{\R^d} f(x)\dx = \lim_{n\to\infty} \int_{\R^d} f_n(x)\dx.
  \end{gather*}
\end{theorem}

\begin{proof}
  \begin{todo}
    ...
  \end{todo}
\end{proof}

\begin{example}
  Condition~\eqref{eq:integral:5} in Lebesgue's Theorem is necessary,
  as can be seen from the following example. Let for $x\in \R$
  \begin{gather*}
    f_n(x) =
    \begin{cases}
      (n+1) |x|^n & x\in [-1,1] \\
      0 & \text{else}.
    \end{cases}
  \end{gather*}
  The sequence converges to zero almost everywhere, but the integrals
  are two. Indeed, by changing the factor in front of $x^n$, the limit
  of the integrals can be made any value including $\infty$. On the
  other hand, if the factors are uniformly bounded, the limit is zero,
  as the theorem predicts.
\end{example}

The assumptions of Lebesgue's Theorem are too strong for some
applications. Thus, the following lemma proves boundedness of the
integral of the limit under weaker assumptions.

\begin{lemma}[Fatou]
If the functions $f_n$ are nonnegative, integrable, and converge
almost everywhere in $\Omega$ to a limit function $f$, and if
furthermore the sequence of integrals
\begin{gather*}
  \int_\Omega f_n(x) \dx,
\end{gather*}
is bounded, then $f$ is integrable and
\begin{gather*}
  \int_\Omega f(x)\dx \le \liminf_{n\to\infty} \int_\Omega f_n(x) \dx.
\end{gather*}
\end{lemma}

\begin{todo}
  \begin{proof}
  \end{proof}
\end{todo}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "main"
%%% End:


%!TEX root = forallxsol.tex
%\part{First-order logic}
%\label{ch.FOL}
%\addtocontents{toc}{\protect\mbox{}\protect\hrulefill\par}

\setcounter{chapter}{14}
\chapter{Sentences with one quantifier}\label{s:MoreMonadic}\setcounter{ProbPart}{0}
\problempart
\label{pr.BarbaraEtc}
Here are the syllogistic figures identified by Aristotle and his successors, along with their medieval names:
\begin{ebullet}
	\item \textbf{Barbara.} All G are F. All H are G. So:  All H are F
	\item[] \myanswer{$\forall x (Gx \eif Fx), \forall x (Hx \eif Gx) \therefore \forall x (Hx \eif Fx)$}
	\item \textbf{Celarent.} No G are F. All H are G. So: No H are F
	\item[] \myanswer{$\forall x (Gx \eif \enot Fx), \forall x (Hx \eif Gx) \therefore \forall x (Hx \eif \enot Fx)$}
	\item \textbf{Ferio.} No G are F. Some H is G. So: Some H is not F
	\item[] \myanswer{$\forall x (Gx \eif \enot Fx), \exists x (Hx \eand  Gx) \therefore \exists x (Hx \eand \enot Fx)$}
	\item \textbf{Darii.} All G are H. Some H is G. So: Some H is F.
	\item[] \myanswer{$\forall x (Gx \eif Fx), \exists x (Hx \eand  Gx) \therefore \exists x (Hx \eand  Fx)$}
	\item \textbf{Camestres.} All F are G. No H are G. So: No H are F.
	\item[] \myanswer{$\forall x (Fx \eif Gx), \forall x (Hx \eif \enot Gx) \therefore \forall x (Hx \eif \enot Fx)$}
	\item \textbf{Cesare.} No F are G. All H are G. So: No H are F.
	\item[] \myanswer{$\forall x (Fx \eif \enot Gx), \forall x (Hx \eif Gx) \therefore \forall x (Hx \eif \enot Fx)$}
	\item \textbf{Baroko.} All F are G. Some H is not G. So: Some H is not F.
	\item[] \myanswer{$\forall x (Fx \eif Gx), \exists x (Hx \eand \enot Gx) \therefore \exists x (Hx \eand \enot Fx)$}
	\item \textbf{Festino.} No F are G. Some H are G. So: Some H is not F.
	\item[] \myanswer{$\forall x (Fx \eif \enot Gx), \exists x (Hx \eand Gx) \therefore \exists x (Hx \eand \enot Fx)$}
	\item \textbf{Datisi.} All G are F. Some G is H. So: Some H is F.
	\item[] \myanswer{$\forall x (Gx \eif Fx), \exists x (Gx \eand Hx) \therefore \exists x (Hx \eand Fx)$}
	\item \textbf{Disamis.} Some G is F. All G are H. So: Some H is F.
	\item[] \myanswer{$\exists x (Gx \eand Fx), \forall x (Gx \eif Hx) \therefore \exists x (Hx \eand Fx)$}
	\item \textbf{Ferison.} No G are F. Some G is H. So: Some H is not F.
	\item[] \myanswer{$\forall x (Gx \eif \enot Fx), \exists x (Gx \eand Hx) \therefore \exists x (Hx \eand \enot Fx)$}
	\item \textbf{Bokardo.} Some G is not F. All G are H. So:  Some H is not F.
	\item[] \myanswer{$\exists x (Gx \eand \enot Fx), \forall x (Gx \eif Hx) \therefore \exists x (Hx \eand \enot Fx)$}
	\item \textbf{Camenes.} All F are G. No G are H So: No H is F.
	\item[] \myanswer{$\forall x (Fx \eif Gx), \forall x (Gx \eif \enot Hx) \therefore \forall x (Hx \eif \enot Fx)$}
	\item \textbf{Dimaris.} Some F is G. All G are H. So: Some H is F.
	\item[] \myanswer{$\exists x (Fx \eand Gx), \forall x (Gx \eif Hx) \therefore \exists x (Hx \eand Fx)$}
	\item \textbf{Fresison.} No F are G. Some G is H. So: Some H is not F.
	\item[] \myanswer{$\forall x (Fx \eif \enot Gx), \exists x (Gx \eand Hx) \therefore \exists (Hx \eand \enot Fx)$}
\end{ebullet}
Symbolise each argument in FOL.

\
\problempart
\label{pr.FOLvegetarians}
Using the following symbolisation key:
\begin{ekey}
\item[\text{domain}] people
\item[K] \gap{1} knows the combination to the safe
\item[S] \gap{1} is a spy
\item[V] \gap{1} is a vegetarian
%\item[Txy] \gap{x} trusts \gap{y}.
\item[h] Hofthor
\item[i] Ingmar
\end{ekey}
symbolise the following sentences in FOL:
\begin{earg}
\item Neither Hofthor nor Ingmar is a vegetarian.
\item[] \myanswer{$\enot Vh \eand \enot Vi$}
\item No spy knows the combination to the safe.
\item[] \myanswer{$\forall x (Sx \eif \enot Kx)$}
\item No one knows the combination to the safe unless Ingmar does.
\item[] \myanswer{$\forall x \enot Kx \eor Ki$}
\item Hofthor is a spy, but no vegetarian is a spy.
\item[] \myanswer{$Sh \eand \forall x(Vx \eif \enot Sx)$}
%\item Hofthor trusts a vegetarian.
%\item Everyone who trusts Ingmar trusts a vegetarian.
%\item Everyone who trusts Ingmar trusts someone who trusts a vegetarian.
%\item Only Ingmar knows the combination to the safe.
%\item Ingmar trusts Hofthor, but no one else.
%\item The person who knows the combination to the safe is a vegetarian.
%\item The person who knows the combination to the safe is not a spy.
\end{earg}

\problempart\label{pr.FOLalligators}
Using this symbolisation key:
\begin{ekey}
\item[\text{domain}] all animals
\item[A] \gap{1} is an alligator.
\item[M] \gap{1} is a monkey.
\item[R] \gap{1} is a reptile.
\item[Z] \gap{1} lives at the zoo.
\item[a] Amos
\item[b] Bouncer
\item[c] Cleo
\end{ekey}
symbolise each of the following sentences in FOL:
\begin{earg}
\item Amos, Bouncer, and Cleo all live at the zoo.
\item[] \myanswer{$Za \eand Zb \eand Zc$}
\item Bouncer is a reptile, but not an alligator.
\item[] \myanswer{$Rb \eand \enot Ab$}
%\item If Cleo loves Bouncer, then Bouncer is a monkey.
%\item If both Bouncer and Cleo are alligators, then Amos loves them both.
\item Some reptile lives at the zoo.
\item[] \myanswer{$\exists x (Rx \eand Zx)$}
\item Every alligator is a reptile.
\item[] \myanswer{$\forall x(Ax \eif Rx)$}
\item Any animal that lives at the zoo is either a monkey or an alligator.
\item[] \myanswer{$\forall x(Zx \eif (Mx \eor Ax))$}
\item There are reptiles which are not alligators.
\item[] \myanswer{$\exists x (Rx \eand \enot Ax)$}
%\item Cleo loves a reptile.
%\item Bouncer loves all the monkeys that live at the zoo.
%\item All the monkeys that Amos loves love him back.
\item If any animal is an reptile, then Amos is.
\item[] \myanswer{$\exists x Rx \eif Ra$}
\item If any animal is an alligator, then it is a reptile.
\item[] \myanswer{$\forall x(Ax \eif Rx)$}
%\item Every monkey that Cleo loves is also loved by Amos.
%\item There is a monkey that loves Bouncer, but sadly Bouncer does not reciprocate this love.
\end{earg}

\problempart
\label{pr.FOLarguments}
For each argument, write a symbolisation key and symbolise the argument in FOL.
\begin{earg}
\item Willard is a logician. All logicians wear funny hats. So Willard wears a funny hat
\myanswer{
\begin{ekey}
\item[\text{domain}] people
\item[L] \gap{1} is a logician
\item[H] \gap{1} wears a funny hat
\item[i] Willard
\end{ekey}
$Li, \forall x (Lx \eif Hx) \therefore Hi$}
\item Nothing on my desk escapes my attention. There is a computer on my desk. As such, there is a computer that does not escape my attention.
\myanswer{
\begin{ekey}
\item[\text{domain}] physical things
\item[D] \gap{1} is on my desk
\item[E] \gap{1} escapes my attention
\item[C] \gap{1} is a computer
\end{ekey}
$\forall x (Dx \eif \enot Ex), \exists x(Dx \eand Cx) \therefore \exists x (Cx \eand \enot Ex)$}
\item All my dreams are black and white. Old TV shows are in black and white. Therefore, some of my dreams are old TV shows.
\myanswer{
\begin{ekey}
\item[\text{domain}] episodes (psychological and televised)
\item[D] \gap{1} is one of my dreams
\item[B] \gap{1} is in black and white
\item[O] \gap{1} is an old TV show
\end{ekey}
$\forall x (Dx \eif Bx), \forall x (Ox \eif Bx) \therefore \exists x (Dx \eand Ox)$. \\Comment: generic statements are tricky to deal with. Does the second sentence mean that \emph{all} old TV shows are in black and white; or that most of them are; or that most of the things which are in black and white are old TV shows? I have gone with the former, but it is not clear that FOL deals with these well.}
\item Neither Holmes nor Watson has been to Australia. A person could see a kangaroo only if they had been to Australia or to a zoo. Although Watson has not seen a kangaroo, Holmes has. Therefore, Holmes has been to a zoo.
\myanswer{
\begin{ekey}
\item[\text{domain}] people
\item[A] \gap{1} has been to Australia
\item[K] \gap{1} has seen a kangaroo
\item[Z] \gap{1} has been to a zoo
\item[h] Holmes
\item[a] Watson
\end{ekey}
$\enot Ah \eand \enot Aa, \forall x(Kx \eif (Ax \eor Zx)), \enot Ka \eand Kh \therefore Zh$}
\item No one expects the Spanish Inquisition. No one knows the troubles I've seen. Therefore, anyone who expects the Spanish Inquisition knows the troubles I've seen.
\myanswer{
\begin{ekey}
\item[\text{domain}] people
\item[S] \gap{1} expects the Spanish Inquisition
\item[T] \gap{1} knows the troubles I've seen
\item[h] Holmes
\item[a] Watson
\end{ekey}
$\forall x\enot Sx, \forall x \enot Tx \therefore \forall x (Sx \eif Tx)$}
\item All babies are illogical. Nobody who is illogical can manage a crocodile. Berthold is a baby. Therefore, Berthold is unable to manage a crocodile.
\myanswer{\begin{ekey}
\item[\text{domain}] people
\item[B] \gap{1} is a baby
\item[I] \gap{1} is illogical
\item[C] \gap{1} can manage a crocodile
\item[b] Berthold
\end{ekey}
$\forall x (Bx \eif Ix), \forall x (Ix \eif \enot Cx), Bb \therefore \enot Cb$}
\end{earg}

\chapter{Multiple generality}\setcounter{ProbPart}{0}
\problempart
Using this symbolisation key:
\begin{ekey}
\item[\text{domain}] all animals
\item[A] \gap{1} is an alligator
\item[M] \gap{1} is a monkey
\item[R] \gap{1} is a reptile
\item[Z] \gap{1} lives at the zoo
\item[L] \gap{1} loves \gap{2}
\item[a] Amos
\item[b] Bouncer
\item[c] Cleo
\end{ekey}
symbolise each of the following sentences in FOL:
\begin{earg}
\item If Cleo loves Bouncer, then Bouncer is a monkey.
\item[] \myanswer{$Lcb \eif Mb$}
\item If both Bouncer and Cleo are alligators, then Amos loves them both.
\item[] \myanswer{$(Ab \eand Ac) \eif (Lab \eand Lac)$}
%\item Some reptile lives at the zoo.
%\item Every alligator is a reptile.
%\item Any animal that lives at the zoo is either a monkey or an alligator.
%\item There are reptiles which are not alligators.
\item Cleo loves a reptile.
\item[] \myanswer{$\exists x(Rx \eand Lcx)$\\Comment: this English expression is ambiguous; in some contexts, it can be read as a generic, along the lines of `Cleo loves reptiles'. (Compare `I do love a good pint'.) }
\item Bouncer loves all the monkeys that live at the zoo.
\item[] \myanswer{$\forall x ((Mx \eand Zx) \eif Lbx)$}\item All the monkeys that Amos loves love him back.
\item[] \myanswer{$\forall x ((Mx \eand Lax) \eif Lxa)$}
%\item If any animal is an reptile, then Amos is.
%\item If any animal is an alligator, then it is a reptile.
\item Every monkey that Cleo loves is also loved by Amos.
\item[] \myanswer{$\forall x ((Mx \eand Lcx) \eif Lax)$}
\item There is a monkey that loves Bouncer, but sadly Bouncer does not reciprocate this love.
\item[] \myanswer{$\exists x (Mx \eand Lxb \eand \enot Lbx)$}
\end{earg}

\problempart
Using the following symbolisation key:
\begin{ekey}
\item[\text{domain}] all animals
\item[D] \gap{1} is a dog
\item[S] \gap{1} likes samurai movies
\item[L] \gap{1} is larger than \gap{2}
\item[b] Bertie
\item[e] Emerson
\item[f] Fergis
\end{ekey}
symbolise the following sentences in FOL:
\begin{earg}
\item Bertie is a dog who likes samurai movies.
\item[] \myanswer{$Db \eand Sb$}
\item Bertie, Emerson, and Fergis are all dogs.
\item[] \myanswer{$Db \eand De \eand D\emph{f}$}
\item Emerson is larger than Bertie, and Fergis is larger than Emerson.
\item[] \myanswer{$Leb \eand L\emph{f}e$}
\item All dogs like samurai movies.
\item[] \myanswer{$\forall x(Dx \eif Sx)$}
\item Only dogs like samurai movies.
\item[] \myanswer{$\forall x(Sx \eif Dx)$\\
Comment: the FOL sentence just written does not require that anyone likes samurai movies. The English sentence might suggest that at least some dogs \emph{do} like samurai movies?}
\item There is a dog that is larger than Emerson.
\item[] \myanswer{$\exists x (Dx \eand Lxe)$}
\item If there is a dog larger than Fergis, then there is a dog larger than Emerson.
\item[] \myanswer{$\exists x (Dx \eand Lx\emph{f}) \eif \exists x(Dx \eand Lxe)$}
\item No animal that likes samurai movies is larger than Emerson.
\item[] \myanswer{$\forall x (Sx \eif \enot Lxe)$}
\item No dog is larger than Fergis.
\item[] \myanswer{$\forall x (Dx \eif \enot Lx\emph{f})$}
\item Any animal that dislikes samurai movies is larger than Bertie.
\item[] \myanswer{$\forall x (\enot Sx \eif Lxb)$\\
Comment: this is very poor, though! For `dislikes' does not mean the same as `does not like'.}
\item There is an animal that is between Bertie and Emerson in size.
\item[] \myanswer{$\exists x((Lbx \eand Lxe) \eor (Lex \eand Lxb))$}
\item There is no dog that is between Bertie and Emerson in size.
\item[] \myanswer{$\forall x \bigl(Dx \eif \enot\bigl[(Lbx \eand Lxe) \eor (Lex \eand Lxb)\bigr]\bigr)$}
\item No dog is larger than itself.
\item[] \myanswer{$\forall x(Dx \eif \enot Lxx)$}
\item Every dog is larger than some dog.
\item[] \myanswer{$\forall x (Dx \eif \exists y(Dy \eand Lxy))$\\
Comment: the English sentence is potentially ambiguous here. I have resolved the ambiguity by assuming it should be paraphrased by `for every dog, there is a dog smaller than it'.}
\item There is an animal that is smaller than every dog.
\item[] \myanswer{$\exists x \forall y(Dy \eif Lyx)$}
\item If there is an animal that is larger than any dog, then that animal does not like samurai movies.
\item[] \myanswer{$\forall x (\forall y (Dy \eif Lxy) \eif \enot Sx)$\\
Comment: I have assumed that `larger than any dog' here means `larger than every dog'.}
\end{earg}

\problempart
Using the following symbolisation key:
\begin{ekey}
\item[\text{domain}] people and dishes at a potluck
\item[R] \gap{1} has run out.
\item[T] \gap{1} is on the table.
\item[F] \gap{1} is food.
\item[P] \gap{1} is a person.
\item[L] \gap{1} likes \gap{2}.
\item[e] Eli
\item[f] Francesca
\item[g] the guacamole
\end{ekey}
symbolise the following English sentences in FOL:
\begin{earg}
\item All the food is on the table.
\item[] \myanswer{$\forall x(Fx \eif Tx)$}
\item If the guacamole has not run out, then it is on the table.
\item[] \myanswer{$\enot Rg \eif Tg$}
\item Everyone likes the guacamole.
\item[] \myanswer{$\forall x (Px \eif Lxg)$}
\item If anyone likes the guacamole, then Eli does.
\item[] \myanswer{$\exists x (Px \eand Lxg) \eif Leg$}\item Francesca only likes the dishes that have run out.
\item[] \myanswer{$\forall x \bigl[(L\emph{f}x \eand Fx) \eif Rx\bigr]$}
\item Francesca likes no one, and no one likes Francesca.
\item[] \myanswer{$\forall x\bigl[Px \eif (\enot L\emph{f}x \eand \enot Lx\emph{f})\bigr]$}
\item Eli likes anyone who likes the guacamole.
\item[] \myanswer{$\forall x ((Px \eand Lxg) \eif Lex)$}
\item Eli likes anyone who likes the people that he likes.
\item[] \myanswer{$\forall x \bigl[\bigl(Px \eand \forall y[(Py \eand Ley) \eif Lxy]\bigr) \eif Lex\bigr]$}
\item If there is a person on the table already, then all of the food must have run out.
\item[] \myanswer{$\exists x(Px \eand Tx) \eif \forall x(Fx \eif Rx)$}
\end{earg}

\problempart
\label{pr.FOLballet}
Using the following symbolisation key:
\begin{ekey}
\item[\text{domain}] people
\item[D] \gap{1} dances ballet.
\item[F] \gap{1} is female.
\item[M] \gap{1} is male.
\item[C] \gap{1} is a child of \gap{2}.
\item[S] \gap{1} is a sibling of \gap{2}.
\item[e] Elmer
\item[j] Jane
\item[p] Patrick
\end{ekey}
symbolise the following arguments in FOL:
\begin{earg}
\item All of Patrick's children are ballet dancers.
\item[] \myanswer{$\forall x(Cxp \eif Dx)$}
\item Jane is Patrick's daughter.
\item[] \myanswer{$Cjp \eand Fj$}
\item Patrick has a daughter.
\item[] \myanswer{$\exists x(Cxp \eand Fx)$}
\item Jane is an only child.
\item[] \myanswer{$\enot \exists x Sxj$}
\item All of Patrick's sons dance ballet.
\item[] \myanswer{$\forall x\bigl[(Cxp \eand Mx) \eif Dx\bigr]$}
\item Patrick has no sons.
\item[] \myanswer{$\enot \exists x(Cxp \eand Mx)$}
\item Jane is Elmer's niece.
\item[] \myanswer{$\exists x(Sxe \eand Cjx \eand Fj)$}
\item Patrick is Elmer's brother.
\item[] \myanswer{$Spe \eand Mp$}
\item Patrick's brothers have no children.
\item[] \myanswer{$\forall x\bigl[(Spx \eand Mx) \eif \enot \exists y Cyx\bigr]$}
\item Jane is an aunt.
\item[] \myanswer{$Fj \eand \exists x(Sxj \eand \exists y Cyx)$}
\item Everyone who dances ballet has a brother who also dances ballet.
\item[] \myanswer{$\forall x\bigl[Dx \eif \exists y(My \eand Syx \eand Dy)\bigr]$}
\item Every woman who dances ballet is the child of someone who dances ballet.
\item[] \myanswer{$\forall x\bigl[(Fx \eand Dx) \eif \exists y(Cxy \eand Dy)\bigr]$}
\end{earg}

\chapter{Identity}\label{sec.identity}\setcounter{ProbPart}{0}
%\problempart
%\label{pr.FOLcandies}
%Using the following symbolisation key:
%\begin{ekey}
%\item[\text{domain}] candies
%\item[Cx] \gap{x} has chocolate in it.
%\item[Mx] \gap{x} has marzipan in it.
%\item[Sx] \gap{x} has sugar in it.
%\item[Tx] Boris has tried \gap{x}.
%\item[Bxy] \gap{x} is better than \gap{y}.
%\end{ekey}
%symbolise the following English sentences in FOL:\\
%\myanswer{Comment: these are deliberately tricky. What follows is the \emph{best} we can offer in FOL, for each of these sentences. Some are not great.}
%\begin{earg}
%\item Boris has never tried any candy.
%\item[] \myanswer{$\forall x(Cx \eif \enot Tx)$}
%\item Marzipan is always made with sugar.
%\item[] \myanswer{$\forall x(Mx \eif Sx)$}
%\item Some candy is sugar-free.
%\item[] \myanswer{$\exists x \enot Sx$}
%\item The very best candy is chocolate.
%\item[] \myanswer{Simply can't be done! The best we can offer is as in answer to 8.}
%\item No candy is better than itself.
%\item[] \myanswer{$\forall x \enot Bxx$}
%\item Boris has never tried sugar-free chocolate.
%\item[] \myanswer{$\forall x((Cx \eand Sx) \eif \enot Tx)$}
%\item Boris has tried marzipan and chocolate, but never together.
%\item[] \myanswer{$\exists x(Mx \eand Tx) \eand \exists x(Cx \eand Tx) \eand \forall x ((Mx \eand Cx) \eif \enot Tx)$}
%%\item Boris has tried nothing that is better than sugar-free marzipan.
%\item Any candy with chocolate is better than any candy without it.
%\item[] \myanswer{$\forall x(Cx \eif \forall (\enot Cy \eif Bxy))$}
%\item Any candy with chocolate and marzipan is better than any candy that lacks both.
%\item[] \myanswer{$\forall x\bigl[(Cx \eand Mx)\eif \forall \bigl((\enot Cy \eand \enot My) \eif Bxy\bigr)\bigr]$}
%\end{earg}

\problempart Explain why:
	\begin{ebullet}
		\item   `$\exists x \forall y(Ay \eiff x= y)$' is a good symbolisation of `there is exactly one apple'.
		\item[] \myanswer{We might naturally read this in English thus:
		\begin{ebullet}
			\item There is something, x, such that, if you choose any object at all, if you chose an apple then you chose x itself, and if you chose x itself then you chose an apple.
		\end{ebullet}
		The x in question must therefore be the one and only thing which is an apple.}
		\item `$\exists x \exists y \bigl[\enot x = y \eand \forall z(Az \eiff (x= z \eor y = z)\bigr]$' is a good symbolisation of `there are exactly two apples'.
		\item[] \myanswer{Similarly to the above, we might naturally read this in English thus:
		\begin{ebullet}
			\item There are two distinct things, x and y, such that if you choose any object at all, if you chose an apple then you either chose x or y, and if you chose either x or y then you chose an apple.
		\end{ebullet}
		The x and y in question must therefore be the only things which are apples, and since they are distinct, there are two of them.}
	\end{ebullet}

\chapter{Definite descriptions}\setcounter{ProbPart}{0}
\problempart
Using the following symbolisation key:
\begin{ekey}
\item[\text{domain}] people
\item[K] \gap{1} knows the combination to the safe.
\item[S] \gap{1} is a spy.
\item[V] \gap{1} is a vegetarian.
\item[T] \gap{1} trusts \gap{2}.
\item[h] Hofthor
\item[i] Ingmar
\end{ekey}
symbolise the following sentences in FOL:
\begin{earg}
\item Hofthor trusts a vegetarian.
\item[] \myanswer{$\exists x(Vx \eand Thx)$}
\item Everyone who trusts Ingmar trusts a vegetarian.
\item[] \myanswer{$\forall x\bigl[Txi \eif \exists y(Txy \eand Vy)\bigr]$}
\item Everyone who trusts Ingmar trusts someone who trusts a vegetarian.
\item[] \myanswer{$\forall x\bigl[Txi \eif \exists y\bigr(Txy \eand \exists z(Tyz \eand Vz)\bigr)\bigr]$}
\item Only Ingmar knows the combination to the safe.
\item[] \myanswer{$\forall x(Ki \eif x = i)$\\Comment: does the English claim entail that Ingmar \emph{does} know the combination to the safe? If so, then we should formalise this with a `$\eiff$'.}
\item Ingmar trusts Hofthor, but no one else.
\item[] \myanswer{$\forall x(Tix \eiff x = h)$}
\item The person who knows the combination to the safe is a vegetarian.
\item[] \myanswer{$\exists x\bigl[Kx \eand \forall y(Ky \eif x = y) \eand Vx\bigr]$}
\item The person who knows the combination to the safe is not a spy.
\item[] \myanswer{$\exists x\bigl[Kx \eand \forall y(Ky \eif x = y) \eand \enot Sx\bigr]$\\
Comment: the scope of negation is potentially ambiguous here; I have read it as \emph{inner} negation.}
\end{earg}

\problempart
\label{pr.FOLcards}
Using the following symbolisation key:
\begin{ekey}
\item[\text{domain}] cards in a standard deck
\item[B] \gap{1} is black.
\item[C] \gap{1} is a club.
\item[D] \gap{1} is a deuce.
\item[J] \gap{1} is a jack.
\item[M] \gap{1} is a man with an axe.
\item[O] \gap{1} is one-eyed.
\item[W] \gap{1} is wild.
\end{ekey}
symbolise each sentence in FOL:
\begin{earg}
\item All clubs are black cards.
\item[] \myanswer{$\forall x (Cx \eif Bx)$}
\item There are no wild cards.
\item[] \myanswer{$\enot \exists x Wx$}
\item There are at least two clubs.
\item[] \myanswer{$\exists x \exists y(\enot x = y \eand Cx \eand Cy)$}
\item There is more than one one-eyed jack.
\item[] \myanswer{$\exists x \exists y(\enot x = y \eand Jx \eand Ox  \eand Jy \eand Oy)$}
\item There are at most two one-eyed jacks.
\item[] \myanswer{$\forall x \forall y \forall z\bigl[(Jx \eand Ox \eand Jy \eand Oy \eand Jz \eand Oz) \eif (x = y \eor x = z \eor y = z)\bigr]$}
\item There are two black jacks.
\item[] \myanswer{$\exists x \exists y(\enot x = y \eand Bx \eand Jx \eand By \eand Jy)$\\
Comment: I am reading this as `there are \emph{at least} two\ldots'. If the suggestion was that there are \emph{exactly} two, then a different FOL sentence would be required, namely:\\
$\exists x \exists y \bigl(\enot x = y \eand Bx \eand Jx \eand By \eand Jy \eand \forall z[(Bz \eand Jz) \eif (x = z \eor y = z)]\bigr)$}
\item There are four deuces.
\item[] \myanswer{$\exists w \exists x \exists y \exists z(\enot w = x \eand \enot w = y \eand \enot w = z \eand \enot x = y \eand \enot x = z \eand \enot y = z \eand Dw \eand Dx \eand Dy \eand Dz)$\\
Comment: I am reading this as `there are \emph{at least} four\ldots'. If the suggestion is that there are \emph{exactly} four, then we should offer instead:\\
$\exists w \exists x \exists y \exists z\bigl(\enot w = x \eand \enot w = y \eand \enot w = z \eand \enot x = y \eand \enot x = z \eand \enot y = z \eand Dw \eand Dx \eand Dy \eand Dz \eand \forall v[Dv \eif (v = w \eor v = x \eor v = y \eor v =z)]\bigr)$}
\item The deuce of clubs is a black card.
\item[] \myanswer{$\exists x \bigl[Dx \eand Cx \eand \forall y\bigl((Dy \eand Cy) \eif x = y\bigr) \eand Bx\bigr]$}
\item One-eyed jacks and the man with the axe are wild.
\item[] \myanswer{$\forall x \bigl[(Jx \eand Ox) \eif Wx\bigr] \eand \exists x\bigl[Mx \eand \forall y(My \eif x = y) \eand Wx\bigr]$}
\item If the deuce of clubs is wild, then there is exactly one wild card.
\item[] \myanswer{$\exists x \bigl(Dx \eand Cx \eand \forall y \bigl[(Dy \eand Cy) \eif x= y\bigr] \eand Wx\bigr) \eif \exists x \bigl(Wx \eand \forall y(Wy \eif x = y)\bigr)$\\
Comment: if there is not exactly one deuce of clubs, then the above sentence is true. Maybe that's the wrong verdict. Perhaps the sentence should definitely be taken to imply that there is one and only one deuce of clubs, and then express a conditional about wildness. If so, then we might symbolise it thus:
\\$\exists x \bigl(Dx \eand Cx \eand \forall y \bigl[(Dy \eand Cy) \eif x = y\bigr] \eand \bigl[Wx \eif \forall y (Wy \eif x = y)\bigr]\bigl)$}
\item The man with the axe is not a jack.
\item[] \myanswer{$\exists x \bigl[Mx \eand \forall y(My \eif x = y) \eand \enot Jx\bigr]$}
\item The deuce of clubs is not the man with the axe.
\item[] \myanswer{$\exists x \exists y\bigl(Dx \eand Cx \eand \forall z[(Dz \eand Cz) \eif x = z] \eand My \eand \forall z(Mz \eif y = z) \eand \enot x = y\bigr)$}

\end{earg}

\

\problempart Using the following symbolisation key:
\begin{ekey}
\item[\text{domain}] animals in the world
\item[B] \gap{1} is in Farmer Brown's field.
\item[H] \gap{1} is a horse.
\item[P] \gap{1} is a Pegasus.
\item[W] \gap{1} has wings.
\end{ekey}
symbolise the following sentences in FOL:
\begin{earg}
\item There are at least three horses in the world.
\item[] \myanswer{$\exists x \exists y \exists z (\enot x = y \eand \enot x = z \eand \enot y = z \eand Hx \eand Hy \eand Hz)$}
\item There are at least three animals in the world.
\item[] \myanswer{$\exists x \exists y \exists z (\enot x = y \eand \enot x = z \eand \enot y = z)$}
\item There is more than one horse in Farmer Brown's field.
\item[] \myanswer{$\exists x \exists y (\enot x = y \eand Hx \eand Hy \eand Bx \eand By)$}
\item There are three horses in Farmer Brown's field.
\item[] \myanswer{$\exists x \exists y \exists z(\enot x = y \eand \enot x = z \eand \enot y = z \eand Hx \eand Hy \eand Hz \eand Bx \eand By \eand Bz)$\\Comment: I have read this as `there are \emph{at least} three\ldots'. If the suggestion was that there are \emph{exactly} three, then a different FOL sentence would be required.}
\item There is a single winged creature in Farmer Brown's field; any other creatures in the field must be wingless.
\item[] \myanswer{$\exists x\bigl[Wx \eand Bx \eand \forall y\bigl((Wy \eand By) \eif x = y)\bigr]$}
\item The Pegasus is a winged horse.
\item[] \myanswer{$\exists x \bigl[Px \eand \forall y(Py \eif x = y) \eand Wx \eand Hx\bigr]$}
\item The animal in Farmer Brown's field is not a horse.
\item[] \myanswer{$\exists x \bigl[ Bx \eand \forall y (By \eif x = y) \eand \enot Hx\bigr]$\\Comment: the scope of negation might be ambiguous here; I have read it as \emph{inner} negation.}
\item The horse in Farmer Brown's field does not have wings.
\item[] \myanswer{$\exists x \bigl[Hx \eand Bx \eand \forall y \bigl((Hy \eand By) \eif x = y\bigr) \eand \enot Wx\bigr]$\\Comment: the scope of negation might be ambiguous here; I have read it as \emph{inner} negation.}

\end{earg}

\problempart
In this section, I symbolised `Nick is the traitor' by `$\exists x (Tx \eand \forall y(Ty \eif x = y) \eand x = n)$'. Explain why these would be equally good symbolisations:
	\begin{ebullet}
		\item $Tn \eand \forall y(Ty \eif n = y)$
		\item[] \myanswer{This sentence requires that Nick is a traitor, and that Nick alone is a traitor. Otherwise put, there is one and only one traitor, namely, Nick. Otherwise put: Nick is the traitor.}
		\item $\forall y(Ty \eiff y = n)$
		\item[] \myanswer{This sentence can be understood thus: Take anything you like; now, if you chose a traitor, you chose Nick, and if you chose Nick, you chose a traitor. So there is one and only one traitor, namely, Nick, as required.}
	\end{ebullet}

\chapter{Sentences of FOL}\setcounter{ProbPart}{0}
\problempart
\label{pr.freeFOL}
Identify which variables are bound and which are free.
\myanswer{I shall underline the bound variables, and put free variables in blue.}
\begin{earg}
\item $\exists x L\underline{x}\myanswer{y} \eand \forall y L\underline{y}\myanswer{x}$
\item $\forall x A\underline{x} \eand B\myanswer{x}$
\item $\forall x (A\underline{x} \eand B\underline{x}) \eand \forall y(C\myanswer{x} \eand D\underline{y})$
\item $\forall x\exists y[R\underline{xy} \eif (J\myanswer{z} \eand K\underline{x})] \eor R\myanswer{yx}$
\item $\forall x_1(M\myanswer{x_2} \eiff L\myanswer{x_2}\underline{x_1}) \eand \exists x_2 L\myanswer{x_3}\underline{x_2}$
\end{earg}


\documentclass[main.tex]{subfiles}
\begin{document}

\section*{Thu Dec 05 2019}

We have the spin vector \(s^{\mu }\): it is orthogonal to the 4-velocity and
%
\begin{align}
  \dv{}{\tau } s^{\mu } = 0
\,.
\end{align}

By symmetry we also have \(s^{\theta } =0\).

By orthogonality to the 4-velocity in the Schwarzschild frame we have
%
\begin{align}
  s^{t} = \frac{R^2 \Omega }{1 - \frac{2GM}{r}} s^{\varphi }
\,,
\end{align}
%
and for geodesic circular orbit we have \(\Omega^2 R^3 = GM \).

Let us also evolve \(s^{\varphi }\):
%
\begin{align}
  \dv{s^{\varphi }}{\tau } + \Gamma^{\varphi }_{\beta \gamma } u^{\beta  } s^{\gamma } = 0
\,,
\end{align}
%
and the nonzero Christoffel symbols which can appear are the \(\Gamma^{3}_{\beta \gamma }\) with \(\beta = 0, 3\) and \(\gamma = 0, 1, 3\).
The only one which is nonzero is \(\Gamma^{3}_{13}\):
%
\begin{align}
  \Gamma^{3}_{13} = \frac{1}{2} g^{33} \qty(g_{33, 1})
 = \frac{r^{-2}}{2} \qty(2r) = \frac{1}{r}
\,.
\end{align}

Then the evolution equation is
%
\begin{align}
  \dv{s^{\varphi }}{\tau } + \frac{1}{r} \underbrace{u^{t} \Omega}_{ u^{\varphi }} s^{r} = 0
\,,
\end{align}
%
and as before we can use the fact that \(u^{t} = \dv*{t}{\tau }\) in order to write the equation as
%
\begin{align}
  \dv{s^{\varphi }}{t} + \frac{\Omega}{r} s^{r} =0
\,,
\end{align}
%
which is coupled with the equation from before:
%
\begin{align}
    \dv{s^{r}}{t} + \qty(3GM - r)\Omega s^{\varphi }= 0
\,,
\end{align}
%
which seems to look like a harmonic oscillator: we just need to differentiate one of them, to get
%
\begin{align}
  \dv[2]{s^{r}}{t} + (3GM-r) \Omega \dv{s^{\varphi }}{t} = \dv[2]{s^{r}}{t} - \frac{3GM-r}{r} \Omega^2 s^{r} = 0
\,,
\end{align}
%
so we found a harmonic oscillator with angular velocity
%
\begin{align}
  \overline{\Omega} = \Omega \sqrt{1 - \frac{3GM}{r}}
\,,
\end{align}
%
and since \(s^{\varphi }\) satisfies the same equation up to a constant it is also a harmonic oscillator with thee same frequency.
Its solution will look like
%
\begin{align}
s^{r} = A \cos(\overline{\Omega} t)
\,,
\end{align}
%
where \(A\) is an arbitrary constant,
we can relate \(s^{\varphi } \) to this solution by differentiating it:
%
\begin{align}
  \dv{s^{r}}{t} =
  - A  \overline{\Omega} \sin(\overline{\Omega} t) = R \Omega \qty(1 - \frac{3GM}{r}) s^{\varphi }
\,,
\end{align}
%
so in the end we have
%
\begin{align}
  s^{\varphi } = - \frac{A}{r} \frac{\Omega}{\overline{\Omega}} \sin(\overline{\Omega} t)
\,.
\end{align}

Also, we can use
%
\begin{align}
  s^{t} = r^2 \Omega \qty(1 - \frac{2GM}{r})^{-1} s^{\varphi }
\,.
\end{align}

By the normalization \(s^{\mu } s^{\nu } g_{\mu \nu } = 1\) we have \((s^{1})^2 g_{11} = A^2 \qty(1 - 3GM/r)^{-1}=s_{*}^2 = \const\) at \(t=0\): so
%
\begin{align}
  A = s_{*} \sqrt{1 - \frac{3GM}{r}}
\,.
\end{align}

What does an observer see? What does somebody at infinity see?

We call \(\Delta \varphi \) the angle between the spin vector and the radial direction: then
%
\begin{align}
  \cos \Delta \varphi  = \frac{\text{radial component of the spin vector now}}{\text{radial component of the spin vector at }  t=0}
\,,
\end{align}
%
which means
%
\begin{align}
  \cos(\Delta \varphi ) = \frac{e_{r} \cdot s (t)}{e_r \cdot s(0)}
\,,
\end{align}
%
where \(s\) is the spin vector and \(e_r\) is the radial unit vector: in Schwarzschild coordinates \(e_{r} = (0, 1/\sqrt{g_{11} } , 0, 0)\).

This just simplifies to
%
\begin{align}
  \cos(\Delta \varphi ) = \frac{s^{r}}{A} = \cos(\overline{\Omega}t)
\,,
\end{align}
%
and we are allowed to do this calculation in the Schwarzschild frame since the spatial velocity is always orthogonal to the radial unit vector.
If we were to use a direction different from the radial one we'd need to boost along it.

What does this solution mean? In the end our solution is
%
\begin{subequations}
\begin{align}
  s^{t} &= s_{*} \sqrt{1 - \frac{2GM}{r}} \cos(\overline{\Omega} t)  \\
s^{\varphi } &= - s_{* } \sqrt{1 - \frac{2GM}{r}} \frac{\Omega}{\overline{\Omega} r} \sin(\overline{\Omega} t)  \\
 s^{t} &= r^{2} \Omega \qty(1 - \frac{2GM}{r})^{-1} s^{\varphi }
\,,
\end{align}
\end{subequations}
%
and the solution to \(\cos(\Delta \varphi ) = \cos(\overline{\Omega} t)\) is \(\Delta \varphi = \pm \overline{\Omega} t\), and we choose the solution for continuity with the case \(M=0\).

If we are rotating around a BH counterclockwise (with \(M \rightarrow 0\)) then the spin must rotate clockwise in order to remain aligned with itself: therefore the right solution to choose is \(\Delta \varphi = - \overline{\Omega} t\).

This is the reason why there is a minus sign in the expression for \(s^{\varphi } \).

The basis is rotating, and the spin must rotate the other way to compensate and remain stationary.

Someone at infinity sees the spin to be rotating with angular velocity \(\Omega - \overline{\Omega}\), where \(\Omega \) is the \(\dv*{\varphi }{t}\) of the orbit and \(\overline{\Omega}\) is the angular velocity of the spin in the coordinate system \(\varphi , r\).

Over a turn, which takes a time \(t = 2 \pi / \Omega \), the total \(\Delta \varphi \) is given by
%
\begin{align}
  \frac{2\pi}{\Omega } \qty( \Omega - \overline{\Omega})
  = 2 \pi \qty(1 - \sqrt{1 - \frac{3GM}{r}})
  \approx \frac{3GM\pi}{r}
\,
\end{align}
%
in the same direction as the orbit.

Let us look at the gyroscope in a slowly rotating geometry: we consider the metric
%
\begin{align}
  \dd{s^2} = \dd{s^2}_{\text{schw}} - \frac{4 GJ}{r} \sin^2 \theta \dd{t} \dd{\varphi } + O(J^2)
\,,
\end{align}
%
which (see homework sheet 8) is a vacuum solution to the Einstein equations. We have a 4 since we have to account both for \(g_{03} \) and \(g_{30} \).

Reinserting  \(c\), we get:
%
\begin{align}
  \dd{s^2} = \dd{s^2}_{\text{schw}} - \frac{4GJ}{c^3r^2} \sin^2\theta \qty(r \dd{\varphi }) \qty(c \dd{t})
\,,
\end{align}
%
then the quantity \(4GJ / c^2 r^2\) must be adimensional: then the dimensions of \(J\) are those of \(c^3 r^2 / G\), which are
%
\begin{align}
  \SI{}{m^3 s^{-3}} \times \SI{}{m^2} \times \frac{1}{\SI{}{kg m^3 s^{-2}}} = \SI{}{kg m^2 s^{-1}}
\,,
\end{align}
%
the dimensions of an angular momentum, \(L = r \wedge p\).

Essentially we are doing a boost along the \(\varphi \) direction.

Let us consider geodetic motion of the gyroscope along the rotation axis: the gyroscope is falling into the rotating BH along that axis.

The spin starts along the \(x\) axis, and we expect a change of the spin of the order
%
\begin{align}
  \frac{GJ}{c^3r^2}
\,.
\end{align}

We might also have terms of order
%
\begin{align}
  O \qty(\frac{GJ}{c^3r^2} \times \frac{GM}{rc^2 })
\,,
\end{align}
%
but there cannot be terms of just order \(O(GM/rc^2)\) since if there is no spin, even with positive BH mass the spin does not change.

\begin{bluebox}
  This is because: the 4-velocity of the infalling observer looks like \(u^{\mu } = (u^{t}, u^{r}, 0,0,)\). The spin in the LIF of the infalling observer only ever has angular components, \(s^{\nu } = (0,0,s^{\theta }, 0)\) (let us neglect the singularity of the coordinates at the \(z\) axis, it is not relevant).

  When we perform a boost to go to the Schwarzschild frame from the LIF, the transformation will mix the temporal and radial components of vectors, but it will leave the angular ones unchanged. Therefore, the spin vector will look like \((0,0, s^{\theta }, 0 )\) in the Schwarzschild frame as well.
\end{bluebox}

The BH-mass contribution is small: then the mixed term is ``second order'', we can discard it and consider the \(M=0\) case.

Therefore we can simply use the metric
%
\begin{align}
  \dd{s^2} = \eta_{\mu \nu } \dd{x^{\mu }} \dd{x^{\nu }}
  - \frac{4GJ}{r} \sin^2 \theta \dd{t} \dd{\varphi }
\,,
\end{align}
%
and only keep the \(O(J)\) terms.

\end{document}


\documentclass{article}
\usepackage {mathpartir}
\usepackage {amssymb}

\newcommand{\from}{\leftarrow}
\newcommand{\arr}{\rightarrow}
\newcommand{\kw}[1]{\mathtt{#1}}
\newcommand{\cc}{~::~}
\newcommand{\fun}{\star}

\newcommand{\eCase}[2]{\kw{case}~{#1}~\kw{of}~\{~{#2}~\}}
\newcommand{\eLetCase}[3]{\kw{case}~{#1}~\kw{of}~{#2}~\{~{#3}~\}}
\newcommand{\eLam}[2]{\lambda{#1}.~{#2}}
\newcommand{\eLet}[3]{\kw{let}~\{~{#1}={#2}~\}~\kw{in}~{#3}}
\newcommand{\eCut}[4]{\{ {#1} \from {#2}~|~{#3} \to {#4} \}}

\newcommand{\ju}[2]{\mathtt{#1} \cc {#2}}
\newcommand{\fits}[2]{{#1}\leftrightarrow{#2}}
\newcommand{\nofit}[2]{{#1}\nleftrightarrow{#2}}
\newcommand{\op}[1]{{#1}^\star}
\newcommand{\ty}[2]{\mathtt{#1}:{#2}}

\title{MALL}

\begin{document}

\section{Syntax}

\begin{mathpar}
t := s~|~\op s \\
s := a~|~()~|~(t,t)~|~0~|~(t+t) \\
\end{mathpar}

\section{No Proof Terms}

\begin{mathpar}

\infer
  {\fits a x}
  {a,x}

\infer
  {\fits a x}
  {a,x+p}

\infer
  {\fits a x}
  {a,p+x}

\infer
  { }
  {()}

\infer
  {\fits a x \\ \fits b y}
  {a,b,(x,y)}

\infer
  { }
  {\Gamma,\op 0}

\infer
  {\Gamma,a \\ \Delta,x \\ \fits a x}
  {\Gamma,\Delta}

\infer
  {\Gamma,x \\ \Gamma,y \\ \fits a x \\ \fits b y}
  {\Gamma,\op{(a+b)}}

\infer
  {\Gamma}
  {\Gamma,\op{()}}

\infer
  {\Gamma,x,y \\ \fits a x \\ \fits b y}
  {\Gamma,\op{(a,b)}}

\\

\infer
  { }
  {\fits a {\op a}}

\infer
  { }
  {\fits {\op a} a}
\end{mathpar}

\section{With Proof Terms}

The typing rules for an expression $e$ are of the form:
$$
\ju e \Gamma
$$

\begin{mathpar}

\infer
  {\fits a x}
  {\ju {u = v} {u:a, v:x}}

\infer
  {\fits a x}
  {\ju {u = L~v} {u:a+p, v:x}}

\infer
  {\fits a x}
  {\ju {u = R~v} {u:p+a, v:x}}

\infer
  { }
  {\ju {u = ()} {u:()}}

\infer
  {\fits a x \\ \fits b y}
  {\ju {u = (v,w)} {u:(x,y),v:a,w:b}}

\infer
  { }
  {\ju {u = \{ v_i \}} {u : \op 0, v_i:x_i}}

\infer
  {\ju {e1} {u:a,\Gamma} \\ \ju{e2} {v:x,\Delta} \\ \fits a x}
  {\ju{ \{ u \to e_1; v \to e_2 \}} {\Gamma,\Delta}}

\infer
  {\ju {e1} {v:x,\Gamma} \\ \ju {e2} {w:y,\Gamma} \\ \fits a x \\ \fits b y}
  {\ju {u = ~\{L~v \to e1; R~w \to~e2\}} {u:\op{(a+b)},\Gamma}}

\infer
  {\ju e {\Gamma}}
  {\ju {u = \{ () \to e \} } {u : \op{()}, \Gamma}}

\infer
  {\ju e {v:x,w:y,\Gamma} \\ \fits a x \\ \fits b y}
  {\ju {u = \{ (v,w) \to e \}} {u:\op{(a,b)},\Gamma}}

\end{mathpar}

\end{document}