mathlib documentation

data.matrix.basic

Matrices #

@[nolint]
def matrix (m : Type u) (n : Type u') [fintype m] [fintype n] (α : Type v) :
Type (max u u' v)

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

Equations
theorem matrix.ext_iff {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : Type v} (M : matrix m n α) :
M.map id = M
@[simp]
theorem matrix.map_map {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : 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} [fintype m] {α : 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} [fintype n] {α : Type v} (v : n → α) :

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

Equations
@[instance]
def matrix.inhabited {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [inhabited α] :
inhabited (matrix m n α)
Equations
@[instance]
def matrix.has_add {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [has_add α] :
has_add (matrix m n α)
Equations
@[instance]
def matrix.add_semigroup {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [add_semigroup α] :
Equations
@[instance]
def matrix.add_comm_semigroup {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [add_comm_semigroup α] :
Equations
@[instance]
def matrix.has_zero {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [has_zero α] :
has_zero (matrix m n α)
Equations
@[instance]
def matrix.add_zero_class {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [add_zero_class α] :
Equations
@[instance]
def matrix.add_monoid {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [add_monoid α] :
Equations
@[instance]
def matrix.add_comm_monoid {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [add_comm_monoid α] :
Equations
@[instance]
def matrix.has_neg {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [has_neg α] :
has_neg (matrix m n α)
Equations
@[instance]
def matrix.has_sub {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [has_sub α] :
has_sub (matrix m n α)
Equations
@[instance]
def matrix.add_group {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [add_group α] :
add_group (matrix m n α)
Equations
@[instance]
def matrix.add_comm_group {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [add_comm_group α] :
Equations
@[instance]
def matrix.unique {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [unique α] :
unique (matrix m n α)
Equations
@[instance]
def matrix.subsingleton {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [subsingleton α] :
@[instance]
def matrix.nontrivial {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [nonempty m] [nonempty n] [nontrivial α] :
@[instance]
def matrix.has_scalar {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {R : Type u_7} {α : Type v} [has_scalar R α] :
has_scalar R (matrix m n α)
Equations
@[instance]
def matrix.smul_comm_class {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {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 α)
@[instance]
def matrix.is_scalar_tower {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {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 α)
@[instance]
def matrix.mul_action {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {R : Type u_7} {α : Type v} [monoid R] [mul_action R α] :
mul_action R (matrix m n α)
Equations
@[instance]
def matrix.distrib_mul_action {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {R : Type u_7} {α : Type v} [monoid R] [add_monoid α] [distrib_mul_action R α] :
Equations
@[instance]
def matrix.module {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {R : Type u_7} {α : Type v} [semiring R] [add_comm_monoid α] [module R α] :
module R (matrix m n α)
Equations
@[simp]
theorem matrix.map_zero {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} {β : Type w} [has_zero α] [has_zero β] (f : α → β) (h : f 0 = 0) :
0.map f = 0
theorem matrix.map_add {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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
theorem matrix.map_sub {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {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.subsingleton_of_empty_left {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [is_empty m] :
theorem matrix.subsingleton_of_empty_right {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [is_empty n] :
def matrix.diagonal {n : Type u_3} [fintype n] {α : 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} [fintype n] {α : 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} [fintype n] {α : Type v} [decidable_eq n] [has_zero α] {d : n → α} {i j : n} (h : i j) :
theorem matrix.diagonal_apply_ne' {n : Type u_3} [fintype n] {α : Type v} [decidable_eq n] [has_zero α] {d : n → α} {i j : n} (h : j i) :
theorem matrix.diagonal_injective {n : Type u_3} [fintype n] {α : Type v} [decidable_eq n] [has_zero α] :
@[simp]
theorem matrix.diagonal_zero {n : Type u_3} [fintype n] {α : Type v} [decidable_eq n] [has_zero α] :
matrix.diagonal (λ (_x : n), 0) = 0
@[simp]
theorem matrix.diagonal_transpose {n : Type u_3} [fintype n] {α : Type v} [decidable_eq n] [has_zero α] (v : n → α) :
@[simp]
theorem matrix.diagonal_add {n : Type u_3} [fintype n] {α : 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} [fintype n] {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) [fintype n] (α : Type v) [decidable_eq n] [add_zero_class α] (d : n → α) :
def matrix.diagonal_linear_map (n : Type u_3) [fintype n] (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) [fintype n] (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} [fintype n] {α : 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))
@[instance]
def matrix.has_one {n : Type u_3} [fintype n] {α : Type v} [decidable_eq n] [has_zero α] [has_one α] :
has_one (matrix n n α)
Equations
@[simp]
theorem matrix.diagonal_one {n : Type u_3} [fintype n] {α : Type v} [decidable_eq n] [has_zero α] [has_one α] :
matrix.diagonal (λ (_x : n), 1) = 1
theorem matrix.one_apply {n : Type u_3} [fintype n] {α : 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} [fintype n] {α : 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} [fintype n] {α : 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} [fintype n] {α : 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} [fintype n] {α : 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
@[simp]
theorem matrix.bit0_apply {m : Type u_2} [fintype m] {α : 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} [fintype n] {α : 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} [fintype n] {α : 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} [fintype n] {α : 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} [fintype m] {α : Type v} [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} [fintype m] [fintype n] {α : Type v} [non_unital_semiring α] (u : m → α) (v : m → n → α) (w : n → α) :
matrix.dot_product (λ (j : n), matrix.dot_product u (λ (i : m), v i j)) w = matrix.dot_product u (λ (i : m), matrix.dot_product (v i) w)
theorem matrix.dot_product_comm {m : Type u_2} [fintype m] {α : Type v} [comm_semiring α] (v w : m → α) :
@[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} [fintype m] {α : Type v} [non_unital_non_assoc_semiring α] (v : m → α) :
@[simp]
theorem matrix.dot_product_zero' {m : Type u_2} [fintype m] {α : Type v} [non_unital_non_assoc_semiring α] (v : m → α) :
matrix.dot_product v (λ (_x : m), 0) = 0
@[simp]
theorem matrix.zero_dot_product {m : Type u_2} [fintype m] {α : Type v} [non_unital_non_assoc_semiring α] (v : m → α) :
@[simp]
theorem matrix.zero_dot_product' {m : Type u_2} [fintype m] {α : Type v} [non_unital_non_assoc_semiring α] (v : m → α) :
matrix.dot_product (λ (_x : m), 0) v = 0
@[simp]
theorem matrix.add_dot_product {m : Type u_2} [fintype m] {α : Type v} [non_unital_non_assoc_semiring α] (u v w : m → α) :
@[simp]
theorem matrix.dot_product_add {m : Type u_2} [fintype m] {α : Type v} [non_unital_non_assoc_semiring α] (u v w : m → α) :
@[simp]
theorem matrix.diagonal_dot_product {m : Type u_2} [fintype m] {α : Type v} [decidable_eq m] [non_unital_non_assoc_semiring α] (v w : m → α) (i : m) :
@[simp]
theorem matrix.dot_product_diagonal {m : Type u_2} [fintype m] {α : Type v} [decidable_eq m] [non_unital_non_assoc_semiring α] (v w : m → α) (i : m) :
@[simp]
theorem matrix.dot_product_diagonal' {m : Type u_2} [fintype m] {α : Type v} [decidable_eq m] [non_unital_non_assoc_semiring α] (v w : m → α) (i : m) :
matrix.dot_product v (λ (j : m), matrix.diagonal w j i) = (v i) * w i
@[simp]
theorem matrix.neg_dot_product {m : Type u_2} [fintype m] {α : Type v} [ring α] (v w : m → α) :
@[simp]
theorem matrix.dot_product_neg {m : Type u_2} [fintype m] {α : Type v} [ring α] (v w : m → α) :
@[simp]
theorem matrix.sub_dot_product {m : Type u_2} [fintype m] {α : Type v} [ring α] (u v w : m → α) :
@[simp]
theorem matrix.dot_product_sub {m : Type u_2} [fintype m] {α : Type v} [ring α] (u v w : m → α) :
@[simp]
theorem matrix.smul_dot_product {m : Type u_2} [fintype m] {R : Type u_7} {α : Type v} [monoid R] [has_mul α] [add_comm_monoid α] [distrib_mul_action R α] [is_scalar_tower R α α] (x : R) (v w : m → α) :
@[simp]
theorem matrix.dot_product_smul {m : Type u_2} [fintype m] {R : Type u_7} {α : Type v} [monoid R] [has_mul α] [add_comm_monoid α] [distrib_mul_action R α] [smul_comm_class R α α] (x : R) (v w : m → α) :
theorem matrix.star_dot_product_star {m : Type u_2} [fintype m] {α : Type v} [semiring α] [star_ring α] (v w : m → α) :
theorem matrix.star_dot_product {m : Type u_2} [fintype m] {α : Type v} [semiring α] [star_ring α] (v w : m → α) :
theorem matrix.dot_product_star {m : Type u_2} [fintype m] {α : Type v} [semiring α] [star_ring α] (v w : m → α) :
def matrix.mul {l : Type u_1} {m : Type u_2} {n : Type u_3} [fintype l] [fintype m] [fintype n] {α : Type v} [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 Ǹ.

Equations
theorem matrix.mul_apply {l : Type u_1} {m : Type u_2} {n : Type u_3} [fintype l] [fintype m] [fintype n] {α : Type v} [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
@[instance]
def matrix.has_mul {n : Type u_3} [fintype n] {α : Type v} [has_mul α] [add_comm_monoid α] :
has_mul (matrix n n α)
Equations
@[simp]
theorem matrix.mul_eq_mul {n : Type u_3} [fintype n] {α : Type v} [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} [fintype l] [fintype m] [fintype n] {α : Type v} [has_mul α] [add_comm_monoid α] {M : matrix l m α} {N : matrix m n α} {i : l} {k : n} :
(M N) i k = matrix.dot_product (λ (j : m), M i j) (λ (j : m), N j k)
@[simp]
theorem matrix.diagonal_neg {n : Type u_3} [fintype n] {α : 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} [fintype m] [fintype n] {α : 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
@[simp]
theorem matrix.mul_zero {m : Type u_2} {n : Type u_3} {o : Type u_4} [fintype m] [fintype n] [fintype o] {α : Type v} [non_unital_non_assoc_semiring α] (M : matrix m n α) :
M 0 = 0
@[simp]
theorem matrix.zero_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} [fintype l] [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (M : matrix m n α) :
0 M = 0
theorem matrix.mul_add {m : Type u_2} {n : Type u_3} {o : Type u_4} [fintype m] [fintype n] [fintype o] {α : Type v} [non_unital_non_assoc_semiring α] (L : matrix m n α) (M N : matrix n o α) :
L (M + N) = L M + L N
theorem matrix.add_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} [fintype l] [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (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} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] [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} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] [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} [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] [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} [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] [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} [fintype l] [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (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} [fintype l] [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (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} [fintype l] [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (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} [fintype l] [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (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
theorem matrix.sum_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} [fintype l] [fintype m] [fintype n] {α : Type v} {β : Type w} [non_unital_non_assoc_semiring α] (s : finset β) (f : β → matrix l m α) (M : matrix m n α) :
(∑ (a : β) in s, f a) M = ∑ (a : β) in s, f a M
theorem matrix.mul_sum {l : Type u_1} {m : Type u_2} {n : Type u_3} [fintype l] [fintype m] [fintype n] {α : Type v} {β : Type w} [non_unital_non_assoc_semiring α] (s : finset β) (f : β → matrix m n α) (M : matrix l m α) :
M ∑ (a : β) in s, f a = ∑ (a : β) in s, M f a
@[simp]
theorem matrix.one_mul {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [non_assoc_semiring α] [decidable_eq m] (M : matrix m n α) :
1 M = M
@[simp]
theorem matrix.mul_one {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [non_assoc_semiring α] [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} [fintype m] [fintype n] [fintype o] {α : Type v} {β : Type w} [non_assoc_semiring α] {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) [fintype n] (α : Type v) [non_assoc_semiring α] [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) [fintype n] (α : Type v) [non_assoc_semiring α] [decidable_eq n] (d : n → α) :
theorem matrix.mul_assoc {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} [fintype l] [fintype m] [fintype n] [fintype o] {α : Type v} [non_unital_semiring α] (L : matrix l m α) (M : matrix m n α) (N : matrix n o α) :
L M N = L (M N)
@[simp]
theorem matrix.neg_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} [fintype m] [fintype n] [fintype o] {α : Type v} [ring α] (M : matrix m n α) (N : matrix n o α) :
-M N = -(M N)
@[simp]
theorem matrix.mul_neg {m : Type u_2} {n : Type u_3} {o : Type u_4} [fintype m] [fintype n] [fintype o] {α : Type v} [ring α] (M : matrix m n α) (N : matrix n o α) :
M -N = -(M N)
theorem matrix.sub_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} [fintype m] [fintype n] [fintype o] {α : Type v} [ring α] (M M' : matrix m n α) (N : matrix n o α) :
(M - M') N = M N - M' N
theorem matrix.mul_sub {m : Type u_2} {n : Type u_3} {o : Type u_4} [fintype m] [fintype n] [fintype o] {α : Type v} [ring α] (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} [fintype m] [fintype n] {α : Type v} [semiring α] [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} [fintype l] [fintype m] [fintype n] {R : Type u_7} {α : Type v} [semiring α] [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
@[instance]
def matrix.semiring.is_scalar_tower {n : Type u_3} [fintype n] {R : Type u_7} {α : Type v} [semiring α] [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} [fintype l] [fintype m] [fintype n] {R : Type u_7} {α : Type v} [semiring α] [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
@[instance]
def matrix.semiring.smul_comm_class {n : Type u_3} [fintype n] {R : Type u_7} {α : Type v} [semiring α] [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} [fintype m] [fintype n] [fintype o] {α : Type v} [semiring α] (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} [fintype n] {α : Type v} [semiring α] [decidable_eq n] :
(matrix.scalar n) = λ (a : α), a 1
theorem matrix.scalar_apply_eq {n : Type u_3} [fintype n] {α : Type v} [semiring α] [decidable_eq n] (a : α) (i : n) :
(matrix.scalar n) a i i = a
theorem matrix.scalar_apply_ne {n : Type u_3} [fintype n] {α : Type v} [semiring α] [decidable_eq n] (a : α) (i j : n) (h : i j) :
(matrix.scalar n) a i j = 0
theorem matrix.scalar_inj {n : Type u_3} [fintype n] {α : Type v} [semiring α] [decidable_eq n] [nonempty n] {r s : α} :
theorem matrix.smul_eq_mul_diagonal {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [comm_semiring α] [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} [fintype m] [fintype n] [fintype o] {α : Type v} [comm_semiring α] (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} [fintype n] {α : Type v} [comm_semiring α] [decidable_eq n] (r : α) (M : matrix n n α) :
@[instance]
def matrix.algebra {n : Type u_3} [fintype n] {R : Type u_7} {α : Type v} [comm_semiring R] [semiring α] [algebra R α] [decidable_eq n] :
algebra R (matrix n n α)
Equations
theorem matrix.algebra_map_matrix_apply {n : Type u_3} [fintype n] {R : Type u_7} {α : Type v} [comm_semiring R] [semiring α] [algebra R α] [decidable_eq n] {r : R} {i j : n} :
(algebra_map R (matrix n n α)) r i j = ite (i = j) ((algebra_map R α) r) 0
@[simp]
theorem matrix.algebra_map_eq_smul {n : Type u_3} [fintype n] {R : Type u_7} [comm_semiring R] [decidable_eq n] (r : R) :
(algebra_map R (matrix n n R)) r = r 1
def matrix.diagonal_alg_hom {n : Type u_3} [fintype n] (R : Type u_7) {α : Type v} [comm_semiring R] [semiring α] [algebra R α] [decidable_eq n] :
(n → α) →ₐ[R] matrix n n α

matrix.diagonal as an alg_hom.

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

Bundled versions of matrix.map #

def equiv.map_matrix {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : Type v} {β : Type w} (f : α β) (M : matrix m n α) :
@[simp]
theorem equiv.map_matrix_refl {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} :
@[simp]
theorem equiv.map_matrix_symm {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} {β : Type w} (f : α β) :
@[simp]
theorem equiv.map_matrix_trans {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} {β : Type w} {γ : Type u_9} (f : α β) (g : β γ) :
def add_monoid_hom.map_matrix {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : Type v} [add_zero_class α] :
@[simp]
theorem add_monoid_hom.map_matrix_comp {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : Type v} [has_add α] :
@[simp]
theorem add_equiv.map_matrix_symm {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} {β : Type w} [has_add α] [has_add β] (f : α ≃+ β) :
@[simp]
theorem add_equiv.map_matrix_trans {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {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} [fintype m] [fintype n] {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} [fintype m] [fintype n] {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} [fintype m] [fintype n] {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} [fintype m] [fintype n] {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} [fintype m] [fintype n] {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} [fintype m] [fintype n] {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} [fintype m] [fintype n] {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} [fintype m] [fintype n] {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} [fintype m] {α : Type v} {β : Type w} [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} [fintype m] {α : Type v} {β : Type w} [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} [fintype m] {α : Type v} [decidable_eq m] [non_assoc_semiring α] :
@[simp]
theorem ring_hom.map_matrix_comp {m : Type u_2} [fintype m] {α : Type v} {β : Type w} {γ : Type u_9} [decidable_eq m] [non_assoc_semiring α] [non_assoc_semiring β] [non_assoc_semiring γ] (f : β →+* γ) (g : α →+* β) :
def ring_equiv.map_matrix {m : Type u_2} [fintype m] {α : Type v} {β : Type w} [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} [fintype m] {α : Type v} {β : Type w} [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} [fintype m] {α : Type v} [decidable_eq m] [non_assoc_semiring α] :
@[simp]
theorem ring_equiv.map_matrix_symm {m : Type u_2} [fintype m] {α : Type v} {β : Type w} [decidable_eq m] [non_assoc_semiring α] [non_assoc_semiring β] (f : α ≃+* β) :
@[simp]
theorem ring_equiv.map_matrix_trans {m : Type u_2} [fintype m] {α : Type v} {β : Type w} {γ : Type u_9} [decidable_eq m] [non_assoc_semiring α] [non_assoc_semiring β] [non_assoc_semiring γ] (f : α ≃+* β) (g : β ≃+* γ) :
def matrix.vec_mul_vec {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (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} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (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} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (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} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (v : n → α) (M : matrix m n α) (ᾰ : m) :
theorem matrix.mul_vec_diagonal {m : Type u_2} [fintype m] {α : Type v} [non_unital_non_assoc_semiring α] [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} [fintype m] {α : Type v} [non_unital_non_assoc_semiring α] [decidable_eq m] (v w : m → α) (x : m) :
matrix.vec_mul v (matrix.diagonal w) x = (v x) * w x
@[simp]
theorem matrix.mul_vec_zero {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (A : matrix m n α) :
A.mul_vec 0 = 0
@[simp]
theorem matrix.zero_vec_mul {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (A : matrix m n α) :
@[simp]
theorem matrix.zero_mul_vec {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (v : n → α) :
0.mul_vec v = 0
@[simp]
theorem matrix.vec_mul_zero {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (v : m → α) :
theorem matrix.vec_mul_vec_eq {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {R : Type u_7} {α : Type v} [non_unital_non_assoc_semiring α] [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} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (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} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (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} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (A B : matrix m n α) (x : m → α) :
theorem matrix.add_vec_mul {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [non_unital_non_assoc_semiring α] (A : matrix m n α) (x y : m → α) :
@[simp]
theorem matrix.vec_mul_vec_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} [fintype m] [fintype n] [fintype o] {α : Type v} [non_unital_semiring α] (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} [fintype m] [fintype n] [fintype o] {α : Type v} [non_unital_semiring α] (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} [fintype m] {α : Type v} [non_assoc_semiring α] [decidable_eq m] (v : m → α) :
1.mul_vec v = v
@[simp]
theorem matrix.vec_mul_one {m : Type u_2} [fintype m] {α : Type v} [non_assoc_semiring α] [decidable_eq m] (v : m → α) :
def matrix.std_basis_matrix {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [semiring α] [decidable_eq m] [decidable_eq n] (i : m) (j : n) (a : α) :
matrix m n α

std_basis_matrix i j a is the matrix with a in the i-th row, j-th column, and zeroes elsewhere.

Equations
@[simp]
theorem matrix.smul_std_basis_matrix {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [semiring α] [decidable_eq m] [decidable_eq n] (i : m) (j : n) (a b : α) :
@[simp]
theorem matrix.std_basis_matrix_zero {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [semiring α] [decidable_eq m] [decidable_eq n] (i : m) (j : n) :
theorem matrix.std_basis_matrix_add {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [semiring α] [decidable_eq m] [decidable_eq n] (i : m) (j : n) (a b : α) :
theorem matrix.matrix_eq_sum_std_basis {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [semiring α] [decidable_eq m] [decidable_eq n] (x : matrix n m α) :
x = ∑ (i : n) (j : m), matrix.std_basis_matrix i j (x i j)
theorem matrix.std_basis_eq_basis_mul_basis {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] [decidable_eq m] [decidable_eq n] (i : m) (j : n) :
matrix.std_basis_matrix i j 1 = matrix.vec_mul_vec (λ (i' : m), ite (i = i') 1 0) (λ (j' : n), ite (j = j') 1 0)
theorem matrix.induction_on' {n : Type u_3} [fintype n] [decidable_eq n] {X : Type u_1} [semiring X] {M : matrix n n X → Prop} (m : matrix n n X) (h_zero : M 0) (h_add : ∀ (p q : matrix n n X), M pM qM (p + q)) (h_std_basis : ∀ (i j : n) (x : X), M (matrix.std_basis_matrix i j x)) :
M m
theorem matrix.induction_on {n : Type u_3} [fintype n] [decidable_eq n] [nonempty n] {X : Type u_1} [semiring X] {M : matrix n n X → Prop} (m : matrix n n X) (h_add : ∀ (p q : matrix n n X), M pM qM (p + q)) (h_std_basis : ∀ (i j : n) (x : X), M (matrix.std_basis_matrix i j x)) :
M m
theorem matrix.neg_vec_mul {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [ring α] (v : m → α) (A : matrix m n α) :
theorem matrix.vec_mul_neg {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [ring α] (v : m → α) (A : matrix m n α) :
theorem matrix.neg_mul_vec {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [ring α] (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} [fintype m] [fintype n] {α : Type v} [ring α] (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} [fintype m] [fintype n] {α : Type v} [comm_semiring α] (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} [fintype m] [fintype n] {α : Type v} [comm_semiring α] (A : matrix m n α) (x : m → α) :
theorem matrix.vec_mul_transpose {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [comm_semiring α] (A : matrix m n α) (x : n → α) :
@[simp]
theorem matrix.transpose_apply {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : Type v} (M : matrix m n α) :
@[simp]
theorem matrix.transpose_zero {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [has_zero α] :
0 = 0
@[simp]
theorem matrix.transpose_one {n : Type u_3} [fintype n] {α : Type v} [decidable_eq n] [has_zero α] [has_one α] :
1 = 1
@[simp]
theorem matrix.transpose_add {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : Type v} [add_group α] (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} [fintype l] [fintype m] [fintype n] {α : Type v} [comm_semiring α] (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} [fintype m] [fintype n] {α : Type v} [semiring α] (c : α) (M : matrix m n α) :
(c M) = c M
@[simp]
theorem matrix.transpose_neg {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [has_neg α] (M : matrix m n α) :
(-M) = -M
theorem matrix.transpose_map {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} {β : Type w} {f : α → β} {M : matrix m n α} :
M.map f = (M.map f)
@[simp]
theorem matrix.conj_transpose_apply {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : Type v} [has_involutive_star α] (M : matrix m n α) :
@[simp]
theorem matrix.conj_transpose_zero {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [semiring α] [star_ring α] :
0 = 0
@[simp]
theorem matrix.conj_transpose_one {n : Type u_3} [fintype n] {α : Type v} [decidable_eq n] [semiring α] [star_ring α] :
1 = 1
@[simp]
theorem matrix.conj_transpose_add {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [semiring α] [star_ring α] (M N : matrix m n α) :
(M + N) = M + N
@[simp]
theorem matrix.conj_transpose_sub {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [ring α] [star_ring α] (M N : matrix m n α) :
(M - N) = M - N
@[simp]
theorem matrix.conj_transpose_smul {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [comm_monoid α] [star_monoid α] (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} [fintype l] [fintype m] [fintype n] {α : Type v} [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} [fintype m] [fintype n] {α : Type v} [ring α] [star_ring α] (M : matrix m n α) :
(-M) = -M
@[instance]
def matrix.has_star {n : Type u_3} [fintype n] {α : 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} [fintype m] {α : Type v} [has_star α] (M : matrix m m α) :
@[simp]
theorem matrix.star_apply {n : Type u_3} [fintype n] {α : Type v} [has_star α] (M : matrix n n α) (i j : n) :
star M i j = star (M j i)
@[instance]
def matrix.star_ring {n : Type u_3} [fintype n] {α : Type v} [decidable_eq 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} [fintype n] {α : Type v} [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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype m] [fintype n] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : Type v} {l₂ : Type u_5} {o₂ : Type u_6} [fintype l₂] [fintype o₂] (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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] {α : 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} [fintype l] [fintype m] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : Type v} [semiring α] {p : Type u_5} {q : Type u_6} [fintype p] [fintype q] (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} [fintype l] [fintype m] {α : 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} [fintype l] [fintype m] {α : 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} [fintype l] [fintype m] {α : 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} [fintype l] [fintype m] {α : Type v} [has_zero α] [has_one α] [decidable_eq m] [decidable_eq l] (e : l m) :
1.minor e e = 1
theorem matrix.minor_mul_equiv {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} [fintype l] [fintype m] [fintype n] [fintype o] {α : Type v} [semiring α] {p : Type u_5} {q : Type u_6} [fintype p] [fintype q] (M : matrix m n α) (N : matrix n p α) (e₁ : l → m) (e₂ : o n) (e₃ : q → p) :
(M N).minor e₁ e₃ = M.minor e₁ e₂ 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : Type v} [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} [fintype l] [fintype m] [fintype n] [fintype o] {α : Type v} [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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype m] [fintype n] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : Type v} {l₂ : Type u_5} {o₂ : Type u_6} [fintype l₂] [fintype o₂] (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} [fintype l] [fintype m] [fintype n] [fintype o] {α : 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} [fintype l] [fintype m] [fintype n] [fintype o] {α : Type v} [has_star α] (eₘ : m l) (eₙ : n o) (M : matrix m n α) :
((matrix.reindex eₘ eₙ) M) = (matrix.reindex eₙ eₘ) M
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} [fintype m] {α : Type v} [has_add α] (v w : m → α) :
@[simp]
theorem matrix.col_smul {m : Type u_2} [fintype m] {R : Type u_7} {α : Type v} [has_scalar R α] (x : R) (v : m → α) :
@[simp]
theorem matrix.row_add {m : Type u_2} [fintype m] {α : Type v} [has_add α] (v w : m → α) :
@[simp]
theorem matrix.row_smul {m : Type u_2} [fintype m] {R : Type u_7} {α : Type v} [has_scalar R α] (x : R) (v : m → α) :
@[simp]
theorem matrix.col_apply {m : Type u_2} [fintype m] {α : Type v} (v : m → α) (i : m) (j : unit) :
matrix.col v i j = v i
@[simp]
theorem matrix.row_apply {m : Type u_2} [fintype m] {α : Type v} (v : m → α) (i : unit) (j : m) :
matrix.row v i j = v j
@[simp]
theorem matrix.transpose_col {m : Type u_2} [fintype m] {α : Type v} (v : m → α) :
@[simp]
theorem matrix.transpose_row {m : Type u_2} [fintype m] {α : Type v} (v : m → α) :
@[simp]
theorem matrix.conj_transpose_col {m : Type u_2} [fintype m] {α : Type v} [has_star α] (v : m → α) :
@[simp]
theorem matrix.conj_transpose_row {m : Type u_2} [fintype m] {α : Type v} [has_star α] (v : m → α) :
theorem matrix.row_vec_mul {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [semiring α] (M : matrix m n α) (v : m → α) :
theorem matrix.col_vec_mul {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [semiring α] (M : matrix m n α) (v : m → α) :
theorem matrix.col_mul_vec {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [semiring α] (M : matrix m n α) (v : n → α) :
theorem matrix.row_mul_vec {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [semiring α] (M : matrix m n α) (v : n → α) :
@[simp]
theorem matrix.row_mul_col_apply {m : Type u_2} [fintype m] {α : Type v} [has_mul α] [add_comm_monoid α] (v w : m → α) (i j : unit) :
def matrix.update_row {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} [decidable_eq n] (M : matrix n m α) (i : n) (b : m → α) :
matrix n m α

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} [fintype m] [fintype n] {α : Type v} [decidable_eq m] (M : matrix n m α) (j : m) (b : n → α) :
matrix n m α

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} [fintype m] [fintype n] {α : Type v} {M : matrix n m α} {i : n} {b : m → α} [decidable_eq n] :
M.update_row i b i = b
@[simp]
theorem matrix.update_column_self {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} {M : matrix n m α} {i : n} {j : m} {c : n → α} [decidable_eq m] :
M.update_column j c i j = c i
@[simp]
theorem matrix.update_row_ne {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} {M : matrix n m α} {i : n} {b : m → α} [decidable_eq n] {i' : n} (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} [fintype m] [fintype n] {α : Type v} {M : matrix n m α} {i : n} {j : m} {c : n → α} [decidable_eq m] {j' : m} (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} [fintype m] [fintype n] {α : Type v} {M : matrix n m α} {i : n} {j : m} {b : m → α} [decidable_eq n] {i' : n} :
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} [fintype m] [fintype n] {α : Type v} {M : matrix n m α} {i : n} {j : m} {c : n → α} [decidable_eq m] {j' : m} :
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} [fintype m] [fintype n] {R : Type u_7} [subsingleton m] (A : matrix n m R) (i : m) (b : n → R) :
@[simp]
theorem matrix.update_row_subsingleton {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {R : Type u_7} [subsingleton n] (A : matrix n m R) (i : n) (b : m → R) :
theorem matrix.map_update_row {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} {β : Type w} {M : matrix n m α} {i : n} {b : m → α} [decidable_eq n] (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} [fintype m] [fintype n] {α : Type v} {β : Type w} {M : matrix n m α} {j : m} {c : n → α} [decidable_eq m] (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} [fintype m] [fintype n] {α : Type v} {M : matrix n m α} {j : m} {c : n → α} [decidable_eq m] :
theorem matrix.update_column_transpose {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} {M : matrix n m α} {i : n} {b : m → α} [decidable_eq n] :
theorem matrix.update_row_conj_transpose {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} {M : matrix n m α} {j : m} {c : n → α} [decidable_eq m] [has_star α] :
theorem matrix.update_column_conj_transpose {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : Type v} {M : matrix n m α} {i : n} {b : m → α} [decidable_eq n] [has_star α] :
@[simp]
theorem matrix.update_row_eq_self {m : Type u_2} {n : Type u_3} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] {α : 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} [fintype m] [fintype n] [fintype o] {α : Type v} {β : Type w} [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