%% filename: thmtest.tex
%% version: 2.01
%% date: 2004/08/02
%%
%% American Mathematical Society
%% Technical Support
%% Publications Technical Group
%% 201 Charles Street
%% Providence, RI 02904
%% USA
%% tel: (401) 455-4080
%%      (800) 321-4267 (USA and Canada only)
%% fax: (401) 331-3842
%% email: tech-support@ams.org
%% 
%% Copyright 1996, 2004, 2010 American Mathematical Society.
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status `maintained'.
%% 
%% The Current Maintainer of this work is the American Mathematical
%% Society.
%%
%% ====================================================================

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    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}
