Zulip Chat Archive

Stream: mathlib4

Topic: Eigenvalues/eigenvectors for Matrix.unitaryGroup


Aaron Hill (Sep 02 2025 at 22:10):

Currently, we only have eigenvalues/eigenvalues defined when a Matrix is hermitian (Matrix.IsHermitian.eigenvalues). I'm interested in extending this to support (at least) Matrix.unitaryGroup. What would be the best way to go about this?

  • Add similar definitions/theorems to the Matrix.unitaryGroup submonoid (e.g. Matrix.unitaryGroup.eigenvalues, Matrix.unitaryGroup.spectral_theorem, etc)
  • Add a new Matrix.IsUnitary prop (similar to IsHermitian), and add the API for plain Matrix types with a Matrix.IsUnitary hypothesis, rather than adding them to the Matrix.unitaryGroup submonoid
  • Introduce a new IsNormal prop for matrices that commute with their conjugate transpose (A*A = AA*), define eigenvectors and (complex) eigenvalues, and prove the spectral theorem for normal matrices, rather than separately for unitary and hermitian matrices.

Since at least some of the proofs for Matrix.IsHermitian go through LinearMap.IsSymmetric, I assume that we'd also need to add LinearMap equivalents of some defintions above.

Jireh Loreaux (Sep 02 2025 at 22:57):

Here's an important question: for what purpose do you want the eigenvalues and eigenvectors of a unitary matrix? It's possible you can get away without them.

Aaron Hill (Sep 02 2025 at 23:15):

I'm working on formalizing a proof of Gromov's theorem of groups of polynomial growth (https://www.diva-portal.org/smash/get/diva2:1851013/FULLTEXT01.pdf). As part of this, I need: for a unitary matrix gU(n)g \in U(n) not equal to a multiple of the identity, the centralizer Z(g)Z(g) is isomorphic to a product of unitary subgroups with dimensions strictly smaller than nn

Aaron Hill (Sep 02 2025 at 23:17):

and for that, I need to diagonalize g

Jireh Loreaux (Sep 03 2025 at 02:57):

You could probably just use the continuous functional calculus.

Jireh Loreaux (Sep 03 2025 at 02:59):

What you really want are the projections corresponding to each element of the spectrum, which is easier to get through the functional calculus anyway.

Jireh Loreaux (Sep 03 2025 at 03:04):

There's some code about commuting with cfc f a in the LeanOA repo. If you bug me about it in a day or two I can upstream it to Mathlib.

Yaël Dillies (Sep 03 2025 at 06:24):

Aaron Hill said:

I'm working on formalizing a proof of Gromov's theorem of groups of polynomial growth (https://www.diva-portal.org/smash/get/diva2:1851013/FULLTEXT01.pdf). As part of this, I need: for a unitary matrix gU(n)g \in U(n) not equal to a multiple of the identity, the centralizer Z(g)Z(g) is isomorphic to a product of unitary subgroups with dimensions strictly smaller than nn

Any chance I could interest you in working with me on the Breuillard-Green-Tao theorem (which has Gromov as corollary) instead?

Kevin Buzzard (Sep 03 2025 at 14:40):

What's wrong with just looking at the roots of the char poly?

Jireh Loreaux (Sep 03 2025 at 16:07):

That doesn't really give you nice access to the projections.

Frédéric Dupuis (Sep 03 2025 at 16:17):

Jireh Loreaux said:

There's some code about commuting with cfc f a in the LeanOA repo. If you bug me about it in a day or two I can upstream it to Mathlib.

If @Aaron Hill doesn't bug you, then I will :-)

Aaron Hill (Sep 03 2025 at 16:30):

Jireh Loreaux said:

There's some code about commuting with cfc f a in the LeanOA repo. If you bug me about it in a day or two I can upstream it to Mathlib.

I'd definitely be interested in that - thanks!

Aaron Hill (Sep 03 2025 at 16:37):

Yaël Dillies said:

Aaron Hill said:

I'm working on formalizing a proof of Gromov's theorem of groups of polynomial growth (https://www.diva-portal.org/smash/get/diva2:1851013/FULLTEXT01.pdf). As part of this, I need: for a unitary matrix gU(n)g \in U(n) not equal to a multiple of the identity, the centralizer Z(g)Z(g) is isomorphic to a product of unitary subgroups with dimensions strictly smaller than nn

Any chance I could interest you in working with me on the Breuillard-Green-Tao theorem (which has Gromov as corollary) instead?

I'm probably going to keep working on that proof, but I'd also be happy to work with you on Breuillard-Green-Tao

Aaron Hill (Sep 03 2025 at 23:32):

Aaron Hill said:

Currently, we only have eigenvalues/eigenvalues defined when a Matrix is hermitian (Matrix.IsHermitian.eigenvalues). I'm interested in extending this to support (at least) Matrix.unitaryGroup. What would be the best way to go about this?

  • Add similar definitions/theorems to the Matrix.unitaryGroup submonoid (e.g. Matrix.unitaryGroup.eigenvalues, Matrix.unitaryGroup.spectral_theorem, etc)
  • Add a new Matrix.IsUnitary prop (similar to IsHermitian), and add the API for plain Matrix types with a Matrix.IsUnitary hypothesis, rather than adding them to the Matrix.unitaryGroup submonoid
  • Introduce a new IsNormal prop for matrices that commute with their conjugate transpose (A*A = AA*), define eigenvectors and (complex) eigenvalues, and prove the spectral theorem for normal matrices, rather than separately for unitary and hermitian matrices.

Since at least some of the proofs for Matrix.IsHermitian go through LinearMap.IsSymmetric, I assume that we'd also need to add LinearMap equivalents of some defintions above.

It turns out that IsStarNormal already exists, but there's no associated eigenvalue/eigenvector definitions for matrices

Jireh Loreaux (Sep 04 2025 at 21:02):

@Aaron Hill if you want to know why we don't have this, it's essentially for the reason I laid out here:
#maths > spectral theorem for normal endomorphisms and related pain @ 💬

The issue is that we don't currently have a nice way to refer to adjoints that works simultaneously for ContinuousLinearMap and for LinearMap. Thus you have a bunch of duplication.

Jireh Loreaux (Sep 04 2025 at 21:02):

I'm sure @Monica Omar cares about this problem too.

Jireh Loreaux (Sep 05 2025 at 17:37):

Here's some code I had from a while ago which adopts the "let there be duplication" approach to this problem. You can get the analogous statements for linear maps in finite dimensions using docs#LinearMap.toContinuousLinearMap

eigenvalues and eigenvectors of normal operators

Monica Omar (Sep 05 2025 at 18:03):

some of this stuff should probably go in Mathlib

Jireh Loreaux (Sep 05 2025 at 18:13):

Feel free to PR if that's what you think should happen, but I won't be able to merge it for obvious reasons. I've been hoping to come up with a solution to the problem in the other thread, but still haven't come up with anything satisfying, despite thinking about it again for an hour or two yesterday.

Aaron Hill (Oct 15 2025 at 00:29):

Jireh Loreaux said:

There's some code about commuting with cfc f a in the LeanOA repo. If you bug me about it in a day or two I can upstream it to Mathlib.

Did that end up getting upstreamed?

Jireh Loreaux (Oct 15 2025 at 12:37):

Yes. docs#Commute.cfc

Aaron Hill (Oct 30 2025 at 19:27):

Do you have any examples of code that projects to a lower-dimensional matrix using the CFC?

Jireh Loreaux (Oct 30 2025 at 19:41):

I'm not sure what you mean, please expand on what you're asking for.

Aaron Hill (Nov 02 2025 at 21:04):

I was referring to your earlier comment:

What you really want are the projections corresponding to
each element of the spectrum, which is easier to get through the
functional calculus anyway.

and I was assuming that these projections would in some way correspond to matrices with lower dimension than the original one

Jireh Loreaux (Nov 05 2025 at 16:57):

Ah, no, i just meant a projection in the sense that P = star P = P ^ 2


Last updated: Dec 20 2025 at 21:32 UTC