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(Data/Finset/NatDivisors): Nat.divisors of a product #8695

Closed
wants to merge 10 commits into from

Conversation

adomani
Copy link
Collaborator

@adomani adomani commented Nov 28, 2023

The function Nat.divisors as a multiplicative homomorphism ℕ →* Finset ℕ.

This result is in a new file Data/Finset/NatDivisors, to avoid adding imports and/or lengthening existing files.


Open in Gitpod

@adomani adomani added the awaiting-review The author would like community review of the PR label Nov 28, 2023
@urkud
Copy link
Member

urkud commented Nov 29, 2023

I golfed your proof. I'm not sure that you need more imports for the new proof. Also, you can get a slightly different version of Nat.Prime.divisors_sq like this:

lemma Prime.divisors_sq {p : ℕ} (hp : p.Prime) : (p ^ 2).divisors = {p ^ 2, p, 1} := by
  simp [divisors_prime_pow hp, range_succ]

I'm not sure that we have a nice way to reorder a chain of inserts.

Also, I think that it would be nice to have a version for Finset.prod of numbers (and possibly for List.prod and/or Multiset.prod as well).

@urkud urkud added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Nov 29, 2023
@adomani
Copy link
Collaborator Author

adomani commented Nov 29, 2023

Yuri, I added the Multiset and the List version. I have to go now, but I'll look into the Finset version and whether this fits better in an earlier file later!

Thanks!

@adomani adomani added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Nov 29, 2023
@adomani
Copy link
Collaborator Author

adomani commented Nov 29, 2023

Yuri, I added the Finset lemmas, but either I took a wrong turn, or there was some missing API around Pointwise.

Anyway, I could still not move the lemmas in a different file, since I could not find any interaction between Nat.divisors and Pointwise: either a file develops the theory of Nat.divisors and has no Pointwise, or there is Pointwise, but no Nat.divisors.

From this point of view, it may make sense to create this new file, what do you think?

@adomani
Copy link
Collaborator Author

adomani commented Nov 29, 2023

Yuri, your latest commit is such an improvement over my butchering of the lemmas! Thanks!

@urkud urkud added t-number-theory Number theory (also use t-algebra or t-analysis to specialize) t-algebra Algebra (groups, rings, fields etc) labels Nov 30, 2023
@urkud
Copy link
Member

urkud commented Nov 30, 2023

Thanks! 🎉
bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Nov 30, 2023
mathlib-bors bot pushed a commit that referenced this pull request Nov 30, 2023
The function `Nat.divisors` as a multiplicative homomorphism `ℕ →* Finset ℕ`.

This result is in a new file `Data/Finset/NatDivisors`, to avoid adding imports and/or lengthening existing files.



Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
@mathlib-bors
Copy link

mathlib-bors bot commented Nov 30, 2023

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Data/Finset/NatDivisors): Nat.divisors of a product [Merged by Bors] - feat(Data/Finset/NatDivisors): Nat.divisors of a product Nov 30, 2023
@mathlib-bors mathlib-bors bot closed this Nov 30, 2023
@mathlib-bors mathlib-bors bot deleted the adomani/Nat.divisors_mul branch November 30, 2023 16:55
awueth pushed a commit that referenced this pull request Dec 19, 2023
The function `Nat.divisors` as a multiplicative homomorphism `ℕ →* Finset ℕ`.

This result is in a new file `Data/Finset/NatDivisors`, to avoid adding imports and/or lengthening existing files.



Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
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. t-algebra Algebra (groups, rings, fields etc) t-number-theory Number theory (also use t-algebra or t-analysis to specialize)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants