Instiki
Theorems

Instiki support something resembling the amsthm Theorem Environments.

The following input

 +-- {: .un_defn}
 ###### Definition
 Let $H$ be a subgroup of a group $G$.  A *left coset* of
 $H$ in $G$ is a subset of $G$ that is of the form $x H$,
 where $x \in G$ and $x H = \{ x h : h \in H \}$.

 Similarly a *right coset* of $H$ in $G$ is a subset of $G$
 that is of the form $H x$, where $H x = \{ h x : h \in H\}$.
 =--

produces an un-numbered Definition:

Definition

Let H be a subgroup of a group G. A left coset of H in G is a subset of G that is of the form xH, where xG and xH={xh:hH}.

Similarly a right coset of H in G is a subset of G that is of the form Hx, where Hx={hx:hH}.

Similarly, the input

 +-- {: .num_lemma #LeftCosetsDisjoint}
 ###### Lemma
 Let $H$ be a subgroup of a group $G$, and let $x$ and $y$ be elements
 of $G$. Suppose that $x H \cap y H$ is non-empty. Then $x H = y H$.
 =--

 +-- {: .proof}
 ###### Proof
 Let $z$ be some element of $x H \cap y H$.  Then $z = x a$ for some
 $a \in H$, and $z = y b$ for some $b \in H$.  If $h$ is any element
 of $H$ then $a h \in H$ and $a^{-1}h \in H$, since $H$ is a subgroup
 of $G$. But $z h = x(a h)$ and $xh = z(a^{-1}h)$ for all $h \in H$.
 Therefore $z H \subset x H$ and $x H \subset z H$, and thus
 $x H = z H$. Similarly $y H = z H$, and thus $x H = y H$, as required.
 =--

 +-- {: .num_lemma #SizeOfLeftCoset}
 ###### Lemma
 Let $H$ be a finite subgroup of a group $G$.  Then each left
 coset of $H$ in $G$ has the same number of elements as $H$.
 =--

 +-- {: .num_theorem #Lagrange}
 ###### Theorem
 **(Lagrange's Theorem)**. Let $G$ be a finite group, and let $H$ be a
 subgroup of $G$. Then the order of $H$ divides the order of $G$.
 =--

produces a numbered Lemma, followed by a Proof, followed by another numbered Lemma and a numbered Theorem:

Lemma

Let H be a subgroup of a group G, and let x and y be elements of G. Suppose that xHyH is non-empty. Then xH=yH.

Proof

Let z be some element of xHyH. Then z=xa for some aH, and z=yb for some bH. If h is any element of H then ahH and a 1hH, since H is a subgroup of G. But zh=x(ah) and xh=z(a 1h) for all hH. Therefore zHxH and xHzH, and thus xH=zH. Similarly yH=zH, and thus xH=yH, as required.

Lemma

Let H be a finite subgroup of a group G. Then each left coset of H in G has the same number of elements as H.

Theorem

(Lagrange’s Theorem). Let G be a finite group, and let H be a subgroup of G. Then the order of H divides the order of G.

These can be linked-to in the obvious fashion.

 See Lemma \ref{LeftCosetsDisjoint}.

produces

See Lemma 1.

as you’d expect. Note that each type of numbered Theorem-like environment has its own number counter.

The key is in the CSS classes.

 .proof

produces a Proof environment.

 .num_*

where ”*” is one of

 theorem     (for Theorem)
 lemma       (for Lemma)
 prop        (for Proposition)
 cor         (for Corollary)
 defn        (for Definition)
 example     (for Example)
 remark      (for Remark)
 note        (for Note)

produces a numbered Theorem (Lemma, … etc).

.un_*

produces the corresponding un-numbered version.

The above examples were drawn from here, though the LaTeX output (as can be seen, by clicking on the TeX link at the bottom of the page) is, instead, amsthm-compatible.

Extensions

Extending this facility, with new Theorem-like environments is easy. For example, say we wish to add a Conjecture and a Problem environment.

In our LaTeX template, we will need

 \theoremstyle{plain}
 \newtheorem{conjecture}{Conjecture}
 \newtheorem*{uconjecture}{Conjecture}
 \theoremstyle{definition}
 \newtheorem{problem}{Problem}
 \newtheorem*{uproblem}{Problem}

(Note the naming convention: the un-numbered version has a “u” prepended to the name.)

The CSS styles for our wiki get augmented with

body {counter-reset: theorem lemma proposition corollary definition example remark note
     conjecture problem}
.un_conjecture *, .num_conjecture * {font-style: italic}
.num_conjecture .theorem_label:after {
    content: " " counter(conjecture); counter-increment: conjecture;}
.num_problem .theorem_label:after {
    content: " " counter(problem); counter-increment: problem;}

and we’re now ready to use our newly-minted CSS class-names, un_conjecture, num_conjecture, un_problem and num_problem.