Tensor algebra proofs #
Backend-generic algebraic lemmas for TorchLean's single packed tensor type.
Proofs observe tensors through item, unstack, and typed indexing; they do
not depend on the physical buffer selected by Storage.
Multiply matching scalar entries and add them in row-major shape order.
Instances For
Fold bridges #
Push an accumulator into an additive fold that starts at zero.
A fold over scalar tensors is the corresponding fold over scalar values.
Dot-product algebra #
The dot product of two scalars is their product: the base case of the recursion.
Dot is multiplicative with scalar scaling in its right argument.
Dot is symmetric over a commutative semiring.
Dot is multiplicative with scalar scaling in its left argument.
Dot distributes over addition in its left argument.
Dot distributes over addition in its right argument.
The dot product with an all-zero tensor is zero.
Vector dot is the ordinary finite sum of matching scalar coordinates.
Indexing and matrix/vector bridges #
Spec.get is the public spelling of packed leading-axis selection.
Scalar-tensor multiply-add folds agree with their scalar-value folds.
Coordinate expansion of matrix-vector multiplication.
Coordinate expansion of vector-matrix multiplication.
Matrix-vector and vector-matrix multiplication are adjoint under dot.