AFTD Auto-Formalizing Theoretical Domains

eval_matrix3_decomposition_add_right

theoremverified

Given a commutative semiring R, a list L of Matrix3Triad R, and matrices A, B₁, and B₂, eval_matrix3_decomposition L A (B₁ + B₂) equals eval_matrix3_decomposition L A B₁ + eval_matrix3_decomposition L A B₂.

Statement

theorem eval_matrix3_decomposition_add_right {R : Type*} [CommSemiring R] (L : List (Matrix3Triad R)) (A B₁ B₂ : Matrix (Fin 3) (Fin 3) R) : eval_matrix3_decomposition L A (B₁ + B₂) = eval_matrix3_decomposition L A B₁ + eval_matrix3_decomposition L A B₂
Source
step towards matrix3_tensor_rank_int_le_22
Verified
23 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 4
  • 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…
  • 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,…
  • 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

The proof, explained

The proof proceeds by structural induction on the list $L$ of triads. The base case for the empty list holds because the empty sum evaluates to zero on both sides. In the inductive step, the decomposition is unfolded into head and tail components, right-additivity for the individual head triad and the induction hypothesis are applied, and the resulting four terms are rearranged using the commutativity and associativity of matrix addition.

  1. The identity holds for the empty list $L = []$.

    We proceed by structural induction on the list $L$ of triads. In the base case where $L = []$, the decomposition sum is empty and evaluates to the zero matrix on both sides, yielding $0 = 0 + 0$, which holds trivially.

    lines 3–4

    uses eval_matrix3_decomposition

      induction L with
      | nil => simp [eval_matrix3_decomposition]
  2. For a list $t :: L'$, expanding the decomposition reduces the goal to rearranging four additive terms.

    In the inductive step for the cons-cell $t :: L'$ with induction hypothesis ih, we unfold the definition of eval_matrix3_decomposition on both sides. The head term eval_matrix3_triad $t$ $A$ $(B_1 + B_2)$ distributes over the sum by right-additivity for individual triads (eval_matrix3_triad_add_right), and the tail sum rewrites via the induction hypothesis ih. This leaves both sides as sums of the same four terms: the evaluations of the head triad $t$ and the evaluations of the tail list $L'$.

    lines 5–6

    uses eval_matrix3_decomposition, eval_matrix3_triad_add_right

      | cons t L' ih =>
        simp [eval_matrix3_decomposition, eval_matrix3_triad_add_right]
  3. The inductive step is complete.

    The remaining goal has the form $(t_1 + t_2) + (s_1 + s_2) = (t_1 + s_1) + (t_2 + s_2)$ in the commutative additive monoid of matrices, which is resolved by rearranging terms via associativity and commutativity of addition.

    line 7

        abel
eval_matrix3_decomposition
Evaluates a list of matrix triads on two matrices $A$ and $B$ by summing the evaluation of each individual triad.
eval_matrix3_triad_add_right
Right-additivity for a single triad: evaluating triad $t$ on $A$ and $B_1 + B_2$ equals evaluating $t$ on $A$ and $B_1$ plus evaluating $t$ on $A$ and $B_2$.

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

/-- Right-additivity of triad decomposition evaluation. -/theorem eval_matrix3_decomposition_add_right {R : Type*} [CommSemiring R] (L : List (Matrix3Triad R)) (A B₁ B₂ : Matrix (Fin 3) (Fin 3) R) : eval_matrix3_decomposition L A (B₁ + B₂) = eval_matrix3_decomposition L A B₁ + eval_matrix3_decomposition L A B₂ := by  induction L with  | nil => simp [eval_matrix3_decomposition]  | cons t L' ih =>    simp [eval_matrix3_decomposition, eval_matrix3_triad_add_right]    abel
See it in the graphDiscuss this resultChallenge it