NLA-lib Explorer

dotProduct_mul_eq_mul_dotProduct

Library · theorem

Dot products of flattened outer products factor: \sum_{(i,j)} (\mathbf{x}_i \mathbf{y}_j) (\mathbf{x}'_i \mathbf{y}'_j) = (\mathbf{x}^{\mathsf{T}}\mathbf{x}') (\mathbf{y}^{\mathsf{T}}\mathbf{y}').

dotProduct_mul_eq_mul_dotProduct.{u_1, u_2, u_3} {R : Type u_1} [CommSemiring R] {m : Type u_2}
  {n : Type u_3} [Fintype m] [Fintype n] (x x' : m → R) (y y' : n → R) :
  ((fun p ↦ x p.1 * y p.2) ⬝ᵥ fun p ↦ x' p.1 * y' p.2) = x ⬝ᵥ x' * y ⬝ᵥ y'

Full source on GitHub

Import NLAlib.ForMathlib.Data.Matrix.Mul.