Theorem: Matrix.det_adjugate
File: Mathlib/LinearAlgebra/Matrix/Adjugate.lean

tactic: cases' (Fintype.card n).eq_zero_or_pos with h_card h_card
state_before: m : Type u
n : Type v
α : Type w
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
inst✝ : CommRing α
A : Matrix n n α
⊢ det (adjugate A) = det A ^ (Fintype.card n - 1)

tactic: replace h_card := tsub_add_cancel_of_le h_card.nat_succ_le
state_before: case inr
m : Type u
n : Type v
α : Type w
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
inst✝ : CommRing α
A : Matrix n n α
h_card : Fintype.card n > 0
⊢ det (adjugate A) = det A ^ (Fintype.card n - 1)

tactic: let A' := mvPolynomialX n n ℤ
state_before: case inr
m : Type u
n : Type v
α : Type w
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
inst✝ : CommRing α
A : Matrix n n α
h_card : Fintype.card n - Nat.succ 0 + Nat.succ 0 = Fintype.card n
⊢ det (adjugate A) = det A ^ (Fintype.card n - 1)

tactic: suffices A'.adjugate.det = A'.det ^ (Fintype.card n - 1) by
  rw [← mvPolynomialX_mapMatrix_aeval ℤ A, ← AlgHom.map_adjugate, ← AlgHom.map_det, ←
    AlgHom.map_det, ← AlgHom.map_pow, this]
state_before: case inr
m : Type u
n : Type v
α : Type w
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
inst✝ : CommRing α
A : Matrix n n α
h_card : Fintype.card n - Nat.succ 0 + Nat.succ 0 = Fintype.card n
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
⊢ det (adjugate A) = det A ^ (Fintype.card n - 1)

tactic: apply mul_left_cancel₀ (show A'.det ≠ 0 from det_mvPolynomialX_ne_zero n ℤ)
state_before: case inr
m : Type u
n : Type v
α : Type w
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
inst✝ : CommRing α
A : Matrix n n α
h_card : Fintype.card n - Nat.succ 0 + Nat.succ 0 = Fintype.card n
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
⊢ det (adjugate A') = det A' ^ (Fintype.card n - 1)

tactic: calc
  A'.det * A'.adjugate.det = (A' ⬝ adjugate A').det := (det_mul _ _).symm
  _ = A'.det ^ Fintype.card n := by rw [mul_adjugate, det_smul, det_one, mul_one]
  _ = A'.det * A'.det ^ (Fintype.card n - 1) := by rw [← pow_succ, h_card]
state_before: case inr
m : Type u
n : Type v
α : Type w
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
inst✝ : CommRing α
A : Matrix n n α
h_card : Fintype.card n - Nat.succ 0 + Nat.succ 0 = Fintype.card n
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
⊢ det A' * det (adjugate A') = det A' * det A' ^ (Fintype.card n - 1)

tactic: haveI : IsEmpty n := Fintype.card_eq_zero_iff.mp h_card
state_before: case inl
m : Type u
n : Type v
α : Type w
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
inst✝ : CommRing α
A : Matrix n n α
h_card : Fintype.card n = 0
⊢ det (adjugate A) = det A ^ (Fintype.card n - 1)

tactic: rw [h_card, Nat.zero_sub, pow_zero, adjugate_subsingleton, det_one]
state_before: case inl
m : Type u
n : Type v
α : Type w
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
inst✝ : CommRing α
A : Matrix n n α
h_card : Fintype.card n = 0
this : IsEmpty n
⊢ det (adjugate A) = det A ^ (Fintype.card n - 1)

tactic: rw [← mvPolynomialX_mapMatrix_aeval ℤ A, ← AlgHom.map_adjugate, ← AlgHom.map_det, ←
  AlgHom.map_det, ← AlgHom.map_pow, this]
state_before: m : Type u
n : Type v
α : Type w
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
inst✝ : CommRing α
A : Matrix n n α
h_card : Fintype.card n - Nat.succ 0 + Nat.succ 0 = Fintype.card n
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
this : det (adjugate A') = det A' ^ (Fintype.card n - 1)
⊢ det (adjugate A) = det A ^ (Fintype.card n - 1)

tactic: rw [mul_adjugate, det_smul, det_one, mul_one]
state_before: m : Type u
n : Type v
α : Type w
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
inst✝ : CommRing α
A : Matrix n n α
h_card : Fintype.card n - Nat.succ 0 + Nat.succ 0 = Fintype.card n
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
⊢ det (A' ⬝ adjugate A') = det A' ^ Fintype.card n

tactic: rw [← pow_succ, h_card]
state_before: m : Type u
n : Type v
α : Type w
inst✝⁴ : DecidableEq n
inst✝³ : Fintype n
inst✝² : DecidableEq m
inst✝¹ : Fintype m
inst✝ : CommRing α
A : Matrix n n α
h_card : Fintype.card n - Nat.succ 0 + Nat.succ 0 = Fintype.card n
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
⊢ det A' ^ Fintype.card n = det A' * det A' ^ (Fintype.card n - 1)