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

tactic: cases' h_card : Fintype.card n with n'
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 : Fintype.card n ≠ 1
⊢ adjugate (adjugate A) = det A ^ (Fintype.card n - 2) • A

tactic: cases n'
state_before: case succ
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 : Fintype.card n ≠ 1
n' : ℕ
h_card : Fintype.card n = Nat.succ n'
⊢ adjugate (adjugate A) = det A ^ (Nat.succ n' - 2) • A

tactic: rw [← h_card]
state_before: case succ.succ
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 : Fintype.card n ≠ 1
n✝ : ℕ
h_card : Fintype.card n = Nat.succ (Nat.succ n✝)
⊢ adjugate (adjugate A) = det A ^ (Nat.succ (Nat.succ n✝) - 2) • A

tactic: let A' := mvPolynomialX n n ℤ
state_before: case succ.succ
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 : Fintype.card n ≠ 1
n✝ : ℕ
h_card : Fintype.card n = Nat.succ (Nat.succ n✝)
⊢ adjugate (adjugate A) = det A ^ (Fintype.card n - 2) • A

tactic: suffices adjugate (adjugate A') = det A' ^ (Fintype.card n - 2) • A' by
  rw [← mvPolynomialX_mapMatrix_aeval ℤ A, ← AlgHom.map_adjugate, ← AlgHom.map_adjugate, this,
    ← AlgHom.map_det, ← AlgHom.map_pow, AlgHom.mapMatrix_apply, AlgHom.mapMatrix_apply,
    Matrix.map_smul' _ _ _ (_root_.map_mul _)]
state_before: case succ.succ
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 : Fintype.card n ≠ 1
n✝ : ℕ
h_card : Fintype.card n = Nat.succ (Nat.succ n✝)
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
⊢ adjugate (adjugate A) = det A ^ (Fintype.card n - 2) • A

tactic: have h_card' : Fintype.card n - 2 + 1 = Fintype.card n - 1 := by simp [h_card]
state_before: case succ.succ
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 : Fintype.card n ≠ 1
n✝ : ℕ
h_card : Fintype.card n = Nat.succ (Nat.succ n✝)
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
⊢ adjugate (adjugate A') = det A' ^ (Fintype.card n - 2) • A'

tactic: have is_reg : IsSMulRegular (MvPolynomial (n × n) ℤ) (det A') := fun x y =>
  mul_left_cancel₀ (det_mvPolynomialX_ne_zero n ℤ)
state_before: case succ.succ
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 : Fintype.card n ≠ 1
n✝ : ℕ
h_card : Fintype.card n = Nat.succ (Nat.succ n✝)
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
h_card' : Fintype.card n - 2 + 1 = Fintype.card n - 1
⊢ adjugate (adjugate A') = det A' ^ (Fintype.card n - 2) • A'

tactic: apply is_reg.matrix
state_before: case succ.succ
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 : Fintype.card n ≠ 1
n✝ : ℕ
h_card : Fintype.card n = Nat.succ (Nat.succ n✝)
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
h_card' : Fintype.card n - 2 + 1 = Fintype.card n - 1
is_reg : IsSMulRegular (MvPolynomial (n × n) ℤ) (det A')
⊢ adjugate (adjugate A') = det A' ^ (Fintype.card n - 2) • A'

tactic: simp only
state_before: case succ.succ.a
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 : Fintype.card n ≠ 1
n✝ : ℕ
h_card : Fintype.card n = Nat.succ (Nat.succ n✝)
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
h_card' : Fintype.card n - 2 + 1 = Fintype.card n - 1
is_reg : IsSMulRegular (MvPolynomial (n × n) ℤ) (det A')
⊢ (fun x => det A' • x) (adjugate (adjugate A')) = (fun x => det A' • x) (det A' ^ (Fintype.card n - 2) • A')

tactic: rw [smul_smul, ← pow_succ, h_card', det_smul_adjugate_adjugate]
state_before: case succ.succ.a
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 : Fintype.card n ≠ 1
n✝ : ℕ
h_card : Fintype.card n = Nat.succ (Nat.succ n✝)
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
h_card' : Fintype.card n - 2 + 1 = Fintype.card n - 1
is_reg : IsSMulRegular (MvPolynomial (n × n) ℤ) (det A')
⊢ det (mvPolynomialX n n ℤ) • adjugate (adjugate (mvPolynomialX n n ℤ)) =
    det (mvPolynomialX n n ℤ) • det (mvPolynomialX n n ℤ) ^ (Fintype.card n - 2) • mvPolynomialX n n ℤ

tactic: haveI : IsEmpty n := Fintype.card_eq_zero_iff.mp h_card
state_before: case zero
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 : Fintype.card n ≠ 1
h_card : Fintype.card n = Nat.zero
⊢ adjugate (adjugate A) = det A ^ (Nat.zero - 2) • A

tactic: apply Subsingleton.elim
state_before: case zero
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 : Fintype.card n ≠ 1
h_card : Fintype.card n = Nat.zero
this : IsEmpty n
⊢ adjugate (adjugate A) = det A ^ (Nat.zero - 2) • A

tactic: exact (h h_card).elim
state_before: case succ.zero
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 : Fintype.card n ≠ 1
h_card : Fintype.card n = Nat.succ Nat.zero
⊢ adjugate (adjugate A) = det A ^ (Nat.succ Nat.zero - 2) • A

tactic: rw [← mvPolynomialX_mapMatrix_aeval ℤ A, ← AlgHom.map_adjugate, ← AlgHom.map_adjugate, this,
  ← AlgHom.map_det, ← AlgHom.map_pow, AlgHom.mapMatrix_apply, AlgHom.mapMatrix_apply,
  Matrix.map_smul' _ _ _ (_root_.map_mul _)]
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 : Fintype.card n ≠ 1
n✝ : ℕ
h_card : Fintype.card n = Nat.succ (Nat.succ n✝)
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
this : adjugate (adjugate A') = det A' ^ (Fintype.card n - 2) • A'
⊢ adjugate (adjugate A) = det A ^ (Fintype.card n - 2) • A

tactic: simp [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 : Fintype.card n ≠ 1
n✝ : ℕ
h_card : Fintype.card n = Nat.succ (Nat.succ n✝)
A' : Matrix n n (MvPolynomial (n × n) ℤ) := mvPolynomialX n n ℤ
⊢ Fintype.card n - 2 + 1 = Fintype.card n - 1