-- Mathlib/LinearAlgebra/Matrix/HermitianFunctionalCalculus.lean
lemma isClosedEmbedding_cfcAux : IsClosedEmbedding hA.cfcAux

Proof state:
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf :
  ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
        star ↑hA.eigenvectorUnitary *
      ↑hA.eigenvectorUnitary =
    0 * ↑hA.eigenvectorUnitary
⊢ diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0

Tactic:
simp only [mul_assoc, SetLike.coe_mem, unitary.star_mul_self_of_mem, mul_one, zero_mul] at hf

Result:
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0
⊢ diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0

Proof state:
case h.mk
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
h2 : diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0
x : ℝ
hx : x ∈ spectrum ℝ A
⊢ f ⟨x, hx⟩ = 0

Tactic:
obtain ⟨i, rfl⟩ := hA.eigenvalues_eq_spectrum_real ▸ hx

Result:
case h.mk.intro
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
h2 : diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0
i : n
hx : hA.eigenvalues i ∈ spectrum ℝ A
⊢ f ⟨hA.eigenvalues i, hx⟩ = 0

Proof state:
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0
⊢ diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0

Tactic:
simpa [← mul_assoc] using congr((star hA.eigenvectorUnitary : Matrix n n 𝕜) * $(hf))

Result:
no goals

Proof state:
case h
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
h2 : diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0
x : ↑(spectrum ℝ A)
⊢ f x = 0

Tactic:
obtain ⟨x, hx⟩ := x

Result:
case h.mk
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
h2 : diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0
x : ℝ
hx : x ∈ spectrum ℝ A
⊢ f ⟨x, hx⟩ = 0

Proof state:
case h
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
h2 : diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0
x : ↑(spectrum ℝ A)
⊢ f x = 0 x

Tactic:
simp only [ContinuousMap.zero_apply]

Result:
case h
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
h2 : diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0
x : ↑(spectrum ℝ A)
⊢ f x = 0

Proof state:
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf :
  ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
      star ↑hA.eigenvectorUnitary =
    0
⊢ diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0

Tactic:
replace hf := congr($(hf) * (eigenvectorUnitary hA : Matrix n n 𝕜))

Result:
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf :
  ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
        star ↑hA.eigenvectorUnitary *
      ↑hA.eigenvectorUnitary =
    0 * ↑hA.eigenvectorUnitary
⊢ diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0

Proof state:
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
⊢ diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0

Tactic:
simp only [LinearMap.coe_coe, cfcAux_apply] at hf

Result:
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf :
  ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
      star ↑hA.eigenvectorUnitary =
    0
⊢ diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0

Proof state:
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
h2 : diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0
⊢ f = 0

Tactic:
ext x

Result:
case h
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
h2 : diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0
x : ↑(spectrum ℝ A)
⊢ f x = 0 x

Proof state:
case h.mk.intro
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
h2 : diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = 0
i : n
hx : hA.eigenvalues i ∈ spectrum ℝ A
⊢ f ⟨hA.eigenvalues i, hx⟩ = 0

Tactic:
rw [← diagonal_zero] at h2

Result:
case h.mk.intro
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
h2 : diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = diagonal fun x => 0
i : n
hx : hA.eigenvalues i ∈ spectrum ℝ A
⊢ f ⟨hA.eigenvalues i, hx⟩ = 0

Proof state:
case h.mk.intro
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
h0 : FiniteDimensional ℝ C(↑(spectrum ℝ A), ℝ)
f : C(↑(spectrum ℝ A), ℝ)
hf : ↑hA.cfcAux f = 0
h2 : diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = diagonal fun x => 0
i : n
hx : hA.eigenvalues i ∈ spectrum ℝ A
this : ∀ (i : n), (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) i = 0
⊢ f ⟨hA.eigenvalues i, hx⟩ = 0

Tactic:
refine RCLike.ofReal_eq_zero.mp (this i)

Result:
no goals