Theorem: Matrix.det_succ_row
File: Mathlib/LinearAlgebra/Matrix/Determinant.lean

tactic: simp_rw [pow_add, mul_assoc, ← mul_sum]
state_before: m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
⊢ det A = ∑ j : Fin (Nat.succ n), (-1) ^ (↑i + ↑j) * A i j * det (submatrix A ↑(Fin.succAbove i) ↑(Fin.succAbove j))

tactic: have : det A = (-1 : R) ^ (i : ℕ) * (Perm.sign i.cycleRange⁻¹) * det A := by
  calc
    det A = ↑((-1 : ℤˣ) ^ (i : ℕ) * (-1 : ℤˣ) ^ (i : ℕ) : ℤˣ) * det A := by simp
    _ = (-1 : R) ^ (i : ℕ) * (Perm.sign i.cycleRange⁻¹) * det A := by simp [-Int.units_mul_self]
state_before: m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
⊢ det A =
    (-1) ^ ↑i * ∑ x : Fin (Nat.succ n), (-1) ^ ↑x * (A i x * det (submatrix A ↑(Fin.succAbove i) ↑(Fin.succAbove x)))

tactic: rw [this, mul_assoc]
state_before: m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
this : det A = (-1) ^ ↑i * ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A
⊢ det A =
    (-1) ^ ↑i * ∑ x : Fin (Nat.succ n), (-1) ^ ↑x * (A i x * det (submatrix A ↑(Fin.succAbove i) ↑(Fin.succAbove x)))

tactic: congr
state_before: m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
this : det A = (-1) ^ ↑i * ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A
⊢ (-1) ^ ↑i * (↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A) =
    (-1) ^ ↑i * ∑ x : Fin (Nat.succ n), (-1) ^ ↑x * (A i x * det (submatrix A ↑(Fin.succAbove i) ↑(Fin.succAbove x)))

tactic: rw [← det_permute, det_succ_row_zero]
state_before: case e_a
m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
this : det A = (-1) ^ ↑i * ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A
⊢ ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A =
    ∑ x : Fin (Nat.succ n), (-1) ^ ↑x * (A i x * det (submatrix A ↑(Fin.succAbove i) ↑(Fin.succAbove x)))

tactic: refine' Finset.sum_congr rfl fun j _ => _
state_before: case e_a
m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
this : det A = (-1) ^ ↑i * ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A
⊢ ∑ j : Fin (Nat.succ n),
      (-1) ^ ↑j * A (↑(Fin.cycleRange i)⁻¹ 0) j *
        det (submatrix (fun i_1 => A (↑(Fin.cycleRange i)⁻¹ i_1)) Fin.succ ↑(Fin.succAbove j)) =
    ∑ x : Fin (Nat.succ n), (-1) ^ ↑x * (A i x * det (submatrix A ↑(Fin.succAbove i) ↑(Fin.succAbove x)))

tactic: rw [mul_assoc, Matrix.submatrix, Matrix.submatrix]
state_before: case e_a
m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
this : det A = (-1) ^ ↑i * ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A
j : Fin (Nat.succ n)
x✝ : j ∈ univ
⊢ (-1) ^ ↑j * A (↑(Fin.cycleRange i)⁻¹ 0) j *
      det (submatrix (fun i_1 => A (↑(Fin.cycleRange i)⁻¹ i_1)) Fin.succ ↑(Fin.succAbove j)) =
    (-1) ^ ↑j * (A i j * det (submatrix A ↑(Fin.succAbove i) ↑(Fin.succAbove j)))

tactic: congr
state_before: case e_a
m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
this : det A = (-1) ^ ↑i * ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A
j : Fin (Nat.succ n)
x✝ : j ∈ univ
⊢ (-1) ^ ↑j *
      (A (↑(Fin.cycleRange i)⁻¹ 0) j *
        det (↑of fun i_1 j_1 => A (↑(Fin.cycleRange i)⁻¹ (Fin.succ i_1)) (↑(Fin.succAbove j) j_1))) =
    (-1) ^ ↑j * (A i j * det (↑of fun i_1 j_1 => A (↑(Fin.succAbove i) i_1) (↑(Fin.succAbove j) j_1)))

tactic: calc
  det A = ↑((-1 : ℤˣ) ^ (i : ℕ) * (-1 : ℤˣ) ^ (i : ℕ) : ℤˣ) * det A := by simp
  _ = (-1 : R) ^ (i : ℕ) * (Perm.sign i.cycleRange⁻¹) * det A := by simp [-Int.units_mul_self]
state_before: m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
⊢ det A = (-1) ^ ↑i * ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A

tactic: simp
state_before: m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
⊢ det A = ↑↑((-1) ^ ↑i * (-1) ^ ↑i) * det A

tactic: simp [-Int.units_mul_self]
state_before: m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
⊢ ↑↑((-1) ^ ↑i * (-1) ^ ↑i) * det A = (-1) ^ ↑i * ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A

tactic: rw [Equiv.Perm.inv_def, Fin.cycleRange_symm_zero]
state_before: case e_a.e_a.e_a.e_a
m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
this : det A = (-1) ^ ↑i * ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A
j : Fin (Nat.succ n)
x✝ : j ∈ univ
⊢ ↑(Fin.cycleRange i)⁻¹ 0 = i

tactic: ext (i' j')
state_before: case e_a.e_a.e_a.e_M.h.e_6.h
m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
this : det A = (-1) ^ ↑i * ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A
j : Fin (Nat.succ n)
x✝ : j ∈ univ
⊢ (fun i_1 j_1 => A (↑(Fin.cycleRange i)⁻¹ (Fin.succ i_1)) (↑(Fin.succAbove j) j_1)) = fun i_1 j_1 =>
    A (↑(Fin.succAbove i) i_1) (↑(Fin.succAbove j) j_1)

tactic: rw [Equiv.Perm.inv_def, Fin.cycleRange_symm_succ]
state_before: case e_a.e_a.e_a.e_M.h.e_6.h.h.h
m : Type ?u.2198697
n✝ : Type ?u.2198700
inst✝⁴ : DecidableEq n✝
inst✝³ : Fintype n✝
inst✝² : DecidableEq m
inst✝¹ : Fintype m
R : Type v
inst✝ : CommRing R
n : ℕ
A : Matrix (Fin (Nat.succ n)) (Fin (Nat.succ n)) R
i : Fin (Nat.succ n)
this : det A = (-1) ^ ↑i * ↑↑(↑sign (Fin.cycleRange i)⁻¹) * det A
j : Fin (Nat.succ n)
x✝ : j ∈ univ
i' j' : Fin n
⊢ A (↑(Fin.cycleRange i)⁻¹ (Fin.succ i')) (↑(Fin.succAbove j) j') = A (↑(Fin.succAbove i) i') (↑(Fin.succAbove j) j')