AFTD Auto-Formalizing Theoretical Domains

Matrix.IsHermitian.cfc_eigenvalues

theoremverifiedformalizationimported Lean

Matrix.IsHermitian.cfc_eigenvalues

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open Matrix in
open BigOperators in
variable {n π•œ : Type*} in
variable [RCLike π•œ] [DecidableEq n] in
open scoped ComplexOrder MatrixOrder in
open ComplexOrder in
variable {d π•œ : Type*} [Fintype d] [DecidableEq d] [RCLike π•œ] in
theorem Matrix.IsHermitian.cfc_eigenvalues {M : Matrix d d π•œ} (hM : M.IsHermitian) (f : ℝ β†’ ℝ) :
    βˆƒ (e : d ≃ d), Matrix.IsHermitian.eigenvalues (cfc_predicate f M) = f ∘ hM.eigenvalues ∘ e
Formalizes
QuantumInfo, `Matrix.IsHermitian.cfc_eigenvalues`
Lean proof
By Alex Meiburg, from github.com/leanprover-community/physlib at e411c6e89692 (Copyright (c) 2025 Alex Meiburg. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.34.1.
Verified
17 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • Multiset.map_univ_eq_iffIf two functions from finite types have the same multiset of values, there exists a bijection between the domains that commutes with the…

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open Matrix in
open BigOperators in
variable {n π•œ : Type*} in
variable [RCLike π•œ] [DecidableEq n] in
open scoped ComplexOrder MatrixOrder in
open ComplexOrder in
variable {d π•œ : Type*} [Fintype d] [DecidableEq d] [RCLike π•œ] in
theorem Matrix.IsHermitian.cfc_eigenvalues {M : Matrix d d π•œ} (hM : M.IsHermitian) (f : ℝ β†’ ℝ) :
    βˆƒ (e : d ≃ d), Matrix.IsHermitian.eigenvalues (cfc_predicate f M) = f ∘ hM.eigenvalues ∘ e := by
  have h_eigenvalues : Multiset.map hM.eigenvalues Finset.univ.val = Multiset.map (fun i => hM.eigenvalues i) Finset.univ.val := by
    rfl
  generalize_proofs at *;
  have h_eigenvalues_cfc : (IsHermitian.cfc hM f).charpoly.roots = Multiset.map (fun i => (f (hM.eigenvalues i) : π•œ)) Finset.univ.val := by
    rw [ Matrix.IsHermitian.cfc, Matrix.charpoly ];
    -- Since $U$ is unitary, we have $U^* U = I$, and thus the characteristic polynomial of $U D U^*$ is the same as the characteristic polynomial of $D$.
    have h_charpoly : Matrix.det ((hM.eigenvectorUnitary : Matrix d d π•œ) * Matrix.diagonal (RCLike.ofReal ∘ f ∘ hM.eigenvalues) * Star.star (hM.eigenvectorUnitary : Matrix d d π•œ)).charmatrix = Matrix.det (Matrix.diagonal (RCLike.ofReal ∘ f ∘ hM.eigenvalues)).charmatrix := by
      -- Since $U$ is unitary, we have $U^* U = I$, and thus the characteristic polynomial of $U D U^*$ is the same as the characteristic polynomial of $D$ by the properties of determinants.
      have h_char_poly : βˆ€ (t : π•œ), Matrix.det (t β€’ 1 - (hM.eigenvectorUnitary : Matrix d d π•œ) * Matrix.diagonal (RCLike.ofReal ∘ f ∘ hM.eigenvalues) * star (hM.eigenvectorUnitary : Matrix d d π•œ)) = Matrix.det (t β€’ 1 - Matrix.diagonal (RCLike.ofReal ∘ f ∘ hM.eigenvalues)) := by
        intro t;
        -- Since $U$ is unitary, we have $U^* U = I$, and thus the determinant of $tI - UDU^*$ is the same as the determinant of $tI - D$.
        have h_det : Matrix.det (t β€’ 1 - (hM.eigenvectorUnitary : Matrix d d π•œ) * Matrix.diagonal (RCLike.ofReal ∘ f ∘ hM.eigenvalues) * star (hM.eigenvectorUnitary : Matrix d d π•œ)) = Matrix.det ((hM.eigenvectorUnitary : Matrix d d π•œ) * (t β€’ 1 - Matrix.diagonal (RCLike.ofReal ∘ f ∘ hM.eigenvalues)) * star (hM.eigenvectorUnitary : Matrix d d π•œ)) := by
          simp [ mul_sub, sub_mul, mul_assoc ];
        rw [ h_det, Matrix.det_mul, Matrix.det_mul ];
        rw [ mul_right_comm, ← Matrix.det_mul, mul_comm ];
        norm_num +zetaDelta at *;
      refine' Polynomial.funext fun t => _;
      convert h_char_poly t using 1;
      Β· simp [ Matrix.det_apply', Polynomial.eval_finsetSum ];
        simp [ Matrix.one_apply, Polynomial.eval_prod ];
        congr! 3;
        aesop;
      Β· simp [ Matrix.det_apply', Polynomial.eval_finsetSum ];
        simp [ Matrix.one_apply, Polynomial.eval_prod ];
        exact Finset.sum_congr rfl fun _ _ => by congr; ext; aesop;
    simp_all [ Matrix.charmatrix, Matrix.det_diagonal ];
    rw [ Polynomial.roots_prod ];
    Β· bound;
    Β· exact Finset.prod_ne_zero_iff.mpr fun i _ => Polynomial.X_sub_C_ne_zero _;
  have := Matrix.IsHermitian.roots_charpoly_eq_eigenvalues (cfc_predicate f M);
  rw [← Matrix.IsHermitian.cfc_eq] at h_eigenvalues_cfc
  rw [ h_eigenvalues_cfc ] at this;
  simp [ Function.comp ] at this;
  rw [ Multiset.map_univ_eq_iff ] at this;
  obtain ⟨ e, he ⟩ := this;
  use e.symm
  ext x
  have := congr_fun he ( e.symm x );
  simp_all only [Function.comp_apply, Equiv.apply_symm_apply, algebraMap.coe_inj]
See it in the graphDiscuss this resultChallenge it