-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - feat(algebra/star/self_adjoint): define normal elements of a star monoid #11991
Conversation
What do people think of making this a type class? |
What do you want the instances to be? I guess selfadjoints, unitaries and in more specialized settings, diagonal operators and multiplication operators? Would the point be that if you had an instance |
Yeah, for now the obvious ones are self-adjoints, unitaries, one, zero, and anything with |
I just changed it to a type class in the end. I think it will be very useful when we defining the functional calculus to have it as a type class, so we don't have to pass this around all the time as a parameter; the same goes for the spectral theorem. I can't really picture it causing serious type class inference problems, since it's anyway a prop and we probably won't be adding too many more instances than the few I just added here. |
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
I'm dubious about making this a class. I confess that my doubts stem mostly from the fact that it is not very Mathlib-idiomatic rather than a specific worry. How about we make this a |
I have thought more about this, and I think making it a type class is the way to go. Unlike some other important classes of operators like selfadjoints or unitaries, star normal elements don't have a nice "substructure" (addition or multiplication of normal elements is not normal in general, really it is only closed under the star involution). Thus, while you could bundle star normal elements into a subtype, doing so only really buys you headaches. However, for many applications, we will be passing this condition around a lot, and it would be nice to package it by making it into a type class. |
Is there a typeclass in another part of the library that you're using as a template here? I'd argue you should not make it a typeclass in this PR, and then ask for typeclass opinions in a follow-up PR from the authors of |
I think we might as well just have this discussion on Zulip right now, instead of possibly having to rewrite a lot of code. I just started a thread there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Zulip discussion seems to have converged on a typeclass approach. Let's try it out!
bors merge
…oid (#11991) In this PR, we define the normal elements of a star monoid, i.e. those elements `x` that commute with `star x`. This is defined as the prop type class `is_star_normal`. This was formalized as part of the semilinear maps paper. Co-authored-by: Frédéric Dupuis <31101893+dupuisf@users.noreply.github.com>
Build failed (retrying...): |
…oid (#11991) In this PR, we define the normal elements of a star monoid, i.e. those elements `x` that commute with `star x`. This is defined as the prop type class `is_star_normal`. This was formalized as part of the semilinear maps paper. Co-authored-by: Frédéric Dupuis <31101893+dupuisf@users.noreply.github.com>
Build failed (retrying...): |
bors r- Can you merge master? bors d+ |
✌️ dupuisf can now approve this pull request. To approve and merge a pull request, simply reply with |
Canceled. |
bors r+ |
…oid (#11991) In this PR, we define the normal elements of a star monoid, i.e. those elements `x` that commute with `star x`. This is defined as the prop type class `is_star_normal`. This was formalized as part of the semilinear maps paper. Co-authored-by: Frédéric Dupuis <31101893+dupuisf@users.noreply.github.com>
Pull request successfully merged into master. Build succeeded: |
In this PR, we define the normal elements of a star monoid, i.e. those elements
x
that commute with
star x
. This is defined as the prop type classis_star_normal
.This was formalized as part of the semilinear maps paper.