Theorem: Matrix.diagonal_transvection_induction_of_det_ne_zero
File: Mathlib/LinearAlgebra/Matrix/Transvection.lean

tactic: let Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
state_before: n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
⊢ P M

tactic: exact this.2
state_before: n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
this : Q M
⊢ P M

tactic: apply diagonal_transvection_induction Q M
state_before: n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
⊢ Q M

tactic: intro D hD
state_before: case hdiag
n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
⊢ ∀ (D : n → 𝕜), det (diagonal D) = det M → Q (diagonal D)

tactic: have detD : det (diagonal D) ≠ 0 := by
  rw [hD]
  exact hMdet
state_before: case hdiag
n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
D : n → 𝕜
hD : det (diagonal D) = det M
⊢ Q (diagonal D)

tactic: exact ⟨detD, hdiag _ detD⟩
state_before: case hdiag
n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
D : n → 𝕜
hD : det (diagonal D) = det M
detD : det (diagonal D) ≠ 0
⊢ Q (diagonal D)

tactic: rw [hD]
state_before: n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
D : n → 𝕜
hD : det (diagonal D) = det M
⊢ det (diagonal D) ≠ 0

tactic: exact hMdet
state_before: n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
D : n → 𝕜
hD : det (diagonal D) = det M
⊢ det M ≠ 0

tactic: intro t
state_before: case htransvec
n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
⊢ ∀ (t : TransvectionStruct n 𝕜), Q (toMatrix t)

tactic: exact ⟨by simp, htransvec t⟩
state_before: case htransvec
n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
t : TransvectionStruct n 𝕜
⊢ Q (toMatrix t)

tactic: simp
state_before: n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
t : TransvectionStruct n 𝕜
⊢ det (toMatrix t) ≠ 0

tactic: intro A B QA QB
state_before: case hmul
n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
⊢ ∀ (A B : Matrix n n 𝕜), Q A → Q B → Q (A ⬝ B)

tactic: exact ⟨by simp [QA.1, QB.1], hmul A B QA.1 QB.1 QA.2 QB.2⟩
state_before: case hmul
n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
A B : Matrix n n 𝕜
QA : Q A
QB : Q B
⊢ Q (A ⬝ B)

tactic: simp [QA.1, QB.1]
state_before: n : Type u_1
p : Type ?u.340683
R : Type u₂
𝕜 : Type u_2
inst✝⁴ : Field 𝕜
inst✝³ : DecidableEq n
inst✝² : DecidableEq p
inst✝¹ : CommRing R
inst✝ : Fintype n
P : Matrix n n 𝕜 → Prop
M : Matrix n n 𝕜
hMdet : det M ≠ 0
hdiag : ∀ (D : n → 𝕜), det (diagonal D) ≠ 0 → P (diagonal D)
htransvec : ∀ (t : TransvectionStruct n 𝕜), P (toMatrix t)
hmul : ∀ (A B : Matrix n n 𝕜), det A ≠ 0 → det B ≠ 0 → P A → P B → P (A ⬝ B)
Q : Matrix n n 𝕜 → Prop := fun N => det N ≠ 0 ∧ P N
A B : Matrix n n 𝕜
QA : Q A
QB : Q B
⊢ det (A ⬝ B) ≠ 0