SoulFireMage commited on
Commit
5ffe393
·
verified ·
1 Parent(s): 84b770a

Formula bank with reference sight-reads

Browse files
Files changed (1) hide show
  1. bank.py +344 -0
bank.py ADDED
@@ -0,0 +1,344 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Formula bank for the Mathematical Sight-Reading Framework.
2
+
3
+ Each entry carries a hidden reference sight-read. The reference is ground truth
4
+ for the judge model; it is never shown to the learner before they answer. Edit
5
+ or extend this list to grow the curriculum. Keep the references rigorous: the
6
+ judge is only as good as they are.
7
+ """
8
+
9
+ BANK = [
10
+ # ------------------------------------------------------------------ Tier 1
11
+ {
12
+ "id": "t1-rayleigh",
13
+ "tier": 1,
14
+ "name": "Rayleigh quotient",
15
+ "tags": ["linear-algebra", "quadratic-form"],
16
+ "latex": r"\frac{\mathbf{x}^{\top} A\,\mathbf{x}}{\mathbf{x}^{\top}\mathbf{x}}",
17
+ "hint_types": "Count the shapes: what is x, what is A, and what kind of object is each of the two products?",
18
+ "hint_mech": "Replace x by 2x. What happens to numerator and denominator? Then try x as an eigenvector of A.",
19
+ "ref": {
20
+ "signature": "x in R^n minus {0}; A an n-by-n real matrix (usually symmetric); numerator x^T A x is a scalar (a quadratic form, sum_ij A_ij x_i x_j); denominator is the squared Euclidean norm; result is a real scalar. Complex case uses x* (conjugate transpose) and Hermitian A.",
21
+ "mechanics": "Measures the 'gain' of A in the direction of x: how much of A's action lines up with x itself, normalised by length. Degree-0 homogeneous: R(cx) = R(x) for c != 0, so it only depends on direction (a function on the sphere / projective space). Only the symmetric part (A + A^T)/2 contributes. For symmetric A, lambda_min <= R(x) <= lambda_max, with equality exactly at the corresponding eigenvectors, and critical points of R are eigenvectors.",
22
+ "boundary": "Undefined at x = 0. If A is not symmetric the extremes are those of the symmetric part, not A's own eigenvalues. For A positive definite the quotient is strictly positive.",
23
+ "transfer": [
24
+ "Mechanics: estimating a vibration mode's squared frequency (x = displacement shape, A = stiffness, with a mass matrix in the denominator in the generalised form).",
25
+ "Statistics/PCA: variance of the data projected on unit direction x when A is the covariance matrix; maximising it gives the first principal component.",
26
+ "Quantum mechanics: expectation value <psi|H|psi>/<psi|psi> of an energy operator, the basis of the variational principle.",
27
+ ],
28
+ "pitfalls": ["Forgetting scale invariance", "Claiming eigenvalues of non-symmetric A bound it", "Ignoring x != 0"],
29
+ },
30
+ },
31
+ {
32
+ "id": "t1-swap-integral",
33
+ "tier": 1,
34
+ "name": "Iterated integral over a triangle",
35
+ "tags": ["integration", "multivariable"],
36
+ "latex": r"\int_{0}^{1}\int_{x}^{1} e^{-y^{2}}\,dy\,dx",
37
+ "hint_types": "Which variable does each limit depend on? Sketch the region of the (x, y) plane being swept.",
38
+ "hint_mech": "Does e^{-y^2} have an elementary antiderivative in y? What changes if you sweep the same region in the other order?",
39
+ "ref": {
40
+ "signature": "Iterated (not yet evaluated) double integral of the continuous, positive function f(x,y) = e^{-y^2} over the region D = {(x,y): 0 <= x <= y <= 1}, a triangle. Inner integral runs over y with lower limit depending on x, so it is a function of x; the outer integral integrates that over x in [0,1]. Result is a real number.",
41
+ "mechanics": "The inner limits depend on the outer variable, so the region is non-rectangular. The integrand is non-negative and continuous, so Fubini/Tonelli lets us swap order: = integral_{y=0}^{1} integral_{x=0}^{y} e^{-y^2} dx dy = integral_0^1 y e^{-y^2} dy = (1 - e^{-1})/2. In the given order the inner integral has no elementary closed form, so swapping order is the point.",
42
+ "boundary": "The triangle has vertices (0,0), (0,1), (1,1). The dummy variables x and y are bound, so the result is a pure number depending on neither.",
43
+ "transfer": [
44
+ "Geometry/mass: total mass of a triangular plate with density e^{-y^2}, or volume under the surface over D.",
45
+ "Probability: P(X <= Y)-type quantities for a joint density, accumulated over a region defined by an inequality between variables.",
46
+ "Computation: a reminder that order of integration is a free choice that can turn an intractable integral into a trivial one.",
47
+ ],
48
+ "pitfalls": ["Treating limits as constants", "Trying to integrate e^{-y^2} in y", "Wrong region after swap (limits for x should be 0..y)"],
49
+ },
50
+ },
51
+ {
52
+ "id": "t1-curlcurl",
53
+ "tier": 1,
54
+ "name": "Curl of a curl",
55
+ "tags": ["vector-calculus"],
56
+ "latex": r"\nabla \times \left(\nabla \times \mathbf{A}\right)",
57
+ "hint_types": "What type is A, what type is the inner result, and what type is the outer result? In how many dimensions does the inner operation return a vector?",
58
+ "hint_mech": "There is an identity splitting this into one term involving divergence and one involving the Laplacian. What are they?",
59
+ "ref": {
60
+ "signature": "A: a C^2 vector field on a region of R^3 (curl as a vector exists in 3D). Inner curl gives a vector field (axial/pseudovector character); outer curl gives another vector field. Operator composition, second-order differential operator.",
61
+ "mechanics": "Identity: curl curl A = grad(div A) - Laplacian(A), where the Laplacian acts component-wise in Cartesian coordinates (the vector Laplacian). Separates the 'compressive/longitudinal' part from the 'solenoidal/rotational' part. If div A = 0 it reduces to minus the vector Laplacian.",
62
+ "boundary": "Needs C^2 regularity so mixed partials commute. Component-wise Laplacian only in Cartesian coordinates; in curvilinear coordinates the vector Laplacian must be defined by this identity.",
63
+ "transfer": [
64
+ "Electromagnetism: with the identity and Maxwell's equations in vacuum, curl curl E = -Laplacian E, producing the wave equation; in magnetostatics curl B = mu0 J with B = curl A in Coulomb gauge gives Laplacian A = -mu0 J.",
65
+ "Fluid mechanics: relates the diffusion of vorticity to the Laplacian of velocity (viscous term in incompressible flow).",
66
+ "Elasticity: Navier-Cauchy equations contain grad(div u) and curl curl u terms for P- and S-waves.",
67
+ ],
68
+ "pitfalls": ["Saying it is zero (that is div curl and curl grad)", "Treating it as a scalar", "Applying in 2D without caveat"],
69
+ },
70
+ },
71
+ {
72
+ "id": "t1-chain-curve",
73
+ "tier": 1,
74
+ "name": "Chain rule along a curve",
75
+ "tags": ["vector-calculus", "chain-rule"],
76
+ "latex": r"\frac{d}{dt}\, f\big(\gamma(t)\big) = \nabla f\big(\gamma(t)\big) \cdot \gamma'(t)",
77
+ "hint_types": "State the domain and codomain of f and of gamma. What is the type of each side of the equation?",
78
+ "hint_mech": "Picture a thermometer carried along a path. What are the two ingredients that determine how fast its reading changes?",
79
+ "ref": {
80
+ "signature": "f: R^n -> R differentiable (continuously differentiable suffices to be safe); gamma: I -> R^n a differentiable curve on an interval I. LHS is the derivative of the scalar function t -> f(gamma(t)). RHS: gradient (a vector in R^n, evaluated at the point gamma(t)) dotted with the velocity vector gamma'(t), giving a scalar. Both sides are scalar functions of t.",
81
+ "mechanics": "Multivariable chain rule. The rate of change of f seen by a moving observer is the directional derivative of f along the velocity: how steeply f changes in each direction (gradient) weighted by how fast you move in that direction. If gamma' is a unit vector it is the directional derivative. Zero when you move along a level set (gamma' orthogonal to grad f); maximal when gamma' is parallel to grad f.",
82
+ "boundary": "Requires differentiability of f at gamma(t) (partial derivatives existing is not enough). At gamma'(t) = 0 the rate is zero regardless of gradient.",
83
+ "transfer": [
84
+ "Physics: power as dW/dt = F . v; for a conservative force F = -grad V it gives dV/dt = -F.v along a trajectory.",
85
+ "Optimisation/ML: under gradient flow theta' = -grad L, dL/dt = -|grad L|^2 <= 0, the proof that loss decreases.",
86
+ "Meteorology/geography: the temperature or altitude change experienced by a hiker or weather balloon moving through a scalar field.",
87
+ ],
88
+ "pitfalls": ["Mixing up gradient (vector) and derivative (scalar)", "Omitting the evaluation point of the gradient", "Missing differentiability condition"],
89
+ },
90
+ },
91
+ # ------------------------------------------------------------------ Tier 2
92
+ {
93
+ "id": "t2-convolution",
94
+ "tier": 2,
95
+ "name": "Convolution",
96
+ "tags": ["transforms", "integration"],
97
+ "latex": r"(f * g)(t) = \int_{-\infty}^{\infty} f(\tau)\, g(t - \tau)\, d\tau",
98
+ "hint_types": "f and g take what to what? Which variable is bound inside the integral and which is free?",
99
+ "hint_mech": "Fix t. What does g(t - tau) do to the graph of g as tau varies, and what does the integral then compute at that t?",
100
+ "ref": {
101
+ "signature": "f, g: R -> R (or C), typically in L^1 (or one in L^1 and the other in L^p) so the integral converges for almost every t. The star is a bilinear operation on functions returning a new function of t. tau is a bound dummy variable; t is free.",
102
+ "mechanics": "Flip g, slide it by t, multiply pointwise with f, and integrate: a moving, g-weighted overlap or average of f. Commutative, associative, bilinear; the Dirac delta is the identity; Fourier transform turns convolution into pointwise multiplication; differentiation passes to either factor. Smoothing: result is at least as regular as the smoother factor.",
103
+ "boundary": "Convergence needs integrability conditions; supports add (support of f*g is contained in the Minkowski sum of supports). For causal signals the limits shrink to [0, t].",
104
+ "transfer": [
105
+ "Signal processing/LTI systems: output = input convolved with the impulse response; filtering and blurring.",
106
+ "Probability: the density of X + Y for independent X, Y is the convolution of their densities.",
107
+ "Image processing: kernel blur/edge detection; also PDE: solving the heat equation by convolving with a Gaussian.",
108
+ ],
109
+ "pitfalls": ["Forgetting the time reversal in g(t - tau)", "Calling it pointwise product", "Not noting convergence/integrability"],
110
+ },
111
+ },
112
+ {
113
+ "id": "t2-fourier",
114
+ "tier": 2,
115
+ "name": "Fourier transform",
116
+ "tags": ["transforms", "integration"],
117
+ "latex": r"\hat{f}(\xi) = \int_{-\infty}^{\infty} f(x)\, e^{-2\pi i x \xi}\, dx",
118
+ "hint_types": "What is the input type of f and what is the type of f-hat? Which variable is bound?",
119
+ "hint_mech": "Fix xi. The exponential is a pure oscillation. What is the integral measuring about f and that oscillation?",
120
+ "ref": {
121
+ "signature": "f: R -> C in L^1(R) (extends to L^2 by density). Output f-hat: R -> C is a function of frequency xi (units cycles per unit of x). x is a bound variable; xi is free. Convention here uses 2 pi in the exponent (so xi is ordinary frequency, no 1/sqrt(2 pi) factors).",
122
+ "mechanics": "At each xi, the integral is the inner product of f with the complex exponential e^{2 pi i x xi}: how much of that frequency is present in f (amplitude and phase). For f in L^1, f-hat is bounded and continuous and tends to 0 at infinity (Riemann-Lebesgue). Invertible via the same kernel with opposite sign. Translation becomes phase multiplication; convolution becomes product; narrow in x means wide in xi.",
123
+ "boundary": "At xi = 0 gives the total integral of f. Sign convention of the exponent and placement of 2 pi vary by field.",
124
+ "transfer": [
125
+ "Audio/signals: the spectrum of a waveform; which pitches are present.",
126
+ "Optics: the far-field (Fraunhofer) diffraction pattern is the Fourier transform of the aperture function.",
127
+ "Quantum mechanics: momentum-space wavefunction; uncertainty principle as a width trade-off between f and f-hat.",
128
+ ],
129
+ "pitfalls": ["Not stating convention", "Ignoring complex-valuedness", "Reading it as just 'frequency content' without inner-product meaning"],
130
+ },
131
+ },
132
+ {
133
+ "id": "t2-euler-lagrange",
134
+ "tier": 2,
135
+ "name": "Euler-Lagrange equation",
136
+ "tags": ["variational", "mechanics"],
137
+ "latex": r"\frac{\partial L}{\partial q} - \frac{d}{dt}\frac{\partial L}{\partial \dot{q}} = 0",
138
+ "hint_types": "What are the arguments of L? Which derivatives are partial and which is a total derivative, and with respect to what?",
139
+ "hint_mech": "This is a condition that a whole curve q(t) must satisfy to make something stationary. What is that something, and what is held fixed?",
140
+ "ref": {
141
+ "signature": "L(q, q-dot, t) a smooth scalar function (the Lagrangian) of position q, velocity q-dot and possibly time; q(t) a twice-differentiable trajectory. The partial derivatives treat q and q-dot as independent arguments, then the result is evaluated along q(t); d/dt is the total time derivative along the trajectory. For several coordinates it is one equation per q_i. Output of each term is a scalar function of t.",
142
+ "mechanics": "The necessary condition for the action S[q] = integral L dt to be stationary (not necessarily a minimum) among paths with fixed endpoints. dL/dq-dot is the generalised momentum; the equation says its rate of change equals the generalised force dL/dq. For L = (1/2) m q-dot^2 - V(q) it reduces to m q-ddot = -V'(q), Newton's second law.",
143
+ "boundary": "Fixed endpoints are assumed. Stationary, not minimum. If L has no explicit q dependence, momentum is conserved (cyclic coordinate); no explicit t dependence gives conserved energy (Noether).",
144
+ "transfer": [
145
+ "Classical mechanics: derives equations of motion in any coordinates from one scalar.",
146
+ "Geometry: with L = the length integrand, solutions are geodesics (shortest/straightest paths).",
147
+ "Optics/economics/control: Fermat's principle (light follows extremal travel time); optimal consumption or control paths.",
148
+ ],
149
+ "pitfalls": ["Calling it a minimisation", "Treating q and q-dot as functions of each other in the partials", "Ignoring fixed endpoints"],
150
+ },
151
+ },
152
+ {
153
+ "id": "t2-laplace",
154
+ "tier": 2,
155
+ "name": "Laplace transform",
156
+ "tags": ["transforms", "integration"],
157
+ "latex": r"F(s) = \int_{0}^{\infty} f(t)\, e^{-st}\, dt",
158
+ "hint_types": "What is the domain of f and what kind of number is s? When can this integral fail to exist?",
159
+ "hint_mech": "Compare with a transform whose kernel is a pure oscillation. What does the real part of s do to the integrand, and why might that be useful?",
160
+ "ref": {
161
+ "signature": "f: [0, infinity) -> C (or R), locally integrable and of exponential order so the integral converges for Re(s) > sigma (abscissa of convergence). s is a complex number; t is bound. F is analytic in the half-plane of convergence.",
162
+ "mechanics": "A one-sided transform that weights f by a decaying exponential e^{-st}, so growth in f is tamed: a Fourier transform with built-in damping, extended to complex frequency. Key property: L{f'} = s F(s) - f(0), so differentiation becomes multiplication and linear ODEs become algebra. Convolution becomes product. Poles of F encode the exponential modes of f.",
163
+ "boundary": "Only uses f on t >= 0 (initial value problems); the region of convergence is part of the definition. f(0) enters via the derivative rule.",
164
+ "transfer": [
165
+ "Control/circuits: transfer functions, pole locations and stability.",
166
+ "Probability: for a nonnegative random variable T with density f, F(s) = E[e^{-sT}], the moment-generating function with sign flipped.",
167
+ "Differential equations: converting initial-value ODEs/PDEs into algebraic equations in s.",
168
+ ],
169
+ "pitfalls": ["Omitting region of convergence", "Treating s as real only", "Missing the initial-condition term in derivative rule"],
170
+ },
171
+ },
172
+ # ------------------------------------------------------------------ Tier 3
173
+ {
174
+ "id": "t3-eps-delta",
175
+ "tier": 3,
176
+ "name": "Epsilon-delta contraction identity",
177
+ "tags": ["index-notation"],
178
+ "latex": r"\epsilon_{ijk}\,\epsilon_{imn} = \delta_{jm}\delta_{kn} - \delta_{jn}\delta_{km}",
179
+ "hint_types": "Which indices appear twice in a term, and what does that imply? Which are free? How many components does each side have?",
180
+ "hint_mech": "Think of the Levi-Civita symbol as a signed volume. What geometric operation does a contraction of two of them encode?",
181
+ "ref": {
182
+ "signature": "Three-dimensional indices i, j, k, m, n each in {1,2,3}. epsilon is the rank-3 totally antisymmetric Levi-Civita symbol (epsilon_123 = +1); delta is the Kronecker delta (identity matrix). On the left the repeated index i is summed over (Einstein convention); j, k, m, n are free, so this is a system of 3^4 = 81 scalar equations. Both sides are rank-4 arrays.",
183
+ "mechanics": "Contracting two Levi-Civita symbols on one index produces a determinant of Kronecker deltas: nonzero only when {j,k} and {m,n} are the same pair of distinct indices, with sign + if in the same order and - if swapped. It is the workhorse for proving vector identities, e.g. a x (b x c) = b(a.c) - c(a.b), and curl curl identities.",
184
+ "boundary": "Holds in exactly three dimensions (rank-3 epsilon); other dimensions have epsilon of rank n and different contraction rules. Orthonormal right-handed Cartesian components assumed (epsilon is a pseudotensor).",
185
+ "transfer": [
186
+ "Vector calculus: derivation of BAC-CAB and curl curl = grad div - Laplacian.",
187
+ "Rigid-body mechanics/EM: simplifies triple products in angular momentum and Lorentz-force expressions.",
188
+ "Geometry: encodes oriented area/volume; the determinant of two cross-product pairings.",
189
+ ],
190
+ "pitfalls": ["Treating i as free", "Missing that it only holds in 3D", "Sign of the second delta product"],
191
+ },
192
+ },
193
+ {
194
+ "id": "t3-raise-index",
195
+ "tier": 3,
196
+ "name": "Index raising with the inverse metric",
197
+ "tags": ["index-notation", "differential-geometry"],
198
+ "latex": r"T^{\mu}{}_{\nu} = g^{\mu\alpha}\, T_{\alpha\nu}",
199
+ "hint_types": "Which index is summed and which are free? What is the up/down (variance) type of each object?",
200
+ "hint_mech": "What does the metric let you do that, without it, you could not do to a tensor index? What happens if the metric is the identity?",
201
+ "ref": {
202
+ "signature": "T_{alpha nu}: a (0,2) tensor (two covariant indices). g^{mu alpha}: the inverse metric, a symmetric (2,0) tensor with g^{mu alpha} g_{alpha beta} = delta^mu_beta. alpha is a repeated up-down pair, so it is summed (contracted) and disappears; mu (up) and nu (down) are free. Result T^mu_nu is a (1,1) tensor.",
203
+ "mechanics": "Raises the first index of T using the metric: converts a covariant slot into a contravariant one. This is the metric-induced isomorphism between vectors and covectors (musical isomorphism) applied to one slot. The metric supplies the notion of length and angle that makes that identification canonical. In Euclidean orthonormal coordinates g is the identity, so raising and lowering change nothing numerically.",
204
+ "boundary": "Requires a non-degenerate metric so the inverse exists. Ordering of indices matters for non-symmetric T (the horizontal position of mu and nu). In Minkowski signature raising a time index versus a space index differs by a sign.",
205
+ "transfer": [
206
+ "General relativity: converting between covariant and contravariant components, with sign flips from the Lorentzian metric.",
207
+ "Machine learning/statistics: converting a gradient (a covector) into a step direction (a vector) using an inverse metric, as in natural gradient or Mahalanobis geometry.",
208
+ "Crystallography/non-orthogonal coordinates: dual (reciprocal) basis components differ from direct components by the metric.",
209
+ ],
210
+ "pitfalls": ["Treating up/down as cosmetic", "Not identifying alpha as summed", "Ignoring that g^{..} is the inverse of g_{..}"],
211
+ },
212
+ },
213
+ {
214
+ "id": "t3-outer-product",
215
+ "tier": 3,
216
+ "name": "Resolution of the identity",
217
+ "tags": ["operators", "linear-algebra"],
218
+ "latex": r"\sum_{i} |v_i\rangle\langle v_i|",
219
+ "hint_types": "What type of object is |v><v| compared with <v|v>? What is the sum ranging over, and what must be true of the v_i?",
220
+ "hint_mech": "Apply the whole sum to an arbitrary vector |psi>. What comes out, term by term, if the v_i are orthonormal?",
221
+ "ref": {
222
+ "signature": "{|v_i>} vectors in a Hilbert (or finite-dimensional inner product) space H. Each |v_i><v_i| is an outer product, a linear operator H -> H (a rank-one matrix v_i v_i^dagger). The sum is a linear operator H -> H. Meaning depends on the v_i: if orthonormal, each term is an orthogonal projector.",
223
+ "mechanics": "Applied to |psi>, each term gives <v_i|psi> |v_i>: the component of psi along v_i. For an orthonormal basis that spans the space the sum is the identity operator (completeness), i.e. psi = sum_i <v_i|psi> v_i. For an orthonormal but incomplete set it projects onto their span. For non-orthonormal v_i it is not a projector.",
224
+ "boundary": "Orthonormality is essential for the projector interpretation; completeness is essential for it to be the identity. In infinite dimensions the sum converges in the strong operator sense and may need an integral for continuous spectra.",
225
+ "transfer": [
226
+ "Quantum mechanics: expanding states in an eigenbasis; inserting a complete set of states in derivations.",
227
+ "Data analysis/PCA: sum of the top-k terms is the projection onto the principal subspace (low-rank approximation).",
228
+ "Signal processing: Fourier-series reconstruction as a sum of projections onto sinusoid basis elements.",
229
+ ],
230
+ "pitfalls": ["Confusing outer with inner product", "Claiming identity without orthonormal and complete", "Not noting each term is rank one"],
231
+ },
232
+ },
233
+ {
234
+ "id": "t3-trace-contraction",
235
+ "tier": 3,
236
+ "name": "Double contraction (trace of a product)",
237
+ "tags": ["index-notation", "linear-algebra"],
238
+ "latex": r"A_{ij}\,B_{ji}",
239
+ "hint_types": "Which indices are repeated? How many free indices remain, and what does that tell you about the type of the result?",
240
+ "hint_mech": "Write it with explicit sums and then as matrix multiplication. Does swapping the order of A and B change the answer?",
241
+ "ref": {
242
+ "signature": "A and B are n-by-n arrays (matrices or rank-2 tensors in the same index space). i and j each appear twice, so both are summed (Einstein convention); no free indices remain, so the result is a scalar: sum_{i,j} A_ij B_ji.",
243
+ "mechanics": "Equals trace(AB) = trace(BA): multiply row i of A with column i of B and sum the diagonal. Equivalent to the Frobenius inner product <A, B^T> (entrywise product of A with the transpose of B). If B is symmetric, equals sum_ij A_ij B_ij. Cyclic invariance of the trace follows from relabelling dummy indices.",
244
+ "boundary": "Dimensions must match (A is m x n, B is n x m works and gives a scalar). Plain index positions here assume an orthonormal frame; in general tensor notation one index of each pair should be up and one down.",
245
+ "transfer": [
246
+ "Continuum mechanics: stress-strain energy density sigma_ij epsilon_ij for symmetric tensors.",
247
+ "Statistics/ML: matrix inner products and Frobenius norms (||A||^2 = tr(A^T A)), and expected quadratic loss with covariance matrices.",
248
+ "Linear algebra/quantum: expectation values Tr(rho O) of an operator O in a mixed state rho.",
249
+ ],
250
+ "pitfalls": ["Treating it as matrix product A B (not a scalar)", "Missing that it is a trace", "Not noting transposition (ji versus ij)"],
251
+ },
252
+ },
253
+ # ------------------------------------------------------------------ Tier 4
254
+ {
255
+ "id": "t4-stokes",
256
+ "tier": 4,
257
+ "name": "Generalised Stokes theorem",
258
+ "tags": ["differential-geometry", "integration"],
259
+ "latex": r"\int_{\partial \Omega} \omega = \int_{\Omega} d\omega",
260
+ "hint_types": "What kind of space is Omega, what kind of object is omega, and how do their dimensions relate? What is d?",
261
+ "hint_mech": "Name three classical theorems from calculus that are special cases of this one by choosing Omega and omega appropriately.",
262
+ "ref": {
263
+ "signature": "Omega: a compact, oriented n-dimensional smooth manifold with boundary; partial Omega: its (n-1)-dimensional boundary with the induced orientation; omega: a smooth (n-1)-form defined on a neighbourhood of Omega; d: the exterior derivative, so d omega is an n-form. Each side is the integral of a form of top degree over the matching dimensional domain, a real number.",
264
+ "mechanics": "The total 'source' (d omega) accumulated through the interior equals the net 'flux' of omega through the boundary. It is the integral form of the statement that d and the boundary operator are adjoint. Special cases: fundamental theorem of calculus (n=1), Green's theorem (n=2), classical Kelvin-Stokes (surface in R^3), divergence theorem (n=3). Consequence: d^2 = 0 because partial of partial is empty.",
265
+ "boundary": "Needs compact support/compactness and orientability and consistent boundary orientation (outward normal first). For a manifold without boundary the right side vanishes for exact forms. Smoothness (or weak regularity) assumptions are required.",
266
+ "transfer": [
267
+ "Electromagnetism/fluids: Gauss's law and conservation laws: net flux out of a closed surface equals the divergence integrated inside; Faraday/Ampere circulation forms.",
268
+ "Topology: closed forms integrate to zero on boundaries, leading to de Rham cohomology and obstructions to exactness.",
269
+ "Calculus: reduces to the fundamental theorem: integral of f' over [a,b] equals f(b) - f(a).",
270
+ ],
271
+ "pitfalls": ["Mismatched dimensions of omega and Omega", "Ignoring orientation", "Calling d the gradient only"],
272
+ },
273
+ },
274
+ {
275
+ "id": "t4-lie-bracket",
276
+ "tier": 4,
277
+ "name": "Lie derivative of a vector field",
278
+ "tags": ["differential-geometry", "operators"],
279
+ "latex": r"\mathcal{L}_X Y = [X, Y]",
280
+ "hint_types": "What are X and Y, what is the type of each side, and what does the bracket do to two such objects?",
281
+ "hint_mech": "Think of X as a flow. What does the left side measure about Y when it is carried along that flow? What does the right side say about the order of two infinitesimal motions?",
282
+ "ref": {
283
+ "signature": "X, Y: smooth vector fields on a smooth manifold M. L_X is the Lie derivative along the flow of X. The bracket [X, Y] is the commutator, acting on smooth functions f as [X,Y]f = X(Yf) - Y(Xf). Both sides are smooth vector fields (the bracket is first order because second-derivative terms cancel).",
284
+ "mechanics": "Left: the rate of change of Y as seen by comparing Y at a point with Y transported (dragged) along the flow of X; defined by differentiating the pullback of Y along the flow at t = 0. Right: the algebraic commutator of derivations. That these coincide is a theorem. It measures the failure of the flows of X and Y to commute: [X,Y] = 0 iff flows commute. Antisymmetric and satisfies Jacobi.",
285
+ "boundary": "Not C-linear in X: [fX, Y] != f[X,Y] in general; there is a derivative-of-f term. Unlike the covariant derivative, no connection or metric is needed.",
286
+ "transfer": [
287
+ "Fluid dynamics: how a field (e.g. vorticity) is dragged and stretched by a flow.",
288
+ "Control theory: parallel parking; steering and driving flows do not commute, and their bracket generates sideways motion (non-holonomic reachability).",
289
+ "Quantum/Lie algebras: commutators of symmetry generators, e.g. angular momentum [L_x, L_y] = i hbar L_z.",
290
+ ],
291
+ "pitfalls": ["Calling it a covariant derivative", "Forgetting flow transport", "Treating the bracket as a plain product"],
292
+ },
293
+ },
294
+ {
295
+ "id": "t4-covariant",
296
+ "tier": 4,
297
+ "name": "Covariant derivative of a vector",
298
+ "tags": ["differential-geometry", "index-notation"],
299
+ "latex": r"\nabla_\mu V^\nu = \partial_\mu V^\nu + \Gamma^{\nu}_{\mu\lambda}\, V^{\lambda}",
300
+ "hint_types": "Which indices are free and which summed? Is Gamma a tensor? What is the variance type of the result?",
301
+ "hint_mech": "Why is the partial derivative alone not coordinate-independent for V^nu? What does the Gamma term compensate for? Where is it zero?",
302
+ "ref": {
303
+ "signature": "V^nu: components of a (1,0) vector field in a coordinate basis. partial_mu V^nu: the plain partial derivative of those components. Gamma^nu_{mu lambda}: connection coefficients (Christoffel symbols for the Levi-Civita connection), NOT a tensor. lambda is summed; mu and nu are free. The result is a (1,1) tensor (components of the covariant derivative nabla V).",
304
+ "mechanics": "The partial derivative of components does not transform as a tensor because the basis vectors change from point to point. The Gamma term corrects for that variation of the basis, so the combination does transform tensorially. It differentiates V in a way that defines parallel transport: V is parallel along a curve when this vanishes along it. In Cartesian coordinates on flat space Gamma = 0 and it reduces to partial_mu V^nu; in polar coordinates on the flat plane Gamma != 0 even though there is no curvature.",
305
+ "boundary": "Gamma depends on the chosen connection and coordinates; for Levi-Civita it is built from the metric and its first derivatives and is symmetric in the lower indices. Torsion-free assumed. Covariant derivative of a covector has a minus sign on the Gamma term.",
306
+ "transfer": [
307
+ "General relativity: geodesic equation and parallel transport of vectors in curved spacetime.",
308
+ "Gauge theory: D_mu = partial_mu + i A_mu is the same structure with the gauge potential playing the role of Gamma.",
309
+ "Navigation/geometry: carrying an arrow on a sphere (or in curvilinear coordinates) without turning it; the Gamma term is the correction a coordinate grid imposes.",
310
+ ],
311
+ "pitfalls": ["Calling Gamma a tensor", "Missing that Gamma's presence does not imply curvature", "Wrong sign/form for covectors"],
312
+ },
313
+ },
314
+ {
315
+ "id": "t4-riemann",
316
+ "tier": 4,
317
+ "name": "Riemann curvature tensor",
318
+ "tags": ["differential-geometry", "index-notation"],
319
+ "latex": r"R^{\rho}{}_{\sigma\mu\nu} = \partial_\mu \Gamma^{\rho}_{\nu\sigma} - \partial_\nu \Gamma^{\rho}_{\mu\sigma} + \Gamma^{\rho}_{\mu\lambda}\Gamma^{\lambda}_{\nu\sigma} - \Gamma^{\rho}_{\nu\lambda}\Gamma^{\lambda}_{\mu\sigma}",
320
+ "hint_types": "Which indices are free on both sides and which is summed? What is the variance type of R and is Gamma a tensor?",
321
+ "hint_mech": "Notice the antisymmetry in mu and nu. What happens if you take a covariant derivative in two orders and subtract?",
322
+ "ref": {
323
+ "signature": "Gamma^rho_{mu nu}: connection coefficients of a torsion-free connection (Levi-Civita for a metric); not tensors. Free indices rho (up), sigma, mu, nu (down) on both sides; lambda is summed in the two quadratic terms. The LHS is a (1,3) tensor even though the right side is built from non-tensors (the non-tensorial pieces cancel). Convention follows e.g. MTW; sign and index placement vary between authors.",
324
+ "mechanics": "Antisymmetric in (mu, nu). It is the commutator of covariant derivatives: [nabla_mu, nabla_nu] V^rho = R^rho_{sigma mu nu} V^sigma. Equivalent to the infinitesimal holonomy: the change of a vector carried around a small closed loop in the (mu, nu) plane. Vanishes iff the space is locally flat (given a Levi-Civita connection). The derivative terms measure how the connection changes across directions; the quadratic terms are the non-commuting corrections of the connection with itself.",
325
+ "boundary": "Convention-dependent signs; the formula assumes coordinate basis and torsion-free connection. Contractions yield Ricci tensor and scalar curvature. Number of independent components depends on dimension (20 in 4D).",
326
+ "transfer": [
327
+ "General relativity: tidal forces and geodesic deviation; Einstein's equations relate its contractions to matter.",
328
+ "Gauge theory: the field strength F = dA + A wedge A of Yang-Mills has exactly this structure with A in place of Gamma.",
329
+ "Surface geometry: reduces to the Gaussian curvature (a single number) in 2D, detecting e.g. the sphere versus the plane.",
330
+ ],
331
+ "pitfalls": ["Calling R a function of Gamma only by derivatives", "Missing the tensorial cancellation", "Ignoring antisymmetry in mu nu"],
332
+ },
333
+ },
334
+ ]
335
+
336
+ BY_ID = {f["id"]: f for f in BANK}
337
+ TIERS = sorted({f["tier"] for f in BANK})
338
+
339
+ TIER_NAMES = {
340
+ 1: "Tier 1: Composite calculus & linear algebra",
341
+ 2: "Tier 2: Transformative & variational operators",
342
+ 3: "Tier 3: Index gymnastics & multilinear algebra",
343
+ 4: "Tier 4: Differential geometry & topology",
344
+ }