AFTD Auto-Formalizing Theoretical Domains

eval_matrix3_triad_add_left

theoremverified

Given 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_triad t (A₁ + A₂) B equals eval_matrix3_triad t A₁ B + eval_matrix3_triad t A₂ B.

Statement

theorem eval_matrix3_triad_add_left {R : Type*} [CommSemiring R] (t : Matrix3Triad R) (A₁ A₂ B : Matrix (Fin 3) (Fin 3) R) : eval_matrix3_triad t (A₁ + A₂) B = eval_matrix3_triad t A₁ B + eval_matrix3_triad t A₂ B
Source
step towards matrix3_tensor_rank_int_le_22
Verified
23 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • eval_matrix3_triadGiven 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…
  • 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 1
  • 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…

The proof, explained

The theorem states that evaluating a 3×3 triad on two matrices is additive in the first matrix argument. The proof unfolds the definition of triad evaluation—which contracts the first matrix with the triad component u, contracts the second with v, and scales w by their product—and simplifies using the entrywise definition of matrix addition alongside the distributive laws for multiplication, finite summations, and scalar multiplication.

  1. eval_matrix3_triad t (A₁ + A₂) B = eval_matrix3_triad t A₁ B + eval_matrix3_triad t A₂ B

    Unfolding the definition of eval_matrix3_triad expresses the evaluation in terms of sums of matrix entries. Matrix addition is evaluated entrywise by Matrix.add_apply, and multiplication distributes over this addition by mul_add. The summation splits linearly across the sum via Finset.sum_add_distrib, and the remaining scalar factors distribute over the resulting sum via add_mul and add_smul, establishing the additive identity.

    lines 3–4

    uses eval_matrix3_triad, Matrix.add_apply, Finset.sum_add_distrib, mul_add, add_mul, add_smul

      simp only [eval_matrix3_triad, Matrix.add_apply, Finset.sum_add_distrib, mul_add, add_mul,
        add_smul]
eval_matrix3_triad
The definition of evaluating a triad t at matrices A and B: it computes the Frobenius-like inner products sA = ∑ i j, t.u i j * A i j and sB = ∑ i j, t.v i j * B i j, and returns the matrix (sA * sB) • t.w.
Matrix.add_apply
Entrywise matrix addition: (A + B) i j = A i j + B i j.
Finset.sum_add_distrib
A sum of sums over a finite set splits into the sum of the two individual sums: ∑ x ∈ s, (f x + g x) = ∑ x ∈ s, f x + ∑ x ∈ s, g x.
mul_add
Left distributivity of multiplication over addition: a * (b + c) = a * b + a * c.
add_mul
Right distributivity of multiplication over addition: (a + b) * c = a * c + b * c.
add_smul
Distributivity of scalar multiplication over scalar addition: (r + s) • x = r • x + s • x.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- Evaluation of a 3x3 triad is additive in its first matrix argument. -/theorem eval_matrix3_triad_add_left {R : Type*} [CommSemiring R] (t : Matrix3Triad R) (A₁ A₂ B : Matrix (Fin 3) (Fin 3) R) : eval_matrix3_triad t (A₁ + A₂) B = eval_matrix3_triad t A₁ B + eval_matrix3_triad t A₂ B := by  simp only [eval_matrix3_triad, Matrix.add_apply, Finset.sum_add_distrib, mul_add, add_mul,    add_smul]
See it in the graphDiscuss this resultChallenge it