Tensor Algebra Lemmas #
This file collects foundational algebraic lemmas for Spec.Tensor: extensionality, map/fold
rewrites, and pointwise arithmetic facts used throughout the autograd and runtime-correctness proof
stack.
theorem
Spec.mat_vec_add
{m n : ℕ}
(W : Tensor ℝ (Shape.dim m (Shape.dim n Shape.scalar)))
(x y : Tensor ℝ (Shape.dim n Shape.scalar))
:
Linearity of matrix-vector multiplication in the vector argument (addition).
theorem
Spec.mat_vec_scale
{m n : ℕ}
(W : Tensor ℝ (Shape.dim m (Shape.dim n Shape.scalar)))
(x : Tensor ℝ (Shape.dim n Shape.scalar))
(c : ℝ)
:
Linearity of matrix-vector multiplication in the vector argument (scaling).
theorem
Spec.mat_vec_linear_combination
{m n : ℕ}
(W : Tensor ℝ (Shape.dim m (Shape.dim n Shape.scalar)))
(x y : Tensor ℝ (Shape.dim n Shape.scalar))
(a b : ℝ)
:
matVecMulSpec W ((x.scaleSpec a).addSpec (y.scaleSpec b)) = ((matVecMulSpec W x).scaleSpec a).addSpec ((matVecMulSpec W y).scaleSpec b)
Full linearity of matrix-vector multiplication in the vector argument.
@[simp]
Simplification lemmas for common patterns. Useful for automated proof tactics.
Mapping 0 + · over an Option is the identity.