Theorem: Matrix.IsHermitian.exists_eigenvector_of_ne_zero
File: Mathlib/LinearAlgebra/Matrix/Spectrum.lean

tactic: classical
have : hA.eigenvalues ≠ 0 := by
  contrapose! h_ne
  have := hA.spectral_theorem
  rwa [h_ne, Pi.comp_zero, RCLike.ofReal_zero, (by rfl : Function.const n (0 : 𝕜) = fun _ ↦ 0),
    diagonal_zero, mul_zero, zero_mul] at this
obtain ⟨i, hi⟩ := Function.ne_iff.mp this
exact ⟨_, _, hi, hA.eigenvectorBasis.orthonormal.ne_zero i, hA.mulVec_eigenvectorBasis i⟩
state_before: 𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : A ≠ 0
⊢ ∃ v t, t ≠ 0 ∧ v ≠ 0 ∧ A *ᵥ v = t • v
state_after: no goals

tactic: have : hA.eigenvalues ≠ 0 := by
  contrapose! h_ne
  have := hA.spectral_theorem
  rwa [h_ne, Pi.comp_zero, RCLike.ofReal_zero, (by rfl : Function.const n (0 : 𝕜) = fun _ ↦ 0),
    diagonal_zero, mul_zero, zero_mul] at this
state_before: 𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : A ≠ 0
⊢ ∃ v t, t ≠ 0 ∧ v ≠ 0 ∧ A *ᵥ v = t • v
state_after: 𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : A ≠ 0
this : hA.eigenvalues ≠ 0
⊢ ∃ v t, t ≠ 0 ∧ v ≠ 0 ∧ A *ᵥ v = t • v

tactic: obtain ⟨i, hi⟩ := Function.ne_iff.mp this
state_before: 𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : A ≠ 0
this : hA.eigenvalues ≠ 0
⊢ ∃ v t, t ≠ 0 ∧ v ≠ 0 ∧ A *ᵥ v = t • v
state_after: case intro
𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : A ≠ 0
this : hA.eigenvalues ≠ 0
i : n
hi : hA.eigenvalues i ≠ 0 i
⊢ ∃ v t, t ≠ 0 ∧ v ≠ 0 ∧ A *ᵥ v = t • v

tactic: exact ⟨_, _, hi, hA.eigenvectorBasis.orthonormal.ne_zero i, hA.mulVec_eigenvectorBasis i⟩
state_before: case intro
𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : A ≠ 0
this : hA.eigenvalues ≠ 0
i : n
hi : hA.eigenvalues i ≠ 0 i
⊢ ∃ v t, t ≠ 0 ∧ v ≠ 0 ∧ A *ᵥ v = t • v
state_after: no goals

tactic: contrapose! h_ne
state_before: 𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : A ≠ 0
⊢ hA.eigenvalues ≠ 0
state_after: 𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : hA.eigenvalues = 0
⊢ A = 0

tactic: have := hA.spectral_theorem
state_before: 𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : hA.eigenvalues = 0
⊢ A = 0
state_after: 𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : hA.eigenvalues = 0
this : A = ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ hA.eigenvalues) * star ↑hA.eigenvectorUnitary
⊢ A = 0

tactic: rwa [h_ne, Pi.comp_zero, RCLike.ofReal_zero, (by rfl : Function.const n (0 : 𝕜) = fun _ ↦ 0),
  diagonal_zero, mul_zero, zero_mul] at this
state_before: 𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : hA.eigenvalues = 0
this : A = ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ hA.eigenvalues) * star ↑hA.eigenvectorUnitary
⊢ A = 0
state_after: no goals

tactic: rfl
state_before: 𝕜 : Type u_1
inst✝¹ : RCLike 𝕜
n : Type u_2
inst✝ : Fintype n
A : Matrix n n 𝕜
hA : A.IsHermitian
h_ne : hA.eigenvalues = 0
this : A = ↑hA.eigenvectorUnitary * diagonal (Function.const n 0) * star ↑hA.eigenvectorUnitary
⊢ Function.const n 0 = fun x => 0
state_after: no goals