Skip to main content

Math

This site supports LaTeX math via KaTeX and numbered math environment components for academic-style content.


Inline and Display Math

Use single dollar signs for inline math: $E = mc^2$ renders as E=mc2E = mc^2.

Use double dollar signs for display math:

θJ(θ)=Eπθ[t=0Tθlogπθ(atst)Gt]\nabla_\theta J(\theta) = \mathbb{E}_{\pi_\theta} \left[ \sum_{t=0}^{T} \nabla_\theta \log \pi_\theta(a_t | s_t) \cdot G_t \right]

See the full list of supported functions at KaTeX docs.


Numbered Equations

The <Equation> component renders a centered, numbered equation:

L(θ)=i=1Nyilogy^iL(\theta) = -\sum_{i=1}^{N} y_i \log \hat{y}_i

softmax(zi)=ezijezj\text{softmax}(z_i) = \frac{e^{z_i}}{\sum_{j} e^{z_j}}

Reference them inline: the cross-entropy loss uses the softmax .


Definitions, Theorems, and Proofs

A function $f: \mathbb{R}^n \to \mathbb{R}$ is **convex** if for all $x, y \in \text{dom}(f)$ and $\lambda \in [0, 1]$:

f(λx+(1λ)y)λf(x)+(1λ)f(y)f(\lambda x + (1-\lambda) y) \leq \lambda f(x) + (1-\lambda) f(y)

If $f$ is a convex function (see [](#def-convex)) and $X$ is a random variable, then:

f(E[X])E[f(X)]f(\mathbb{E}[X]) \leq \mathbb{E}[f(X)]

By [](#def-convex), for any convex combination we have $f(\lambda x + (1-\lambda)y) \leq \lambda f(x) + (1-\lambda)f(y)$. Extending by induction to $n$ points with weights $\lambda_i \geq 0, \sum \lambda_i = 1$ gives $f\!\left(\sum_i \lambda_i x_i\right) \leq \sum_i \lambda_i f(x_i)$. Taking the limit to a continuous distribution yields the result.

All Available Environments

All environments are auto-numbered and cross-referenceable via id. Use name for an optional label.

ComponentColorUse caseSyntax example
<Theorem>Blue-grayMain results<Theorem id="thm-main" name="Main Result">...</Theorem>
<Lemma>Blue-graySupporting results<Lemma id="lem-bound">...</Lemma>
<Proposition>Blue-grayIntermediate claims<Proposition id="prop-equiv">...</Proposition>
<Corollary>Blue-grayDirect consequences<Corollary id="cor-rate">...</Corollary>
<Definition>GreenFormal definitions<Definition id="def-foo" name="Foo">...</Definition>
<Remark>YellowCommentary and observations<Remark id="rmk-note">...</Remark>
<Example>PurpleWorked examples<Example id="ex-demo">...</Example>
<Proof>Left borderProof with QED symbol<Proof>...</Proof>
<Equation>Centered numbered equation<Equation id="eq-loss">$$...$$</Equation>
<Code>Captioned code block<Code id="code-foo" caption="...">...</Code>
<Algorithm>BorderedPseudocode with caption<Algorithm id="alg-foo" caption="...">...</Algorithm>