% chap3.tex
% 2011/02/03, v1.10

\chapter{Mathematical solutions}
\label{mathsol}

\section{Why are we using amsthm.sty?}

Many authors are already using this style file, so we have decided that rather than re-invent the wheel, we will make it part of our distribution. This means that at the top of the root file must include the following lines:\\[0.5\baselineskip]
\verb"  \documentclass{"\texttt{\cambridge}\verb"}"\\
\verb"  \usepackage{amsmath}"\\
\verb"  \usepackage{amsthm}"\\[0.5\baselineskip]
As mentioned in Chapter~\ref{intro}, if your book does not use theorems, proofs, etc., then there is no need to include the amsthm package, but you do need to include these files to run this guide through \LaTeX. Note that if you are also using \verb"amsmath.sty", it \emph{must} precede \verb"amsthm.sty".

The instructions for amsthm.sty are documentated separately in \texttt{amsthdoc.pdf}. We are including \texttt{amsthm.sty} and \texttt{amsthdoc.pdf} in this distribution for your convenience, but you may find more recent versions on the web. The following sections discuss the basic features, plus a few extras.

To save time, you may cut and paste the code in Appendix~\ref{amsthmcommands} into your root file. This is a comprehensive (but not necessarily a complete) list of theorem-like environments you may wish to use.

The \verb"amsthm" commands used in this guide are detailed in Appendix~\ref{rootfile}. They are simply a subset of commands from Appendix~\ref{amsthmcommands}; some illustrate unnumbered versions.

Please note that theorems, lemmas, corollaries, propositions, conjectures, criteria, algorithms, definitions, conditions, problems, examples, etc.\ should be numbered in a single sequence, either by chapter (Chapter~4 would have \mbox{\textsc{\spacedheader{definition}} 4.1},
\mbox{\textsc{\spacedheader{lemma}} 4.2},
\mbox{\textsc{\spacedheader{lemma}} 4.3},
\mbox{\textsc{\spacedheader{proposition}} 4.4},
\mbox{\textsc{\spacedheader{corollary}} 4.5}) or by section (%
\mbox{\textsc{\spacedheader{definition}} 4.1.1},
\mbox{\textsc{\spacedheader{lemma}} 4.1.2},
\mbox{\textsc{\spacedheader{lemma}} 4.1.3},
\mbox{\textsc{\spacedheader{proposition}} 4.1.4},
\mbox{\textsc{\spacedheader{corollary}} 4.1.5}).

To number these elements by chapter in this guide, we have used\linebreak \verb"\newtheorem{theorem}{Theorem}[chapter]". If you prefer to have the elements numbered by section, replace \verb"[chapter]" with \verb"[section]".

\section{amsthm styles}

If no \verb"\theoremstyle" command is given, the style used will be \texttt{plain}. To specify different styles, divide your \verb"\newtheorem" commands into groups and preface each group with the appropriate \verb"\theoremstyle".

\subsection{amsthm \texttt{plain} style}

The \texttt{plain} style is normally used for theorems, lemmas, corollaries, propositions, conjectures, criteria and algorithms. The \cambridge\ style calls for these to be numbered in the same sequence. The following example resets the theorem numbers for each chapter; lemmas follow in the same sequence. For demonstration purposes only, we have requested that corollaries remain unnumbered by using the starred version:
\begin{verbatim}
  \theoremstyle{plain}% default
  \newtheorem{theorem}{Theorem}[chapter]
  \newtheorem{lemma}[theorem]{Lemma}
  \newtheorem*{corollary}{Corollary}

  \begin{theorem}
    Let the scalar function\ldots
  \end{theorem}
  \begin{lemma}[Tranah 2009]
    The first-order free surface amplitudes\ldots
  \end{lemma}
  \begin{lemma}[Normansell 2010]
    The exotic behaviours of Lagrangian\ldots
  \end{lemma}
  \begin{corollary}
    Let $G$ be the free group on\ldots
  \end{corollary}
\end{verbatim}
will produce the following output:
  \begin{theorem}
    Let the scalar function\ldots
  \end{theorem}
  \begin{lemma}[Tranah 2009]
    The first-order free surface amplitudes\ldots
  \end{lemma}
  \begin{lemma}[Normansell 2010]
    The exotic behaviours of Lagrangian\ldots
  \end{lemma}
  \begin{corollary}
    Let $G$ be the free group on\ldots
  \end{corollary}
%
Note that corollaries would normally be in the same numbering sequence as theorems and lemmas.

\subsection{amsthm \texttt{definition} style}
\label{amsdefn}

The \texttt{definition} style is normally used for definitions and conditions. It is \cambridge\ style to continue  with the same numbering sequence as for theorems, lemmas, etc.:
\begin{verbatim}
  \theoremstyle{definition}
  \newtheorem{definition}[theorem]{Definition}
  \newtheorem{condition}[theorem]{Condition}

  \begin{definition}
    The series above is the Green function\ldots
  \end{definition}
  \begin{condition}
    Diagrams~3 and~4 contribute to coupling constant renormalization
      of the mean field contribution\ldots
  \end{condition}
\end{verbatim}
will produce the following output:
  \begin{definition}
    The series above is the Green function\ldots
  \end{definition}
  \begin{condition}
    Diagrams~3 and~4 contribute to coupling constant renormalization
      of the mean field contribution\ldots
  \end{condition}


\subsection{amsthm \texttt{remark} style}
The \texttt{remark} style is normally used for remarks, notes, notation, claims, summary, acknowledgements, cases, conclusions. Authors are free to define their preferred numbering systems for these, but they must be separate from the theorem sequence.
\begin{verbatim}
  \theoremstyle{remark}
  \newtheorem{remark}{Remark}[chapter]
  \newtheorem{notation}[remark]{Notation}
  \newtheorem*{case}{Case}

  \begin{remark}
    The absolute amplitude of a stratified wake\ldots
  \end{remark}
  \begin{notation}
    For a poset $P$ and $\pi,\sigma \in P$ with $\pi < \sigma$
    we denote by $[\pi,\sigma]$ the interval\ldots
  \end{notation}
  \begin{case}
    The profiles of quadratic fluctuations\ldots
  \end{case}
\end{verbatim}
will produce the following output:
  \begin{remark}
    The absolute amplitude of a stratified wake\ldots
  \end{remark}
  \begin{notation}
    For a poset $P$ and $\pi,\sigma \in P$ with $\pi < \sigma$
    we denote by $[\pi,\sigma]$ the interval\ldots
  \end{notation}
  \begin{case}
    The profiles of quadratic fluctuations\ldots
  \end{case}

\section{Proofs}
\label{proofs}

The \verb"proof" environment is also part of the amsthm package, and provides a consistent format for proofs.
 For example,
\begin{verbatim}
  \begin{proof}
    Use $K_\lambda$ and $S_\lambda$ to translate combinators
    into $\lambda$-terms. For the converse, translate
    $\lambda x$ \ldots by [$x$] \ldots and use induction
    and the lemma.
  \end{proof}
\end{verbatim}
produces the following:
  \begin{proof}
    Use $K_\lambda$ and $S_\lambda$ to translate combinators
    into $\lambda$-terms. For the converse, translate
    $\lambda x$ \ldots by [$x$] \ldots and use induction
    and the lemma.
  \end{proof}

\subsection{Changing the word `Proof' to something else}

An optional argument allows you to substitute a different name for the standard `Proof'. To change the proof heading to read `Proof of the Pythagorean Theorem', key the following:
\begin{verbatim}
  \begin{proof}[Proof of the Pythagorean Theorem]
    Start with a generic right-angled triangle\ldots
  \end{proof}
\end{verbatim}
which produces:
  \begin{proof}[Proof of the Pythagorean Theorem]
    Start with a generic right-angled triangle\ldots
  \end{proof}


\subsection{Typesetting a proof without a \qedsymbol}

This is not part of the amsthm package. Use the \verb"proof*" version. For example,
\begin{verbatim}
  \begin{proof*}
    The apparent virtual mass coefficient\ldots
  \end{proof*}
\end{verbatim}
produces the following:
  \begin{proof*}
    The apparent virtual mass coefficient\ldots
  \end{proof*}

\subsection{Placing the \qedsymbol\ after a displayed equation}

To avoid the \qedsymbol\ dropping onto the following line at the end of a proof,
\begin{verbatim}
  \begin{proof}
    \ldots and, as we are all aware,
    \[
       E=mc^2. \qedhere
    \]
  \end{proof}
\end{verbatim}
produces the following:
  \begin{proof}
    \ldots and, as we are all aware,
    \[
       E=mc^2. \qedhere
    \]
  \end{proof}
When used with the amsmath package, version~2 or later, \verb"\qedhere" will position \qedsymbol\ flush right; with earlier versions, \qedsymbol\ will be spaced a quad away
from the end of the text or display.

If \verb"\qedhere" produces an error message in an equation, try using \verb"\mbox{\qedhere}" instead.

\subsection{Placing the \qedsymbol\ after a displayed eqnarray}

This is also not part of the amsthm package. To enable this, you need to used the starred version of \verb"proof", and add both \verb"\arrayqed" and \verb"\arrayqedhere", as shown in the following example:
\begin{verbatim}
  \begin{proof*}
    The following equations prove the theorem:
      \arrayqed
        \begin{eqnarray}
          \epsilon &=& -\frac{1}{2}U_0\frac{\mathrm{d}q'^2}
                       {\mathrm{d}x}\nonumber\\
                   &=& 10\nu\frac{q'^2}{\lambda^2}
        \arrayqedhere
        \end{eqnarray}
  \end{proof*}
\end{verbatim}
produces the following:
  \begin{proof*}
    The following equations prove the theorem:
      \arrayqed
        \begin{eqnarray}
          \epsilon &=& -\frac{1}{2}U_0\frac{\mathrm{d}q'^2}
                       {\mathrm{d}x}\nonumber\\
                   &=& 10\nu\frac{q'^2}{\lambda^2}
        \arrayqedhere
        \end{eqnarray}
  \end{proof*}

\section{Boxed equations}

You may highlight an individual equation using the standard \verb"\fbox" command as follows:
\begin{verbatim}
  \begin{equation}
    \fbox{$
    \ell_\textrm{c}(\alpha) = 2\alpha - \log \left( \mathrm{e}^\alpha
                                + \cdots + \mathrm{e}^{4\alpha} \right)
    $}
  \end{equation}
\end{verbatim}
%
  \begin{equation}
    \fbox{$
    \ell_\textrm{c}(\alpha) = 2\alpha - \log \left( \mathrm{e}^\alpha
                                + \cdots + \mathrm{e}^{4\alpha} \right)
    $}
  \end{equation}

\endinput
