Tensor Coordinate and Shape Bridges #
Coordinate formulas for real vector addition and scaling, together with row-major flattening and
constant-tensor reshape rules for any storage scalar. Shape.Coord.equivFin identifies shaped
coordinates with flat indices, including empty shapes with a zero-length dimension.
The generic matrix/vector indexing helpers are re-exported from NN.Proofs.Tensor.Algebra into
Spec. General fold lemmas retain their canonical List names.
The shape conventions match
PyTorch flatten
and reshape. Spec.Shape.size
corresponds to numel.
Vector coordinates #
The forward map of Shape.Coord.equivFin is row-major linearization.
Reading a flattened tensor at the row-major position of a coordinate returns that entry.
A scalar in the flattened tensor is read at its row-major shaped coordinate.
A shape change preserves a constant tensor's fill value.