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: implement rpow norm_num extension #9893
Conversation
This PR depends on #9875. The first four commits are borrowed from that PR, and I intend to rebase it once that PR lands. |
(removed the "awaiting review" label while I fix the breakage in Bertrand.lean...) |
Mathlib/Tactic/NormNum/Pow.lean
Outdated
/-- The `norm_num` extension which identifies expressions of the form `a ^ b`, | ||
such that `norm_num` successfully recognises both `a` and `b`, with `b : ℤ`. -/ | ||
@[norm_num (_ : α) ^ (_ : ℤ)] |
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.
Note that we also have #9875 that implements this. Nevermind, I see that was you!
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.
Yep. Please let me know if there's a better way to do stacked diffs.
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.
I know on gitlab I used to be able to have a PR pointing on the branch of another dependency PR, so that once the dependency is merged the PR would then point to master instead, and in the meantime you get a clean diff. I don't know if bors messes with that, though.
Edit: you can manually do that, it seems :)
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.
I don't think that's necessary, and it's a mess with our squash merges anyway. Putting things in the PR description is sufficient (I made an edit to that effect)
guard <|← withNewMCtxDepth <| isDefEq f q(HPow.hPow (α := ℝ) (β := ℝ)) | ||
haveI' : u =QL 0 := ⟨⟩ | ||
haveI' : $α =Q ℝ := ⟨⟩ | ||
haveI' h : $e =Q $a ^ $b := ⟨⟩ |
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.
I don't really care either way, but I'm curious what the advantage of haveI
vs have
is here.
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.
Me too! I'm just copying what I see in other extensions.
Mathlib/NumberTheory/Bertrand.lean
Outdated
· positivity | ||
· positivity | ||
· positivity |
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.
Where did these side-goals come from?
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.
They come from the removal of <;> norm_num1
above. Two of them could be norm_num1
.
I've moved them inline now, to make the proof structure more clear.
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.
done in 33546e9
(oops, I meant for this comment to apply to the other thread #9893 (comment) )
This PR/issue depends on:
|
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.
bors d+
Thanks!
let e' : Q(ℝ) := q(($a ^ (-($nb : ℤ)))) | ||
match ← derive e' with |
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.
This one can probably be inlined too
✌️ dwrensha can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
* Implements a norm_num extension for `a ^ b` where `a` and `b` are reals. Unlike in the mathlib3 version, there is no restriction on the positivity of `a`. * Moves commented-out tests from test/norm_num_ext.lean into a new file test/norm_num_rpow.lean, to keep the dependencies of norm_num_ext.lean lightweight. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Build failed (retrying...): |
* Implements a norm_num extension for `a ^ b` where `a` and `b` are reals. Unlike in the mathlib3 version, there is no restriction on the positivity of `a`. * Moves commented-out tests from test/norm_num_ext.lean into a new file test/norm_num_rpow.lean, to keep the dependencies of norm_num_ext.lean lightweight. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Pull request successfully merged into master. Build succeeded: |
a ^ b
wherea
andb
are reals. Unlike in the mathlib3 version, there is no restriction on the positivity ofa
.