File: Mathlib/Data/Matrix/RowCol.lean

full_name: Matrix.col
code: /--
`Matrix.col ι u` the matrix with all columns equal to the vector `u`.

To get a column matrix with exactly one column, `Matrix.col (Fin 1) u` is the canonical choice.
-/
def col (ι : Type*) (w : m → α) : Matrix m ι α 
goal: Matrix m ι α

full_name: Matrix.col_apply
code: @[simp]
theorem col_apply {ι : Type*} (w : m → α) (i) (j : ι) : col ι w i j = w i 
goal: Matrix.col ι w i j = w i

full_name: Matrix.row
code: /--
`Matrix.row ι u` the matrix with all rows equal to the vector `u`.

To get a row matrix with exactly one row, `Matrix.row (Fin 1) u` is the canonical choice.
-/
def row (ι : Type*) (v : n → α) : Matrix ι n α 
goal: Matrix ι n α

full_name: Matrix.row_apply
code: @[simp]
theorem row_apply (v : n → α) (i : ι) (j) : row ι v i j = v j 
goal: Matrix.row ι v i j = v j

full_name: Matrix.col_injective
code: theorem col_injective [Nonempty ι] : Function.Injective (col ι : (m → α) → Matrix m ι α) 
goal: Function.Injective (Matrix.col ι)

full_name: Matrix.col_inj
code: @[simp] theorem col_inj [Nonempty ι] {v w : m → α} : col ι v = col ι w ↔ v = w 
goal: Matrix.col ι v = Matrix.col ι w ↔ v = w

full_name: Matrix.col_zero
code: @[simp] theorem col_zero [Zero α] : col ι (0 : m → α) = 0 
goal: Matrix.col ι 0 = 0

full_name: Matrix.col_eq_zero
code: @[simp] theorem col_eq_zero [Zero α] [Nonempty ι] (v : m → α) : col ι v = 0 ↔ v = 0 
goal: Matrix.col ι v = 0 ↔ v = 0

full_name: Matrix.col_add
code: @[simp]
theorem col_add [Add α] (v w : m → α) : col ι (v + w) = col ι v + col ι w 
goal: Matrix.col ι (v + w) = Matrix.col ι v + Matrix.col ι w

full_name: Matrix.col_smul
code: @[simp]
theorem col_smul [SMul R α] (x : R) (v : m → α) : col ι (x • v) = x • col ι v 
goal: Matrix.col ι (x • v) = x • Matrix.col ι v

full_name: Matrix.row_injective
code: theorem row_injective [Nonempty ι] : Function.Injective (row ι : (n → α) → Matrix ι n α) 
goal: Function.Injective (Matrix.row ι)

full_name: Matrix.row_inj
code: @[simp] theorem row_inj [Nonempty ι] {v w : n → α} : row ι v = row ι w ↔ v = w 
goal: Matrix.row ι v = Matrix.row ι w ↔ v = w

full_name: Matrix.row_zero
code: @[simp] theorem row_zero [Zero α] : row ι (0 : n → α) = 0 
goal: Matrix.row ι 0 = 0

full_name: Matrix.row_eq_zero
code: @[simp] theorem row_eq_zero [Zero α] [Nonempty ι] (v : n → α) : row ι v = 0 ↔ v = 0 
goal: Matrix.row ι v = 0 ↔ v = 0

full_name: Matrix.row_add
code: @[simp]
theorem row_add [Add α] (v w : m → α) : row ι (v + w) = row ι v + row ι w 
goal: Matrix.row ι (v + w) = Matrix.row ι v + Matrix.row ι w

full_name: Matrix.row_smul
code: @[simp]
theorem row_smul [SMul R α] (x : R) (v : m → α) : row ι (x • v) = x • row ι v 
goal: Matrix.row ι (x • v) = x • Matrix.row ι v

full_name: Matrix.transpose_col
code: @[simp]
theorem transpose_col (v : m → α) : (Matrix.col ι v)ᵀ = Matrix.row ι v 
goal: (Matrix.col ι v).transpose = Matrix.row ι v

full_name: Matrix.transpose_row
code: @[simp]
theorem transpose_row (v : m → α) : (Matrix.row ι v)ᵀ = Matrix.col ι v 
goal: (Matrix.row ι v).transpose = Matrix.col ι v

full_name: Matrix.conjTranspose_col
code: @[simp]
theorem conjTranspose_col [Star α] (v : m → α) : (col ι v)ᴴ = row ι (star v) 
goal: (Matrix.col ι v).conjTranspose = Matrix.row ι (star v)

full_name: Matrix.conjTranspose_row
code: @[simp]
theorem conjTranspose_row [Star α] (v : m → α) : (row ι v)ᴴ = col ι (star v) 
goal: (Matrix.row ι v).conjTranspose = Matrix.col ι (star v)

full_name: Matrix.row_vecMul
code: theorem row_vecMul [Fintype m] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : m → α) :
    Matrix.row ι (v ᵥ* M) = Matrix.row ι v * M 
goal: Matrix.row ι (Matrix.vecMul v M) = Matrix.row ι v * M

full_name: Matrix.col_vecMul
code: theorem col_vecMul [Fintype m] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : m → α) :
    Matrix.col ι (v ᵥ* M) = (Matrix.row ι v * M)ᵀ 
goal: Matrix.col ι (Matrix.vecMul v M) = (Matrix.row ι v * M).transpose

full_name: Matrix.col_mulVec
code: theorem col_mulVec [Fintype n] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : n → α) :
    Matrix.col ι (M *ᵥ v) = M * Matrix.col ι v 
goal: Matrix.col ι (M.mulVec v) = M * Matrix.col ι v

full_name: Matrix.row_mulVec
code: theorem row_mulVec [Fintype n] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : n → α) :
    Matrix.row ι (M *ᵥ v) = (M * Matrix.col ι v)ᵀ 
goal: Matrix.row ι (M.mulVec v) = (M * Matrix.col ι v).transpose

full_name: Matrix.row_mul_col_apply
code: @[simp]
theorem row_mul_col_apply [Fintype m] [Mul α] [AddCommMonoid α] (v w : m → α) (i j) :
    (row ι v * col ι w) i j = v ⬝ᵥ w 
goal: (Matrix.row ι v * Matrix.col ι w) i j = Matrix.dotProduct v w

full_name: Matrix.diag_col_mul_row
code: @[simp]
theorem diag_col_mul_row [Mul α] [AddCommMonoid α] [Unique ι] (a b : n → α) :
    diag (col ι a * row ι b) = a * b 
goal: (Matrix.col ι a * Matrix.row ι b).diag = a * b

full_name: Matrix.vecMulVec_eq
code: theorem vecMulVec_eq [Mul α] [AddCommMonoid α] [Unique ι] (w : m → α) (v : n → α) :
    vecMulVec w v = col ι w * row ι v 
goal: Matrix.vecMulVec w v = Matrix.col ι w * Matrix.row ι v

full_name: Matrix.updateRow
code: /-- Update, i.e. replace the `i`th row of matrix `A` with the values in `b`. -/
def updateRow [DecidableEq m] (M : Matrix m n α) (i : m) (b : n → α) : Matrix m n α 
goal: Matrix m n α

full_name: Matrix.updateColumn
code: /-- Update, i.e. replace the `j`th column of matrix `A` with the values in `b`. -/
def updateColumn [DecidableEq n] (M : Matrix m n α) (j : n) (b : m → α) : Matrix m n α 
goal: Matrix m n α

full_name: Matrix.updateRow_self
code: @[simp]
theorem updateRow_self [DecidableEq m] : updateRow M i b i = b 
goal: M.updateRow i b i = b

full_name: Matrix.updateColumn_self
code: @[simp]
theorem updateColumn_self [DecidableEq n] : updateColumn M j c i j = c i 
goal: M.updateColumn j c i j = c i

full_name: Matrix.updateRow_ne
code: @[simp]
theorem updateRow_ne [DecidableEq m] {i' : m} (i_ne : i' ≠ i) : updateRow M i b i' = M i' 
goal: M.updateRow i b i' = M i'

full_name: Matrix.updateColumn_ne
code: @[simp]
theorem updateColumn_ne [DecidableEq n] {j' : n} (j_ne : j' ≠ j) :
    updateColumn M j c i j' = M i j' 
goal: M.updateColumn j c i j' = M i j'

full_name: Matrix.updateRow_apply
code: theorem updateRow_apply [DecidableEq m] {i' : m} :
    updateRow M i b i' j = if i' = i then b j else M i' j 
goal: M.updateRow i b i' j = if i' = i then b j else M i' j

full_name: Matrix.updateColumn_apply
code: theorem updateColumn_apply [DecidableEq n] {j' : n} :
    updateColumn M j c i j' = if j' = j then c i else M i j' 
goal: M.updateColumn j c i j' = if j' = j then c i else M i j'

full_name: Matrix.updateColumn_subsingleton
code: @[simp]
theorem updateColumn_subsingleton [Subsingleton n] (A : Matrix m n R) (i : n) (b : m → R) :
    A.updateColumn i b = (col (Fin 1) b).submatrix id (Function.const n 0) 
goal: A.updateColumn i b = (Matrix.col (Fin 1) b).submatrix id (Function.const n 0)

full_name: Matrix.updateRow_subsingleton
code: @[simp]
theorem updateRow_subsingleton [Subsingleton m] (A : Matrix m n R) (i : m) (b : n → R) :
    A.updateRow i b = (row (Fin 1) b).submatrix (Function.const m 0) id 
goal: A.updateRow i b = (Matrix.row (Fin 1) b).submatrix (Function.const m 0) id

full_name: Matrix.map_updateRow
code: theorem map_updateRow [DecidableEq m] (f : α → β) :
    map (updateRow M i b) f = updateRow (M.map f) i (f ∘ b) 
goal: (M.updateRow i b).map f = (M.map f).updateRow i (f ∘ b)

full_name: Matrix.map_updateColumn
code: theorem map_updateColumn [DecidableEq n] (f : α → β) :
    map (updateColumn M j c) f = updateColumn (M.map f) j (f ∘ c) 
goal: (M.updateColumn j c).map f = (M.map f).updateColumn j (f ∘ c)

full_name: Matrix.updateRow_transpose
code: theorem updateRow_transpose [DecidableEq n] : updateRow Mᵀ j c = (updateColumn M j c)ᵀ 
goal: M.transpose.updateRow j c = (M.updateColumn j c).transpose

full_name: Matrix.updateColumn_transpose
code: theorem updateColumn_transpose [DecidableEq m] : updateColumn Mᵀ i b = (updateRow M i b)ᵀ 
goal: M.transpose.updateColumn i b = (M.updateRow i b).transpose

full_name: Matrix.updateRow_conjTranspose
code: theorem updateRow_conjTranspose [DecidableEq n] [Star α] :
    updateRow Mᴴ j (star c) = (updateColumn M j c)ᴴ 
goal: M.conjTranspose.updateRow j (star c) = (M.updateColumn j c).conjTranspose

full_name: Matrix.updateColumn_conjTranspose
code: theorem updateColumn_conjTranspose [DecidableEq m] [Star α] :
    updateColumn Mᴴ i (star b) = (updateRow M i b)ᴴ 
goal: M.conjTranspose.updateColumn i (star b) = (M.updateRow i b).conjTranspose

full_name: Matrix.updateRow_eq_self
code: @[simp]
theorem updateRow_eq_self [DecidableEq m] (A : Matrix m n α) (i : m) : A.updateRow i (A i) = A 
goal: A.updateRow i (A i) = A

full_name: Matrix.updateColumn_eq_self
code: @[simp]
theorem updateColumn_eq_self [DecidableEq n] (A : Matrix m n α) (i : n) :
    (A.updateColumn i fun j => A j i) = A 
goal: (A.updateColumn i fun j => A j i) = A

full_name: Matrix.diagonal_updateColumn_single
code: theorem diagonal_updateColumn_single [DecidableEq n] [Zero α] (v : n → α) (i : n) (x : α) :
    (diagonal v).updateColumn i (Pi.single i x) = diagonal (Function.update v i x) 
goal: (Matrix.diagonal v).updateColumn i (Pi.single i x) = Matrix.diagonal (Function.update v i x)

full_name: Matrix.diagonal_updateRow_single
code: theorem diagonal_updateRow_single [DecidableEq n] [Zero α] (v : n → α) (i : n) (x : α) :
    (diagonal v).updateRow i (Pi.single i x) = diagonal (Function.update v i x) 
goal: (Matrix.diagonal v).updateRow i (Pi.single i x) = Matrix.diagonal (Function.update v i x)

full_name: Matrix.updateRow_submatrix_equiv
code: theorem updateRow_submatrix_equiv [DecidableEq l] [DecidableEq m] (A : Matrix m n α) (i : l)
    (r : o → α) (e : l ≃ m) (f : o ≃ n) :
    updateRow (A.submatrix e f) i r = (A.updateRow (e i) fun j => r (f.symm j)).submatrix e f 
goal: (A.submatrix ⇑e ⇑f).updateRow i r = (A.updateRow (e i) fun j => r (f.symm j)).submatrix ⇑e ⇑f

full_name: Matrix.submatrix_updateRow_equiv
code: theorem submatrix_updateRow_equiv [DecidableEq l] [DecidableEq m] (A : Matrix m n α) (i : m)
    (r : n → α) (e : l ≃ m) (f : o ≃ n) :
    (A.updateRow i r).submatrix e f = updateRow (A.submatrix e f) (e.symm i) fun i => r (f i) 
goal: (A.updateRow i r).submatrix ⇑e ⇑f = (A.submatrix ⇑e ⇑f).updateRow (e.symm i) fun i => r (f i)

full_name: Matrix.updateColumn_submatrix_equiv
code: theorem updateColumn_submatrix_equiv [DecidableEq o] [DecidableEq n] (A : Matrix m n α) (j : o)
    (c : l → α) (e : l ≃ m) (f : o ≃ n) : updateColumn (A.submatrix e f) j c =
    (A.updateColumn (f j) fun i => c (e.symm i)).submatrix e f 
goal: (A.submatrix ⇑e ⇑f).updateColumn j c = (A.updateColumn (f j) fun i => c (e.symm i)).submatrix ⇑e ⇑f

full_name: Matrix.submatrix_updateColumn_equiv
code: theorem submatrix_updateColumn_equiv [DecidableEq o] [DecidableEq n] (A : Matrix m n α) (j : n)
    (c : m → α) (e : l ≃ m) (f : o ≃ n) : (A.updateColumn j c).submatrix e f =
    updateColumn (A.submatrix e f) (f.symm j) fun i => c (e i) 
goal: (A.updateColumn j c).submatrix ⇑e ⇑f = (A.submatrix ⇑e ⇑f).updateColumn (f.symm j) fun i => c (e i)

full_name: Matrix.updateRow_reindex
code: theorem updateRow_reindex [DecidableEq l] [DecidableEq m] (A : Matrix m n α) (i : l) (r : o → α)
    (e : m ≃ l) (f : n ≃ o) :
    updateRow (reindex e f A) i r = reindex e f (A.updateRow (e.symm i) fun j => r (f j)) 
goal: ((Matrix.reindex e f) A).updateRow i r = (Matrix.reindex e f) (A.updateRow (e.symm i) fun j => r (f j))

full_name: Matrix.reindex_updateRow
code: theorem reindex_updateRow [DecidableEq l] [DecidableEq m] (A : Matrix m n α) (i : m) (r : n → α)
    (e : m ≃ l) (f : n ≃ o) :
    reindex e f (A.updateRow i r) = updateRow (reindex e f A) (e i) fun i => r (f.symm i) 
goal: (Matrix.reindex e f) (A.updateRow i r) = ((Matrix.reindex e f) A).updateRow (e i) fun i => r (f.symm i)

full_name: Matrix.updateColumn_reindex
code: theorem updateColumn_reindex [DecidableEq o] [DecidableEq n] (A : Matrix m n α) (j : o) (c : l → α)
    (e : m ≃ l) (f : n ≃ o) :
    updateColumn (reindex e f A) j c = reindex e f (A.updateColumn (f.symm j) fun i => c (e i)) 
goal: ((Matrix.reindex e f) A).updateColumn j c = (Matrix.reindex e f) (A.updateColumn (f.symm j) fun i => c (e i))

full_name: Matrix.reindex_updateColumn
code: theorem reindex_updateColumn [DecidableEq o] [DecidableEq n] (A : Matrix m n α) (j : n) (c : m → α)
    (e : m ≃ l) (f : n ≃ o) :
    reindex e f (A.updateColumn j c) = updateColumn (reindex e f A) (f j) fun i => c (e.symm i) 
goal: (Matrix.reindex e f) (A.updateColumn j c) = ((Matrix.reindex e f) A).updateColumn (f j) fun i => c (e.symm i)