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: simple lemmas about polynomials and their degrees #6220

Closed
wants to merge 9 commits into from

Conversation

adomani
Copy link
Collaborator

@adomani adomani commented Jul 28, 2023

This PR extracts some lemmas about polynomials that are helpful for the tactic compute_degree (#6221).

The signature of a theorem changed:

theorem coeff_pow_of_natDegree_le (pn : p.natDegree ≤ n) :
    (p ^ m).coeff (n * m) = p.coeff n ^ m  -- <-- the order of the product was `n * m`
    (p ^ m).coeff (m * n) = p.coeff n ^ m  -- <-- and it became `m * n`

Modified files:

Data/Polynomial/Basic.lean
Data/Polynomial/Degree/Lemmas.lean
Data/Polynomial/Degree/Definitions.lean
Data/Polynomial/Coeff.lean  -- for a "`simp` can prove this" golf

Open in Gitpod

@adomani adomani added awaiting-review The author would like community review of the PR awaiting-CI t-algebra Algebra (groups, rings, fields etc) labels Jul 28, 2023
Copy link
Contributor

@ocfnash ocfnash left a comment

Choose a reason for hiding this comment

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

Thanks, a few minor comments.

Mathlib/Data/Polynomial/Coeff.lean Outdated Show resolved Hide resolved
Mathlib/Data/Polynomial/Degree/Lemmas.lean Outdated Show resolved Hide resolved
Mathlib/Data/Polynomial/Degree/Lemmas.lean Outdated Show resolved Hide resolved
Mathlib/Data/Polynomial/EraseLead.lean Outdated Show resolved Hide resolved
@ocfnash ocfnash 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 Aug 9, 2023
@adomani adomani added awaiting-review The author would like community review of the PR awaiting-CI and removed awaiting-author A reviewer has asked the author a question or requested changes labels Aug 9, 2023
@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 Aug 10, 2023
bors bot pushed a commit that referenced this pull request Aug 10, 2023
…d_eq_of_le_of_le_of_mul_le` earlier (#6483)

This move was suggested in #6220.  In fact, the lemma is a general fact about an inequality involving multiplications and did not really belong in the file where it was.

Affected files:
```
Algebra.Group.UniqueProds
Algebra.Order.Monoid.Basic
```
@adomani adomani force-pushed the adomani_compute_degree_lemmas branch from fb204dd to 6712a61 Compare August 10, 2023 10:16
@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 Aug 10, 2023
@leanprover-community-mathlib4-bot
Copy link
Collaborator

Copy link
Contributor

@ocfnash ocfnash left a comment

Choose a reason for hiding this comment

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

Thanks!

Please apply the suggestions and then feel free to merge.

bors d+

Mathlib/Data/Polynomial/Degree/Definitions.lean Outdated Show resolved Hide resolved
Mathlib/Data/Polynomial/Degree/Lemmas.lean Outdated Show resolved Hide resolved
@bors
Copy link

bors bot commented Aug 10, 2023

✌️ adomani 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 Aug 10, 2023
Co-authored-by: Oliver Nash <github@olivernash.org>
@adomani
Copy link
Collaborator Author

adomani commented Aug 10, 2023

bors r+

bors bot pushed a commit that referenced this pull request Aug 10, 2023
This PR extracts some lemmas about polynomials that are helpful for the tactic `compute_degree` (#6221).

The signature of a theorem changed:
```lean
theorem coeff_pow_of_natDegree_le (pn : p.natDegree ≤ n) :
    (p ^ m).coeff (n * m) = p.coeff n ^ m  -- <-- the order of the product was `n * m`
    (p ^ m).coeff (m * n) = p.coeff n ^ m  -- <-- and it became `m * n`
```
Modified files:
```
Data/Polynomial/Basic.lean
Data/Polynomial/Degree/Lemmas.lean
Data/Polynomial/Degree/Definitions.lean
Data/Polynomial/Coeff.lean  -- for a "`simp` can prove this" golf
```
@bors
Copy link

bors bot commented Aug 10, 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 feat: simple lemmas about polynomials and their degrees [Merged by Bors] - feat: simple lemmas about polynomials and their degrees Aug 10, 2023
@bors bors bot closed this Aug 10, 2023
@bors bors bot deleted the adomani_compute_degree_lemmas branch August 10, 2023 13:44
semorrison pushed a commit that referenced this pull request Aug 14, 2023
…d_eq_of_le_of_le_of_mul_le` earlier (#6483)

This move was suggested in #6220.  In fact, the lemma is a general fact about an inequality involving multiplications and did not really belong in the file where it was.

Affected files:
```
Algebra.Group.UniqueProds
Algebra.Order.Monoid.Basic
```
semorrison pushed a commit that referenced this pull request Aug 14, 2023
This PR extracts some lemmas about polynomials that are helpful for the tactic `compute_degree` (#6221).

The signature of a theorem changed:
```lean
theorem coeff_pow_of_natDegree_le (pn : p.natDegree ≤ n) :
    (p ^ m).coeff (n * m) = p.coeff n ^ m  -- <-- the order of the product was `n * m`
    (p ^ m).coeff (m * n) = p.coeff n ^ m  -- <-- and it became `m * n`
```
Modified files:
```
Data/Polynomial/Basic.lean
Data/Polynomial/Degree/Lemmas.lean
Data/Polynomial/Degree/Definitions.lean
Data/Polynomial/Coeff.lean  -- for a "`simp` can prove this" golf
```
semorrison pushed a commit that referenced this pull request Aug 15, 2023
…d_eq_of_le_of_le_of_mul_le` earlier (#6483)

This move was suggested in #6220.  In fact, the lemma is a general fact about an inequality involving multiplications and did not really belong in the file where it was.

Affected files:
```
Algebra.Group.UniqueProds
Algebra.Order.Monoid.Basic
```
semorrison pushed a commit that referenced this pull request Aug 15, 2023
This PR extracts some lemmas about polynomials that are helpful for the tactic `compute_degree` (#6221).

The signature of a theorem changed:
```lean
theorem coeff_pow_of_natDegree_le (pn : p.natDegree ≤ n) :
    (p ^ m).coeff (n * m) = p.coeff n ^ m  -- <-- the order of the product was `n * m`
    (p ^ m).coeff (m * n) = p.coeff n ^ m  -- <-- and it became `m * n`
```
Modified files:
```
Data/Polynomial/Basic.lean
Data/Polynomial/Degree/Lemmas.lean
Data/Polynomial/Degree/Definitions.lean
Data/Polynomial/Coeff.lean  -- for a "`simp` can prove this" golf
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants