Higher derivatives through the model API #
The public transforms lower a model, embed fixed state, and seed input directions. The forward
theorem connects coefficient extraction to mathlib's iterated derivative. Model.Reverse also
connects the returned state and input gradients to its pullback. Their hypotheses identify the
recorded graph and certify its operations; successful recording alone does not imply
differentiability.
A model with no state tensors evaluates on its input alone, regardless of the empty state value. This equation lets clients reason about execution without unpacking the opaque state wrapper.
Successful certified lowering makes model.derivative compute the iterated Fréchet derivative.
State is fixed, directions can repeat, and the list length is the derivative order. real supplies
the reference function, while the jet certificate relates every recorded operation to the nested
graph actually returned by the IO lowering call. No assumption identifies native floats with reals.