eval_matrix3_triad
Given a commutative semiring R, a triad t of type Matrix3Triad R, and 3x3 matrices A and B over R, eval_matrix3_triad t A B is the scalar multiple of t.w by the product of the sum of t.u i j * A i j and the sum of t.v i j * B i j over all i and j in Fin 3.
Statement
def eval_matrix3_triad {R : Type*} [CommSemiring R] (t : Matrix3Triad R) (A B : Matrix (Fin 3) (Fin 3) R) : Matrix (Fin 3) (Fin 3) R
- Defined in
- arXiv:2610.01639, Sec. 2.1
- Verified
- 04 Oct 2026
- Axioms
- none listed
- Built on 1
- Matrix3TriadGiven a type R, a Matrix3Triad R is a structure consisting of three 3-by-3 matrices with entries in R, labeled u, v, and w.
- Used by 23
- matrix3_shorter_valid_of_shared_u_wIf a list of triads written as L₁ ++ t₁ :: L₂ ++ t₂ :: L₃ is a valid decomposition of matrix multiplication, and t₁ and t₂ have the same u…
- eval_matrix3_triad_smul_leftGiven a commutative semiring R, a triad t of type Matrix3Triad R, a scalar c : R, and matrices A and B, eval_matrix3_triad t (c • A) B…
- matrix3_eval_triad_zero_vEvaluating any triad whose v component is zero yields the zero matrix for all input matrices A and B.
- eval_matrix3_decomposition_sum_rightGiven a commutative semiring R, a finite set s, a list L of triads, a matrix A, and a family of matrices G, evaluating L on A and (∑ i ∈…
- eval_matrix3_decomposition_add_rightGiven a commutative semiring R, a list L of Matrix3Triad R, and matrices A, B₁, and B₂, eval_matrix3_decomposition L A (B₁ + B₂) equals…
- matrix3_tensor_rank_le_pred_of_zero_wIf a valid decomposition has length at most r and contains a triad with zero w matrix, then the tensor rank of 3x3 matrix multiplication…
- eval_matrix3_triad_add_leftGiven a commutative semiring R, a triad t of type Matrix3Triad R, and matrices A₁, A₂, and B in Matrix (Fin 3) (Fin 3) R,…
- eval_matrix3_decomposition_add_leftGiven a commutative semiring R, a list L of Matrix3Triad R, and matrices A₁, A₂, and B, eval_matrix3_decomposition L (A₁ + A₂) B equals…
- matrix3_valid_transpose_swapTransposing and swapping the two input factors along with transposing the output factor, (u, v, w) ↦ (vᵀ, uᵀ, wᵀ), preserves the validity…
- matrix3_eval_triad_zero_wEvaluating any triad whose w component is zero yields the zero matrix for all input matrices A and B.
- matrix3_shorter_valid_of_shared_u_vIf a list of triads written as L₁ ++ t₁ :: L₂ ++ t₂ :: L₃ is a valid decomposition of matrix multiplication, and t₁ and t₂ have the same u…
- eval_matrix3_decomposition_applyEntry (i, j) of the evaluation of a list of 3x3 triads on A and B is the sum, over the triads, of (sum of u_kl A_kl) times (sum of v_kl…
- eval_matrix3_decomposition_sum_leftGiven a commutative semiring R, a finite set s, a list L of triads, a family of matrices F, and a matrix B, evaluating L on (∑ i ∈ s, F i)…
- eval_matrix3_triad_smul_rightGiven a commutative semiring R, a triad t of type Matrix3Triad R, a scalar c : R, and matrices A and B, eval_matrix3_triad t A (c • B)…
- matrix3_valid_of_unit_checksIf a list L of triads over a commutative semiring R evaluates to matrix multiplication on all 81 pairs of matrix units, then L is a valid…
- matrix3_eval_triad_add_self_of_two_eq_zeroIn characteristic 2 a triad repeated twice contributes nothing: if 2 = 0 in R then eval t A B + eval t A B = 0 for every triad t and all…
- matrix3_tensor_rank_le_pred_of_zero_uIf a valid decomposition has length at most r and contains a triad with zero u matrix, then the tensor rank of 3x3 matrix multiplication…
- matrix3_tensor_rank_le_pred_of_zero_vIf a valid decomposition has length at most r and contains a triad with zero v matrix, then the tensor rank of 3x3 matrix multiplication…
- matrix3_eval_triad_zero_uEvaluating any triad whose u component is zero yields the zero matrix for all input matrices A and B.
- eval_matrix3_triad_add_rightGiven a commutative semiring R, a triad t of type Matrix3Triad R, and matrices A, B₁, and B₂ in Matrix (Fin 3) (Fin 3) R,…
- matrix3_shorter_valid_of_shared_v_wIf a list of triads written as L₁ ++ t₁ :: L₂ ++ t₂ :: L₃ is a valid decomposition of matrix multiplication, and t₁ and t₂ have the same v…
- eval_matrix3_decompositionGiven a commutative semiring R, a list L of Matrix3Triad R, and 3x3 matrices A and B over R, eval_matrix3_decomposition L A B is the sum…
- matrix3_eval_triad_mergeTwo triads that agree in two of their three slots can be replaced by a single triad: if they share u and w their v's add, if they share v…
Read back from the Lean
eval_matrix3_triad is a definition that takes a commutative semiring R, a triad t of $3 \times 3$ matrices t.u, t.v, t.w over R, and two $3 \times 3$ matrices A and B over R, and produces the $3 \times 3$ matrix over R obtained by scalar multiplying t.w by the product of two scalars: the sum over all entries $(i, j) \in \{0, 1, 2\}^2$ of $(t.u)_{i,j} \cdot A_{i,j}$, and the sum over all entries $(i, j) \in \{0, 1, 2\}^2$ of $(t.v)_{i,j} \cdot B_{i,j}$.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- Bilinear evaluation of a 3x3 triad on input matrices A and B. -/ def eval_matrix3_triad {R : Type*} [CommSemiring R] (t : Matrix3Triad R) (A B : Matrix (Fin 3) (Fin 3) R) : Matrix (Fin 3) (Fin 3) R := let sA := ∑ i : Fin 3, ∑ j : Fin 3, t.u i j * A i j let sB := ∑ i : Fin 3, ∑ j : Fin 3, t.v i j * B i j (sA * sB) • t.w