Documentation

Mathlib.Data.Matrix.Hadamard

Hadamard product of matrices #

This file defines the Hadamard product Matrix.hadamard and contains basic properties about them.

Main definition #

Notation #

References #

Tags #

hadamard product, hadamard

def Matrix.hadamard {α : Type u_1} {m : Type u_4} {n : Type u_5} [Mul α] (A : Matrix m n α) (B : Matrix m n α) :
Matrix m n α

Matrix.hadamard defines the Hadamard product, which is the pointwise product of two matrices of the same size.

Equations
Instances For
    @[simp]
    theorem Matrix.hadamard_apply {α : Type u_1} {m : Type u_4} {n : Type u_5} [Mul α] (A : Matrix m n α) (B : Matrix m n α) (i : m) (j : n) :
    Matrix.hadamard A B i j = A i j * B i j
    theorem Matrix.hadamard_comm {α : Type u_1} {m : Type u_4} {n : Type u_5} (A : Matrix m n α) (B : Matrix m n α) [CommSemigroup α] :
    theorem Matrix.hadamard_assoc {α : Type u_1} {m : Type u_4} {n : Type u_5} (A : Matrix m n α) (B : Matrix m n α) (C : Matrix m n α) [Semigroup α] :
    theorem Matrix.hadamard_add {α : Type u_1} {m : Type u_4} {n : Type u_5} (A : Matrix m n α) (B : Matrix m n α) (C : Matrix m n α) [Distrib α] :
    theorem Matrix.add_hadamard {α : Type u_1} {m : Type u_4} {n : Type u_5} (A : Matrix m n α) (B : Matrix m n α) (C : Matrix m n α) [Distrib α] :
    @[simp]
    theorem Matrix.smul_hadamard {α : Type u_1} {m : Type u_4} {n : Type u_5} {R : Type u_6} (A : Matrix m n α) (B : Matrix m n α) [Mul α] [SMul R α] [IsScalarTower R α α] (k : R) :
    @[simp]
    theorem Matrix.hadamard_smul {α : Type u_1} {m : Type u_4} {n : Type u_5} {R : Type u_6} (A : Matrix m n α) (B : Matrix m n α) [Mul α] [SMul R α] [SMulCommClass R α α] (k : R) :
    @[simp]
    theorem Matrix.hadamard_zero {α : Type u_1} {m : Type u_4} {n : Type u_5} (A : Matrix m n α) [MulZeroClass α] :
    @[simp]
    theorem Matrix.zero_hadamard {α : Type u_1} {m : Type u_4} {n : Type u_5} (A : Matrix m n α) [MulZeroClass α] :
    theorem Matrix.hadamard_one {α : Type u_1} {n : Type u_5} [DecidableEq n] [MulZeroOneClass α] (M : Matrix n n α) :
    Matrix.hadamard M 1 = Matrix.diagonal fun (i : n) => M i i
    theorem Matrix.one_hadamard {α : Type u_1} {n : Type u_5} [DecidableEq n] [MulZeroOneClass α] (M : Matrix n n α) :
    Matrix.hadamard 1 M = Matrix.diagonal fun (i : n) => M i i
    theorem Matrix.diagonal_hadamard_diagonal {α : Type u_1} {n : Type u_5} [DecidableEq n] [MulZeroClass α] (v : nα) (w : nα) :
    theorem Matrix.sum_hadamard_eq {α : Type u_1} {m : Type u_4} {n : Type u_5} (A : Matrix m n α) (B : Matrix m n α) [Fintype m] [Fintype n] [Semiring α] :
    (Finset.sum Finset.univ fun (i : m) => Finset.sum Finset.univ fun (j : n) => Matrix.hadamard A B i j) = Matrix.trace (A * Matrix.transpose B)
    theorem Matrix.dotProduct_vecMul_hadamard {α : Type u_1} {m : Type u_4} {n : Type u_5} (A : Matrix m n α) (B : Matrix m n α) [Fintype m] [Fintype n] [Semiring α] [DecidableEq m] [DecidableEq n] (v : mα) (w : nα) :