All proof directives can be included using the prf:kind
pattern, where the proof directives are shown in Table 1. The directive is enumerated by default and can take in an optional title argument which is shown in brackets after the proof.
Same as Sphinx Proof 🎉
The implementation and documentation for proofs, theorems, etc. is based on Sphinx Proof, the syntax can be used interchangeably. We have reused the examples in that extension here to show off the various parts of the MyST extension.
Changes to the original extension include being able to click on the proof label (e.g. “Theorem 1”), and having a link to that proof anchor. We have also updated the styles from both Sphinx and Jupyter Book to be more distinct from admonitions.
You can also reference proofs with any cross-reference syntax (including the {prf:ref}
role). We recommend the markdown link syntax.
Here is an example of a {prf:theorem}
with a custom title:
Table 1:Proof kinds that can be used as directives
prf:algorithm | prf:axiom | prf:conjecture |
prf:corollary | prf:criteria | prf:definition |
prf:example | prf:lemma | prf:observation |
prf:property | prf:proposition | prf:proof |
prf:remark | prf:theorem |
The following options for proof directives are supported:
label
: textA unique identifier for your theorem that you can use to reference it with a Markdown link or the
{prf:ref}
role. Cannot contain spaces or special characters.class
: textValue of the theorem’s class attribute which can be used to add custom CSS or JavaScript. This can also be the optional
dropdown
class to initially hide the proof.nonumber
: flag (empty)Turns off auto numbering.
Referencing Proofs¶
You can refer to a proof using the standard link syntax:
[](#my-theorem)
, creates Theorem 1[{name}](#my-theorem)
creates Orthogonal-Projection-Theorem[{number}](#my-theorem)
creates 1[See Theorem](#my-theorem)
creates See Theorem
Compatibility with Sphinx Proof
You may also use the the {prf:ref}
role like: {prf:ref}`my-theorem`
, which will replace the reference with the theorem number like so: Theorem 1. When an explicit text is provided, this caption will serve as the title of the reference. For example, {prf:ref}`Orthogonal-Projection-Theorem <my-theorem>`
will produce: Orthogonal-Projection-Theorem.
Hiding Proof Content¶
To hide the directive, simply add :class: dropdown
as a directive option.
Example
Proof Examples¶
Proofs¶
Source: Adapted from QuantEcon
Theorems¶
Source: QuantEcon
Axioms¶
Source: Stachurski (2009)
Lemmas¶
Source: QuantEcon
Definitions¶
Source: QuantEcon
Criteria¶
Source: Wikipedia
Remarks¶
Source: QuantEcon
Conjectures¶
Corollaries¶
Source: QuantEcon
Algorithms¶
Source: Wikipedia
Examples¶
Source: QuantEcon
Properties¶
Observations¶
Propositions¶
Assumptions¶
- Stachurski, J. (2009). Economic Dynamics: Theory and Computation (Vol. 1). The MIT Press. https://ideas.repec.org/b/mtp/titles/0262012774.html