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] - field_simp: Use positivity as a discharger #6312
Conversation
This is my attempt at #4835. Some questions:
|
6fcccf1
to
237657c
Compare
There will be a merge conflict with @mattrobball’s #6034, and they eliminate some of the same extra steps, but both additions seem to be useful. |
Yeah. This looks great. My motivation was code like have : n \neq 0 := sorry
have : (n : Real) := by norm_cast; exact this A real world example is in #6034 handles this. But it makes more sense to operate on the norm casted term directly. This runs into the problem that often there are simp args fed into Right now I want to |
What does this mean for the present PR? Go ahead, wait for yours first, do them together? |
Go full speed ahead. Feel free to incorporate whatever from #6034 or nothing. |
Whatever your want is good with me. |
In that case I’ll just be lazy and ignore your PR for now, and see if I can get this change in without learning more about |
!bench |
I couldn’t find information on |
The bot will report back once it clears the queue |
Here are the benchmark results for commit ce54f5e.Found no runs to compare against. |
I’ll be traveling without a laptop for week, and will address review comments afterwards. Should anyone want to adopt this PR and see it through, that’s fine with me as well. |
Back from vacation. What’s needed to make progress here? |
!bench |
Here are the benchmark results for commit dfc7782. |
!bench |
Looks like latest master (or the speedcenter) had stricter linting. Fixed, I hope. |
Here are the benchmark results for commit f6de4b6. Benchmark Metric Change
================================================================================================
+ build native linking -5.0%
- ~Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating instructions 35.7%
- ~Mathlib.Analysis.Convex.Slope instructions 6.2%
+ ~Mathlib.Analysis.SpecialFunctions.Stirling instructions -6.0%
+ ~Mathlib.NumberTheory.Bernoulli instructions -7.3% |
|
I think I think the performance profile is good and the PR definitely improves user ergonomics. @sgouezel do you have any concerns? |
I'm perfectly happy with the performance, given how it improves readability and usability. Someone more skilled than me in meta code should still review it properly, however. If noone shows up, you can ping on Zulip. |
Looks great, thanks! bors merge |
The main reasons is that having `h : 0 < denom` in the context should suffice for `field_simp` to do its job, without the need to manually pass `h.ne` or similar. Quite a few `have := … ≠ 0` could be dropped, and some `field_simp` calls no longer need explicit arguments; this is promising. This does break some proofs where `field_simp` was not used as a closing tactic, and it now shuffles terms around a bit different. These were fixed. Using `field_simp` in the middle of a proof seems rather fragile anyways. As a drive-by contribution, `positivity` now knows about `π > 0`. fixes: #4835 Co-authored-by: Matthew Ballard <matt@mrb.email>
Pull request successfully merged into master. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
The main reasons is that having
h : 0 < denom
in the context should suffice forfield_simp
to do its job, without the need to manually passh.ne
or similar.Quite a few
have := … ≠ 0
could be dropped, and somefield_simp
calls no longer need explicit arguments; this is promising.This does break some proofs where
field_simp
was not used as a closing tactic, and it nowshuffles terms around a bit different. These were fixed. Using
field_simp
in the middle of a proof seems rather fragile anyways.As a drive-by contribution,
positivity
now knows aboutπ > 0
.fixes: #4835