Tensor coordinates for primitive derivatives #
Flattening preserves the coordinate formulas of pointwise tensor operations. These lemmas connect
the actual tensor functions to the diagonal calculus in PrimitiveSpecs, without restricting the
tensor to one axis. A binary operation with a captured right argument then needs only the scalar
derivative with respect to its left argument.
Row-major flattening commutes with a unary pointwise map.
Both operands of a binary pointwise map use the same flattened coordinate.
Every coordinate of a filled tensor is its fill value.
Elementwise multiplication becomes multiplication of the corresponding real coordinates.
The captured-right constructor differentiates its actual tensor forward function.
Scalar derivative evidence certifies the stored captured-right backward formula.