mathlib documentation

data.matrix.basic

Matrices #

This file defines basic properties of matrices.

Notation #

The locale matrix gives the following notation:

TODO #

Under various conditions, multiplication of infinite matrices makes sense. These have not yet been implemented.

def matrix (m : Type u) (n : Type u') (α : Type v) :
Type (max u u' v)

matrix m n is the type of matrices whose rows are indexed by m and whose columns are indexed by n.

Equations
theorem matrix.ext_iff {m : Type u_2} {n : Type u_3} {α : Type v} {M N : matrix m n α} :
(∀ (i : m) (j : n), M i j = N i j) M = N
@[ext]
theorem matrix.ext {m : Type u_2} {n : Type u_3} {α : Type v} {M N : matrix m n α} :
(∀ (i : m) (j : n), M i j = N i j)M = N
def matrix.map {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} (M : matrix m n α) (f : α → β) :
matrix m n β

M.map f is the matrix obtained by applying f to each entry of the matrix M.

This is available in bundled forms as:

Equations
  • M.map f = λ (i : m) (j : n), f (M i j)
@[simp]
theorem matrix.map_apply {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {M : matrix m n α} {f : α → β} {i : m} {j : n} :
M.map f i j = f (M i j)
@[simp]
theorem matrix.map_id {m : Type u_2} {n : Type u_3} {α : Type v} (M : matrix m n α) :
M.map id = M
@[simp]
theorem matrix.map_map {m : Type u_2} {n : Type u_3} {α : Type v} {M : matrix m n α} {β : Type u_1} {γ : Type u_4} {f : α → β} {g : β → γ} :
(M.map f).map g = M.map (g f)
def matrix.transpose {m : Type u_2} {n : Type u_3} {α : Type v} (M : matrix m n α) :
matrix n m α

The transpose of a matrix.

Equations
def matrix.conj_transpose {m : Type u_2} {n : Type u_3} {α : Type v} [has_star α] (M : matrix m n α) :
matrix n m α

The conjugate transpose of a matrix defined in term of star.

Equations
def matrix.col {m : Type u_2} {α : Type v} (w : m → α) :

matrix.col u is the column matrix whose entries are given by u.

Equations
def matrix.row {n : Type u_3} {α : Type v} (v : n → α) :

matrix.row u is the row matrix whose entries are given by u.

Equations
@[protected, instance]
def matrix.inhabited {m : Type u_2} {n : Type u_3} {α : Type v} [inhabited α] :
inhabited (matrix m n α)
Equations
@[protected, instance]
def matrix.has_add {m : Type u_2} {n : Type u_3} {α : Type v} [has_add α] :
has_add (matrix m n α)
Equations
@[protected, instance]
def matrix.add_semigroup {m : Type u_2} {n : Type u_3} {α : Type v} [add_semigroup α] :
Equations
@[protected, instance]
def matrix.add_comm_semigroup {m : Type u_2} {n : Type u_3} {α : Type v} [add_comm_semigroup α] :
Equations
@[protected, instance]
def matrix.has_zero {m : Type u_2} {n : Type u_3} {α : Type v} [has_zero α] :
has_zero (matrix m n α)
Equations
@[protected, instance]
def matrix.add_zero_class {m : Type u_2} {n : Type u_3} {α : Type v} [add_zero_class α] :
Equations
@[protected, instance]
def matrix.add_monoid {m : Type u_2} {n : Type u_3} {α : Type v} [add_monoid α] :
Equations
@[protected, instance]
def matrix.add_comm_monoid {m : Type u_2} {n : Type u_3} {α : Type v} [add_comm_monoid α] :
Equations
@[protected, instance]
def matrix.has_neg {m : Type u_2} {n : Type u_3} {α : Type v} [has_neg α] :
has_neg (matrix m n α)
Equations
@[protected, instance]
def matrix.has_sub {m : Type u_2} {n : Type u_3} {α : Type v} [has_sub α] :
has_sub (matrix m n α)
Equations
@[protected, instance]
def matrix.add_group {m : Type u_2} {n : Type u_3} {α : Type v} [add_group α] :
add_group (matrix m n α)
Equations
@[protected, instance]
def matrix.add_comm_group {m : Type u_2} {n : Type u_3} {α : Type v} [add_comm_group α] :
Equations
@[protected, instance]
def matrix.unique {m : Type u_2} {n : Type u_3} {α : Type v} [unique α] :
unique (matrix m n α)
Equations
@[protected, instance]
def matrix.subsingleton {m : Type u_2} {n : Type u_3} {α : Type v} [subsingleton α] :
@[protected, instance]
def matrix.nontrivial {m : Type u_2} {n : Type u_3} {α : Type v} [nonempty m] [nonempty n] [nontrivial α] :
@[protected, instance]
def matrix.has_scalar {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [has_scalar R α] :
has_scalar R (matrix m n α)
Equations
@[protected, instance]
def matrix.smul_comm_class {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} {α : Type v} [has_scalar R α] [has_scalar S α] [smul_comm_class R S α] :
smul_comm_class R S (matrix m n α)
@[protected, instance]
def matrix.is_scalar_tower {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} {α : Type v} [has_scalar R S] [has_scalar R α] [has_scalar S α] [is_scalar_tower R S α] :
is_scalar_tower R S (matrix m n α)
@[protected, instance]
def matrix.is_central_scalar {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [has_scalar R α] [has_scalar Rᵐᵒᵖ α] [is_central_scalar R α] :
@[protected, instance]
def matrix.mul_action {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [monoid R] [mul_action R α] :
mul_action R (matrix m n α)
Equations
@[protected, instance]
def matrix.distrib_mul_action {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [monoid R] [add_monoid α] [distrib_mul_action R α] :
Equations
@[protected, instance]
def matrix.module {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [semiring R] [add_comm_monoid α] [module R α] :
module R (matrix m n α)
Equations
@[protected, simp]
theorem matrix.map_zero {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [has_zero α] [has_zero β] (f : α → β) (h : f 0 = 0) :
0.map f = 0
@[protected]
theorem matrix.map_add {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [has_add α] [has_add β] (f : α → β) (hf : ∀ (a₁ a₂ : α), f (a₁ + a₂) = f a₁ + f a₂) (M N : matrix m n α) :
(M + N).map f = M.map f + N.map f
@[protected]
theorem matrix.map_sub {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [has_sub α] [has_sub β] (f : α → β) (hf : ∀ (a₁ a₂ : α), f (a₁ - a₂) = f a₁ - f a₂) (M N : matrix m n α) :
(M - N).map f = M.map f - N.map f
theorem matrix.map_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [has_scalar R α] [has_scalar R β] (f : α → β) (r : R) (hf : ∀ (a : α), f (r a) = r f a) (M : matrix m n α) :
(r M).map f = r M.map f
theorem matrix.map_smul' {n : Type u_3} {α : Type v} {β : Type w} [has_mul α] [has_mul β] (f : α → β) (r : α) (A : matrix n n α) (hf : ∀ (a₁ a₂ : α), f (a₁ * a₂) = (f a₁) * f a₂) :
(r A).map f = f r A.map f

The scalar action via has_mul.to_has_scalar is transformed by the same map as the elements of the matrix, when f preserves multiplication.

theorem matrix.map_op_smul' {n : Type u_3} {α : Type v} {β : Type w} [has_mul α] [has_mul β] (f : α → β) (r : α) (A : matrix n n α) (hf : ∀ (a₁ a₂ : α), f (a₁ * a₂) = (f a₁) * f a₂) :

The scalar action via has_mul.to_has_opposite_scalar is transformed by the same map as the elements of the matrix, when f preserves multiplication.

theorem is_smul_regular.matrix {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} [has_scalar R S] {k : R} (hk : is_smul_regular S k) :
theorem is_left_regular.matrix {m : Type u_2} {n : Type u_3} {α : Type v} [has_mul α] {k : α} (hk : is_left_regular k) :
theorem matrix.subsingleton_of_empty_left {m : Type u_2} {n : Type u_3} {α : Type v} [is_empty m] :
theorem matrix.subsingleton_of_empty_right {m : Type u_2} {n : Type u_3} {α : Type v} [is_empty n] :
def matrix.diagonal {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] (d : n → α) :
matrix n n α

diagonal d is the square matrix such that (diagonal d) i i = d i and (diagonal d) i j = 0 if i ≠ j.

Note that bundled versions exist as:

Equations
@[simp]
theorem matrix.diagonal_apply_eq {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] {d : n → α} (i : n) :
matrix.diagonal d i i = d i
@[simp]
theorem matrix.diagonal_apply_ne {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] {d : n → α} {i j : n} (h : i j) :
theorem matrix.diagonal_apply_ne' {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] {d : n → α} {i j : n} (h : j i) :
theorem matrix.diagonal_injective {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] :
@[simp]
theorem matrix.diagonal_zero {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] :
matrix.diagonal (λ (_x : n), 0) = 0
@[simp]
theorem matrix.diagonal_transpose {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] (v : n → α) :
@[simp]
theorem matrix.diagonal_add {n : Type u_3} {α : Type v} [decidable_eq n] [add_zero_class α] (d₁ d₂ : n → α) :
matrix.diagonal d₁ + matrix.diagonal d₂ = matrix.diagonal (λ (i : n), d₁ i + d₂ i)
@[simp]
theorem matrix.diagonal_smul {n : Type u_3} {R : Type u_7} {α : Type v} [decidable_eq n] [monoid R] [add_monoid α] [distrib_mul_action R α] (r : R) (d : n → α) :
@[simp]
theorem matrix.diagonal_add_monoid_hom_apply (n : Type u_3) (α : Type v) [decidable_eq n] [add_zero_class α] (d : n → α) :
def matrix.diagonal_linear_map (n : Type u_3) (R : Type u_7) (α : Type v) [decidable_eq n] [semiring R] [add_comm_monoid α] [module R α] :
(n → α) →ₗ[R] matrix n n α

matrix.diagonal as a linear_map.

Equations
@[simp]
theorem matrix.diagonal_linear_map_apply (n : Type u_3) (R : Type u_7) (α : Type v) [decidable_eq n] [semiring R] [add_comm_monoid α] [module R α] (ᾰ : n → α) :
@[simp]
theorem matrix.diagonal_map {n : Type u_3} {α : Type v} {β : Type w} [decidable_eq n] [has_zero α] [has_zero β] {f : α → β} (h : f 0 = 0) {d : n → α} :
(matrix.diagonal d).map f = matrix.diagonal (λ (m : n), f (d m))
@[simp]
theorem matrix.diagonal_conj_transpose {n : Type u_3} {α : Type v} [decidable_eq n] [semiring α] [star_ring α] (v : n → α) :
@[protected, instance]
def matrix.has_one {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] [has_one α] :
has_one (matrix n n α)
Equations
@[simp]
theorem matrix.diagonal_one {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] [has_one α] :
matrix.diagonal (λ (_x : n), 1) = 1
theorem matrix.one_apply {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] [has_one α] {i j : n} :
1 i j = ite (i = j) 1 0
@[simp]
theorem matrix.one_apply_eq {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] [has_one α] (i : n) :
1 i i = 1
@[simp]
theorem matrix.one_apply_ne {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] [has_one α] {i j : n} :
i j1 i j = 0
theorem matrix.one_apply_ne' {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] [has_one α] {i j : n} :
j i1 i j = 0
@[simp]
theorem matrix.map_one {n : Type u_3} {α : Type v} {β : Type w} [decidable_eq n] [has_zero α] [has_one α] [has_zero β] [has_one β] (f : α → β) (h₀ : f 0 = 0) (h₁ : f 1 = 1) :
1.map f = 1
theorem matrix.one_eq_pi_single {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] [has_one α] {i j : n} :
1 i j = pi.single i 1 j
@[simp]
theorem matrix.bit0_apply {m : Type u_2} {α : Type v} [has_add α] (M : matrix m m α) (i j : m) :
bit0 M i j = bit0 (M i j)
theorem matrix.bit1_apply {n : Type u_3} {α : Type v} [decidable_eq n] [add_monoid α] [has_one α] (M : matrix n n α) (i j : n) :
bit1 M i j = ite (i = j) (bit1 (M i j)) (bit0 (M i j))
@[simp]
theorem matrix.bit1_apply_eq {n : Type u_3} {α : Type v} [decidable_eq n] [add_monoid α] [has_one α] (M : matrix n n α) (i : n) :
bit1 M i i = bit1 (M i i)
@[simp]
theorem matrix.bit1_apply_ne {n : Type u_3} {α : Type v} [decidable_eq n] [add_monoid α] [has_one α] (M : matrix n n α) {i j : n} (h : i j) :
bit1 M i j = bit0 (M i j)
def matrix.dot_product {m : Type u_2} {α : Type v} [fintype m] [has_mul α] [add_comm_monoid α] (v w : m → α) :
α

dot_product v w is the sum of the entrywise products v i * w i

Equations
theorem matrix.dot_product_assoc {m : Type u_2} {n : Type u_3} {α : Type v} [fintype m] [fintype n] [non_unital_semiring α] (u : m → α) (w : n → α) (v : matrix m n α) :
(λ (j : n), u ⬝ᵥ λ (i : m), v i j) ⬝ᵥ w = u ⬝ᵥ λ (i : m), v i ⬝ᵥ w
theorem matrix.dot_product_comm {m : Type u_2} {α : Type v} [fintype m] [comm_semiring α] (v w : m → α) :
v ⬝ᵥ w = w ⬝ᵥ v
@[simp]
theorem matrix.dot_product_punit {α : Type v} [add_comm_monoid α] [has_mul α] (v w : punit → α) :
@[simp]
theorem matrix.dot_product_zero {m : Type u_2} {α : Type v} [fintype m] [non_unital_non_assoc_semiring α] (v : m → α) :
v ⬝ᵥ 0 = 0
@[simp]
theorem matrix.dot_product_zero' {m : Type u_2} {α : Type v} [fintype m] [non_unital_non_assoc_semiring α] (v : m → α) :
(v ⬝ᵥ λ (_x : m), 0) = 0
@[simp]
theorem matrix.zero_dot_product {m : Type u_2} {α : Type v} [fintype m] [non_unital_non_assoc_semiring α] (v : m → α) :
0 ⬝ᵥ v = 0
@[simp]
theorem matrix.zero_dot_product' {m : Type u_2} {α : Type v} [fintype m] [non_unital_non_assoc_semiring α] (v : m → α) :
(λ (_x : m), 0) ⬝ᵥ v = 0
@[simp]
theorem matrix.add_dot_product {m : Type u_2} {α : Type v} [fintype m] [non_unital_non_assoc_semiring α] (u v w : m → α) :
(u + v) ⬝ᵥ w = u ⬝ᵥ w + v ⬝ᵥ w
@[simp]
theorem matrix.dot_product_add {m : Type u_2} {α : Type v} [fintype m] [non_unital_non_assoc_semiring α] (u v w : m → α) :
u ⬝ᵥ (v + w) = u ⬝ᵥ v + u ⬝ᵥ w
@[simp]
theorem matrix.diagonal_dot_product {m : Type u_2} {α : Type v} [fintype m] [decidable_eq m] [non_unital_non_assoc_semiring α] (v w : m → α) (i : m) :
matrix.diagonal v i ⬝ᵥ w = (v i) * w i
@[simp]
theorem matrix.dot_product_diagonal {m : Type u_2} {α : Type v} [fintype m] [decidable_eq m] [non_unital_non_assoc_semiring α] (v w : m → α) (i : m) :
v ⬝ᵥ matrix.diagonal w i = (v i) * w i
@[simp]
theorem matrix.dot_product_diagonal' {m : Type u_2} {α : Type v} [fintype m] [decidable_eq m] [non_unital_non_assoc_semiring α] (v w : m → α) (i : m) :
(v ⬝ᵥ λ (j : m), matrix.diagonal w j i) = (v i) * w i
@[simp]
theorem matrix.single_dot_product {m : Type u_2} {α : Type v} [fintype m] [decidable_eq m] [non_unital_non_assoc_semiring α] (v : m → α) (x : α) (i : m) :
pi.single i x ⬝ᵥ v = x * v i
@[simp]
theorem matrix.dot_product_single {m : Type u_2} {α : Type v} [fintype m] [decidable_eq m] [non_unital_non_assoc_semiring α] (v : m → α) (x : α) (i : m) :
v ⬝ᵥ pi.single i x = (v i) * x
@[simp]
theorem matrix.neg_dot_product {m : Type u_2} {α : Type v} [fintype m] [non_unital_non_assoc_ring α] (v w : m → α) :
-v ⬝ᵥ w = -(v ⬝ᵥ w)
@[simp]
theorem matrix.dot_product_neg {m : Type u_2} {α : Type v} [fintype m] [non_unital_non_assoc_ring α] (v w : m → α) :
v ⬝ᵥ -w = -(v ⬝ᵥ w)
@[simp]
theorem matrix.sub_dot_product {m : Type u_2} {α : Type v} [fintype m] [non_unital_non_assoc_ring α] (u v w : m → α) :
(u - v) ⬝ᵥ w = u ⬝ᵥ w - v ⬝ᵥ w
@[simp]
theorem matrix.dot_product_sub {m : Type u_2} {α : Type v} [fintype m] [non_unital_non_assoc_ring α] (u v w : m → α) :
u ⬝ᵥ (v - w) = u ⬝ᵥ v - u ⬝ᵥ w
@[simp]
theorem matrix.smul_dot_product {m : Type u_2} {R : Type u_7} {α : Type v} [fintype m] [monoid R] [has_mul α] [add_comm_monoid α] [distrib_mul_action R α] [is_scalar_tower R α α] (x : R) (v w : m → α) :
x v ⬝ᵥ w = x (v ⬝ᵥ w)
@[simp]
theorem matrix.dot_product_smul {m : Type u_2} {R : Type u_7} {α : Type v} [fintype m] [monoid R] [has_mul α] [add_comm_monoid α] [distrib_mul_action R α] [smul_comm_class R α α] (x : R) (v w : m → α) :
v ⬝ᵥ x w = x (v ⬝ᵥ w)
theorem matrix.star_dot_product_star {m : Type u_2} {α : Type v} [fintype m] [non_unital_semiring α] [star_ring α] (v w : m → α) :
theorem matrix.star_dot_product {m : Type u_2} {α : Type v} [fintype m] [non_unital_semiring α] [star_ring α] (v w : m → α) :
theorem matrix.dot_product_star {m : Type u_2} {α : Type v} [fintype m] [non_unital_semiring α] [star_ring α] (v w : m → α) :
@[protected]
def matrix.mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [fintype m] [has_mul α] [add_comm_monoid α] (M : matrix l m α) (N : matrix m n α) :
matrix l n α

M ⬝ N is the usual product of matrices M and N, i.e. we have that (M ⬝ N) i k is the dot product of the i-th row of M by the k-th column of N. This is currently only defined when m is finite.

Equations
  • M N = λ (i : l) (k : n), (λ (j : m), M i j) ⬝ᵥ λ (j : m), N j k
theorem matrix.mul_apply {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [fintype m] [has_mul α] [add_comm_monoid α] {M : matrix l m α} {N : matrix m n α} {i : l} {k : n} :
(M N) i k = ∑ (j : m), (M i j) * N j k
@[protected, instance]
def matrix.has_mul {n : Type u_3} {α : Type v} [fintype n] [has_mul α] [add_comm_monoid α] :
has_mul (matrix n n α)
Equations
@[simp]
theorem matrix.mul_eq_mul {n : Type u_3} {α : Type v} [fintype n] [has_mul α] [add_comm_monoid α] (M N : matrix n n α) :
M * N = M N
theorem matrix.mul_apply' {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [fintype m] [has_mul α] [add_comm_monoid α] {M : matrix l m α} {N : matrix m n α} {i : l} {k : n} :
(M N) i k = (λ (j : m), M i j) ⬝ᵥ λ (j : m), N j k
@[simp]
theorem matrix.diagonal_neg {n : Type u_3} {α : Type v} [decidable_eq n] [add_group α] (d : n → α) :
-matrix.diagonal d = matrix.diagonal (λ (i : n), -d i)
theorem matrix.sum_apply {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [add_comm_monoid α] (i : m) (j : n) (s : finset β) (g : β → matrix m n α) :
(∑ (c : β) in s, g c) i j = ∑ (c : β) in s, g c i j
@[protected, simp]
theorem matrix.mul_zero {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] (M : matrix m n α) :
M 0 = 0
@[protected, simp]
theorem matrix.zero_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] (M : matrix m n α) :
0 M = 0
@[protected]
theorem matrix.mul_add {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] (L : matrix m n α) (M N : matrix n o α) :
L (M + N) = L M + L N
@[protected]
theorem matrix.add_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] (L M : matrix l m α) (N : matrix m n α) :
(L + M) N = L N + M N
@[simp]
theorem matrix.diagonal_mul {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] [decidable_eq m] (d : m → α) (M : matrix m n α) (i : m) (j : n) :
(matrix.diagonal d M) i j = (d i) * M i j
@[simp]
theorem matrix.mul_diagonal {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] [decidable_eq n] (d : n → α) (M : matrix m n α) (i : m) (j : n) :
(M matrix.diagonal d) i j = (M i j) * d j
@[simp]
theorem matrix.diagonal_mul_diagonal {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] [decidable_eq n] (d₁ d₂ : n → α) :
matrix.diagonal d₁ matrix.diagonal d₂ = matrix.diagonal (λ (i : n), (d₁ i) * d₂ i)
theorem matrix.diagonal_mul_diagonal' {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] [decidable_eq n] (d₁ d₂ : n → α) :
(matrix.diagonal d₁) * matrix.diagonal d₂ = matrix.diagonal (λ (i : n), (d₁ i) * d₂ i)
def matrix.add_monoid_hom_mul_left {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] (M : matrix l m α) :
matrix m n α →+ matrix l n α

Left multiplication by a matrix, as an add_monoid_hom from matrices to matrices.

Equations
@[simp]
theorem matrix.add_monoid_hom_mul_left_apply {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] (M : matrix l m α) (x : matrix m n α) :
@[simp]
theorem matrix.add_monoid_hom_mul_right_apply {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] (M : matrix m n α) (x : matrix l m α) :
def matrix.add_monoid_hom_mul_right {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] (M : matrix m n α) :
matrix l m α →+ matrix l n α

Right multiplication by a matrix, as an add_monoid_hom from matrices to matrices.

Equations
@[protected]
theorem matrix.sum_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [non_unital_non_assoc_semiring α] [fintype m] (s : finset β) (f : β → matrix l m α) (M : matrix m n α) :
(∑ (a : β) in s, f a) M = ∑ (a : β) in s, f a M
@[protected]
theorem matrix.mul_sum {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [non_unital_non_assoc_semiring α] [fintype m] (s : finset β) (f : β → matrix m n α) (M : matrix l m α) :
M ∑ (a : β) in s, f a = ∑ (a : β) in s, M f a
@[protected, simp]
theorem matrix.one_mul {m : Type u_2} {n : Type u_3} {α : Type v} [non_assoc_semiring α] [fintype m] [decidable_eq m] (M : matrix m n α) :
1 M = M
@[protected, simp]
theorem matrix.mul_one {m : Type u_2} {n : Type u_3} {α : Type v} [non_assoc_semiring α] [fintype n] [decidable_eq n] (M : matrix m n α) :
M 1 = M
@[simp]
theorem matrix.map_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} {β : Type w} [non_assoc_semiring α] [fintype n] {L : matrix m n α} {M : matrix n o α} [non_assoc_semiring β] {f : α →+* β} :
(L M).map f = L.map f M.map f
def matrix.diagonal_ring_hom (n : Type u_3) (α : Type v) [non_assoc_semiring α] [fintype n] [decidable_eq n] :
(n → α) →+* matrix n n α

matrix.diagonal as a ring_hom.

Equations
@[simp]
theorem matrix.diagonal_ring_hom_apply (n : Type u_3) (α : Type v) [non_assoc_semiring α] [fintype n] [decidable_eq n] (d : n → α) :
@[protected]
theorem matrix.mul_assoc {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [non_unital_semiring α] [fintype m] [fintype n] (L : matrix l m α) (M : matrix m n α) (N : matrix n o α) :
L M N = L (M N)
@[protected, simp]
theorem matrix.neg_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [non_unital_non_assoc_ring α] [fintype n] (M : matrix m n α) (N : matrix n o α) :
-M N = -(M N)
@[protected, simp]
theorem matrix.mul_neg {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [non_unital_non_assoc_ring α] [fintype n] (M : matrix m n α) (N : matrix n o α) :
M -N = -(M N)
@[protected]
theorem matrix.sub_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [non_unital_non_assoc_ring α] [fintype n] (M M' : matrix m n α) (N : matrix n o α) :
(M - M') N = M N - M' N
@[protected]
theorem matrix.mul_sub {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [non_unital_non_assoc_ring α] [fintype n] (M : matrix m n α) (N N' : matrix n o α) :
M (N - N') = M N - M N'
theorem matrix.smul_eq_diagonal_mul {m : Type u_2} {n : Type u_3} {α : Type v} [semiring α] [fintype m] [decidable_eq m] (M : matrix m n α) (a : α) :
a M = matrix.diagonal (λ (_x : m), a) M
@[simp]
theorem matrix.smul_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [semiring α] [fintype n] [monoid R] [distrib_mul_action R α] [is_scalar_tower R α α] (a : R) (M : matrix m n α) (N : matrix n l α) :
(a M) N = a M N
@[protected, instance]
def matrix.semiring.is_scalar_tower {n : Type u_3} {R : Type u_7} {α : Type v} [semiring α] [fintype n] [monoid R] [distrib_mul_action R α] [is_scalar_tower R α α] :
is_scalar_tower R (matrix n n α) (matrix n n α)

This instance enables use with smul_mul_assoc.

@[simp]
theorem matrix.mul_smul {l : Type u_1} {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [semiring α] [fintype n] [monoid R] [distrib_mul_action R α] [smul_comm_class R α α] (M : matrix m n α) (a : R) (N : matrix n l α) :
M (a N) = a M N
@[protected, instance]
def matrix.semiring.smul_comm_class {n : Type u_3} {R : Type u_7} {α : Type v} [semiring α] [fintype n] [monoid R] [distrib_mul_action R α] [smul_comm_class R α α] :
smul_comm_class R (matrix n n α) (matrix n n α)

This instance enables use with mul_smul_comm.

@[simp]
theorem matrix.mul_mul_left {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [semiring α] [fintype n] (M : matrix m n α) (N : matrix n o α) (a : α) :
(λ (i : m) (j : n), a * M i j) N = a M N
def matrix.scalar {α : Type v} [semiring α] (n : Type u) [decidable_eq n] [fintype n] :
α →+* matrix n n α

The ring homomorphism α →+* matrix n n α sending a to the diagonal matrix with a on the diagonal.

Equations
@[simp]
theorem matrix.coe_scalar {n : Type u_3} {α : Type v} [semiring α] [decidable_eq n] [fintype n] :
(matrix.scalar n) = λ (a : α), a 1
theorem matrix.scalar_apply_eq {n : Type u_3} {α : Type v} [semiring α] [decidable_eq n] [fintype n] (a : α) (i : n) :
(matrix.scalar n) a i i = a
theorem matrix.scalar_apply_ne {n : Type u_3} {α : Type v} [semiring α] [decidable_eq n] [fintype n] (a : α) (i j : n) (h : i j) :
(matrix.scalar n) a i j = 0
theorem matrix.scalar_inj {n : Type u_3} {α : Type v} [semiring α] [decidable_eq n] [fintype n] [nonempty n] {r s : α} :
theorem matrix.smul_eq_mul_diagonal {m : Type u_2} {n : Type u_3} {α : Type v} [comm_semiring α] [fintype n] [decidable_eq n] (M : matrix m n α) (a : α) :
a M = M matrix.diagonal (λ (_x : n), a)
@[simp]
theorem matrix.mul_mul_right {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [comm_semiring α] [fintype n] (M : matrix m n α) (N : matrix n o α) (a : α) :
(M λ (i : n) (j : o), a * N i j) = a M N
theorem matrix.scalar.commute {n : Type u_3} {α : Type v} [comm_semiring α] [fintype n] [decidable_eq n] (r : α) (M : matrix n n α) :
@[protected, instance]
def matrix.algebra {n : Type u_3} {R : Type u_7} {α : Type v} [fintype n] [decidable_eq n] [comm_semiring R] [semiring α] [algebra R α] :
algebra R (matrix n n α)
Equations
theorem matrix.algebra_map_matrix_apply {n : Type u_3} {R : Type u_7} {α : Type v} [fintype n] [decidable_eq n] [comm_semiring R] [semiring α] [algebra R α] {r : R} {i j : n} :
(algebra_map R (matrix n n α)) r i j = ite (i = j) ((algebra_map R α) r) 0
theorem matrix.algebra_map_eq_diagonal {n : Type u_3} {R : Type u_7} {α : Type v} [fintype n] [decidable_eq n] [comm_semiring R] [semiring α] [algebra R α] (r : R) :
(algebra_map R (matrix n n α)) r = matrix.diagonal ((algebra_map R (n → α)) r)
@[simp]
theorem matrix.algebra_map_eq_smul {n : Type u_3} {R : Type u_7} [fintype n] [decidable_eq n] [comm_semiring R] (r : R) :
(algebra_map R (matrix n n R)) r = r 1
theorem matrix.algebra_map_eq_diagonal_ring_hom {n : Type u_3} {R : Type u_7} {α : Type v} [fintype n] [decidable_eq n] [comm_semiring R] [semiring α] [algebra R α] :
algebra_map R (matrix n n α) = (matrix.diagonal_ring_hom n α).comp (algebra_map R (n → α))
@[simp]
theorem matrix.map_algebra_map {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [fintype n] [decidable_eq n] [comm_semiring R] [semiring α] [semiring β] [algebra R α] [algebra R β] (r : R) (f : α → β) (hf : f 0 = 0) (hf₂ : f ((algebra_map R α) r) = (algebra_map R β) r) :
((algebra_map R (matrix n n α)) r).map f = (algebra_map R (matrix n n β)) r
def matrix.diagonal_alg_hom {n : Type u_3} (R : Type u_7) {α : Type v} [fintype n] [decidable_eq n] [comm_semiring R] [semiring α] [algebra R α] :
(n → α) →ₐ[R] matrix n n α

matrix.diagonal as an alg_hom.

Equations
@[simp]
theorem matrix.diagonal_alg_hom_apply {n : Type u_3} (R : Type u_7) {α : Type v} [fintype n] [decidable_eq n] [comm_semiring R] [semiring α] [algebra R α] (d : n → α) :

Bundled versions of matrix.map #

def equiv.map_matrix {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} (f : α β) :
matrix m n α matrix m n β

The equiv between spaces of matrices induced by an equiv between their coefficients. This is matrix.map as an equiv.

Equations
@[simp]
theorem equiv.map_matrix_apply {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} (f : α β) (M : matrix m n α) :
@[simp]
theorem equiv.map_matrix_refl {m : Type u_2} {n : Type u_3} {α : Type v} :
@[simp]
theorem equiv.map_matrix_symm {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} (f : α β) :
@[simp]
theorem equiv.map_matrix_trans {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {γ : Type u_9} (f : α β) (g : β γ) :
def add_monoid_hom.map_matrix {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [add_zero_class α] [add_zero_class β] (f : α →+ β) :
matrix m n α →+ matrix m n β

The add_monoid_hom between spaces of matrices induced by an add_monoid_hom between their coefficients. This is matrix.map as an add_monoid_hom.

Equations
@[simp]
theorem add_monoid_hom.map_matrix_apply {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [add_zero_class α] [add_zero_class β] (f : α →+ β) (M : matrix m n α) :
@[simp]
theorem add_monoid_hom.map_matrix_id {m : Type u_2} {n : Type u_3} {α : Type v} [add_zero_class α] :
@[simp]
theorem add_monoid_hom.map_matrix_comp {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {γ : Type u_9} [add_zero_class α] [add_zero_class β] [add_zero_class γ] (f : β →+ γ) (g : α →+ β) :
def add_equiv.map_matrix {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [has_add α] [has_add β] (f : α ≃+ β) :
matrix m n α ≃+ matrix m n β

The add_equiv between spaces of matrices induced by an add_equiv between their coefficients. This is matrix.map as an add_equiv.

Equations
@[simp]
theorem add_equiv.map_matrix_apply {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [has_add α] [has_add β] (f : α ≃+ β) (M : matrix m n α) :
@[simp]
theorem add_equiv.map_matrix_refl {m : Type u_2} {n : Type u_3} {α : Type v} [has_add α] :
@[simp]
theorem add_equiv.map_matrix_symm {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [has_add α] [has_add β] (f : α ≃+ β) :
@[simp]
theorem add_equiv.map_matrix_trans {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {γ : Type u_9} [has_add α] [has_add β] [has_add γ] (f : α ≃+ β) (g : β ≃+ γ) :
def linear_map.map_matrix {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [semiring R] [add_comm_monoid α] [add_comm_monoid β] [module R α] [module R β] (f : α →ₗ[R] β) :
matrix m n α →ₗ[R] matrix m n β

The linear_map between spaces of matrices induced by a linear_map between their coefficients. This is matrix.map as a linear_map.

Equations
@[simp]
theorem linear_map.map_matrix_apply {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [semiring R] [add_comm_monoid α] [add_comm_monoid β] [module R α] [module R β] (f : α →ₗ[R] β) (M : matrix m n α) :
@[simp]
theorem linear_map.map_matrix_id {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [semiring R] [add_comm_monoid α] [module R α] :
@[simp]
theorem linear_map.map_matrix_comp {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} {γ : Type u_9} [semiring R] [add_comm_monoid α] [add_comm_monoid β] [add_comm_monoid γ] [module R α] [module R β] [module R γ] (f : β →ₗ[R] γ) (g : α →ₗ[R] β) :
def linear_equiv.map_matrix {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [semiring R] [add_comm_monoid α] [add_comm_monoid β] [module R α] [module R β] (f : α ≃ₗ[R] β) :
matrix m n α ≃ₗ[R] matrix m n β

The linear_equiv between spaces of matrices induced by an linear_equiv between their coefficients. This is matrix.map as an linear_equiv.

Equations
@[simp]
theorem linear_equiv.map_matrix_apply {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [semiring R] [add_comm_monoid α] [add_comm_monoid β] [module R α] [module R β] (f : α ≃ₗ[R] β) (M : matrix m n α) :
@[simp]
theorem linear_equiv.map_matrix_refl {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [semiring R] [add_comm_monoid α] [module R α] :
@[simp]
theorem linear_equiv.map_matrix_symm {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [semiring R] [add_comm_monoid α] [add_comm_monoid β] [module R α] [module R β] (f : α ≃ₗ[R] β) :
@[simp]
theorem linear_equiv.map_matrix_trans {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} {γ : Type u_9} [semiring R] [add_comm_monoid α] [add_comm_monoid β] [add_comm_monoid γ] [module R α] [module R β] [module R γ] (f : α ≃ₗ[R] β) (g : β ≃ₗ[R] γ) :
def ring_hom.map_matrix {m : Type u_2} {α : Type v} {β : Type w} [fintype m] [decidable_eq m] [non_assoc_semiring α] [non_assoc_semiring β] (f : α →+* β) :
matrix m m α →+* matrix m m β

The ring_hom between spaces of square matrices induced by a ring_hom between their coefficients. This is matrix.map as a ring_hom.

Equations
@[simp]
theorem ring_hom.map_matrix_apply {m : Type u_2} {α : Type v} {β : Type w} [fintype m] [decidable_eq m] [non_assoc_semiring α] [non_assoc_semiring β] (f : α →+* β) (M : matrix m m α) :
@[simp]
theorem ring_hom.map_matrix_id {m : Type u_2} {α : Type v} [fintype m] [decidable_eq m] [non_assoc_semiring α] :
@[simp]
theorem ring_hom.map_matrix_comp {m : Type u_2} {α : Type v} {β : Type w} {γ : Type u_9} [fintype m] [decidable_eq m] [non_assoc_semiring α] [non_assoc_semiring β] [non_assoc_semiring γ] (f : β →+* γ) (g : α →+* β) :
def ring_equiv.map_matrix {m : Type u_2} {α : Type v} {β : Type w} [fintype m] [decidable_eq m] [non_assoc_semiring α] [non_assoc_semiring β] (f : α ≃+* β) :
matrix m m α ≃+* matrix m m β

The ring_equiv between spaces of square matrices induced by a ring_equiv between their coefficients. This is matrix.map as a ring_equiv.

Equations
@[simp]
theorem ring_equiv.map_matrix_apply {m : Type u_2} {α : Type v} {β : Type w} [fintype m] [decidable_eq m] [non_assoc_semiring α] [non_assoc_semiring β] (f : α ≃+* β) (M : matrix m m α) :
@[simp]
theorem ring_equiv.map_matrix_refl {m : Type u_2} {α : Type v} [fintype m] [decidable_eq m] [non_assoc_semiring α] :
@[simp]
theorem ring_equiv.map_matrix_symm {m : Type u_2} {α : Type v} {β : Type w} [fintype m] [decidable_eq m] [non_assoc_semiring α] [non_assoc_semiring β] (f : α ≃+* β) :
@[simp]
theorem ring_equiv.map_matrix_trans {m : Type u_2} {α : Type v} {β : Type w} {γ : Type u_9} [fintype m] [decidable_eq m] [non_assoc_semiring α] [non_assoc_semiring β] [non_assoc_semiring γ] (f : α ≃+* β) (g : β ≃+* γ) :
def alg_hom.map_matrix {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} [fintype m] [decidable_eq m] [comm_semiring R] [semiring α] [semiring β] [algebra R α] [algebra R β] (f : α →ₐ[R] β) :
matrix m m α →ₐ[R] matrix m m β

The alg_hom between spaces of square matrices induced by a alg_hom between their coefficients. This is matrix.map as a alg_hom.

Equations
@[simp]
theorem alg_hom.map_matrix_apply {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} [fintype m] [decidable_eq m] [comm_semiring R] [semiring α] [semiring β] [algebra R α] [algebra R β] (f : α →ₐ[R] β) (M : matrix m m α) :
@[simp]
theorem alg_hom.map_matrix_id {m : Type u_2} {R : Type u_7} {α : Type v} [fintype m] [decidable_eq m] [comm_semiring R] [semiring α] [algebra R α] :
@[simp]
theorem alg_hom.map_matrix_comp {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} {γ : Type u_9} [fintype m] [decidable_eq m] [comm_semiring R] [semiring α] [semiring β] [semiring γ] [algebra R α] [algebra R β] [algebra R γ] (f : β →ₐ[R] γ) (g : α →ₐ[R] β) :
@[simp]
theorem alg_equiv.map_matrix_apply {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} [fintype m] [decidable_eq m] [comm_semiring R] [semiring α] [semiring β] [algebra R α] [algebra R β] (f : α ≃ₐ[R] β) (M : matrix m m α) :
def alg_equiv.map_matrix {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} [fintype m] [decidable_eq m] [comm_semiring R] [semiring α] [semiring β] [algebra R α] [algebra R β] (f : α ≃ₐ[R] β) :
matrix m m α ≃ₐ[R] matrix m m β

The alg_equiv between spaces of square matrices induced by a alg_equiv between their coefficients. This is matrix.map as a alg_equiv.

Equations
@[simp]
theorem alg_equiv.map_matrix_refl {m : Type u_2} {R : Type u_7} {α : Type v} [fintype m] [decidable_eq m] [comm_semiring R] [semiring α] [algebra R α] :
@[simp]
theorem alg_equiv.map_matrix_symm {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} [fintype m] [decidable_eq m] [comm_semiring R] [semiring α] [semiring β] [algebra R α] [algebra R β] (f : α ≃ₐ[R] β) :
@[simp]
theorem alg_equiv.map_matrix_trans {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} {γ : Type u_9} [fintype m] [decidable_eq m] [comm_semiring R] [semiring α] [semiring β] [semiring γ] [algebra R α] [algebra R β] [algebra R γ] (f : α ≃ₐ[R] β) (g : β ≃ₐ[R] γ) :
def matrix.vec_mul_vec {m : Type u_2} {n : Type u_3} {α : Type v} [has_mul α] (w : m → α) (v : n → α) :
matrix m n α

For two vectors w and v, vec_mul_vec w v i j is defined to be w i * v j. Put another way, vec_mul_vec w v is exactly col w ⬝ row v.

Equations
def matrix.mul_vec {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] (M : matrix m n α) (v : n → α) :
m → α

mul_vec M v is the matrix-vector product of M and v, where v is seen as a column matrix. Put another way, mul_vec M v is the vector whose entries are those of M ⬝ col v (see col_mul_vec).

Equations
def matrix.vec_mul {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] (v : m → α) (M : matrix m n α) :
n → α

vec_mul v M is the vector-matrix product of v and M, where v is seen as a row matrix. Put another way, vec_mul v M is the vector whose entries are those of row v ⬝ M (see row_vec_mul).

Equations
def matrix.mul_vec.add_monoid_hom_left {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] (v : n → α) :
matrix m n α →+ m → α

Left multiplication by a matrix, as an add_monoid_hom from vectors to vectors.

Equations
@[simp]
theorem matrix.mul_vec.add_monoid_hom_left_apply {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] (v : n → α) (M : matrix m n α) (ᾰ : m) :
theorem matrix.mul_vec_diagonal {m : Type u_2} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] [decidable_eq m] (v w : m → α) (x : m) :
(matrix.diagonal v).mul_vec w x = (v x) * w x
theorem matrix.vec_mul_diagonal {m : Type u_2} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] [decidable_eq m] (v w : m → α) (x : m) :
matrix.vec_mul v (matrix.diagonal w) x = (v x) * w x
theorem matrix.dot_product_mul_vec {m : Type u_2} {n : Type u_3} {R : Type u_7} [fintype n] [fintype m] [non_unital_semiring R] (v : m → R) (A : matrix m n R) (w : n → R) :

Associate the dot product of mul_vec to the left.

@[simp]
theorem matrix.mul_vec_zero {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] (A : matrix m n α) :
A.mul_vec 0 = 0
@[simp]
theorem matrix.zero_vec_mul {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] (A : matrix m n α) :
@[simp]
theorem matrix.zero_mul_vec {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] (v : n → α) :
0.mul_vec v = 0
@[simp]
theorem matrix.vec_mul_zero {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] (v : m → α) :
theorem matrix.vec_mul_vec_eq {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] (w : m → α) (v : n → α) :
theorem matrix.smul_mul_vec_assoc {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] [monoid R] [distrib_mul_action R α] [is_scalar_tower R α α] (a : R) (A : matrix m n α) (b : n → α) :
(a A).mul_vec b = a A.mul_vec b
theorem matrix.mul_vec_add {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] (A : matrix m n α) (x y : n → α) :
A.mul_vec (x + y) = A.mul_vec x + A.mul_vec y
theorem matrix.add_mul_vec {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype n] (A B : matrix m n α) (x : n → α) :
(A + B).mul_vec x = A.mul_vec x + B.mul_vec x
theorem matrix.vec_mul_add {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] (A B : matrix m n α) (x : m → α) :
theorem matrix.add_vec_mul {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_semiring α] [fintype m] (A : matrix m n α) (x y : m → α) :
theorem matrix.vec_mul_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} [fintype m] [comm_semiring R] [semiring S] [algebra R S] (M : matrix m n S) (b : R) (v : m → S) :
theorem matrix.mul_vec_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} [fintype n] [comm_semiring R] [semiring S] [algebra R S] (M : matrix m n S) (b : R) (v : n → S) :
M.mul_vec (b v) = b M.mul_vec v
@[simp]
theorem matrix.vec_mul_vec_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [non_unital_semiring α] [fintype n] [fintype m] (v : m → α) (M : matrix m n α) (N : matrix n o α) :
@[simp]
theorem matrix.mul_vec_mul_vec {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [non_unital_semiring α] [fintype n] [fintype o] (v : o → α) (M : matrix m n α) (N : matrix n o α) :
M.mul_vec (N.mul_vec v) = (M N).mul_vec v
@[simp]
theorem matrix.one_mul_vec {m : Type u_2} {α : Type v} [fintype m] [decidable_eq m] [non_assoc_semiring α] (v : m → α) :
1.mul_vec v = v
@[simp]
theorem matrix.vec_mul_one {m : Type u_2} {α : Type v} [fintype m] [decidable_eq m] [non_assoc_semiring α] (v : m → α) :
theorem matrix.neg_vec_mul {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_ring α] [fintype m] (v : m → α) (A : matrix m n α) :
theorem matrix.vec_mul_neg {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_ring α] [fintype m] (v : m → α) (A : matrix m n α) :
theorem matrix.neg_mul_vec {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_ring α] [fintype n] (v : n → α) (A : matrix m n α) :
(-A).mul_vec v = -A.mul_vec v
theorem matrix.mul_vec_neg {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_non_assoc_ring α] [fintype n] (v : n → α) (A : matrix m n α) :
A.mul_vec (-v) = -A.mul_vec v
theorem matrix.mul_vec_smul_assoc {m : Type u_2} {n : Type u_3} {α : Type v} [comm_semiring α] [fintype n] (A : matrix m n α) (b : n → α) (a : α) :
A.mul_vec (a b) = a A.mul_vec b
theorem matrix.mul_vec_transpose {m : Type u_2} {n : Type u_3} {α : Type v} [comm_semiring α] [fintype m] (A : matrix m n α) (x : m → α) :
theorem matrix.vec_mul_transpose {m : Type u_2} {n : Type u_3} {α : Type v} [comm_semiring α] [fintype n] (A : matrix m n α) (x : n → α) :
@[simp]
theorem matrix.transpose_apply {m : Type u_2} {n : Type u_3} {α : Type v} (M : matrix m n α) (i : m) (j : n) :
M j i = M i j

Tell simp what the entries are in a transposed matrix.

Compare with mul_apply, diagonal_apply_eq, etc.

@[simp]
theorem matrix.transpose_transpose {m : Type u_2} {n : Type u_3} {α : Type v} (M : matrix m n α) :
@[simp]
theorem matrix.transpose_zero {m : Type u_2} {n : Type u_3} {α : Type v} [has_zero α] :
0 = 0
@[simp]
theorem matrix.transpose_one {n : Type u_3} {α : Type v} [decidable_eq n] [has_zero α] [has_one α] :
1 = 1
@[simp]
theorem matrix.transpose_add {m : Type u_2} {n : Type u_3} {α : Type v} [has_add α] (M N : matrix m n α) :
(M + N) = M + N
@[simp]
theorem matrix.transpose_sub {m : Type u_2} {n : Type u_3} {α : Type v} [has_sub α] (M N : matrix m n α) :
(M - N) = M - N
@[simp]
theorem matrix.transpose_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [comm_semiring α] [fintype n] (M : matrix m n α) (N : matrix n l α) :
(M N) = N M
@[simp]
theorem matrix.transpose_smul {m : Type u_2} {n : Type u_3} {α : Type v} {R : Type u_1} [has_scalar R α] (c : R) (M : matrix m n α) :
(c M) = c M
@[simp]
theorem matrix.transpose_neg {m : Type u_2} {n : Type u_3} {α : Type v} [has_neg α] (M : matrix m n α) :
(-M) = -M
theorem matrix.transpose_map {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {f : α → β} {M : matrix m n α} :
M.map f = (M.map f)
@[simp]
theorem matrix.transpose_add_equiv_apply {m : Type u_2} {n : Type u_3} {α : Type v} [has_add α] (M : matrix m n α) :
def matrix.transpose_add_equiv {m : Type u_2} {n : Type u_3} {α : Type v} [has_add α] :
matrix m n α ≃+ matrix n m α

matrix.transpose as an add_equiv

Equations
@[simp]
theorem matrix.transpose_add_equiv_symm {m : Type u_2} {n : Type u_3} {α : Type v} [has_add α] :
theorem matrix.transpose_list_sum {m : Type u_2} {n : Type u_3} {α : Type v} [add_monoid α] (l : list (matrix m n α)) :
theorem matrix.transpose_multiset_sum {m : Type u_2} {n : Type u_3} {α : Type v} [add_comm_monoid α] (s : multiset (matrix m n α)) :
theorem matrix.transpose_sum {m : Type u_2} {n : Type u_3} {α : Type v} [add_comm_monoid α] {ι : Type u_1} (s : finset ι) (M : ι → matrix m n α) :
(∑ (i : ι) in s, M i) = ∑ (i : ι) in s, (M i)
def matrix.transpose_ring_equiv {m : Type u_2} {α : Type v} [comm_semiring α] [fintype m] :
matrix m m α ≃+* (matrix m m α)ᵐᵒᵖ

matrix.transpose as a ring_equiv to the opposite ring

Equations
@[simp]
theorem matrix.transpose_ring_equiv_apply {m : Type u_2} {α : Type v} [comm_semiring α] [fintype m] (M : matrix m m α) :
@[simp]
theorem matrix.transpose_list_prod {m : Type u_2} {α : Type v} [comm_semiring α] [fintype m] [decidable_eq m] (l : list (matrix m m α)) :
@[simp]
theorem matrix.conj_transpose_apply {m : Type u_2} {n : Type u_3} {α : Type v} [has_star α] (M : matrix m n α) (i : m) (j : n) :
M j i = star (M i j)

Tell simp what the entries are in a conjugate transposed matrix.

Compare with mul_apply, diagonal_apply_eq, etc.

@[simp]
theorem matrix.conj_transpose_conj_transpose {m : Type u_2} {n : Type u_3} {α : Type v} [has_involutive_star α] (M : matrix m n α) :
@[simp]
theorem matrix.conj_transpose_zero {m : Type u_2} {n : Type u_3} {α : Type v} [semiring α] [star_ring α] :
0 = 0
@[simp]
theorem matrix.conj_transpose_one {n : Type u_3} {α : Type v} [decidable_eq n] [semiring α] [star_ring α] :
1 = 1
@[simp]
theorem matrix.conj_transpose_add {m : Type u_2} {n : Type u_3} {α : Type v} [add_monoid α] [star_add_monoid α] (M N : matrix m n α) :
(M + N) = M + N
@[simp]
theorem matrix.conj_transpose_sub {m : Type u_2} {n : Type u_3} {α : Type v} [add_group α] [star_add_monoid α] (M N : matrix m n α) :
(M - N) = M - N
@[simp]
theorem matrix.conj_transpose_smul {m : Type u_2} {n : Type u_3} {α : Type v} [comm_monoid α] [star_semigroup α] (c : α) (M : matrix m n α) :
(c M) = star c M
@[simp]
theorem matrix.conj_transpose_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [fintype n] [semiring α] [star_ring α] (M : matrix m n α) (N : matrix n l α) :
(M N) = N M
@[simp]
theorem matrix.conj_transpose_neg {m : Type u_2} {n : Type u_3} {α : Type v} [non_unital_ring α] [star_ring α] (M : matrix m n α) :
(-M) = -M
@[simp]
theorem matrix.conj_transpose_add_equiv_apply {m : Type u_2} {n : Type u_3} {α : Type v} [add_monoid α] [star_add_monoid α] (M : matrix m n α) :
theorem matrix.conj_transpose_list_sum {m : Type u_2} {n : Type u_3} {α : Type v} [add_monoid α] [star_add_monoid α] (l : list (matrix m n α)) :
theorem matrix.conj_transpose_multiset_sum {m : Type u_2} {n : Type u_3} {α : Type v} [add_comm_monoid α] [star_add_monoid α] (s : multiset (matrix m n α)) :
theorem matrix.conj_transpose_sum {m : Type u_2} {n : Type u_3} {α : Type v} [add_comm_monoid α] [star_add_monoid α] {ι : Type u_1} (s : finset ι) (M : ι → matrix m n α) :
(∑ (i : ι) in s, M i) = ∑ (i : ι) in s, (M i)
def matrix.conj_transpose_ring_equiv {m : Type u_2} {α : Type v} [comm_semiring α] [star_ring α] [fintype m] :
matrix m m α ≃+* (matrix m m α)ᵐᵒᵖ

matrix.conj_transpose as a ring_equiv to the opposite ring

Equations
@[simp]
theorem matrix.conj_transpose_list_prod {m : Type u_2} {α : Type v} [comm_semiring α] [star_ring α] [fintype m] [decidable_eq m] (l : list (matrix m m α)) :
@[protected, instance]
def matrix.has_star {n : Type u_3} {α : Type v} [has_star α] :
has_star (matrix n n α)

When α has a star operation, square matrices matrix n n α have a star operation equal to matrix.conj_transpose.

Equations
theorem matrix.star_eq_conj_transpose {m : Type u_2} {α : Type v} [has_star α] (M : matrix m m α) :
@[simp]
theorem matrix.star_apply {n : Type u_3} {α : Type v} [has_star α] (M : matrix n n α) (i j : n) :
star M i j = star (M j i)
@[protected, instance]
def matrix.star_add_monoid {n : Type u_3} {α : Type v} [add_monoid α] [star_add_monoid α] :

When α is a *-additive monoid, matrix.has_star is also a *-additive monoid.

Equations
@[protected, instance]
def matrix.star_ring {n : Type u_3} {α : Type v} [fintype n] [semiring α] [star_ring α] :
star_ring (matrix n n α)

When α is a *-(semi)ring, matrix.has_star is also a *-(semi)ring.

Equations
theorem matrix.star_mul {n : Type u_3} {α : Type v} [fintype n] [semiring α] [star_ring α] (M N : matrix n n α) :
star (M N) = star N star M

A version of star_mul for instead of *.

def matrix.minor {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} (A : matrix m n α) (r_reindex : l → m) (c_reindex : o → n) :
matrix l o α

Given maps (r_reindex : l → m) and (c_reindex : o → n) reindexing the rows and columns of a matrix M : matrix m n α, the matrix M.minor r_reindex c_reindex : matrix l o α is defined by (M.minor r_reindex c_reindex) i j = M (r_reindex i) (c_reindex j) for (i,j) : l × o. Note that the total number of row and columns does not have to be preserved.

Equations
  • A.minor r_reindex c_reindex = λ (i : l) (j : o), A (r_reindex i) (c_reindex j)
@[simp]
theorem matrix.minor_apply {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} (A : matrix m n α) (r_reindex : l → m) (c_reindex : o → n) (i : l) (j : o) :
A.minor r_reindex c_reindex i j = A (r_reindex i) (c_reindex j)
@[simp]
theorem matrix.minor_id_id {m : Type u_2} {n : Type u_3} {α : Type v} (A : matrix m n α) :
A.minor id id = A
@[simp]
theorem matrix.minor_minor {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} {l₂ : Type u_5} {o₂ : Type u_6} (A : matrix m n α) (r₁ : l → m) (c₁ : o → n) (r₂ : l₂ → l) (c₂ : o₂ → o) :
(A.minor r₁ c₁).minor r₂ c₂ = A.minor (r₁ r₂) (c₁ c₂)
@[simp]
theorem matrix.transpose_minor {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} (A : matrix m n α) (r_reindex : l → m) (c_reindex : o → n) :
(A.minor r_reindex c_reindex) = A.minor c_reindex r_reindex
@[simp]
theorem matrix.conj_transpose_minor {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [has_star α] (A : matrix m n α) (r_reindex : l → m) (c_reindex : o → n) :
(A.minor r_reindex c_reindex) = A.minor c_reindex r_reindex
theorem matrix.minor_add {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [has_add α] (A B : matrix m n α) :
(A + B).minor = A.minor + B.minor
theorem matrix.minor_neg {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [has_neg α] (A : matrix m n α) :
theorem matrix.minor_sub {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [has_sub α] (A B : matrix m n α) :
(A - B).minor = A.minor - B.minor
@[simp]
theorem matrix.minor_zero {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [has_zero α] :
0.minor = 0
theorem matrix.minor_smul {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} {R : Type u_5} [semiring R] [add_comm_monoid α] [module R α] (r : R) (A : matrix m n α) :
(r A).minor = r A.minor
theorem matrix.minor_map {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} {β : Type w} (f : α → β) (e₁ : l → m) (e₂ : o → n) (A : matrix m n α) :
(A.map f).minor e₁ e₂ = (A.minor e₁ e₂).map f
theorem matrix.minor_diagonal {l : Type u_1} {m : Type u_2} {α : Type v} [has_zero α] [decidable_eq m] [decidable_eq l] (d : m → α) (e : l → m) (he : function.injective e) :

Given a (m × m) diagonal matrix defined by a map d : m → α, if the reindexing map e is injective, then the resulting matrix is again diagonal.

theorem matrix.minor_one {l : Type u_1} {m : Type u_2} {α : Type v} [has_zero α] [has_one α] [decidable_eq m] [decidable_eq l] (e : l → m) (he : function.injective e) :
1.minor e e = 1
theorem matrix.minor_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [fintype n] [fintype o] [semiring α] {p : Type u_5} {q : Type u_6} (M : matrix m n α) (N : matrix n p α) (e₁ : l → m) (e₂ : o → n) (e₃ : q → p) (he₂ : function.bijective e₂) :
(M N).minor e₁ e₃ = M.minor e₁ e₂ N.minor e₂ e₃

simp lemmas for matrix.minors interaction with matrix.diagonal, 1, and matrix.mul for when the mappings are bundled.

@[simp]
theorem matrix.minor_diagonal_embedding {l : Type u_1} {m : Type u_2} {α : Type v} [has_zero α] [decidable_eq m] [decidable_eq l] (d : m → α) (e : l m) :
@[simp]
theorem matrix.minor_diagonal_equiv {l : Type u_1} {m : Type u_2} {α : Type v} [has_zero α] [decidable_eq m] [decidable_eq l] (d : m → α) (e : l m) :
@[simp]
theorem matrix.minor_one_embedding {l : Type u_1} {m : Type u_2} {α : Type v} [has_zero α] [has_one α] [decidable_eq m] [decidable_eq l] (e : l m) :
1.minor e e = 1
@[simp]
theorem matrix.minor_one_equiv {l : Type u_1} {m : Type u_2} {α : Type v} [has_zero α] [has_one α] [decidable_eq m] [decidable_eq l] (e : l m) :
1.minor e e = 1
@[simp]
theorem matrix.minor_mul_equiv {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [fintype n] [fintype o] [semiring α] {p : Type u_5} {q : Type u_6} (M : matrix m n α) (N : matrix n p α) (e₁ : l → m) (e₂ : o n) (e₃ : q → p) :
M.minor e₁ e₂ N.minor e₂ e₃ = (M N).minor e₁ e₃
theorem matrix.mul_minor_one {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [fintype n] [fintype o] [semiring α] [decidable_eq o] (e₁ : n o) (e₂ : l → o) (M : matrix m n α) :
M 1.minor e₁ e₂ = M.minor id ((e₁.symm) e₂)
theorem matrix.one_minor_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [fintype m] [fintype o] [semiring α] [decidable_eq o] (e₁ : l → o) (e₂ : m o) (M : matrix m n α) :
1.minor e₁ e₂ M = M.minor ((e₂.symm) e₁) id
def matrix.reindex {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} (eₘ : m l) (eₙ : n o) :
matrix m n α matrix l o α

The natural map that reindexes a matrix's rows and columns with equivalent types is an equivalence.

Equations
@[simp]
theorem matrix.reindex_apply {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} (eₘ : m l) (eₙ : n o) (M : matrix m n α) :
(matrix.reindex eₘ eₙ) M = M.minor (eₘ.symm) (eₙ.symm)
@[simp]
theorem matrix.reindex_refl_refl {m : Type u_2} {n : Type u_3} {α : Type v} (A : matrix m n α) :
@[simp]
theorem matrix.reindex_symm {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} (eₘ : m l) (eₙ : n o) :
@[simp]
theorem matrix.reindex_trans {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} {l₂ : Type u_5} {o₂ : Type u_6} (eₘ : m l) (eₙ : n o) (eₘ₂ : l l₂) (eₙ₂ : o o₂) :
(matrix.reindex eₘ eₙ).trans (matrix.reindex eₘ₂ eₙ₂) = matrix.reindex (eₘ.trans eₘ₂) (eₙ.trans eₙ₂)
theorem matrix.transpose_reindex {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} (eₘ : m l) (eₙ : n o) (M : matrix m n α) :
((matrix.reindex eₘ eₙ) M) = (matrix.reindex eₙ eₘ) M
theorem matrix.conj_transpose_reindex {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [has_star α] (eₘ : m l) (eₙ : n o) (M : matrix m n α) :
((matrix.reindex eₘ eₙ) M) = (matrix.reindex eₙ eₘ) M
@[simp]
theorem matrix.minor_mul_transpose_minor {m : Type u_2} {n : Type u_3} {α : Type v} [fintype m] [fintype n] [semiring α] (e : m n) (M : matrix m n α) :
def matrix.sub_left {α : Type v} {m l r : } (A : matrix (fin m) (fin (l + r)) α) :
matrix (fin m) (fin l) α

The left n × l part of a n × (l+r) matrix.

Equations
def matrix.sub_right {α : Type v} {m l r : } (A : matrix (fin m) (fin (l + r)) α) :
matrix (fin m) (fin r) α

The right n × r part of a n × (l+r) matrix.

Equations
def matrix.sub_up {α : Type v} {d u n : } (A : matrix (fin (u + d)) (fin n) α) :
matrix (fin u) (fin n) α

The top u × n part of a (u+d) × n matrix.

Equations
def matrix.sub_down {α : Type v} {d u n : } (A : matrix (fin (u + d)) (fin n) α) :
matrix (fin d) (fin n) α

The bottom d × n part of a (u+d) × n matrix.

Equations
def matrix.sub_up_right {α : Type v} {d u l r : } (A : matrix (fin (u + d)) (fin (l + r)) α) :
matrix (fin u) (fin r) α

The top-right u × r part of a (u+d) × (l+r) matrix.

Equations
def matrix.sub_down_right {α : Type v} {d u l r : } (A : matrix (fin (u + d)) (fin (l + r)) α) :
matrix (fin d) (fin r) α

The bottom-right d × r part of a (u+d) × (l+r) matrix.

Equations
def matrix.sub_up_left {α : Type v} {d u l r : } (A : matrix (fin (u + d)) (fin (l + r)) α) :
matrix (fin u) (fin l) α

The top-left u × l part of a (u+d) × (l+r) matrix.

Equations
def matrix.sub_down_left {α : Type v} {d u l r : } (A : matrix (fin (u + d)) (fin (l + r)) α) :
matrix (fin d) (fin l) α

The bottom-left d × l part of a (u+d) × (l+r) matrix.

Equations

row_col section #

Simplification lemmas for matrix.row and matrix.col.

@[simp]
theorem matrix.col_add {m : Type u_2} {α : Type v} [has_add α] (v w : m → α) :
@[simp]
theorem matrix.col_smul {m : Type u_2} {R : Type u_7} {α : Type v} [has_scalar R α] (x : R) (v : m → α) :
@[simp]
theorem matrix.row_add {m : Type u_2} {α : Type v} [has_add α] (v w : m → α) :
@[simp]
theorem matrix.row_smul {m : Type u_2} {R : Type u_7} {α : Type v} [has_scalar R α] (x : R) (v : m → α) :
@[simp]
theorem matrix.col_apply {m : Type u_2} {α : Type v} (v : m → α) (i : m) (j : unit) :
matrix.col v i j = v i
@[simp]
theorem matrix.row_apply {m : Type u_2} {α : Type v} (v : m → α) (i : unit) (j : m) :
matrix.row v i j = v j
@[simp]
theorem matrix.transpose_col {m : Type u_2} {α : Type v} (v : m → α) :
@[simp]
theorem matrix.transpose_row {m : Type u_2} {α : Type v} (v : m → α) :
@[simp]
theorem matrix.conj_transpose_col {m : Type u_2} {α : Type v} [has_star α] (v : m → α) :
@[simp]
theorem matrix.conj_transpose_row {m : Type u_2} {α : Type v} [has_star α] (v : m → α) :
theorem matrix.row_vec_mul {m : Type u_2} {n : Type u_3} {α : Type v} [fintype m] [semiring α] (M : matrix m n α) (v : m → α) :
theorem matrix.col_vec_mul {m : Type u_2} {n : Type u_3} {α : Type v} [fintype m] [semiring α] (M : matrix m n α) (v : m → α) :
theorem matrix.col_mul_vec {m : Type u_2} {n : Type u_3} {α : Type v} [fintype n] [semiring α] (M : matrix m n α) (v : n → α) :
theorem matrix.row_mul_vec {m : Type u_2} {n : Type u_3} {α : Type v} [fintype n] [semiring α] (M : matrix m n α) (v : n → α) :
@[simp]
theorem matrix.row_mul_col_apply {m : Type u_2} {α : Type v} [fintype m] [has_mul α] [add_comm_monoid α] (v w : m → α) (i j : unit) :
def matrix.update_row {m : Type u_2} {n : Type u_3} {α : Type v} [decidable_eq m] (M : matrix m n α) (i : m) (b : n → α) :
matrix m n α

Update, i.e. replace the ith row of matrix A with the values in b.

Equations
def matrix.update_column {m : Type u_2} {n : Type u_3} {α : Type v} [decidable_eq n] (M : matrix m n α) (j : n) (b : m → α) :
matrix m n α

Update, i.e. replace the jth column of matrix A with the values in b.

Equations
@[simp]
theorem matrix.update_row_self {m : Type u_2} {n : Type u_3} {α : Type v} {M : matrix m n α} {i : m} {b : n → α} [decidable_eq m] :
M.update_row i b i = b
@[simp]
theorem matrix.update_column_self {m : Type u_2} {n : Type u_3} {α : Type v} {M : matrix m n α} {i : m} {j : n} {c : m → α} [decidable_eq n] :
M.update_column j c i j = c i
@[simp]
theorem matrix.update_row_ne {m : Type u_2} {n : Type u_3} {α : Type v} {M : matrix m n α} {i : m} {b : n → α} [decidable_eq m] {i' : m} (i_ne : i' i) :
M.update_row i b i' = M i'
@[simp]
theorem matrix.update_column_ne {m : Type u_2} {n : Type u_3} {α : Type v} {M : matrix m n α} {i : m} {j : n} {c : m → α} [decidable_eq n] {j' : n} (j_ne : j' j) :
M.update_column j c i j' = M i j'
theorem matrix.update_row_apply {m : Type u_2} {n : Type u_3} {α : Type v} {M : matrix m n α} {i : m} {j : n} {b : n → α} [decidable_eq m] {i' : m} :
M.update_row i b i' j = ite (i' = i) (b j) (M i' j)
theorem matrix.update_column_apply {m : Type u_2} {n : Type u_3} {α : Type v} {M : matrix m n α} {i : m} {j : n} {c : m → α} [decidable_eq n] {j' : n} :
M.update_column j c i j' = ite (j' = j) (c i) (M i j')
@[simp]
theorem matrix.update_column_subsingleton {m : Type u_2} {n : Type u_3} {R : Type u_7} [subsingleton n] (A : matrix m n R) (i : n) (b : m → R) :
@[simp]
theorem matrix.update_row_subsingleton {m : Type u_2} {n : Type u_3} {R : Type u_7} [subsingleton m] (A : matrix m n R) (i : m) (b : n → R) :
theorem matrix.map_update_row {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {M : matrix m n α} {i : m} {b : n → α} [decidable_eq m] (f : α → β) :
(M.update_row i b).map f = (M.map f).update_row i (f b)
theorem matrix.map_update_column {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {M : matrix m n α} {j : n} {c : m → α} [decidable_eq n] (f : α → β) :
(M.update_column j c).map f = (M.map f).update_column j (f c)
theorem matrix.update_row_transpose {m : Type u_2} {n : Type u_3} {α : Type v} {M : matrix m n α} {j : n} {c : m → α} [decidable_eq n] :
theorem matrix.update_column_transpose {m : Type u_2} {n : Type u_3} {α : Type v} {M : matrix m n α} {i : m} {b : n → α} [decidable_eq m] :
theorem matrix.update_row_conj_transpose {m : Type u_2} {n : Type u_3} {α : Type v} {M : matrix m n α} {j : n} {c : m → α} [decidable_eq n] [has_star α] :
theorem matrix.update_column_conj_transpose {m : Type u_2} {n : Type u_3} {α : Type v} {M : matrix m n α} {i : m} {b : n → α} [decidable_eq m] [has_star α] :
@[simp]
theorem matrix.update_row_eq_self {m : Type u_2} {n : Type u_3} {α : Type v} [decidable_eq m] (A : matrix m n α) {i : m} :
A.update_row i (A i) = A
@[simp]
theorem matrix.update_column_eq_self {m : Type u_2} {n : Type u_3} {α : Type v} [decidable_eq n] (A : matrix m n α) {i : n} :
A.update_column i (λ (j : m), A j i) = A
theorem ring_hom.map_matrix_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} {β : Type w} [fintype n] [semiring α] [semiring β] (M : matrix m n α) (N : matrix n o α) (i : m) (j : o) (f : α →+* β) :
f ((M N) i j) = ((λ (i : m) (j : n), f (M i j)) λ (i : n) (j : o), f (N i j)) i j
theorem ring_hom.map_dot_product {n : Type u_3} {R : Type u_7} {S : Type u_8} [fintype n] [semiring R] [semiring S] (f : R →+* S) (v w : n → R) :
f (v ⬝ᵥ w) = f v ⬝ᵥ f w
theorem ring_hom.map_vec_mul {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} [fintype n] [semiring R] [semiring S] (f : R →+* S) (M : matrix n m R) (v : n → R) (i : m) :
theorem ring_hom.map_mul_vec {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} [fintype n] [semiring R] [semiring S] (f : R →+* S) (M : matrix m n R) (v : n → R) (i : m) :
f (M.mul_vec v i) = (M.map f).mul_vec (f v) i