Eigenvalues of Hermitian matrices
Library · Source module
Eigenvalues of Hermitian matrices
NLAlib.eigenvalue A k is \lambda_k(\mathbf{A}), the k-th largest eigenvalue of a Hermitian matrix \mathbf{A}, counted with multiplicity and indexed from 0. It is a total function of the matrix and a natural number: it is 0 when k is at least the size of \mathbf{A}, and 0 when \mathbf{A} is not Hermitian. The values are sorted in non-increasing order on the valid range k < \lvert n \rvert.
This is the library's spelling of an eigenvalue. Mathlib's Matrix.IsHermitian.eigenvalues₀ (sorted, indexed by Fin (Fintype.card n), taking the proof of Hermitian-ness as an argument) is the definition underneath, and Matrix.IsHermitian.eigenvalue_eq_eigenvalues₀ is the bridge. Mathlib's Matrix.IsHermitian.eigenvalues is a different function: unsorted and indexed by n.
The largest eigenvalue is \lambda_0(\mathbf{A}), eigenvalue A 0. Statements never mention a chosen eigenvector basis: a diagonalisation is an equation \mathbf{A}\mathbf{U} = \mathbf{U} \operatorname{diag}(\mathbf{d}) with HasOrthonormalCols U.
Reading and writing statements about eigenvalue A k
eigenvalue is a total function: it returns a number for every matrix and every natural number, including inputs for which "the k-th eigenvalue" does not exist. There the value is 0, a junk value, in the way that 1 / 0 = 0 and A⁻¹ = 0 for a singular A are in Mathlib. This cannot make a false theorem provable, because Lean checks every proof against this definition. What it does mean is that a statement is also a statement about the junk values, so the range of the index has to be read, and written, with care.
The example to remember. ∃ k, -3 < eigenvalue A k does not say that \mathbf{A} has an eigenvalue above -3. It holds for every matrix: take k \ge \lvert n \rvert, where the value is 0. The statement that was meant is ∃ k < Fintype.card n, -3 < eigenvalue A k.
* An index quantified by ∃ needs k < Fintype.card n, or the witness can be out of range. * An index quantified by ∀ in a hypothesis needs it too. ∀ k, 0 < eigenvalue A k is never satisfied, since the value is 0 out of range, so a theorem that assumes it says nothing. * An index quantified by ∀ in a conclusion, or left free, makes a claim about the padding too. That is fine when the claim is true of 0, and such statements are left unbounded on purpose. Compare Matrix.IsHermitian.posSemidef_iff_eigenvalue_nonneg, A.PosSemidef ↔ ∀ k, 0 ≤ eigenvalue A k, with Matrix.IsHermitian.posDef_iff_eigenvalue_pos, A.PosDef ↔ ∀ k < Fintype.card n, 0 < eigenvalue A k: the strict one must carry the bound. * The same applies to a matrix that is not Hermitian, for which eigenvalue A k = 0 for every k. Theorems carry A.IsHermitian where the value matters. Identities such as NLAlib.eigenvalue_neg hold for every matrix, because both sides are junk together.
NLAlib.singularValues is padded in the same way and is read by the same rules. The reasons for this design, and what Mathlib does, are in docs/design/Mathlib-deviations.md, entry 1.
Main definitions
* NLAlib.eigenvalue: the sorted, zero-padded eigenvalues of a Hermitian matrix.
Main results
* Matrix.IsHermitian.eigenvalue_eq_eigenvalues₀: the bridge to Mathlib. * Matrix.IsHermitian.eigenvalue_le_eigenvalue: the values are non-increasing. * Matrix.IsHermitian.exists_mul_eq_mul_diagonal: a unitary diagonalisation with the eigenvalues in order. * Matrix.IsHermitian.exists_hasOrthonormalCols_eq_mul_diagonal_mul_conjTranspose: a unitary diagonalisation indexed by the index type of the matrix. * NLAlib.HasOrthonormalCols.eigenvalue_eq_of_eq_mul_diagonal_mul_conjTranspose: the eigenvalues are determined by any sorted unitary diagonalisation. * Matrix.IsHermitian.exists_norm_eq_one_and_mulVec_eq: a unit eigenvector for each eigenvalue.
Declarations
- Matrix.IsHermitian.antitone_eigenvalue_coe
- Matrix.IsHermitian.eigenvalue_eq_eigenvalues₀
- Matrix.IsHermitian.eigenvalue_le_eigenvalue
- Matrix.IsHermitian.eigenvalue_mem_spectrum
- Matrix.IsHermitian.exists_eigenvalue_eq_of_mulVec_eq_smul
- Matrix.IsHermitian.exists_eq_mul_diagonal_mul_conjTranspose
- Matrix.IsHermitian.exists_equiv_eigenvalue_eq
- Matrix.IsHermitian.exists_hasOrthonormalCols_eq_mul_diagonal_mul_conjTranspose
- Matrix.IsHermitian.exists_mul_eq_mul_diagonal
- Matrix.IsHermitian.exists_norm_eq_one_and_mulVec_eq
- Matrix.IsHermitian.hasOrthonormalCols_eigenvectorUnitary
- Matrix.IsHermitian.spectrum_eq_image_eigenvalue
- NLAlib.HasOrthonormalCols.eigenvalue_eq_of_eq_mul_diagonal_mul_conjTranspose
- NLAlib.HasOrthonormalCols.exists_equiv_eq_eigenvalue_of_eq_mul_diagonal_mul_conjTranspose
- NLAlib.eigenvalue
- NLAlib.eigenvalue_of_card_le
- NLAlib.eigenvalue_of_not_isHermitian