Theorem: Matrix.IsHermitian.cfcAux_apply
File: Mathlib/LinearAlgebra/Matrix/HermitianFunctionalCalculus.lean

Proof steps:
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
⊢ (fun g =>
        ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
          star ↑hA.eigenvectorUnitary)
      1 =
    1
state_after: no goals
tactic: simp [Pi.one_def (f := fun _ : n ↦ 𝕜)]
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
⊢ {
          toFun := fun g =>
            ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
              star ↑hA.eigenvectorUnitary,
          map_one' := ⋯ }.toFun
      (f * g) =
    {
            toFun := fun g =>
              ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                star ↑hA.eigenvectorUnitary,
            map_one' := ⋯ }.toFun
        f *
      {
            toFun := fun g =>
              ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                star ↑hA.eigenvectorUnitary,
            map_one' := ⋯ }.toFun
        g
state_after: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
this : ∀ {a b c d e f : Matrix n n 𝕜}, a * b * c * (d * e * f) = a * (b * (c * d) * e) * f
⊢ {
          toFun := fun g =>
            ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
              star ↑hA.eigenvectorUnitary,
          map_one' := ⋯ }.toFun
      (f * g) =
    {
            toFun := fun g =>
              ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                star ↑hA.eigenvectorUnitary,
            map_one' := ⋯ }.toFun
        f *
      {
            toFun := fun g =>
              ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                star ↑hA.eigenvectorUnitary,
            map_one' := ⋯ }.toFun
        g
tactic: have {a b c d e f : Matrix n n 𝕜} : (a * b * c) * (d * e * f) = a * (b * (c * d) * e) * f := by
      simp only [mul_assoc]
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
this : ∀ {a b c d e f : Matrix n n 𝕜}, a * b * c * (d * e * f) = a * (b * (c * d) * e) * f
⊢ {
          toFun := fun g =>
            ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
              star ↑hA.eigenvectorUnitary,
          map_one' := ⋯ }.toFun
      (f * g) =
    {
            toFun := fun g =>
              ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                star ↑hA.eigenvectorUnitary,
            map_one' := ⋯ }.toFun
        f *
      {
            toFun := fun g =>
              ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                star ↑hA.eigenvectorUnitary,
            map_one' := ⋯ }.toFun
        g
state_after: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
this : ∀ {a b c d e f : Matrix n n 𝕜}, a * b * c * (d * e * f) = a * (b * (c * d) * e) * f
⊢ ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ (⇑f * ⇑g) ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
      star ↑hA.eigenvectorUnitary =
    (↑hA.eigenvectorUnitary * diagonal fun i => ↑(f ⟨hA.eigenvalues i, ⋯⟩) * ↑(g ⟨hA.eigenvalues i, ⋯⟩)) *
      star ↑hA.eigenvectorUnitary
tactic: simp only [this, ContinuousMap.coe_mul, SetLike.coe_mem, unitary.star_mul_self_of_mem, mul_one,
      diagonal_mul_diagonal, Function.comp_apply]
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
this : ∀ {a b c d e f : Matrix n n 𝕜}, a * b * c * (d * e * f) = a * (b * (c * d) * e) * f
⊢ ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ (⇑f * ⇑g) ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
      star ↑hA.eigenvectorUnitary =
    (↑hA.eigenvectorUnitary * diagonal fun i => ↑(f ⟨hA.eigenvalues i, ⋯⟩) * ↑(g ⟨hA.eigenvalues i, ⋯⟩)) *
      star ↑hA.eigenvectorUnitary
state_after: case h.e'_5.h.e'_6.h.e'_5.h
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
this : ∀ {a b c d e f : Matrix n n 𝕜}, a * b * c * (d * e * f) = a * (b * (c * d) * e) * f
i : n
⊢ (RCLike.ofReal ∘ (⇑f * ⇑g) ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) i =
    ↑(f ⟨hA.eigenvalues i, ⋯⟩) * ↑(g ⟨hA.eigenvalues i, ⋯⟩)
tactic: congr! with i
state_before: case h.e'_5.h.e'_6.h.e'_5.h
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
this : ∀ {a b c d e f : Matrix n n 𝕜}, a * b * c * (d * e * f) = a * (b * (c * d) * e) * f
i : n
⊢ (RCLike.ofReal ∘ (⇑f * ⇑g) ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) i =
    ↑(f ⟨hA.eigenvalues i, ⋯⟩) * ↑(g ⟨hA.eigenvalues i, ⋯⟩)
state_after: no goals
tactic: simp
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
⊢ (↑{
            toFun := fun g =>
              ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                star ↑hA.eigenvectorUnitary,
            map_one' := ⋯, map_mul' := ⋯ }).toFun
      0 =
    0
state_after: no goals
tactic: simp [Pi.zero_def (f := fun _ : n ↦ 𝕜)]
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
⊢ (↑{
            toFun := fun g =>
              ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                star ↑hA.eigenvectorUnitary,
            map_one' := ⋯, map_mul' := ⋯ }).toFun
      (f + g) =
    (↑{
              toFun := fun g =>
                ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                  star ↑hA.eigenvectorUnitary,
              map_one' := ⋯, map_mul' := ⋯ }).toFun
        f +
      (↑{
              toFun := fun g =>
                ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                  star ↑hA.eigenvectorUnitary,
              map_one' := ⋯, map_mul' := ⋯ }).toFun
        g
state_after: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
⊢ ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ (⇑f + ⇑g) ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
      star ↑hA.eigenvectorUnitary =
    (↑hA.eigenvectorUnitary * diagonal fun i => ↑(f ⟨hA.eigenvalues i, ⋯⟩) + ↑(g ⟨hA.eigenvalues i, ⋯⟩)) *
      star ↑hA.eigenvectorUnitary
tactic: simp only [ContinuousMap.coe_add, ← add_mul, ← mul_add, diagonal_add, Function.comp_apply]
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
⊢ ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ (⇑f + ⇑g) ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
      star ↑hA.eigenvectorUnitary =
    (↑hA.eigenvectorUnitary * diagonal fun i => ↑(f ⟨hA.eigenvalues i, ⋯⟩) + ↑(g ⟨hA.eigenvalues i, ⋯⟩)) *
      star ↑hA.eigenvectorUnitary
state_after: case h.e'_5.h.e'_6.h.e'_5.h
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
i : n
⊢ (RCLike.ofReal ∘ (⇑f + ⇑g) ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) i =
    ↑(f ⟨hA.eigenvalues i, ⋯⟩) + ↑(g ⟨hA.eigenvalues i, ⋯⟩)
tactic: congr! with i
state_before: case h.e'_5.h.e'_6.h.e'_5.h
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f g : C(↑(spectrum ℝ A), ℝ)
i : n
⊢ (RCLike.ofReal ∘ (⇑f + ⇑g) ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) i =
    ↑(f ⟨hA.eigenvalues i, ⋯⟩) + ↑(g ⟨hA.eigenvalues i, ⋯⟩)
state_after: no goals
tactic: simp
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
r : ℝ
⊢ (↑↑{
              toFun := fun g =>
                ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                  star ↑hA.eigenvectorUnitary,
              map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }).toFun
      ((algebraMap ℝ C(↑(spectrum ℝ A), ℝ)) r) =
    (algebraMap ℝ (Matrix n n 𝕜)) r
state_after: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
r : ℝ
⊢ (↑hA.eigenvectorUnitary * diagonal fun x => ↑r) * star ↑hA.eigenvectorUnitary = (algebraMap ℝ (Matrix n n 𝕜)) r
tactic: simp only [Function.comp, algebraMap_apply, smul_eq_mul, mul_one]
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
r : ℝ
⊢ (↑hA.eigenvectorUnitary * diagonal fun x => ↑r) * star ↑hA.eigenvectorUnitary = (algebraMap ℝ (Matrix n n 𝕜)) r
state_after: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
r : ℝ
⊢ ↑hA.eigenvectorUnitary * ((diagonal fun x => ↑r) * star ↑hA.eigenvectorUnitary) =
    ↑hA.eigenvectorUnitary * ((algebraMap ℝ (Matrix n n 𝕜)) r * star ↑hA.eigenvectorUnitary)
tactic: rw [← mul_one (algebraMap _ _ _), ← unitary.coe_mul_star_self hA.eigenvectorUnitary,
      ← Algebra.left_comm, unitary.coe_star, mul_assoc]
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
r : ℝ
⊢ ↑hA.eigenvectorUnitary * ((diagonal fun x => ↑r) * star ↑hA.eigenvectorUnitary) =
    ↑hA.eigenvectorUnitary * ((algebraMap ℝ (Matrix n n 𝕜)) r * star ↑hA.eigenvectorUnitary)
state_after: no goals
tactic: congr!
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f : C(↑(spectrum ℝ A), ℝ)
⊢ (↑↑{
                toFun := fun g =>
                  ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                    star ↑hA.eigenvectorUnitary,
                map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯, commutes' := ⋯ }.toRingHom).toFun
      (star f) =
    star
      ((↑↑{
                  toFun := fun g =>
                    ↑hA.eigenvectorUnitary * diagonal (RCLike.ofReal ∘ ⇑g ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) *
                      star ↑hA.eigenvectorUnitary,
                  map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯, commutes' := ⋯ }.toRingHom).toFun
        f)
state_after: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f : C(↑(spectrum ℝ A), ℝ)
⊢ ↑hA.eigenvectorUnitary *
      (diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) * star ↑hA.eigenvectorUnitary) =
    ↑hA.eigenvectorUnitary *
      (diagonal (star (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩)) * star ↑hA.eigenvectorUnitary)
tactic: simp only [star_trivial, StarMul.star_mul, star_star, star_eq_conjTranspose (diagonal _),
      diagonal_conjTranspose, mul_assoc]
state_before: n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f : C(↑(spectrum ℝ A), ℝ)
⊢ ↑hA.eigenvectorUnitary *
      (diagonal (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) * star ↑hA.eigenvectorUnitary) =
    ↑hA.eigenvectorUnitary *
      (diagonal (star (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩)) * star ↑hA.eigenvectorUnitary)
state_after: case h.e'_6.h.e'_5.h.e'_5
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f : C(↑(spectrum ℝ A), ℝ)
⊢ (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = star (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩)
tactic: congr!
state_before: case h.e'_6.h.e'_5.h.e'_5
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f : C(↑(spectrum ℝ A), ℝ)
⊢ (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) = star (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩)
state_after: case h.e'_6.h.e'_5.h.e'_5.h
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f : C(↑(spectrum ℝ A), ℝ)
x✝ : n
⊢ (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) x✝ =
    star (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) x✝
tactic: ext
state_before: case h.e'_6.h.e'_5.h.e'_5.h
n : Type u_1
𝕜 : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n 𝕜
hA : A.IsHermitian
f : C(↑(spectrum ℝ A), ℝ)
x✝ : n
⊢ (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) x✝ =
    star (RCLike.ofReal ∘ ⇑f ∘ fun i => ⟨hA.eigenvalues i, ⋯⟩) x✝
state_after: no goals
tactic: simp