Skip to content
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] - chore/perf(Probability/MeasureTheory): use fun_prop for manual measurability calls #13871

Closed
wants to merge 14 commits into from

Conversation

grunweg
Copy link
Collaborator

@grunweg grunweg commented Jun 16, 2024

Replace manual measurability calls with fun_prop; replace measurability calls by fun_prop when possible.
As a by-product, this tags a few more lemmas fun_prop and resolves all porting notes involving measurability.

Follow- up to #13770.


Open in Gitpod

Copy link

github-actions bot commented Jun 16, 2024

PR summary 3ef23cd541

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

@grunweg grunweg force-pushed the MR-replace-slow-measurability-funprop branch from f5c5ca1 to 9824e37 Compare June 16, 2024 08:17
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) label Jun 16, 2024
@grunweg
Copy link
Collaborator Author

grunweg commented Jun 16, 2024

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 7cce133.
There were significant changes against commit 59c05f4:

  Benchmark                                            Metric         Change
  ==========================================================================
+ ~Mathlib.Analysis.SpecialFunctions.JapaneseBracket   instructions   -64.8%

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) and removed blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) labels Jun 23, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

This PR/issue depends on:

Copy link
Collaborator Author

@grunweg grunweg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three questions I asked myself: mainly about the fun_prop tagging.

-- TODO(#13864): reinstate faster automation, e.g. by making `fun_prop` work here
exact (((Measure.measurable_rnDeriv _ μ
).ennreal_toNNReal).coe_nnreal_real).aestronglyMeasurable
· apply Measurable.aestronglyMeasurable
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flagging this for the future: it would be nice to avoid the Measurable.aestronglyMeasurable lemma; fun_prop should infer this instead.

Copy link
Collaborator

@j-loreaux j-loreaux Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear, in order for that to work properly, we need to mark AEStronglyMeasurable (the definition) with the fun_prop attribute. (EDIT: I see you did in this PR)

grunweg added 2 commits June 24, 2024 16:24
- seven out of nine goals use positivity
- the second last one works by measurability: this is only because aesop
calls simp_all; simp_all proves this and doesn't use any measurability lemma
- the last one is truly measurability
@grunweg grunweg removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 24, 2024
@grunweg grunweg added the t-measure-probability Measure theory / Probability theory label Jun 24, 2024
@grunweg
Copy link
Collaborator Author

grunweg commented Jun 24, 2024

@RemyDegenne This is the follow-up PR I promised; I guess you're interested. It does even yield some slight speed-ups.

@grunweg
Copy link
Collaborator Author

grunweg commented Jun 24, 2024

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 72b694e.
There were significant changes against commit ae6dfcd:

  Benchmark                                            Metric         Change
  ==========================================================================
+ ~Mathlib.Analysis.SpecialFunctions.JapaneseBracket   instructions   -64.3%

@grunweg
Copy link
Collaborator Author

grunweg commented Jun 24, 2024

Comparing the two benchmarking runs, the second one is a minor improvement (save for CircleIntegral, which is very slightly slower - I would say this is a fair trade-off for the increased automation).

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 26, 2024
@grunweg grunweg added tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels Jun 26, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 29, 2024
@grunweg grunweg removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 30, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 12, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 13, 2024
@jcommelin
Copy link
Member

bors d+

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jul 15, 2024

✌️ grunweg can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@grunweg
Copy link
Collaborator Author

grunweg commented Jul 15, 2024

Thanks for the review. Since CI passes, let me
bors r+

mathlib-bors bot pushed a commit that referenced this pull request Jul 15, 2024
…rability` calls (#13871)

Replace manual `measurability` calls with `fun_prop`; replace `measurability` calls by `fun_prop` when possible.
As a by-product, this tags a few more lemmas `fun_prop` and resolves all porting notes involving `measurability`.

Follow- up to #13770.



Co-authored-by: Johan Commelin <[email protected]>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jul 15, 2024

Build failed (retrying...):

mathlib-bors bot pushed a commit that referenced this pull request Jul 15, 2024
…rability` calls (#13871)

Replace manual `measurability` calls with `fun_prop`; replace `measurability` calls by `fun_prop` when possible.
As a by-product, this tags a few more lemmas `fun_prop` and resolves all porting notes involving `measurability`.

Follow- up to #13770.



Co-authored-by: Johan Commelin <[email protected]>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jul 15, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore/perf(Probability/MeasureTheory): use fun_prop for manual measurability calls [Merged by Bors] - chore/perf(Probability/MeasureTheory): use fun_prop for manual measurability calls Jul 15, 2024
@mathlib-bors mathlib-bors bot closed this Jul 15, 2024
@mathlib-bors mathlib-bors bot deleted the MR-replace-slow-measurability-funprop branch July 15, 2024 14:50
@adomani adomani mentioned this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated t-measure-probability Measure theory / Probability theory tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants