Reference

Mathematical notation

The platform uses shared notation. If a lesson needs a symbol missing here, add it here and, if it is a macro, to src/lib/math/macros.mjs before using it.

General conventions

ObjectNotationMacroExample
Scalarslowercase italica,λ,ηa, \lambda, \eta
Vectors (column)lowercase bold\vb{x}x∈Rn\vb{x} \in \R^n
Matricesuppercase bold\mat{A}A∈Rm×n\mat{A} \in \R^{m \times n}
Tensors (order > 2)uppercase bold, like matrices\mat{T}T∈RB×T×d\mat{T} \in \R^{B \times T \times d}
Transposesuperscript ⊤\TA⊤\mat{A}\T
Inverse, pseudoinverse\inv, \pinvA−1\mat{A}\inv, A+\mat{A}\pinv
Number setsblackboard bold\R \N \Z \Q \CRn\R^n
Norm\norm{x}∥x∥2\norm{\vb{x}}_2
Absolute value\abs{x}∣x∣\abs{x}
Inner product\inner{x}{y}⟨x,y⟩\inner{\vb{x}}{\vb{y}}
Trace, rank, diagonal\tr \rank \diagtr⁡(A)\tr(\mat{A})
Span, null space, columns\spn \nullsp \col \rowspan⁡{v1,v2}\spn\{\vb{v}_1, \vb{v}_2\}
Projection\projproj⁡uv\proj_{\vb{u}} \vb{v}
Vectorization (stacking columns)\vecopvec⁡(X)\vecop(\mat{X})
Sign\sgnsgn⁡(x)\sgn(x)
Effective domain\domdom⁡f\dom f
Differentialupright d\dd∫f(x) ⁣dx\int f(x) \dd x
Partial derivative\pd{f}{x}∂f∂x\pd{f}{x}
Gradient, Hessian\grad, \hess∇f\grad f, ∇2f\hess f
Argmin, argmax\argmin, \argmaxarg min⁡wL(w)\argmin_{\vb{w}} \Loss(\vb{w})
Probabilityblackboard bold P\PrP(A∣B)\Pr(A \given B)
Expectation, variance, covariance\E \Var \Cov \CorrE[X]\E[X]
Distributions\Normal \Bern \Bin \Unif \PoisX∼N(μ,σ2)X \sim \Normal(\mu, \sigma^2)
Independence\indepX⊥ ⁣ ⁣ ⁣⊥YX \indep Y
IID samples\iidXi∼iidPX_i \iid P
Conditional\givenp(x∣θ)p(x \given \theta)
Indicator\ind1[x>0]\ind[x > 0]
Entropy, KL\Ent, \KLH⁡(X)\Ent(X), KL⁡(p ∥ q)\KL(p \,\Vert\, q)
Loss, data, hypothesiscalligraphic\Loss \Data \HypL(θ;D)\Loss(\theta; \Data)
Complexity order\bigOO(nlog⁡n)\bigO(n \log n)
Activation functions\softmax \relu \sigmoidsoftmax⁡(z)\softmax(\vb{z})
Epsilonvariant\epsε>0\eps > 0

Linear algebra: bases, coordinates, and mappings

ObjectNotationNote
Inner product in Rn\R^nx⊤y\vb{x}\T\vb{y} or ⟨x,y⟩\inner{\vb{x}}{\vb{y}}⟨⋅,⋅⟩\inner{\cdot}{\cdot} for general inner products
Coordinates of v\vb{v} in basis B\mathcal{B}[v]B[\vb{v}]_{\mathcal{B}}column vector
Matrix of T:V→WT: V \to W from basis B\mathcal{B} to C\mathcal{C}[T]C←B[T]_{\mathcal{C} \leftarrow \mathcal{B}}so that [Tv]C=[T]C←B[v]B[T\vb{v}]_{\mathcal{C}} = [T]_{\mathcal{C} \leftarrow \mathcal{B}} [\vb{v}]_{\mathcal{B}}
Linear maps from VV to WWL(V,W)\mathcal{L}(V, W)
Identityid⁡V\operatorname{id}_V, In\mat{I}_n
Polynomials of degree ≤n\le nPn\mathcal{P}_ndimension n+1n + 1
Row ii of A\mat{A} as a column vectora~i\tilde{\vb{a}}_iA=[a~1⋯a~m]⊤\mat{A} = [\tilde{\vb{a}}_1 \cdots \tilde{\vb{a}}_m]\T
Column jj of A\mat{A}aj\vb{a}_j
Rigid motionsSE(2)SE(2), SE(3)SE(3)rotation plus translation
Layer dimensionsdind_{\text{in}}, doutd_{\text{out}}W∈Rdout×din\mat{W} \in \R^{d_{\text{out}} \times d_{\text{in}}}

Machine learning conventions

  • Data: nn examples, dd features. Design matrix X∈Rn×d\mat{X} \in \R^{n \times d} has one example per row; xi∈Rd\vb{x}_i \in \R^d is row ii as a column vector.
  • Labels: y∈Rn\vb{y} \in \R^n (regression) or yi∈{1,…,K}y_i \in \{1, \dots, K\} (classification with KK classes).
  • Parameters: θ\theta is generic; w,b\vb{w}, b in linear models; W(ℓ),b(ℓ)\mat{W}^{(\ell)}, \vb{b}^{(\ell)} in layer ℓ\ell of a network.
  • Empirical risk: R^(θ)=1n∑iℓ(fθ(xi),yi)\hat{R}(\theta) = \frac{1}{n}\sum_i \ell(f_\theta(\vb{x}_i), y_i); risk: R(θ)=E[ℓ(fθ(X),Y)]R(\theta) = \E[\ell(f_\theta(X), Y)].
  • Learning rate: η\eta. Iterations: parenthesized superscript or subscript tt: θt+1=θt−η∇R^(θt)\theta_{t+1} = \theta_t - \eta \grad \hat{R}(\theta_t).
  • Sequences and transformers: length TT, model dimension dmodeld_{\text{model}}, heads hh, dk=dmodel/hd_k = d_{\text{model}} / h, batch BB. Tensor shapes are written as B×T×dB \times T \times d.
  • Probability: uppercase for random variables (XX), lowercase for values (xx); pp for densities or masses.
  • RL: states ss, actions aa, reward rr, discount γ\gamma, policy π(a∣s)\pi(a \given s), values VπV^\pi, QπQ^\pi.

Numbers

  • Use a decimal point, as in code: 0.50.5, not 0,50{,}5. This matches the output printed by Python.
  • Mathematical indices start at 1; code indices start at 0. When both appear, this is stated explicitly.
  • Widgets use a typographic minus sign (−) for numeric readings.

Meaningful colors in figures

RoleTokenUsage
e1\vb{e}_1 and derived quantities--viz-2 (orange)first column of a matrix, xx transformed axis
e2\vb{e}_2--viz-3 (aqua)second column
e3\vb{e}_3--viz-7 (violet)third column
primary vector u\vb{u} / data--viz-1 (blue)
secondary vector v\vb{v} / model--viz-8 (red) or --viz-2
result--viz-5 (magenta)
reference truth--ink-2theoretical curves, exact solutions

In code: ROLE in @/widgets/kit.

All macros

Available in formulas throughout lessons, exercises, and interactives.

MacroOutput
\RR\R
\NN\N
\ZZ\Z
\QQ\Q
\CC\C
\vb{x}x\vb{x}
\mat{A}A\mat{A}
\mat{A}\TA⊤\mat{A}\T
\mat{A}\invA−1\mat{A}\inv
\mat{A}\pinvA+\mat{A}\pinv
\norm{x}∥x∥\norm{x}
\abs{x}∣x∣\abs{x}
\inner{x}{y}⟨x,y⟩\inner{x}{y}
\trtr⁡\tr
\rankrank⁡\rank
\diagdiag⁡\diag
\spnspan⁡\spn
\nullspnull⁡\nullsp
\colcol⁡\col
\rowrow⁡\row
\projproj⁡\proj
\vecopvec⁡\vecop
\sgnsgn⁡\sgn
\dd ⁣d\dd
\pd{x}{y}∂x∂y\pd{x}{y}
\grad∇\grad
\hess∇2\hess
\argminarg min⁡\argmin
\argmaxarg max⁡\argmax
\domdom⁡\dom
\PrP\Pr
\EE\E
\VarVar⁡\Var
\CovCov⁡\Cov
\CorrCorr⁡\Corr
\NormalN\Normal
\BernBern⁡\Bern
\BinBin⁡\Bin
\UnifUnif⁡\Unif
\PoisPois⁡\Pois
\iid∼iid\iid
\indep⊥ ⁣ ⁣ ⁣⊥\indep
\given∣\given
\ind1\ind
\KLKL⁡\KL
\EntH⁡\Ent
\softmaxsoftmax⁡\softmax
\reluReLU⁡\relu
\sigmoidσ\sigmoid
\LossL\Loss
\DataD\Data
\HypH\Hyp
\bigOO\bigO
\epsε\eps