Write a theorem and its proof
Write a theorem, lemma or definition with a name and a number, add its proof, refer to it from elsewhere in the text, and set problems with hints and solutions.
Theorems, lemmas, definitions, proofs and the rest are statements: blocks that print a bold label at the start of their first line, the way a mathematics text does. This guide writes one from start to finish, numbers it, refers to it, and covers the cases a lecture course runs into: a kind the list does not have, a claim inside a proof, and a problem with its hint and solution.
Choose the kind
Pick the kind by what the block is in the argument: theorem for a main
result, lemma for a step towards one, corollary for what follows from it,
definition, example, remark, conjecture, and proof. The
syntax reference lists every
kind with how it renders. The label is printed in the document's language, so
you always write the kind in English: a :::theorem in a Russian lecture
prints Теорема.
Write a theorem with a name
- Open the block with three colons and the kind, and put the result's name
in square brackets if it has one:
:::theorem[Lagrange]. - Write the statement on the following lines. It is ordinary Markdown, with maths, lists and displays.
- Close the block with a line of three colons.
Theorem (Lagrange). If is a subgroup of a finite group , then divides .
:::theorem[Lagrange]
If $H$ is a subgroup of a finite group $G$, then $|H|$ divides $|G|$.
:::The page prints Theorem (Lagrange). in bold and sets the statement in
italics. The brackets hold the name, never the number: [Lagrange], not
[Theorem 3].
Add its proof
- Directly under the theorem, open a
:::proofblock, write the proof, and close it.
Proof. The left cosets of partition , and each has elements, so .
:::proof
The left cosets of $H$ partition $G$, and each has $|H|$ elements, so
$|G| = [G : H]\,|H|$.
:::The page labels it Proof. and ends it with ∎, so do not type your own
QED mark. To print a different word, such as Sketch of proof or the
Dem. of an older text, give the proof a label:
:::proof{label="Sketch of proof"}. It keeps its ∎.
Number your results
The published page does not number statements by itself yet: a theorem without a number is labelled Theorem. If the reader should be able to say "by Theorem 2.1", give each result its number.
- Decide on the scheme, for example the section number and a running count: 2.1, 2.2, 2.3.
- Write the number on the fence as
number=::::theorem{number=2.1}. - If the statement also has a name, keep the name in brackets:
:::theorem[Lagrange]{number=2.1}.
Definition 2.1. The index of a subgroup is the number of its left cosets.
Theorem 2.2 (Lagrange). If is a subgroup of a finite group , then .
:::definition{number=2.1}
The *index* $[G : H]$ of a subgroup $H$ is the number of its left cosets.
:::
:::theorem[Lagrange]{number=2.2}
If $H$ is a subgroup of a finite group $G$, then $|G| = [G : H]\,|H|$.
:::The page prints Definition 2.1. and Theorem 2.2 (Lagrange). A number
made only of digits and dots can also go in the brackets when there is no
name: :::lemma[2.3] is Lemma 2.3.
A number does not have to be digits: number=IV.7, number=1b and
number=A.3 print as written. A number that starts with a symbol, such as
✱2·17 or §4, is printed alone, without the word, the way a book prints
it.
Refer to a result
- Give the statement an anchor on its fence, together with its number:
:::theorem[Lagrange]{#lagrange number=2.2}. - Link to it with the number in the link text:
[Theorem 2.2](#lagrange).
Theorem 2.2 (Lagrange). If is a subgroup of a finite group , then divides .
By Theorem 2.2, a group of prime order has no subgroups other than itself and the trivial one.
:::theorem[Lagrange]{#lagrange number=2.2}
If $H$ is a subgroup of a finite group $G$, then $|H|$ divides $|G|$.
:::
By [Theorem 2.2](#lagrange), a group of prime order has no subgroups other
than itself and the trivial one.A click on the link takes the reader to the theorem. Choose a name that says
what the result is, such as #lagrange, rather than where it is, such as
#theorem-2-2: the name stays right when the numbers change. Links from
another work, and to figures and equations, are in
Cite works and cross-reference.
Use a kind the list does not have
There is no :::proposition or :::claim. A misspelt or unknown kind is
shown as typed, so you will see it in the preview. Two forms give you the
word you want:
- For a result that should look and behave like a theorem, keep the kind and
change the word:
:::theorem{label="Proposition"}. - For a block with a word of its own and no kind behind it, use
:::statement[Claim]. Its body is upright, not italic.
Either way, the word is printed exactly as you wrote it and is not translated, so write it in the document's language.
Put a claim inside a proof
A statement can hold other blocks. Give the outer fence more colons than the one inside it:
- Open the proof with four colons,
::::proof. - Write the inner block with three,
:::statement[Claim] … :::. - Close the proof with four colons.
Proof. We argue by induction on .
Claim. For every , the map is injective.
The claim for is the theorem.
::::proof
We argue by induction on $n$.
:::statement[Claim]
For every $k \le n$, the map $\varphi_k$ is injective.
:::
The claim for $k = n$ is the theorem.
::::The ∎ goes at the end of the whole proof, after the claim.
Set a problem with a hint and a solution
On a problem sheet, each problem is a :::problem, and its hint and solution
go inside it. Both render folded, so a reader can try the problem before
opening them.
- Open the problem with four colons and its number:
::::problem[1]. - Write the problem, then a
:::hintand a:::solutionwith three colons each. - Close the problem with four colons.
Problem 1. Show that is irrational.
Hint.
Suppose in lowest terms, and look at the parity of .
Solution.
From , is even, say . Then , so is even too, contradicting lowest terms.
::::problem[1]
Show that $\sqrt{2}$ is irrational.
:::hint
Suppose $\sqrt{2} = p/q$ in lowest terms, and look at the parity of $p$.
:::
:::solution
From $p^2 = 2q^2$, $p$ is even, say $p = 2r$. Then $q^2 = 2r^2$, so $q$ is
even too, contradicting lowest terms.
:::
::::A problem migrated from an older sheet may carry an anchor such as
{#p-412} on its fence. Leave it: old links to that problem arrive through
it.
The result
In the preview, each statement starts with its bold label and the number and
name you gave it; theorems, lemmas and corollaries have italic bodies, and
definitions, examples and remarks upright ones; each proof ends with ∎; a
link to a statement jumps to it; and a problem's hint and solution are closed
until clicked. If a ::: line is shown as text instead, the kind is misspelt
or the colons do not match; see
Troubleshooting Markdown.