AFTD Auto-Formalizing Theoretical Domains

matrix_order_four_centered_shift_mulVec

theoremverified

The action of a centered scalar shift on a complex vector is its original image plus the scalar multiple of the vector minus its average.

Statement

theorem matrix_order_four_centered_shift_mulVec (L : Matrix (Fin 4) (Fin 4) ℝ)
    (b : ℝ) (v : Fin 4 → ℂ) :
    ((matrix_order_four_centered_shift L b).map (algebraMap ℝ ℂ)).mulVec v =
      fun i => (L.map (algebraMap ℝ ℂ)).mulVec v i + (b : ℂ) * v i -
        (b : ℂ) / 4 * ∑ j, v j
Source
Sector-bound formalization for IN-166; arXiv:math/0508176, Theorem 5.
Verified
27 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
Used by 2

The proof, explained

The identity is proved componentwise for each index $i \in \{0, 1, 2, 3\}$ using functional extensionality. After verifying that casting the conditional shift to the complex numbers commutes with the condition, the proof expands the definition of matrix-vector multiplication and the centered shift matrix. Distributing multiplication over addition and subtraction and splitting the sum allows the identity component to collapse to $b v_i$ and the shift component to factor out as $(b / 4) \sum_j v_j$.

  1. To prove the vector identity, it suffices to show that the $i$-th components of both sides are equal for an arbitrary coordinate $i \in \{0, 1, 2, 3\}$.

    Two vectors in $\mathbb{C}^4$ are equal if and only if all their coordinates agree. Applying functional extensionality introduces an arbitrary index $i$.

    line 6

      ext i
  2. For any index $j$, casting the real indicator term $\text{if } i = j \text{ then } b \text{ else } 0$ to $\mathbb{C}$ equals the conditional $\text{if } i = j \text{ then } (b : \mathbb{C}) \text{ else } 0$.

    We perform a case split on whether $i = j$. If $i = j$, both sides reduce to $b \in \mathbb{C}$; if $i \ne j$, both sides reduce to $0 \in \mathbb{C}$.

    lines 7–9

      have hcast (j : Fin 4) : ((if i = j then b else 0 : ℝ) : ℂ) =
          if i = j then (b : ℂ) else 0 := by
        by_cases hij : i = j <;> simp [hij]
  3. The $i$-th component of the shifted matrix applied to $v$ equals $(L v)_i + b v_i - \frac{b}{4} \sum_j v_j$.

    Unfolding the definition of the centered shift matrix, matrix-vector multiplication, and dot products expands the $i$-th component into a sum over $j$ of $(L_{i, j} + (\text{if } i = j \text{ then } b \text{ else } 0) - b / 4) v_j$. Using the helper lemma to cast the conditional, distributing multiplication by $v_j$ across the sum and difference, and splitting the summation into three parts transforms this into $(L v)_i$, an indicator sum that evaluates to $b v_i$, and a constant term from which $b / 4$ is factored out to leave $(b / 4) \sum_j v_j$.

    lines 10–11

    uses Matrix.mulVec, add_mul, sub_mul, ite_mul, Finset.sum_add_distrib, Finset.sum_sub_distrib, Finset.mul_sum

      simp [matrix_order_four_centered_shift, Matrix.mulVec, dotProduct, hcast, add_mul, sub_mul, ite_mul,
        Finset.sum_add_distrib, Finset.sum_sub_distrib, ← Finset.mul_sum]
Matrix.mulVec
matrix-vector multiplication, defined componentwise by taking the dot product of each row of the matrix with the vector
add_mul
multiplication distributes over addition on the right: (a + b) * c = a * c + b * c
sub_mul
multiplication distributes over subtraction on the right: (a - b) * c = a * c - b * c
ite_mul
multiplication distributes into an if-then-else condition: (if P then a else b) * c = if P then a * c else b * c
Finset.sum_add_distrib
a sum of sums over a finite set equals the sum of the individual sums: ∑ x ∈ s, (f x + g x) = ∑ x ∈ s, f x + ∑ x ∈ s, g x
Finset.sum_sub_distrib
a sum of differences over a finite set equals the difference of the individual sums: ∑ x ∈ s, (f x - g x) = ∑ x ∈ s, f x - ∑ x ∈ s, g x
Finset.mul_sum
a scalar factor distributes across a finite sum: a * ∑ i ∈ s, f i = ∑ i ∈ s, a * f i

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

theorem matrix_order_four_centered_shift_mulVec (L : Matrix (Fin 4) (Fin 4) ℝ)    (b : ℝ) (v : Fin 4 → ℂ) :    ((matrix_order_four_centered_shift L b).map (algebraMap ℝ ℂ)).mulVec v =      fun i => (L.map (algebraMap ℝ ℂ)).mulVec v i + (b : ℂ) * v i -        (b : ℂ) / 4 * ∑ j, v j := by  ext i  have hcast (j : Fin 4) : ((if i = j then b else 0 : ℝ) : ℂ) =      if i = j then (b : ℂ) else 0 := by    by_cases hij : i = j <;> simp [hij]  simp [matrix_order_four_centered_shift, Matrix.mulVec, dotProduct, hcast, add_mul, sub_mul, ite_mul,    Finset.sum_add_distrib, Finset.sum_sub_distrib, ← Finset.mul_sum]
See it in the graphDiscuss this resultChallenge it