Sarmate.net Sarmate.net
Home Features Pricing Documentation Contact
Log in Sign up
Scientific web 10 min

Formal blocks — definition, theorem, proof…

These mathpad tags structure mathematical statements: definitions, theorems, properties, proofs, corollaries, lemmas, remarks, examples. Each block has its own style (color, frame, title bar) and is automatically numbered per category. The label language («Definition», «Theorem»…) follows the lang attribute of <mp-course>.

Block overview

<mp-definition>A definition. Accepts a <mp-title> as first child.
<mp-theorem>A theorem. Optional roc attribute for «restitution of organized knowledge» (French exam convention).
<mp-property>A mathematical property (often more technical than a theorem).
<mp-proof>A proof. Often placed right after an mp-theorem. An automatic «□» closes the block.
<mp-corollary>A direct consequence of a previous theorem.
<mp-lemma>A preparatory lemma, used as a step toward a proof.
<mp-remark>A remark — lighter note, often explanatory or contextual.
<mp-example>An inline example within a paragraph — compact, less visible than a proof block.

<mp-definition> — example

HTML
<mp-definition>
  <mp-title>Continuous function at $a$</mp-title>
  A function $f$ is <strong>continuous at $a$</strong> if $\lim\limits_{x \to a} f(x) = f(a)$.</mp-definition>
Output Continuous function at $a$ A function $f$ is continuous at $a$ if $\lim\limits_{x \to a} f(x) = f(a)$.
<mp-title> is always the first child All formal blocks (mp-definition, mp-theorem, mp-property…) follow the same pattern: an optional <mp-title> as first child, then content. <mp-title> accepts KaTeX formulas (unlike the old name="" attribute which isn't rendered).

<mp-theorem> + <mp-proof>

A theorem and its proof are typically placed together. The roc attribute (Restitution Organisée de Connaissances, French baccalaureate convention) adds a visible «ROC» mark.

HTML
<mp-theorem roc>
  <mp-title>Sum of a geometric sequence</mp-title>
  For all $q \neq 1$ and all $n \in \mathbb{N}$:  $$\sum_{k=0}^{n} q^k = \dfrac{1 - q^{n+1}}{1 - q}$$
</mp-theorem>

<mp-proof>
  Let $S_n = 1 + q + q^2 + \cdots + q^n$. Then:  <mp-align>
    q \, S_n & = & q + q^2 + \cdots + q^{n+1} \\
    q \, S_n - S_n & = & q^{n+1} - 1 \\
    (q - 1) S_n & = & q^{n+1} - 1
  </mp-align>
  Since $q \neq 1$, $q - 1 \neq 0$, so $S_n = \dfrac{q^{n+1} - 1}{q - 1} = \dfrac{1 - q^{n+1}}{1 - q}$.</mp-proof>
Output Sum of a geometric sequence For all $q \neq 1$ and all $n \in \mathbb{N}$: $$\sum_{k=0}^{n} q^k = \dfrac{1 - q^{n+1}}{1 - q}$$ Let $S_n = 1 + q + q^2 + \cdots + q^n$. Then: $$\begin{array}{rcl}q \, S_n & = & q + q^2 + \cdots + q^{n+1} \\ q \, S_n - S_n & = & q^{n+1} - 1 \\ (q - 1) S_n & = & q^{n+1} - 1\end{array}$$ Since $q \neq 1$, $q - 1 \neq 0$, so $S_n = \dfrac{q^{n+1} - 1}{q - 1} = \dfrac{1 - q^{n+1}}{1 - q}$.

<mp-property> and <mp-corollary>

Work like mp-theorem — distinct styles and independent counters:

HTML
<mp-property>
  <mp-title>Symmetry</mp-title>
  For all $a, b \in \mathbb{R}$: $a + b = b + a$.</mp-property>

<mp-corollary>
  Therefore the sum operation is commutative over $\mathbb{R}$.</mp-corollary>
Output Symmetry For all $a, b \in \mathbb{R}$: $a + b = b + a$. Therefore the sum operation is commutative over $\mathbb{R}$.

<mp-remark>, <mp-lemma>, <mp-example>

Three secondary blocks, lighter than a theorem, each with its own visual style.

HTML
<mp-remark>
  This property no longer holds in $\mathbb{N}$ — see $3 - 5$.</mp-remark>

<mp-lemma>
  If $a \mid b$ and $a \mid c$, then $a \mid (b + c)$.</mp-lemma>

<mp-example>
  $\sqrt{2}$ is irrational.</mp-example>
Output This property no longer holds in $\mathbb{N}$ — see $3 - 5$. If $a \mid b$ and $a \mid c$, then $a \mid (b + c)$. $\sqrt{2}$ is irrational.

Reference a block

Give the target block a standard HTML id, then reference it with <mp-ref target="...">. The reference automatically displays the number («3») or the full label («Theorem 3») depending on the format attribute.

HTML
<mp-theorem id="thm-bolzano">
  <mp-title>Intermediate value theorem</mp-title>
  …
</mp-theorem>

By <mp-ref target="thm-bolzano" format="full"></mp-ref>, there exists $c \in [a;b]$ such that …
Editor buttons In the online editor: the Structures menu offers one button per formal block (Definition, Theorem, Property…). Each inserts the skeleton with an example <mp-title>.

Ready to try mathpad?

Create your first interactive scientific HTML document in the online editor, or import your existing LaTeX course in one click.