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] - feat: implement rpow norm_num extension #9893

Closed
wants to merge 14 commits into from

Conversation

dwrensha
Copy link
Member

@dwrensha dwrensha commented Jan 21, 2024

  • 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.

Open in Gitpod

@dwrensha
Copy link
Member Author

dwrensha commented Jan 21, 2024

This PR depends on #9875. The first four commits are borrowed from that PR, and I intend to rebase it once that PR lands.

@dwrensha dwrensha added awaiting-review The author would like community review of the PR t-meta Tactics, attributes or user commands labels Jan 21, 2024
@dwrensha dwrensha removed the awaiting-review The author would like community review of the PR label Jan 21, 2024
@dwrensha
Copy link
Member Author

dwrensha commented Jan 21, 2024

(removed the "awaiting review" label while I fix the breakage in Bertrand.lean...)

Mathlib/Analysis/SpecialFunctions/Pow/Real.lean Outdated Show resolved Hide resolved
Comment on lines 229 to 231
/-- 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 (_ : α) ^ (_ : ℤ)]
Copy link
Member

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!

Copy link
Member Author

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.

Copy link
Collaborator

@adri326 adri326 Jan 21, 2024

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 :)

Copy link
Member

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)

Mathlib/Analysis/SpecialFunctions/Pow/Real.lean Outdated Show resolved Hide resolved
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the blocked-by-other-PR This PR depends on another PR which is still in the queue. label Jan 21, 2024
guard <|← withNewMCtxDepth <| isDefEq f q(HPow.hPow (α := ℝ) (β := ℝ))
haveI' : u =QL 0 := ⟨⟩
haveI' : $α =Q ℝ := ⟨⟩
haveI' h : $e =Q $a ^ $b := ⟨⟩
Copy link
Member

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.

Copy link
Member Author

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.

Comment on lines 106 to 108
· positivity
· positivity
· positivity
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

@dwrensha dwrensha Jan 22, 2024

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) )

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. label Jan 22, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

This PR/issue depends on:

@dwrensha dwrensha added the awaiting-review The author would like community review of the PR label Jan 22, 2024
Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

bors d+

Thanks!

Comment on lines 970 to 971
let e' : Q(ℝ) := q(($a ^ (-($nb : ℤ))))
match ← derive e' with
Copy link
Member

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

@mathlib-bors
Copy link

mathlib-bors bot commented Jan 22, 2024

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

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added delegated and removed awaiting-review The author would like community review of the PR labels Jan 22, 2024
@dwrensha
Copy link
Member Author

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Jan 23, 2024
* 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>
@mathlib-bors
Copy link

mathlib-bors bot commented Jan 23, 2024

Build failed (retrying...):

mathlib-bors bot pushed a commit that referenced this pull request Jan 23, 2024
* 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>
@mathlib-bors
Copy link

mathlib-bors bot commented Jan 23, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: implement rpow norm_num extension [Merged by Bors] - feat: implement rpow norm_num extension Jan 23, 2024
@mathlib-bors mathlib-bors bot closed this Jan 23, 2024
@mathlib-bors mathlib-bors bot deleted the norm-num-rpow-2 branch January 23, 2024 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated t-meta Tactics, attributes or user commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants