Skip to content

[Merged by Bors] - fix: norm_num extension for Nat.pow#5740

Closed
digama0 wants to merge 3 commits intomasterfrom
norm_num_pow
Closed

[Merged by Bors] - fix: norm_num extension for Nat.pow#5740
digama0 wants to merge 3 commits intomasterfrom
norm_num_pow

Conversation

@digama0
Copy link
Copy Markdown
Member

@digama0 digama0 commented Jul 6, 2023

Alternative to leanprover/lean4#2310. The original implementation of the pow extension would force a Nat.pow application by defeq, but this should only be done for kernel-approved definitions and Nat.pow is not one of them. Rather than adding more things to the kernel, we can implement an efficient pow implementation by binary recursion, using the clauses:

  • a ^ (2*b) = a^b * a^b
  • a ^ (2*b + 1) = a^b * a^b * a

Open in Gitpod

@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Jul 8, 2023

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Jul 8, 2023
bors bot pushed a commit that referenced this pull request Jul 9, 2023
Alternative to leanprover/lean4#2310. The original implementation of the pow extension would force a `Nat.pow` application by defeq, but this should only be done for kernel-approved definitions and `Nat.pow` is not one of them. Rather than adding more things to the kernel, we can implement an efficient pow implementation by binary recursion, using the clauses:

* `a ^ (2*b) = a^b * a^b`
* `a ^ (2*b + 1) = a^b * a^b * a`



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@bors
Copy link
Copy Markdown

bors bot commented Jul 9, 2023

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.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title fix: norm_num extension for Nat.pow [Merged by Bors] - fix: norm_num extension for Nat.pow Jul 9, 2023
@bors bors bot closed this Jul 9, 2023
@bors bors bot deleted the norm_num_pow branch July 9, 2023 01:59
kim-em added a commit that referenced this pull request Aug 14, 2023
Alternative to leanprover/lean4#2310. The original implementation of the pow extension would force a `Nat.pow` application by defeq, but this should only be done for kernel-approved definitions and `Nat.pow` is not one of them. Rather than adding more things to the kernel, we can implement an efficient pow implementation by binary recursion, using the clauses:

* `a ^ (2*b) = a^b * a^b`
* `a ^ (2*b + 1) = a^b * a^b * a`



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants