-
Notifications
You must be signed in to change notification settings - Fork 356
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: Positivity extension for Finset.prod
#9365
Conversation
Note this extension is pretty unopinionated about deriving `Finset.Nonempty` assumptions. We might want to buff it up in the future but it's already a big improvement over the nothing we currently have. From LeanAPAP Co-authored-by: Alex J. Best <[email protected]>
EDIT: Now fixed |
Here's a simpler test-case: example (s : Finset (ℕ)) : 0 ≤ ∑ j in s, j := by positivity --ok
example (s : Finset (ℕ)) : 0 ≤ s.sum id := by positivity -- fails |
I pushed an attempt at a fix, we beta expand if the f is not already a lambda |
…_prod feat: Positivity extension for `Finset.prod`
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.
Love how much can be replaced with by positivity
due to this PR! :)
This review is shorter than it appears: almost all of these 12 comments are about $
, with only a couple potentially "meaningful" review comments.
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.
Looks good with @thorimur's comments. (I am neutral about the <|
vs $
issue, but the style guide takes precedence.) @robertylewis, any suggestions or shall we delegate it to @thorimur?
Co-authored-by: Anne Baanen <[email protected]>
LGTM! :) |
!bench |
Here are the benchmark results for commit e6a642d. |
bors merge |
Followup to #9365 From LeanAPAP Co-authored-by: Eric Wieser <[email protected]> Co-authored-by: Alex J Best <[email protected]>
Pull request successfully merged into master. Build succeeded: |
Finset.prod
Finset.prod
Followup to #9365 From LeanAPAP Co-authored-by: Eric Wieser <[email protected]> Co-authored-by: Alex J Best <[email protected]>
Followup to #9365 From LeanAPAP Co-authored-by: Eric Wieser <[email protected]> Co-authored-by: Alex J Best <[email protected]>
Followup to #9365
From LeanAPAP
Finset.sum
#10538PosMulMono
#10875