Skip to content
Topos Uranos

Summary

This lesson teaches how to typeset statements and proofs as declared environments, not as bold type written by hand. It explains what is gained by declaring them (numbering, cross-referencing, consistency and a style that can be changed in one line); it presents the amsthm package and its command \newtheorem, with the unnumbered form, the shared counter versus separate counters and numbering within the section or the chapter, and deduces which numbering suits an article and which a book; it distinguishes the three styles of \theoremstyle according to the function of the statement; it shows the optional argument that gives a result a name or an attribution; it studies the proof environment, its heading in the document's language, its closing symbol and the defect that \qedhere corrects; it teaches how to refer to statements with cleveref and checks what cleveref writes when it is not given the name, including a behaviour of the shared counter worth knowing; it briefly presents \newtheoremstyle and thmtools; it shows the use of these environments outside mathematics; and it ends with the typical errors and their logs.

Learning objectives

  1. Declare theorems, lemmas, definitions and remarks with \newtheorem and \theoremstyle, choosing the style by the function of the statement.
  2. Choose between a shared counter and separate counters, and between continuous numbering and numbering by section, and predict the resulting numbers.
  3. Write proofs with proof, give them a heading of their own and put the closing symbol in its place with \qedhere when they end in a displayed formula or a list.
  4. Refer to statements with \cref, order the preamble so that cleveref names them correctly, and diagnose references that print “??” or a wrong name.
  5. Interpret the logs of the typical errors in declaring statements and correct their cause.

Why declare statements

A demonstrative text is articulated in statements with different functions: a definition fixes the meaning of a term, a theorem asserts something that will be proved, a lemma prepares a theorem, a corollary follows from it, a remark comments without asserting anything new. Typographic tradition distinguishes them by their heading, “Theorem 3.”, by their number, which allows them to be cited, and by their appearance. Nothing prevents imitating all this by hand, with bold type and a number written by the author.

LaTeX code
\textbf{Theorem 2.} \emph{Every prime number greater than 2 is odd.}​\textbf{Lemma 3.} \emph{If $n$ is even, $n^2$ is even.}

The printed result may be identical to that of a declared environment; the defect lies in the source, and it is the same one that the lesson on cross-references and the one on macros and a preamble of one's own pointed out for other objects. If this is so, four losses follow. The number, written by hand, ceases to be true as soon as a statement is inserted. There is nothing to attach a label to, so the reference becomes once again a number written by hand. The appearance depends on the author's memory, and a single lapse is enough for a theorem to come out in upright type. And if a journal asks for the statements in another typeface, each one must be corrected. Declaring a theorem environment names the function, and its definition, written once in the preamble, fixes the number, the heading and the appearance.