l3lab/ntp-mathlib huggingface dataset:
theorem col_mulVec [Fintype n] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : n → α) :
    Matrix.col (Matrix.mulVec M v) = M * Matrix.col v := by
  ext
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
inst✝¹ : Fintype n
inst✝ : NonUnitalNonAssocSemiring α
M : Matrix m n α
v : n → α
i✝ : m
x✝ : Unit
⊢ col (mulVec M v) i✝ x✝ = (M * col v) i✝ x✝

Next tactic:
rfl
theorem row_mulVec [Fintype n] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : n → α) :
    Matrix.row (Matrix.mulVec M v) = (M * Matrix.col v)ᵀ := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
inst✝¹ : Fintype n
inst✝ : NonUnitalNonAssocSemiring α
M : Matrix m n α
v : n → α
⊢ row (mulVec M v) = (M * col v)ᵀ

Next tactic:
ext
theorem row_mulVec [Fintype n] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : n → α) :
    Matrix.row (Matrix.mulVec M v) = (M * Matrix.col v)ᵀ := by
  ext
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
inst✝¹ : Fintype n
inst✝ : NonUnitalNonAssocSemiring α
M : Matrix m n α
v : n → α
i✝ : Unit
x✝ : m
⊢ row (mulVec M v) i✝ x✝ = (M * col v)ᵀ i✝ x✝

Next tactic:
rfl
@[simp]
theorem diag_col_mul_row [Mul α] [AddCommMonoid α] (a b : n → α) :
    diag (col a * row b) = a * b := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
inst✝¹ : Mul α
inst✝ : AddCommMonoid α
a b : n → α
⊢ diag (col a * row b) = a * b

Next tactic:
ext
@[simp]
theorem diag_col_mul_row [Mul α] [AddCommMonoid α] (a b : n → α) :
    diag (col a * row b) = a * b := by
  ext
  

Proof state:
case h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
inst✝¹ : Mul α
inst✝ : AddCommMonoid α
a b : n → α
x✝ : n
⊢ diag (col a * row b) x✝ = (a * b) x✝

Next tactic:
simp [Matrix.mul_apply, col, row]
theorem vecMulVec_eq [Mul α] [AddCommMonoid α] (w : m → α) (v : n → α) :
    vecMulVec w v = col w * row v := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
inst✝¹ : Mul α
inst✝ : AddCommMonoid α
w : m → α
v : n → α
⊢ vecMulVec w v = col w * row v

Next tactic:
ext
theorem vecMulVec_eq [Mul α] [AddCommMonoid α] (w : m → α) (v : n → α) :
    vecMulVec w v = col w * row v := by
  ext
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
inst✝¹ : Mul α
inst✝ : AddCommMonoid α
w : m → α
v : n → α
i✝ : m
x✝ : n
⊢ vecMulVec w v i✝ x✝ = (col w * row v) i✝ x✝

Next tactic:
simp only [vecMulVec, mul_apply, Fintype.univ_punit, Finset.sum_singleton]
theorem vecMulVec_eq [Mul α] [AddCommMonoid α] (w : m → α) (v : n → α) :
    vecMulVec w v = col w * row v := by
  ext
  simp only [vecMulVec, mul_apply, Fintype.univ_punit, Finset.sum_singleton]
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
inst✝¹ : Mul α
inst✝ : AddCommMonoid α
w : m → α
v : n → α
i✝ : m
x✝ : n
⊢ of (fun x y => w x * v y) i✝ x✝ = col w i✝ PUnit.unit * row v PUnit.unit x✝

Next tactic:
rfl
theorem updateRow_apply [DecidableEq m] {i' : m} :
    updateRow M i b i' j = if i' = i then b j else M i' j := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq m
i' : m
⊢ updateRow M i b i' j = if i' = i then b j else M i' j

Next tactic:
by_cases h : i' = i
theorem updateRow_apply [DecidableEq m] {i' : m} :
    updateRow M i b i' j = if i' = i then b j else M i' j := by
  by_cases h : i' = i
  · 

Proof state:
case pos
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq m
i' : m
h : i' = i
⊢ updateRow M i b i' j = if i' = i then b j else M i' j

Next tactic:
rw [h, updateRow_self, if_pos rfl]
theorem updateRow_apply [DecidableEq m] {i' : m} :
    updateRow M i b i' j = if i' = i then b j else M i' j := by
  by_cases h : i' = i
  · rw [h, updateRow_self, if_pos rfl]
  · 

Proof state:
case neg
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq m
i' : m
h : ¬i' = i
⊢ updateRow M i b i' j = if i' = i then b j else M i' j

Next tactic:
rw [updateRow_ne h, if_neg h]
theorem updateColumn_apply [DecidableEq n] {j' : n} :
    updateColumn M j c i j' = if j' = j then c i else M i j' := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq n
j' : n
⊢ updateColumn M j c i j' = if j' = j then c i else M i j'

Next tactic:
by_cases h : j' = j
theorem updateColumn_apply [DecidableEq n] {j' : n} :
    updateColumn M j c i j' = if j' = j then c i else M i j' := by
  by_cases h : j' = j
  · 

Proof state:
case pos
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq n
j' : n
h : j' = j
⊢ updateColumn M j c i j' = if j' = j then c i else M i j'

Next tactic:
rw [h, updateColumn_self, if_pos rfl]
theorem updateColumn_apply [DecidableEq n] {j' : n} :
    updateColumn M j c i j' = if j' = j then c i else M i j' := by
  by_cases h : j' = j
  · rw [h, updateColumn_self, if_pos rfl]
  · 

Proof state:
case neg
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq n
j' : n
h : ¬j' = j
⊢ updateColumn M j c i j' = if j' = j then c i else M i j'

Next tactic:
rw [updateColumn_ne h, if_neg h]
@[simp]
theorem updateColumn_subsingleton [Subsingleton n] (A : Matrix m n R) (i : n) (b : m → R) :
    A.updateColumn i b = (col b).submatrix id (Function.const n ()) := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j : n
b✝ : n → α
c : m → α
inst✝ : Subsingleton n
A : Matrix m n R
i : n
b : m → R
⊢ updateColumn A i b = submatrix (col b) id (Function.const n ())

Next tactic:
ext x y
@[simp]
theorem updateColumn_subsingleton [Subsingleton n] (A : Matrix m n R) (i : n) (b : m → R) :
    A.updateColumn i b = (col b).submatrix id (Function.const n ()) := by
  ext x y
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j : n
b✝ : n → α
c : m → α
inst✝ : Subsingleton n
A : Matrix m n R
i : n
b : m → R
x : m
y : n
⊢ updateColumn A i b x y = submatrix (col b) id (Function.const n ()) x y

Next tactic:
simp [updateColumn_apply, Subsingleton.elim i y]
@[simp]
theorem updateRow_subsingleton [Subsingleton m] (A : Matrix m n R) (i : m) (b : n → R) :
    A.updateRow i b = (row b).submatrix (Function.const m ()) id := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j : n
b✝ : n → α
c : m → α
inst✝ : Subsingleton m
A : Matrix m n R
i : m
b : n → R
⊢ updateRow A i b = submatrix (row b) (Function.const m ()) id

Next tactic:
ext x y
@[simp]
theorem updateRow_subsingleton [Subsingleton m] (A : Matrix m n R) (i : m) (b : n → R) :
    A.updateRow i b = (row b).submatrix (Function.const m ()) id := by
  ext x y
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j : n
b✝ : n → α
c : m → α
inst✝ : Subsingleton m
A : Matrix m n R
i : m
b : n → R
x : m
y : n
⊢ updateRow A i b x y = submatrix (row b) (Function.const m ()) id x y

Next tactic:
simp [updateColumn_apply, Subsingleton.elim i x]
theorem map_updateRow [DecidableEq m] (f : α → β) :
    map (updateRow M i b) f = updateRow (M.map f) i (f ∘ b) := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq m
f : α → β
⊢ map (updateRow M i b) f = updateRow (map M f) i (f ∘ b)

Next tactic:
ext
theorem map_updateRow [DecidableEq m] (f : α → β) :
    map (updateRow M i b) f = updateRow (M.map f) i (f ∘ b) := by
  ext
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq m
f : α → β
i✝ : m
x✝ : n
⊢ map (updateRow M i b) f i✝ x✝ = updateRow (map M f) i (f ∘ b) i✝ x✝

Next tactic:
rw [updateRow_apply, map_apply, map_apply, updateRow_apply]
theorem map_updateRow [DecidableEq m] (f : α → β) :
    map (updateRow M i b) f = updateRow (M.map f) i (f ∘ b) := by
  ext
  rw [updateRow_apply, map_apply, map_apply, updateRow_apply]
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq m
f : α → β
i✝ : m
x✝ : n
⊢ f (if i✝ = i then b x✝ else M i✝ x✝) = if i✝ = i then (f ∘ b) x✝ else f (M i✝ x✝)

Next tactic:
exact apply_ite f _ _ _
theorem map_updateColumn [DecidableEq n] (f : α → β) :
    map (updateColumn M j c) f = updateColumn (M.map f) j (f ∘ c) := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq n
f : α → β
⊢ map (updateColumn M j c) f = updateColumn (map M f) j (f ∘ c)

Next tactic:
ext
theorem map_updateColumn [DecidableEq n] (f : α → β) :
    map (updateColumn M j c) f = updateColumn (M.map f) j (f ∘ c) := by
  ext
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq n
f : α → β
i✝ : m
x✝ : n
⊢ map (updateColumn M j c) f i✝ x✝ = updateColumn (map M f) j (f ∘ c) i✝ x✝

Next tactic:
rw [updateColumn_apply, map_apply, map_apply, updateColumn_apply]
theorem map_updateColumn [DecidableEq n] (f : α → β) :
    map (updateColumn M j c) f = updateColumn (M.map f) j (f ∘ c) := by
  ext
  rw [updateColumn_apply, map_apply, map_apply, updateColumn_apply]
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq n
f : α → β
i✝ : m
x✝ : n
⊢ f (if x✝ = j then c i✝ else M i✝ x✝) = if x✝ = j then (f ∘ c) i✝ else f (M i✝ x✝)

Next tactic:
exact apply_ite f _ _ _
theorem updateRow_transpose [DecidableEq n] : updateRow Mᵀ j c = (updateColumn M j c)ᵀ := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq n
⊢ updateRow Mᵀ j c = (updateColumn M j c)ᵀ

Next tactic:
ext
theorem updateRow_transpose [DecidableEq n] : updateRow Mᵀ j c = (updateColumn M j c)ᵀ := by
  ext
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq n
i✝ : n
x✝ : m
⊢ updateRow Mᵀ j c i✝ x✝ = (updateColumn M j c)ᵀ i✝ x✝

Next tactic:
rw [transpose_apply, updateRow_apply, updateColumn_apply]
theorem updateRow_transpose [DecidableEq n] : updateRow Mᵀ j c = (updateColumn M j c)ᵀ := by
  ext
  rw [transpose_apply, updateRow_apply, updateColumn_apply]
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq n
i✝ : n
x✝ : m
⊢ (if i✝ = j then c x✝ else Mᵀ i✝ x✝) = if i✝ = j then c x✝ else M x✝ i✝

Next tactic:
rfl
theorem updateColumn_transpose [DecidableEq m] : updateColumn Mᵀ i b = (updateRow M i b)ᵀ := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq m
⊢ updateColumn Mᵀ i b = (updateRow M i b)ᵀ

Next tactic:
ext
theorem updateColumn_transpose [DecidableEq m] : updateColumn Mᵀ i b = (updateRow M i b)ᵀ := by
  ext
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq m
i✝ : n
x✝ : m
⊢ updateColumn Mᵀ i b i✝ x✝ = (updateRow M i b)ᵀ i✝ x✝

Next tactic:
rw [transpose_apply, updateRow_apply, updateColumn_apply]
theorem updateColumn_transpose [DecidableEq m] : updateColumn Mᵀ i b = (updateRow M i b)ᵀ := by
  ext
  rw [transpose_apply, updateRow_apply, updateColumn_apply]
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝ : DecidableEq m
i✝ : n
x✝ : m
⊢ (if x✝ = i then b i✝ else Mᵀ i✝ x✝) = if x✝ = i then b i✝ else M x✝ i✝

Next tactic:
rfl
theorem updateRow_conjTranspose [DecidableEq n] [Star α] :
    updateRow Mᴴ j (star c) = (updateColumn M j c)ᴴ := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Star α
⊢ updateRow Mᴴ j (star c) = (updateColumn M j c)ᴴ

Next tactic:
rw [conjTranspose, conjTranspose, transpose_map, transpose_map, updateRow_transpose,
    map_updateColumn]
theorem updateRow_conjTranspose [DecidableEq n] [Star α] :
    updateRow Mᴴ j (star c) = (updateColumn M j c)ᴴ := by
  rw [conjTranspose, conjTranspose, transpose_map, transpose_map, updateRow_transpose,
    map_updateColumn]
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Star α
⊢ (updateColumn (map M star) j (star c))ᵀ = (updateColumn (map M star) j (star ∘ c))ᵀ

Next tactic:
rfl
theorem updateColumn_conjTranspose [DecidableEq m] [Star α] :
    updateColumn Mᴴ i (star b) = (updateRow M i b)ᴴ := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝¹ : DecidableEq m
inst✝ : Star α
⊢ updateColumn Mᴴ i (star b) = (updateRow M i b)ᴴ

Next tactic:
rw [conjTranspose, conjTranspose, transpose_map, transpose_map, updateColumn_transpose,
    map_updateRow]
theorem updateColumn_conjTranspose [DecidableEq m] [Star α] :
    updateColumn Mᴴ i (star b) = (updateRow M i b)ᴴ := by
  rw [conjTranspose, conjTranspose, transpose_map, transpose_map, updateColumn_transpose,
    map_updateRow]
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j : n
b : n → α
c : m → α
inst✝¹ : DecidableEq m
inst✝ : Star α
⊢ (updateRow (map M star) i (star b))ᵀ = (updateRow (map M star) i (star ∘ b))ᵀ

Next tactic:
rfl
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) := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Zero α
v : n → α
i : n
x : α
⊢ updateColumn (diagonal v) i (Pi.single i x) = diagonal (Function.update v i x)

Next tactic:
ext j k
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) := by
  ext j k
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j✝ : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Zero α
v : n → α
i : n
x : α
j k : n
⊢ updateColumn (diagonal v) i (Pi.single i x) j k = diagonal (Function.update v i x) j k

Next tactic:
obtain rfl | hjk := eq_or_ne j k
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) := by
  ext j k
  obtain rfl | hjk := eq_or_ne j k
  · 

Proof state:
case a.h.inl
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j✝ : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Zero α
v : n → α
i : n
x : α
j : n
⊢ updateColumn (diagonal v) i (Pi.single i x) j j = diagonal (Function.update v i x) j j

Next tactic:
rw [diagonal_apply_eq]
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) := by
  ext j k
  obtain rfl | hjk := eq_or_ne j k
  · rw [diagonal_apply_eq]
    

Proof state:
case a.h.inl
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j✝ : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Zero α
v : n → α
i : n
x : α
j : n
⊢ updateColumn (diagonal v) i (Pi.single i x) j j = Function.update v i x j

Next tactic:
obtain rfl | hji := eq_or_ne j i
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) := by
  ext j k
  obtain rfl | hjk := eq_or_ne j k
  · rw [diagonal_apply_eq]
    obtain rfl | hji := eq_or_ne j i
    · 

Proof state:
case a.h.inl.inl
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j✝ : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Zero α
v : n → α
x : α
j : n
⊢ updateColumn (diagonal v) j (Pi.single j x) j j = Function.update v j x j

Next tactic:
rw [updateColumn_self, Pi.single_eq_same, Function.update_same]
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) := by
  ext j k
  obtain rfl | hjk := eq_or_ne j k
  · rw [diagonal_apply_eq]
    obtain rfl | hji := eq_or_ne j i
    · rw [updateColumn_self, Pi.single_eq_same, Function.update_same]
    · 

Proof state:
case a.h.inl.inr
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j✝ : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Zero α
v : n → α
i : n
x : α
j : n
hji : j ≠ i
⊢ updateColumn (diagonal v) i (Pi.single i x) j j = Function.update v i x j

Next tactic:
rw [updateColumn_ne hji, diagonal_apply_eq, Function.update_noteq hji]
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) := by
  ext j k
  obtain rfl | hjk := eq_or_ne j k
  · rw [diagonal_apply_eq]
    obtain rfl | hji := eq_or_ne j i
    · rw [updateColumn_self, Pi.single_eq_same, Function.update_same]
    · rw [updateColumn_ne hji, diagonal_apply_eq, Function.update_noteq hji]
  · 

Proof state:
case a.h.inr
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j✝ : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Zero α
v : n → α
i : n
x : α
j k : n
hjk : j ≠ k
⊢ updateColumn (diagonal v) i (Pi.single i x) j k = diagonal (Function.update v i x) j k

Next tactic:
rw [diagonal_apply_ne _ hjk]
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) := by
  ext j k
  obtain rfl | hjk := eq_or_ne j k
  · rw [diagonal_apply_eq]
    obtain rfl | hji := eq_or_ne j i
    · rw [updateColumn_self, Pi.single_eq_same, Function.update_same]
    · rw [updateColumn_ne hji, diagonal_apply_eq, Function.update_noteq hji]
  · rw [diagonal_apply_ne _ hjk]
    

Proof state:
case a.h.inr
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j✝ : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Zero α
v : n → α
i : n
x : α
j k : n
hjk : j ≠ k
⊢ updateColumn (diagonal v) i (Pi.single i x) j k = 0

Next tactic:
obtain rfl | hki := eq_or_ne k i
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) := by
  ext j k
  obtain rfl | hjk := eq_or_ne j k
  · rw [diagonal_apply_eq]
    obtain rfl | hji := eq_or_ne j i
    · rw [updateColumn_self, Pi.single_eq_same, Function.update_same]
    · rw [updateColumn_ne hji, diagonal_apply_eq, Function.update_noteq hji]
  · rw [diagonal_apply_ne _ hjk]
    obtain rfl | hki := eq_or_ne k i
    · 

Proof state:
case a.h.inr.inl
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i : m
j✝ : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Zero α
v : n → α
x : α
j k : n
hjk : j ≠ k
⊢ updateColumn (diagonal v) k (Pi.single k x) j k = 0

Next tactic:
rw [updateColumn_self, Pi.single_eq_of_ne hjk]
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) := by
  ext j k
  obtain rfl | hjk := eq_or_ne j k
  · rw [diagonal_apply_eq]
    obtain rfl | hji := eq_or_ne j i
    · rw [updateColumn_self, Pi.single_eq_same, Function.update_same]
    · rw [updateColumn_ne hji, diagonal_apply_eq, Function.update_noteq hji]
  · rw [diagonal_apply_ne _ hjk]
    obtain rfl | hki := eq_or_ne k i
    · rw [updateColumn_self, Pi.single_eq_of_ne hjk]
    · 

Proof state:
case a.h.inr.inr
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j✝ : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Zero α
v : n → α
i : n
x : α
j k : n
hjk : j ≠ k
hki : k ≠ i
⊢ updateColumn (diagonal v) i (Pi.single i x) j k = 0

Next tactic:
rw [updateColumn_ne hki, diagonal_apply_ne _ hjk]
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) := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j : n
b : n → α
c : m → α
inst✝¹ : DecidableEq n
inst✝ : Zero α
v : n → α
i : n
x : α
⊢ updateRow (diagonal v) i (Pi.single i x) = diagonal (Function.update v i x)

Next tactic:
rw [← diagonal_transpose, updateRow_transpose, diagonal_updateColumn_single, diagonal_transpose]
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 := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j : n
b : n → α
c : m → α
inst✝¹ : DecidableEq l
inst✝ : DecidableEq m
A : Matrix m n α
i : l
r : o → α
e : l ≃ m
f : o ≃ n
⊢ updateRow (submatrix A ⇑e ⇑f) i r = submatrix (updateRow A (e i) fun j => r (f.symm j)) ⇑e ⇑f

Next tactic:
ext i' j
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 := by
  ext i' j
  

Proof state:
case a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
R : Type u_5
α : Type v
β : Type w
M : Matrix m n α
i✝ : m
j✝ : n
b : n → α
c : m → α
inst✝¹ : DecidableEq l
inst✝ : DecidableEq m
A : Matrix m n α
i : l
r : o → α
e : l ≃ m
f : o ≃ n
i' : l
j : o
⊢ updateRow (submatrix A ⇑e ⇑f) i r i' j = submatrix (updateRow A (e i) fun j => r (f.symm j)) (⇑e) (⇑f) i' j

Next tactic:
simp only [submatrix_apply, updateRow_apply, Equiv.apply_eq_iff_eq, Equiv.symm_apply_apply]