Coordinatewise primitive specifications #
A captured tensor can supply a different scalar function at every coordinate. Its derivative is still diagonal: each input tangent is multiplied by the corresponding scalar derivative. Over the reals this diagonal map is self-adjoint, which gives the reverse rule for the same scalar formula.
The final lemmas apply to an actual OpSpec. They require its forward and backward coordinate
formulas, as well as scalar derivative evidence at the input being differentiated. This keeps the
analytic step separate from an algebraic pairing identity and permits the necessary domain
conditions for reciprocals and piecewise functions. Flattening uses the existing tensor/vector
equivalence, so the statements apply to arbitrary tensor shapes, including empty ones.
Scalar derivatives at the input coordinates determine the derivative of the whole vector.
Real diagonal maps are self-adjoint, independently of differentiability.
Transport coordinatewise calculus to the exact forward function stored by an OpSpec.
Identify the stored backward with the adjoint of the actual forward derivative.
The backward formula is checked at the same input as the scalar derivative hypotheses. In particular, supplying a selected slope at a kink does not establish a classical derivative there.