# Notation supported by the current equation editor

Use [the schema](../course.schema.json) for field names and
[the worked examples](worked-examples.json) for complete, validated cards.
This is an equation-building engine, not a general quiz or theorem-proving system.

## Start with these symbols

- Single Latin letters: `a`, `b`, `x`, `y`, `v`, `w`.
- Simple subscripts: `a_1`, `x_0`, `f_u`, `f_uv`. The underscore is part of one
  symbol token; it is not a separate subscript editing operation.
- Greek tokens supported by the parser include `α`, `β`, `γ`, `φ`, `θ`, `λ`, `τ`,
  `μ`, `π`, and `Δ`. Some names have function meanings; see below. Other Unicode
  characters are not automatically supported just because LaTeX can render them.
- Integers are assembled from digit buttons. Use a fraction for rational constants.
  Decimal-point notation is not currently supported.
- Prime tokens such as `x'` can be supplied as one palette tool. Alternatively,
  supply both `x` and a separate `'` palette tool. A prime is notation, not an
  instruction to the grader to differentiate an expression.

For each palette entry, use the same plain token for `tool` and `label` initially.
`accessibleLabel` can provide a spoken description. Neither label field defines a
custom LaTeX glyph or changes mathematical meaning. Do not put an entire formula
or a LaTeX command such as `\\frac` in one symbol token.

## Structure and grouping

Use fraction, power, radical, and matrix trees for those structures. A `row` only
joins its children: **it does not create parentheses**. To group an additive base
visibly, include `(` and `)` tokens, as the square-expansion example does.
Matrices store one row node per cell in row-major order. Use `column` for 2×1,
`matrix` for 2×2, and `matrix-3x1`, `matrix-2x3`, `matrix-3x2`, or `matrix-3x3`
for those shapes in `editor.operations`.

The schema also allows one-row matrices, but the editor converts these to tuple
notation. Do not use them as row-matrix factors. Instead, use a `power` node whose
`base` is a column matrix and whose `exponent` is a row containing the symbol `T`.
Offer `power` and the palette token `T`. This represents the transposed column.
Declare matrix-valued symbols in `grading.symbolTypes` so multiplication keeps
its order.

The standard tray offers `=`, `+`, `−`, `fraction`, `power`, `square`, `sqrt`, `×`,
`/`, `,`, `(`, `)`, `⟨`, `⟩`, `|`, `||`, and matrix controls when declared.
Use the Unicode minus `−` in JSON, not the ASCII hyphen `-`.
The legacy schema still permits `{` and `}` in operations, but these no longer
have standard buttons. Use parentheses; if braces are essential, explicitly put
them in the palette. The checker now uses the same operation list as the tray.

## Differential and derivative buttons

Use atomic palette tokens `ds`, `dt`, `du`, `dv`, `dx`, `dy`, and `dz` for
differentials. Do not offer a standalone `d` solely to assemble them. This is
notation support, not a general integration engine: the current definite-integral
parser requires `dt`.

Use `d/ds`, `d/dt`, or `d/dv` as single tokens for derivative operators;
`d²/dt²` is a single second-derivative token (with Unicode `²`). More generally,
the operator forms `d/dq` and `d²/dq²` accept a single Latin-letter variable.
These render as fractions and act on the following expression. Parenthesize
a sum or product when the operator applies to the whole expression.

For example, a palette entry is `{"tool":"d²/dt²","label":"d²/dt²"}` and its
answer node is `{"kind":"symbol","text":"d²/dt²"}`. Do not split this operator
into a numerator `d`, a fraction control, and denominator pieces.

### Partial derivatives

The atomic tokens `partial_u` and `partial_v` render as $\partial/\partial u$ and $\partial/\partial v$. They act on the next expression, just like a derivative fraction. Offer either as one palette button; parenthesize a sum or product when the derivative should apply to the whole expression. The fraction notation remains accepted.

## Functions have reserved meanings

The engine has fixed function names and argument counts. An arbitrary `g(x)` is
not automatically a function call: it may be interpreted as multiplication.
For a first course, use these established functions when needed:

| Token | Arguments |
| --- | --- |
| `cos`, `sin`, `ln`, `exp`, `cosh`, `sinh`, `sqrt`, `det`, `tr`, `rank`, `dim` | 1 |
| `f`, `X` | 2 |
| `N`, `K`, `H`, `S`, `n`, `α`, `β`, `φ`, `α'`, `α''`, `β'`, `φ'`, `γ'`, `s'` | 1 |
| `h_a`, `d_p0`, `df_p`, `∇f`, `k_i`, `k_1`, `k_2`, `dN_p`, `dN` | 1 |
| `I_p`, `II_p`, `II`, `Hess_p`, `Hh_p` | 2 |
| `D_0`, `D2_0`, `dNX_q`, `N_X` | 1 |

`N_X` additionally accepts two coordinate arguments. The last rows contain
course-specific notation; prefer the elementary symbols unless your source
actually uses these objects. Bare names can still be atoms when no arguments
follow, but parentheses after a reserved name trigger function parsing.
`ln` and `exp` are supported names, but there is no general custom-function
registry. Recognition of a function does not imply support for every identity
involving that function.

The legacy `implicitArguments` field now declares function arities only: for
example, `{"B":["v","w"]}` registers `B` as a two-argument function. The listed
names never fill in missing arguments. Bare `B` and `B(v,w)` are distinct in
both directions; accepted solutions must use the intended notation. Ordinary
algebraic equivalences still apply. Recognition of a function does not declare
its mathematical properties, such as bilinearity or symmetry.

## What equivalence means

The grader supports some algebraic normalization; it does not know every
identity or theorems stated in a prompt. Supply explicit alternate `answers` for
valid forms it does not recognize. Assumptions in prose alone do not become
algebraic rules. Declare vector/matrix symbols in `symbolTypes`; scalar is the
default. Never add false positivity or nonzero assumptions just to pass a check.

For a required chain, use `equalityChain: true`, one complete chain in `answers`,
and the same complete chain as the single entry of `sequence`. Each portion must
match the corresponding official portion up to supported normalization. Skipping
or inserting arbitrary intermediate expressions is not supported. Do not split
one chain into multiple `sequence` entries for a first course.

Independent computations can share one answer, separated by top-level comma
symbols. The parser returns a nonempty list of computations, even for a single
computation. The grader matches the computations in either order, preserving
multiplicity and the steps and relation signs within each chain. Commas inside
function calls, tuples, and inner products retain their existing meanings. Put
the entire comma-separated answer in one `answers` entry and one `sequence`
entry; separate `answers` entries describe alternatives, not required parts.

A successful import proves that the declared answers can be entered and
recognized. It does not prove that the questions or answers are mathematically
correct. Practice every card and inspect all previews before sharing the file.

### Real matrix transpose assumptions

For cards working in one real coordinate space, optional `grading.matrixShapes`
can declare symbols as `square`, `column`, or `row` (all share one dimension).
For example, `{"A":"square","M":"square","x":"column","y":"column"}`.
Optional `grading.symmetricMatrices: ["M"]` asserts symmetry of a declared
square matrix. Declare only hypotheses, never a condition the learner must prove.
These enable product-transpose rules, double transposes and transposing scalar
row–matrix–column products. Thus `x^T M y` and `y^T M x` agree when M is
symmetric. Factors do not commute; matrix inverses are not cancelled. Keep
explicit `answers` alternatives for equivalent conditions requiring rearrangement
by an invertible matrix, or genuinely different computation chains.

## Superscript scope follows visible notation

A `power` node is a visual superscript attachment. Its `base` field is retained
for format compatibility; it does **not** supply invisible parentheses.
The editor normalizes this field to one preceding visual item, moving any earlier
items into the surrounding row. Saved drafts use the same normalization.

For example, a legacy base row containing `a`, `b` with exponent `2` means
`a b²`, not `(a b)²`. To square a product or sum, include explicit `(` and `)`
symbols. Attaching the superscript to `)` then powers the visibly enclosed
expression. A fraction or matrix is already a single structured visual item.
Function notation such as `sin(t)²` powers the function value. Ordinary layout
rows never create mathematical groups. The same rules apply to transpose and
inverse superscripts.
