Linear-algebra facts for dependent tensors.
The results here cover dot products, matrix-vector structure, and linearity facts used by autograd, runtime approximation, and model proofs.
Coordinate formula for vec_mat_mul_spec as a Finset sum: (v @ A)[j] = ∑ i, v[i] * A[i,j].
Adjointness of matrix-vector and vector-matrix multiplication under the dot product:
⟪y, W x⟫ = ⟪y W, x⟫ (a.k.a. ⟪y, W x⟫ = ⟪Wᵀ y, x⟫ depending on conventions).
This is the algebraic heart of the linear-layer gradient rule.
Map and elementwise operation laws #
Functor identity law for map_spec: mapping id is a no-op.
Matrix and vector algebra #
Associativity of matrix-vector multiplication: A (B x) = (A B) x.
Matrix transpose is an involution.
Coordinate rule for matrix_transpose_spec: (Aᵀ)[i,j] = A[j,i].
Transpose of a product: (A ⬝ B)ᵀ = Bᵀ ⬝ Aᵀ.
Right-adjointness of matrix multiplication under the Frobenius dot-product.
Informally: ⟪A ⬝ B, C⟫ = ⟪A, C ⬝ Bᵀ⟫.
Transpose invariance of the Frobenius dot-product: ⟪Aᵀ, Bᵀ⟫ = ⟪A, B⟫.
Left-adjointness of matrix multiplication under the Frobenius dot-product.
Informally: ⟪A ⬝ B, C⟫ = ⟪B, Aᵀ ⬝ C⟫.
Outer product properties. Essential for proving weight gradient correctness.