%%% ====================================================================
%%% @LaTeX-file{
%%%   filename  = "thmtest.tex",
%%%   version   = "2.01",
%%%   date      = "2004/08/02",
%%%   time      = "14:18:27 EDT",
%%%   checksum  = "26819 255 963 8277",
%%%   author    = "American Mathematical Society",
%%%   copyright = "Copyright 1996, 2004 American Mathematical Society,
%%%                all rights reserved.  Copying of this file is
%%%                authorized only if either:
%%%                (1) you make absolutely no changes to your copy,
%%%                including name; OR
%%%                (2) if you do make changes, you first rename it
%%%                to some other name.",
%%%   address   = "American Mathematical Society,
%%%                Technical Support,
%%%                Publications Technical Group,
%%%                201 Charles Street,
%%%                Providence, RI 02904,
%%%                USA",
%%%   telephone = "401-455-4080 or (in the USA and Canada)
%%%                800-321-4AMS (321-4267)",
%%%   FAX       = "401-331-3842",
%%%   email     = "tech-support@ams.org (Internet)",
%%%   codetable = "ISO/ASCII",
%%%   supported = "yes",
%%%   keywords  = "latex, amslatex, ams-latex, theorem, proof",
%%%   abstract  = "This is part of the AMS-\LaTeX{} distribution.
%%%                It is a sample document illustrating the use of
%%%                the amsthm package.",
%%%   docstring = "The checksum field above contains a CRC-16
%%%                checksum as the first value, followed by the
%%%                equivalent of the standard UNIX wc (word
%%%                count) utility output of lines, words, and
%%%                characters.  This is produced by Robert
%%%                Solovay's checksum utility.",
%%% }
%%% ====================================================================

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    Option test file, will be created during the first LaTeX run;
%    this facility is not available when using an AMS document class.
\begin{filecontents}{exercise.thm}
\def\th@exercise{%
  \normalfont % body font
  \thm@headpunct{:}%
}
\end{filecontents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass{article}
\title{Newtheorem and theoremstyle test}
\author{Michael Downes\\updated by Barbara Beeton}

\usepackage[exercise]{amsthm}

\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{prop}{Proposition}
\newtheorem{lem}[thm]{Lemma}

\theoremstyle{remark}
\newtheorem*{rmk}{Remark}

\theoremstyle{plain}
\newtheorem*{Ahlfors}{Ahlfors' Lemma}

\newtheoremstyle{note}% name
  {3pt}%      Space above
  {3pt}%      Space below
  {}%         Body font
  {}%         Indent amount (empty = no indent, \parindent = para indent)
  {\itshape}% Thm head font
  {:}%        Punctuation after thm head
  {.5em}%     Space after thm head: " " = normal interword space;
        %       \newline = linebreak
  {}%         Thm head spec (can be left empty, meaning `normal')

\theoremstyle{note}
\newtheorem{note}{Note}

\newtheoremstyle{citing}% name
  {3pt}%      Space above, empty = `usual value'
  {3pt}%      Space below
  {\itshape}% Body font
  {}%         Indent amount (empty = no indent, \parindent = para indent)
  {\bfseries}% Thm head font
  {.}%        Punctuation after thm head
  {.5em}%     Space after thm head: " " = normal interword space;
        %       \newline = linebreak
  {\thmnote{#3}}% Thm head spec

\theoremstyle{citing}
\newtheorem*{varthm}{}% all text supplied in the note

\newtheoremstyle{break}% name
  {9pt}%      Space above, empty = `usual value'
  {9pt}%      Space below
  {\itshape}% Body font
  {}%         Indent amount (empty = no indent, \parindent = para indent)
  {\bfseries}% Thm head font
  {.}%        Punctuation after thm head
  {\newline}% Space after thm head: \newline = linebreak
  {}%         Thm head spec

\theoremstyle{break}
\newtheorem{bthm}{B-Theorem}

\theoremstyle{exercise}
\newtheorem{exer}{Exercise}

\swapnumbers
\theoremstyle{plain}
\newtheorem{thmsw}{Theorem}[section]
\newtheorem{corsw}[thmsw]{Corollary}
\newtheorem{propsw}{Proposition}
\newtheorem{lemsw}[thmsw]{Lemma}

%    Because the amsmath pkg is not used, we need to define a couple of
%    commands in more primitive terms.
\let\lvert=|\let\rvert=|
\newcommand{\Ric}{\mathop{\mathrm{Ric}}\nolimits}

%    Dispel annoying problem of slightly overlong lines:
\addtolength{\textwidth}{8pt}

\begin{document}
\maketitle

\section{Test of standard theorem styles}

Ahlfors' Lemma gives the principal criterion for obtaining lower bounds
on the Kobayashi metric.

\begin{Ahlfors}
Let $ds^2 = h(z)\lvert dz\rvert^2$ be a Hermitian pseudo-metric on
$\mathbf{D}_r$, $h\in C^2(\mathbf{D}_r)$, with $\omega$ the associated
$(1,1)$-form. If $\Ric\omega\geq\omega$ on $\mathbf{D}_r$,
then $\omega\leq\omega_r$ on all of $\mathbf{D}_r$ (or equivalently,
$ds^2\leq ds_r^2$).
\end{Ahlfors}

\begin{lem}[negatively curved families]
Let $\{ds_1^2,\dots,ds_k^2\}$ be a negatively curved family of metrics
on $\mathbf{D}_r$, with associated forms $\omega^1$, \dots, $\omega^k$.
Then $\omega^i \leq\omega_r$ for all $i$.
\end{lem}

Then our main theorem:
\begin{thm}\label{pigspan}
Let $d_{\max}$ and $d_{\min}$ be the maximum, resp.\ minimum distance
between any two adjacent vertices of a quadrilateral $Q$. Let $\sigma$
be the diagonal pigspan of a pig $P$ with four legs.
Then $P$ is capable of standing on the corners of $Q$ iff
\begin{equation}\label{sdq}
\sigma\geq \sqrt{d_{\max}^2+d_{\min}^2}.
\end{equation}
\end{thm}

\begin{cor}
Admitting reflection and rotation, a three-legged pig $P$ is capable of
standing on the corners of a triangle $T$ iff (\ref{sdq}) holds.
\end{cor}

\begin{rmk}
As two-legged pigs generally fall over, the case of a polygon of order
$2$ is uninteresting.
\end{rmk}

\section{Custom theorem styles}

\begin{exer}
Generalize Theorem~\ref{pigspan} to three and four dimensions.
\end{exer}

\begin{note}
This is a test of the custom theorem style `note'. It is supposed to have
variant fonts and other differences.
\end{note}

\begin{bthm}
Test of the `linebreak' style of theorem heading.
\end{bthm}

This is a test of a citing theorem to cite a theorem from some other source.

\begin{varthm}[Theorem 3.6 in \cite{thatone}]
No hyperlinking available here yet \dots\ but that's not a
bad idea for the future.
\end{varthm}

\section{The proof environment}

\begin{proof}
Here is a test of the proof environment.
\end{proof}

\begin{proof}[Proof of Theorem \ref{pigspan}]
And another test.
\end{proof}

\begin{proof}[Proof \textup(necessity\textup)]
And another.
\end{proof}

\begin{proof}[Proof \textup(sufficiency\textup)]
And another, ending with a display:
\[
1+1=2\,. \qedhere
\]
\end{proof}

\section{Test of number-swapping}

This is a repeat of the first section but with numbers in theorem heads
swapped to the left.

Ahlfors' Lemma gives the principal criterion for obtaining lower bounds
on the Kobayashi metric.
\begin{Ahlfors}
Let $ds^2 = h(z)\lvert dz\rvert^2$ be a Hermitian pseudo-metric on
$\mathbf{D}_r$, $h\in C^2(\mathbf{D}_r)$, with $\omega$ the associated
$(1,1)$-form. If $\Ric\omega\geq\omega$ on $\mathbf{D}_r$,
then $\omega\leq\omega_r$ on all of $\mathbf{D}_r$ (or equivalently,
$ds^2\leq ds_r^2$).
\end{Ahlfors}

\begin{lemsw}[negatively curved families]
Let $\{ds_1^2,\dots,ds_k^2\}$ be a negatively curved family of metrics
on $\mathbf{D}_r$, with associated forms $\omega^1$, \dots, $\omega^k$.
Then $\omega^i \leq\omega_r$ for all $i$.
\end{lemsw}

Then our main theorem:
\begin{thmsw}
Let $d_{\max}$ and $d_{\min}$ be the maximum, resp.\ minimum distance
between any two adjacent vertices of a quadrilateral $Q$. Let $\sigma$
be the diagonal pigspan of a pig $P$ with four legs.
Then $P$ is capable of standing on the corners of $Q$ iff
\begin{equation}\label{sdqsw}
\sigma\geq \sqrt{d_{\max}^2+d_{\min}^2}.
\end{equation}
\end{thmsw}

\begin{corsw}
Admitting reflection and rotation, a three-legged pig $P$ is capable of
standing on the corners of a triangle $T$ iff (\ref{sdqsw}) holds.
\end{corsw}

\begin{thebibliography}{99}
\bibitem{thatone} Dummy entry.
\end{thebibliography}

\end{document}
