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 JupyterBook 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:algorithmprf:axiomprf:conjecture
prf:corollaryprf:criteriaprf:definition
prf:exampleprf:lemmaprf:observation
prf:propertyprf:propositionprf:proof
prf:remarkprf:theorem

The following options for proof directives are supported:

  • label: text

    A 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: text

    Value 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:

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

References
  1. Stachurski, J. (2009). Economic Dynamics: Theory and Computation (Vol. 1). The MIT Press.
MyST MarkdownMyST Markdown
Community-driven tools for the future of technical communication and publication