M3 Shortcodes Stress Test
This page stress-tests all m3 shortcodes with nesting, markup, and edge cases.
Basic Shortcodes
Definition
A group is a set \(G\) together with a binary operation \(\cdot : G \times G \to G\) satisfying:
- Associativity: \((a \cdot b) \cdot c = a \cdot (b \cdot c)\)
- Identity: There exists \(e \in G\) such that \(e \cdot a = a \cdot e = a\)
- Inverses: For each \(a \in G\), there exists \(a^{-1}\) such that \(a \cdot a^{-1} = a^{-1} \cdot a = e\)
Theorem
Lagrange’s Theorem: Let \(G\) be a finite group and \(H \leq G\) a subgroup. Then \(|H|\) divides \(|G|\).
Lemma
If \(H \leq G\) and \(a, b \in G\), then either \(aH = bH\) or \(aH \cap bH = \emptyset\).
Corollary
The order of any element in a finite group divides the order of the group.
Proposition
Every group of prime order is cyclic.
Remark
The converse of Lagrange’s theorem is not true in general. For example, \(A_4\) has order 12 but no subgroup of order 6.
Example
Consider \(\mathbb{Z}_6 = \{0, 1, 2, 3, 4, 5\}\) under addition modulo 6.
- The subgroups are: \(\{0\}\), \(\{0, 3\}\), \(\{0, 2, 4\}\), and \(\mathbb{Z}_6\) itself.
- Their orders (1, 2, 3, 6) all divide \(|\mathbb{Z}_6| = 6\).
Proof
Let \([G:H] = n\) be the index of \(H\) in \(G\). The cosets \(a_1H, a_2H, \ldots, a_nH\) partition \(G\), and each coset has \(|H|\) elements. Thus \(|G| = n \cdot |H|\), so \(|H| \mid |G|\). \(\square\)
Hint
Try using the orbit-stabilizer theorem and count carefully.
Sketch
The key insight is that cosets partition the group. Count elements in each coset.
Answer
The answer is \(\boxed{42}\).
Nested Problem-Solution Structure
Basic Nesting
Show that \(\mathcal{G} = \left\{ \begin{bmatrix} 1 & x & y \\ 0 & 1 & z \\ 0 & 0 & 1 \end{bmatrix} : x, y, z \in \mathbb{R} \right\}\) is a group under matrix multiplication.
Let \(A_1 = \begin{bmatrix} 1 & x_1 & y_1 \\ 0 & 1 & z_1 \\ 0 & 0 & 1 \end{bmatrix}\) and \(A_2 = \begin{bmatrix} 1 & x_2 & y_2 \\ 0 & 1 & z_2 \\ 0 & 0 & 1 \end{bmatrix}\in \mathcal{G}\).
Then \(A_1 A_2 =\begin{bmatrix} 1 & x_1+x_2 & y_1+x_1z_2+y_2 \\ 0 & 1 & z_1+z_2 \\ 0 & 0 & 1 \end{bmatrix}\in\mathcal{G}\), so we have closure.
Associativity follows from the associativity of standard matrix multiplication.
Letting \(x=y=z=0\), observe that the identity is in \(\mathcal{G}\).
Finally, if we take \(x_2 = -x_1\), \(z_2 = -z_1\), and \(y_2 = -y_1-x_1z_2\), then \(A_1A_2 = I_3\), and thus inverses are of the required form! Therefore, \(\mathcal{G}\) is a group.
Subproblem Nesting
Solve the following:
Find all \(x\) such that \(x^2 \equiv 1 \pmod{8}\).
Testing \(x = 0, 1, \ldots, 7\):
- \(1^2 = 1 \equiv 1\)
- \(3^2 = 9 \equiv 1\)
- \(5^2 = 25 \equiv 1\)
- \(7^2 = 49 \equiv 1\)
So \(x \in \{1, 3, 5, 7\}\).
Determine if \((\mathbb{Z}/8\mathbb{Z})^*\) is cyclic.
Count elements and check if there’s an element of order 4.
No, \((\mathbb{Z}/8\mathbb{Z})^* \cong \mathbb{Z}_2 \times \mathbb{Z}_2\) is not cyclic.
Deeply Nested Structures
Fundamental Theorem of Finitely Generated Abelian Groups
Every finitely generated abelian group \(G\) is isomorphic to: \[G \cong \mathbb{Z}^r \oplus \mathbb{Z}_{n_1} \oplus \mathbb{Z}_{n_2} \oplus \cdots \oplus \mathbb{Z}_{n_k}\] where \(r \geq 0\) and \(n_1 | n_2 | \cdots | n_k\).
We prove this in several steps.
Every subgroup of \(\mathbb{Z}^n\) is free of rank at most \(n\).
Using this lemma, we proceed by induction on the number of generators.
The numbers \(n_1, \ldots, n_k\) are called the invariant factors of \(G\). They are unique up to ordering.
The base case \(n=1\) is trivial. For the inductive step, consider the quotient…
\(\blacksquare\)
TikZ Integration Test
Draw a commutative diagram showing the factory pattern.
Here is the UML diagram:
This demonstrates the Factory Method pattern where:
- Creator declares the factory method
- ConcreteCreator implements it
- Products are created through the factory method
Edge Cases
Empty Content
Special Characters
Testing special chars: \(\alpha\), \(\beta\), \(\gamma\), \(\delta\), \(\epsilon\)
LaTeX environments:
\begin{align} e^{i\pi} + 1 &= 0 \\ \int_0^\infty e^{-x^2} dx &= \frac{\sqrt{\pi}}{2} \end{align}
Code-like content: inline code, verbatim
def factorial(n):
return 1 if n <= 1 else n * factorial(n-1)
Long Content
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
This tests how the shortcode handles longer content that might wrap across multiple lines and paragraphs.
- Item 1
- Item 2
- Item 3
| Column 1 | Column 2 | Column 3 |
|---|---|---|
| A | B | C |
| D | E | F |
Multiple Counters Test
First theorem.
First definition.
Second theorem (should be numbered 2).
First lemma.
Second definition (should be numbered 2).
First corollary.
First example.
Third theorem (should be numbered 3).