Skip to content

Conversation

yury-harmonic
Copy link
Contributor

@yury-harmonic yury-harmonic commented Aug 22, 2025

Define Nat.nthRoot n a to be the nth root of a natural number a.


This is a dependency of a norm_num plugin that can handle (8 : Real) ^ (2 / 3 : Real).

Open in Gitpod

Define `Nat.nthRoot n a` to be the `n`th root of a natural number `a`.
@github-actions github-actions bot added new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-data Data (lists, quotients, numbers, etc) labels Aug 22, 2025
Copy link

github-actions bot commented Aug 22, 2025

PR summary 4b0359cc77

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Data.Nat.NthRoot.Defs (new file) 44
Mathlib.Analysis.SpecialFunctions.Pow.NthRootLemmas (new file) 1817

Declarations diff

+ Nat.nthRoot
+ exists_pow_eq_iff
+ exists_pow_eq_iff'
+ instDecidableExistsPowEq
+ le_nthRoot_iff
+ lt_pow_nthRoot_add_one
+ nthRoot.lt_pow_go_succ_aux
+ nthRoot_eq_of_le_of_lt
+ nthRoot_lt_iff
+ nthRoot_one_left
+ nthRoot_one_right
+ nthRoot_pow
+ nthRoot_zero_left
+ nthRoot_zero_right
+ pow_nthRoot_le
+ pow_nthRoot_le_iff

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>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@eric-wieser
Copy link
Member

I'll note there's a small overlap in concept here with #26935

@yury-harmonic
Copy link
Contributor Author

AFAICT, there is no code overlap, but Nat.nthRoot can be used to write a norm_num extension for qpow too.

@j-loreaux j-loreaux added the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 22, 2025
Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>
@yury-harmonic yury-harmonic requested a review from b-mehta August 23, 2025 03:02
@yury-harmonic
Copy link
Contributor Author

-awaiting-author

@github-actions github-actions bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 23, 2025
Copy link
Collaborator

@pechersky pechersky left a comment

Choose a reason for hiding this comment

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

golfs with grind (and making sure to replace omega). I was surprised that fun_induction didn't work

@pechersky pechersky added the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 6, 2025
@yury-harmonic
Copy link
Contributor Author

-awaiting-author

@github-actions github-actions bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 10, 2025
Copy link
Collaborator

@pechersky pechersky left a comment

Choose a reason for hiding this comment

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

Thanks! Looking forward to the norm_num extension.

maintainer merge

Copy link

🚀 Pull request has been placed on the maintainer queue by pechersky.

@kbuzzard
Copy link
Member

kbuzzard commented Oct 15, 2025

Thanks! Yes it's funny that we're using real numbers to make the API for this, but if it makes life easier then why not!

bors merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added ready-to-merge This PR has been sent to bors. and removed maintainer-merge labels Oct 15, 2025
mathlib-bors bot pushed a commit that referenced this pull request Oct 16, 2025
Define `Nat.nthRoot n a` to be the `n`th root of a natural number `a`.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 16, 2025

Build failed (retrying...):

@bryangingechen
Copy link
Contributor

bryangingechen commented Oct 16, 2025

bors r-

It turns out this PR is actually failing a style lint; not sure why it isn't throwing a red x here though: https://github.com/leanprover-community/mathlib4/actions/runs/18470107241/job/52621590367#step:2:275

@Vierkantor could you take a look when you have a chance?

edit: I think I know why it didn't fire. The lint-style-action action was not updated in the branch that this PR was based off, and pull_request workflows apparently run in that context rather than the version from master (!).

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 16, 2025

Canceled.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the ready-to-merge This PR has been sent to bors. label Oct 16, 2025
@bryangingechen
Copy link
Contributor

bors d+

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 16, 2025

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

@yury-harmonic
Copy link
Contributor Author

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Oct 16, 2025
Define `Nat.nthRoot n a` to be the `n`th root of a natural number `a`.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 16, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Data/Nat): define Nat.nthRoot [Merged by Bors] - feat(Data/Nat): define Nat.nthRoot Oct 16, 2025
@mathlib-bors mathlib-bors bot closed this Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-data Data (lists, quotients, numbers, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants