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(field_theory): define the field of rational functions ratfunc #9563

Closed
wants to merge 10 commits into from

Conversation

Vierkantor
Copy link
Collaborator

@Vierkantor Vierkantor commented Oct 5, 2021

This PR defines ratfunc K as the field of rational functions over a field K, in terms of fraction_ring (polynomial K). I have been careful to use structures and @[irreducible] defs. Not only does that make for a nicer API, it also helps quite a bit with unification since the check can stop at ratfunc and doesn't have to start unfolding along the lines of fraction_field.field → localization.comm_ring → localization.comm_monoid → localization.has_mul and/or polynomial.integral_domain → polynomial.comm_ring → polynomial.ring → polynomial.semiring.

Most of the API is automatically derived from the (components of the) is_fraction_ring instance: the map polynomial K → ratpoly K is algebra_map, the isomorphism to fraction_ring (polynomial K) is is_localization.alg_equiv, ...

As a first application to verify that the definitions work, I rewrote function_field in terms of ratfunc.


It turned into a big PR, so you might like to review the individual commits instead:

Open in Gitpod

@Vierkantor Vierkantor added the awaiting-review The author would like community review of the PR label Oct 5, 2021
src/field_theory/ratpoly.lean Outdated Show resolved Hide resolved
src/field_theory/ratpoly.lean Outdated Show resolved Hide resolved
@jcommelin jcommelin 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 Oct 5, 2021
@alexjbest
Copy link
Member

/bikeshed: I would call this rational_functions or even function_field instead of ratpoly, as this matches the conventions in magma and sage respectively.

@bryangingechen
Copy link
Collaborator

I've also only ever seen these as referred to as rational functions; Wikipedia agrees as well https://en.wikipedia.org/wiki/Rational_function

@Vierkantor Vierkantor changed the title feat(field_theory): define the field of rational polynomials ratpoly feat(field_theory): define the field of rational functions ratfunc Oct 7, 2021
@github-actions github-actions bot added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Oct 7, 2021
@Vierkantor
Copy link
Collaborator Author

I've also only ever seen these as referred to as rational functions; Wikipedia agrees as well https://en.wikipedia.org/wiki/Rational_function

I've searched-and-replaced everything from ratpoly to ratfunc and [Rr]ational polynomial to [Rr]ational function. 👍

@Vierkantor Vierkantor 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 Oct 7, 2021
@jcommelin
Copy link
Member

@Vierkantor I think this PR can also update the undergrad file:
https://github.com/leanprover-community/mathlib/blob/master/docs/undergrad.yaml#L189

@Vierkantor
Copy link
Collaborator Author

@Vierkantor I think this PR can also update the undergrad file: https://github.com/leanprover-community/mathlib/blob/master/docs/undergrad.yaml#L189

Good point, almost forgot!

@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Oct 25, 2021
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Nov 8, 2021
bors bot pushed a commit that referenced this pull request Nov 11, 2021
…ials (#9600)

This PR provides a couple of lemmas involving the division and gcd operators of polynomials that I needed for #9563. The ones that generalized to `euclidean_domain` and/or `gcd_monoid` are provided in the respective files.



Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@github-actions github-actions bot added merge-conflict Please `git merge origin/master` then a bot will remove this label. and removed blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. labels Nov 11, 2021
@github-actions
Copy link

🎉 Great news! Looks like all the dependencies have been resolved:

💡 To add or remove a dependency please update this issue/PR description.

Brought to you by Dependent Issues (:robot: ). Happy coding!

@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Nov 11, 2021
src/ring_theory/witt_vector/frobenius.lean Outdated Show resolved Hide resolved
src/number_theory/function_field.lean Outdated Show resolved Hide resolved
src/field_theory/ratfunc.lean Outdated Show resolved Hide resolved
@jcommelin jcommelin 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 12, 2021
@Vierkantor Vierkantor 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 12, 2021
@jcommelin
Copy link
Member

CI isn't happy

@jcommelin jcommelin 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 12, 2021
@Vierkantor Vierkantor 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 16, 2021
@Vierkantor
Copy link
Collaborator Author

Pretty sure it was one of the CI runners that failed/timed out - it worked on my machine. After restarting, it looks like it's building correctly again.

Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Nov 16, 2021
bors bot pushed a commit that referenced this pull request Nov 16, 2021
…9563)

This PR defines `ratfunc K` as the field of rational functions over a field `K`, in terms of `fraction_ring (polynomial K)`. I have been careful to use `structure`s and `@[irreducible] def`s. Not only does that make for a nicer API, it also helps quite a bit with unification since the check can stop at `ratfunc` and doesn't have to start unfolding along the lines of `fraction_field.field → localization.comm_ring → localization.comm_monoid → localization.has_mul` and/or `polynomial.integral_domain → polynomial.comm_ring → polynomial.ring → polynomial.semiring`.

Most of the API is automatically derived from the (components of the) `is_fraction_ring` instance: the map `polynomial K → ratpoly K` is `algebra_map`, the isomorphism to `fraction_ring (polynomial K)` is `is_localization.alg_equiv`, ...

As a first application to verify that the definitions work, I rewrote `function_field` in terms of `ratfunc`.



Co-authored-by: Johan Commelin <johan@commelin.net>
@eric-wieser
Copy link
Member

bors merge

(bors crashed)

bors bot pushed a commit that referenced this pull request Nov 16, 2021
…9563)

This PR defines `ratfunc K` as the field of rational functions over a field `K`, in terms of `fraction_ring (polynomial K)`. I have been careful to use `structure`s and `@[irreducible] def`s. Not only does that make for a nicer API, it also helps quite a bit with unification since the check can stop at `ratfunc` and doesn't have to start unfolding along the lines of `fraction_field.field → localization.comm_ring → localization.comm_monoid → localization.has_mul` and/or `polynomial.integral_domain → polynomial.comm_ring → polynomial.ring → polynomial.semiring`.

Most of the API is automatically derived from the (components of the) `is_fraction_ring` instance: the map `polynomial K → ratpoly K` is `algebra_map`, the isomorphism to `fraction_ring (polynomial K)` is `is_localization.alg_equiv`, ...

As a first application to verify that the definitions work, I rewrote `function_field` in terms of `ratfunc`.



Co-authored-by: Johan Commelin <johan@commelin.net>
@bors
Copy link

bors bot commented Nov 16, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(field_theory): define the field of rational functions ratfunc [Merged by Bors] - feat(field_theory): define the field of rational functions ratfunc Nov 16, 2021
@bors bors bot closed this Nov 16, 2021
@bors bors bot deleted the ratpoly branch November 16, 2021 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants