Skip to content

[Merged by Bors] - chore: Move sign of power lemmas#11986

Closed
YaelDillies wants to merge 12 commits intomasterfrom
generalise_even_pow_nonneg
Closed

[Merged by Bors] - chore: Move sign of power lemmas#11986
YaelDillies wants to merge 12 commits intomasterfrom
generalise_even_pow_nonneg

Conversation

@YaelDillies
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies commented Apr 7, 2024

  • Move the sign of power lemmas from Algebra.Parity to Algebra.GroupPower.Order.
  • For this to work, I must swap the order of import between Algebra.GroupPower.Order and Algebra.Parity. This means that I need to weaken one assert_not_exists to allow importing Data.Set.Defs. This is inconsequential.
  • Use them to golf and deprecate the bit0/bit1 lemmas
  • Delete the deprecated pow_bit0_abs, pow_bit0_pos_of_neg, pow_bit1_neg

* Generalise the lemmas in `Algebra.Parity` from `LinearOrderedRing` to `LinearOrderedSemiring` + `ExistsAddOfLE`. This means they now apply to eg `ℕ`.
* Move them to `Algebra.GroupPower.Order`.
* For this to work, I must swap the order of import between `Algebra.GroupPower.Order` and `Algebra.Parity`. This means that I need to weaken one `assert_not_exists` to allow importing `Data.Set.Defs`. This is inconsequential.
* Rename a bunch of variables in `Algebra.Parity` as I need a new lemma about `a b : α` and `m n : ℕ` but the names were used as `m n : α` and `a b : ℕ`.
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Apr 8, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Apr 14, 2024
Copy link
Copy Markdown
Contributor

@Ruben-VandeVelde Ruben-VandeVelde left a comment

Choose a reason for hiding this comment

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

I think this is doing a bit too much at once, but I'll try to split it up a bit myself. Please give me a day or two.

@YaelDillies
Copy link
Copy Markdown
Contributor Author

I did the minimal amount of fixes, but if you can find something smaller I'm all ears!

@ghost ghost added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Apr 20, 2024
@YaelDillies YaelDillies force-pushed the generalise_even_pow_nonneg branch from 71875c8 to d5b974e Compare April 20, 2024 19:06
@ghost ghost removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Apr 21, 2024
@YaelDillies YaelDillies changed the title refactor: Generalise sign of power lemmas chore: Move sign of power lemmas Apr 22, 2024
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Apr 24, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Apr 24, 2024
Comment on lines -305 to -313
theorem pow_bit0_pos_of_neg (ha : a < 0) (n : ℕ) : 0 < a ^ bit0 n := by
rw [pow_bit0']
exact pow_pos (mul_pos_of_neg_of_neg ha ha) _
#align pow_bit0_pos_of_neg pow_bit0_pos_of_neg

theorem pow_bit1_neg (ha : a < 0) (n : ℕ) : a ^ bit1 n < 0 := by
rw [bit1, pow_succ']
exact mul_neg_of_neg_of_pos ha (pow_bit0_pos_of_neg ha n)
#align pow_bit1_neg pow_bit1_neg
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where did these lemmas go?

Copy link
Copy Markdown
Contributor Author

@YaelDillies YaelDillies Apr 24, 2024

Choose a reason for hiding this comment

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

They were about long-deprecated declarations, so I simply removed them instead of trying to move them

@Vierkantor
Copy link
Copy Markdown
Contributor

This looks good to me. @Ruben-VandeVelde, what exactly would you like to simplify in this PR?

@YaelDillies
Copy link
Copy Markdown
Contributor Author

@Vierkantor, it was done. See #12288 and #12289

Copy link
Copy Markdown
Contributor

@Ruben-VandeVelde Ruben-VandeVelde left a comment

Choose a reason for hiding this comment

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

Apologies for the delay.

maintainer merge

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 6, 2024

🚀 Pull request has been placed on the maintainer queue by Ruben-VandeVelde.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label May 6, 2024
Copy link
Copy Markdown
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

@ghost ghost added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels May 7, 2024
mathlib-bors bot pushed a commit that referenced this pull request May 7, 2024
* Move the sign of power lemmas from `Algebra.Parity` to `Algebra.GroupPower.Order`.
* For this to work, I must swap the order of import between `Algebra.GroupPower.Order` and `Algebra.Parity`. This means that I need to weaken one `assert_not_exists` to allow importing `Data.Set.Defs`. This is inconsequential.
* Use them to golf and deprecate the `bit0`/`bit1` lemmas
* Delete the deprecated `pow_bit0_abs`, `pow_bit0_pos_of_neg`, `pow_bit1_neg`



Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented May 7, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: Move sign of power lemmas [Merged by Bors] - chore: Move sign of power lemmas May 7, 2024
@mathlib-bors mathlib-bors bot closed this May 7, 2024
@mathlib-bors mathlib-bors bot deleted the generalise_even_pow_nonneg branch May 7, 2024 09:25
apnelson1 pushed a commit that referenced this pull request May 12, 2024
* Move the sign of power lemmas from `Algebra.Parity` to `Algebra.GroupPower.Order`.
* For this to work, I must swap the order of import between `Algebra.GroupPower.Order` and `Algebra.Parity`. This means that I need to weaken one `assert_not_exists` to allow importing `Data.Set.Defs`. This is inconsequential.
* Use them to golf and deprecate the `bit0`/`bit1` lemmas
* Delete the deprecated `pow_bit0_abs`, `pow_bit0_pos_of_neg`, `pow_bit1_neg`



Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
callesonne pushed a commit that referenced this pull request May 16, 2024
* Move the sign of power lemmas from `Algebra.Parity` to `Algebra.GroupPower.Order`.
* For this to work, I must swap the order of import between `Algebra.GroupPower.Order` and `Algebra.Parity`. This means that I need to weaken one `assert_not_exists` to allow importing `Data.Set.Defs`. This is inconsequential.
* Use them to golf and deprecate the `bit0`/`bit1` lemmas
* Delete the deprecated `pow_bit0_abs`, `pow_bit0_pos_of_neg`, `pow_bit1_neg`



Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc) t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants