Typeset theorems and proofs
Define numbered theorem environments and finish proofs with consistent academic formatting.
On this page
The amsthm package gives statements, definitions, and proofs a consistent structure. Check the venue template for existing statement types before loading packages
or defining your own. Define each missing type once in the preamble, then label
instances so their numbers survive reordering.
Define related statement types#
The first argument to \newtheorem is the source environment name and the second is the printed heading. An optional existing counter in brackets makes statement types share a sequence; a final [section] resets the new counter in each section.
\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\begin{document}
\section{Parity}
\begin{definition}
An integer is even if it equals \(2k\) for some integer \(k\).
\end{definition}
\begin{lemma}\label{lem:even-sum}
The sum of two even integers is even.
\end{lemma}
\begin{proof}[Proof of Lemma~\ref{lem:even-sum}]
Write the integers as \(2m\) and \(2n\). Since \(m+n\) is an integer,
\[
2m+2n=2(m+n), \qedhere
\]
\end{proof}
\begin{corollary}
Any finite sum of even integers is even.
\end{corollary}
\end{document}The output numbers the definition, lemma, and corollary in one section-based sequence. The optional proof title identifies the result being proved. \qedhere places the end-of-proof mark on the displayed equation; omit it when the proof ends in ordinary text and let the environment place the mark.
Choose styles by meaning#
\theoremstyle{plain} is the usual style for theorems, lemmas, and corollaries; definition suits definitions and examples; remark suits remarks and notes. Set a style before the declarations it should affect. A theorem can also have a one-off optional note, as in \begin{theorem}[Central limit theorem].
Put \label immediately after the theorem or lemma begins, then use \ref or the reference package required by your template. Do not type statement numbers by hand.
Respect an existing class or template#
Journal classes often declare theorem environments, counter relationships, and proof styling themselves. Read the author template before adding amsthm or redeclaring theorem: a duplicate definition causes an error, and a replacement style may violate the venue format. Add only the missing statement types in the form the template documents.
As an exercise, add a remark environment with \theoremstyle{remark} and confirm it has the intended style without disrupting the shared statement numbers. Then continue with images, or use cross-references to cite results throughout a manuscript.
