File: Mathlib/Data/Matrix/Basis.lean

full_name: Matrix.stdBasisMatrix
code: /-- `stdBasisMatrix i j a` is the matrix with `a` in the `i`-th row, `j`-th column,
and zeroes elsewhere.
-/
def stdBasisMatrix (i : m) (j : n) (a : α) : Matrix m n α 
goal: Matrix m n α

full_name: Matrix.smul_stdBasisMatrix
code: @[simp]
theorem smul_stdBasisMatrix [SMulZeroClass R α] (r : R) (i : m) (j : n) (a : α) :
    r • stdBasisMatrix i j a = stdBasisMatrix i j (r • a) 
goal: r • Matrix.stdBasisMatrix i j a = Matrix.stdBasisMatrix i j (r • a)

full_name: Matrix.stdBasisMatrix_zero
code: @[simp]
theorem stdBasisMatrix_zero (i : m) (j : n) : stdBasisMatrix i j (0 : α) = 0 
goal: Matrix.stdBasisMatrix i j 0 = 0

full_name: Matrix.stdBasisMatrix_add
code: theorem stdBasisMatrix_add (i : m) (j : n) (a b : α) :
    stdBasisMatrix i j (a + b) = stdBasisMatrix i j a + stdBasisMatrix i j b 
goal: Matrix.stdBasisMatrix i j (a + b) = Matrix.stdBasisMatrix i j a + Matrix.stdBasisMatrix i j b

full_name: Matrix.mulVec_stdBasisMatrix
code: theorem mulVec_stdBasisMatrix [Fintype m] (i : n) (j : m) (c : α) (x : m → α) :
    mulVec (stdBasisMatrix i j c) x = Function.update (0 : n → α) i (c * x j) 
goal: (Matrix.stdBasisMatrix i j c).mulVec x = Function.update 0 i (c * x j)

full_name: Matrix.matrix_eq_sum_std_basis
code: theorem matrix_eq_sum_std_basis [Fintype m] [Fintype n] (x : Matrix m n α) :
    x = ∑ i : m, ∑ j : n, stdBasisMatrix i j (x i j) 
goal: x = ∑ i : m, ∑ j : n, Matrix.stdBasisMatrix i j (x i j)

full_name: Matrix.std_basis_eq_basis_mul_basis
code: theorem std_basis_eq_basis_mul_basis (i : m) (j : n) :
    stdBasisMatrix i j (1 : α) =
      vecMulVec (fun i' => ite (i = i') 1 0) fun j' => ite (j = j') 1 0 
goal: Matrix.stdBasisMatrix i j 1 = Matrix.vecMulVec (fun i' => if i = i' then 1 else 0) fun j' => if j = j' then 1 else 0

full_name: Matrix.induction_on'
code: @[elab_as_elim]
protected theorem induction_on' [Finite m] [Finite n] {P : Matrix m n α → Prop} (M : Matrix m n α)
    (h_zero : P 0) (h_add : ∀ p q, P p → P q → P (p + q))
    (h_std_basis : ∀ (i : m) (j : n) (x : α), P (stdBasisMatrix i j x)) : P M 
goal: P M

full_name: Matrix.induction_on
code: @[elab_as_elim]
protected theorem induction_on [Finite m] [Finite n] [Nonempty m] [Nonempty n]
    {P : Matrix m n α → Prop} (M : Matrix m n α) (h_add : ∀ p q, P p → P q → P (p + q))
    (h_std_basis : ∀ i j x, P (stdBasisMatrix i j x)) : P M 
goal: P M

full_name: Matrix.StdBasisMatrix.apply_same
code: @[simp]
theorem apply_same : stdBasisMatrix i j c i j = c 
goal: Matrix.stdBasisMatrix i j c i j = c

full_name: Matrix.StdBasisMatrix.apply_of_ne
code: @[simp]
theorem apply_of_ne (h : ¬(i = i' ∧ j = j')) : stdBasisMatrix i j c i' j' = 0 
goal: Matrix.stdBasisMatrix i j c i' j' = 0

full_name: Matrix.StdBasisMatrix.apply_of_row_ne
code: @[simp]
theorem apply_of_row_ne {i i' : m} (hi : i ≠ i') (j j' : n) (a : α) :
    stdBasisMatrix i j a i' j' = 0 
goal: Matrix.stdBasisMatrix i j a i' j' = 0

full_name: Matrix.StdBasisMatrix.apply_of_col_ne
code: @[simp]
theorem apply_of_col_ne (i i' : m) {j j' : n} (hj : j ≠ j') (a : α) :
    stdBasisMatrix i j a i' j' = 0 
goal: Matrix.stdBasisMatrix i j a i' j' = 0

full_name: Matrix.StdBasisMatrix.diag_zero
code: @[simp]
theorem diag_zero (h : j ≠ i) : diag (stdBasisMatrix i j c) = 0 
goal: (Matrix.stdBasisMatrix i j c).diag = 0

full_name: Matrix.StdBasisMatrix.diag_same
code: @[simp]
theorem diag_same : diag (stdBasisMatrix i i c) = Pi.single i c 
goal: (Matrix.stdBasisMatrix i i c).diag = Pi.single i c

full_name: Matrix.StdBasisMatrix.trace_zero
code: @[simp]
theorem trace_zero (h : j ≠ i) : trace (stdBasisMatrix i j c) = 0 
goal: (Matrix.stdBasisMatrix i j c).trace = 0

full_name: Matrix.StdBasisMatrix.trace_eq
code: @[simp]
theorem trace_eq : trace (stdBasisMatrix i i c) = c 
goal: (Matrix.stdBasisMatrix i i c).trace = c

full_name: Matrix.StdBasisMatrix.mul_left_apply_same
code: @[simp]
theorem mul_left_apply_same (b : n) (M : Matrix n n α) :
    (stdBasisMatrix i j c * M) i b = c * M j b 
goal: (Matrix.stdBasisMatrix i j c * M) i b = c * M j b

full_name: Matrix.StdBasisMatrix.mul_right_apply_same
code: @[simp]
theorem mul_right_apply_same (a : n) (M : Matrix n n α) :
    (M * stdBasisMatrix i j c) a j = M a i * c 
goal: (M * Matrix.stdBasisMatrix i j c) a j = M a i * c

full_name: Matrix.StdBasisMatrix.mul_left_apply_of_ne
code: @[simp]
theorem mul_left_apply_of_ne (a b : n) (h : a ≠ i) (M : Matrix n n α) :
    (stdBasisMatrix i j c * M) a b = 0 
goal: (Matrix.stdBasisMatrix i j c * M) a b = 0

full_name: Matrix.StdBasisMatrix.mul_right_apply_of_ne
code: @[simp]
theorem mul_right_apply_of_ne (a b : n) (hbj : b ≠ j) (M : Matrix n n α) :
    (M * stdBasisMatrix i j c) a b = 0 
goal: (M * Matrix.stdBasisMatrix i j c) a b = 0

full_name: Matrix.StdBasisMatrix.mul_same
code: @[simp]
theorem mul_same (k : n) (d : α) :
    stdBasisMatrix i j c * stdBasisMatrix j k d = stdBasisMatrix i k (c * d) 
goal: Matrix.stdBasisMatrix i j c * Matrix.stdBasisMatrix j k d = Matrix.stdBasisMatrix i k (c * d)

full_name: Matrix.StdBasisMatrix.mul_of_ne
code: @[simp]
theorem mul_of_ne {k l : n} (h : j ≠ k) (d : α) :
    stdBasisMatrix i j c * stdBasisMatrix k l d = 0 
goal: Matrix.stdBasisMatrix i j c * Matrix.stdBasisMatrix k l d = 0

full_name: Matrix.row_eq_zero_of_commute_stdBasisMatrix
code: theorem row_eq_zero_of_commute_stdBasisMatrix {i j k : n} {M : Matrix n n α}
    (hM : Commute (stdBasisMatrix i j 1) M) (hkj : k ≠ j) : M j k = 0 
goal: M j k = 0

full_name: Matrix.col_eq_zero_of_commute_stdBasisMatrix
code: theorem col_eq_zero_of_commute_stdBasisMatrix {i j k : n} {M : Matrix n n α}
    (hM : Commute (stdBasisMatrix i j 1) M) (hki : k ≠ i) : M k i = 0 
goal: M k i = 0

full_name: Matrix.diag_eq_of_commute_stdBasisMatrix
code: theorem diag_eq_of_commute_stdBasisMatrix {i j : n} {M : Matrix n n α}
    (hM : Commute (stdBasisMatrix i j 1) M) : M i i = M j j 
goal: M i i = M j j

full_name: Matrix.mem_range_scalar_of_commute_stdBasisMatrix
code: /-- `M` is a scalar matrix if it commutes with every non-diagonal `stdBasisMatrix`. -/
theorem mem_range_scalar_of_commute_stdBasisMatrix {M : Matrix n n α}
    (hM : Pairwise fun i j => Commute (stdBasisMatrix i j 1) M) :
    M ∈ Set.range (Matrix.scalar n) 
goal: M ∈ Set.range ⇑(Matrix.scalar n)

full_name: Matrix.mem_range_scalar_iff_commute_stdBasisMatrix
code: theorem mem_range_scalar_iff_commute_stdBasisMatrix {M : Matrix n n α} :
    M ∈ Set.range (Matrix.scalar n) ↔ ∀ (i j : n), i ≠ j → Commute (stdBasisMatrix i j 1) M 
goal: M ∈ Set.range ⇑(Matrix.scalar n) ↔ ∀ (i j : n), i ≠ j → Commute (Matrix.stdBasisMatrix i j 1) M

full_name: Matrix.mem_range_scalar_iff_commute_stdBasisMatrix'
code: /-- `M` is a scalar matrix if and only if it commutes with every `stdBasisMatrix`. -/
theorem mem_range_scalar_iff_commute_stdBasisMatrix' {M : Matrix n n α} :
    M ∈ Set.range (Matrix.scalar n) ↔ ∀ (i j : n), Commute (stdBasisMatrix i j 1) M 
goal: M ∈ Set.range ⇑(Matrix.scalar n) ↔ ∀ (i j : n), Commute (Matrix.stdBasisMatrix i j 1) M