Skip to content

[Merged by Bors] - chore: Sort big operator order lemmas - #11750

Closed
YaelDillies wants to merge 9 commits into
masterfrom
move_order_big_ops
Closed

[Merged by Bors] - chore: Sort big operator order lemmas#11750
YaelDillies wants to merge 9 commits into
masterfrom
move_order_big_ops

Conversation

@YaelDillies

@YaelDillies YaelDillies commented Mar 28, 2024

Copy link
Copy Markdown
Contributor

Take the content of

  • some of Algebra.BigOperators.List.Basic
  • some of Algebra.BigOperators.List.Lemmas
  • some of Algebra.BigOperators.Multiset.Basic
  • some of Algebra.BigOperators.Multiset.Lemmas
  • Algebra.BigOperators.Multiset.Order
  • Algebra.BigOperators.Order

and sort it into six files:

Here are the design decisions at play:

  • Pure algebra and big operators algebra shouldn't import (algebraic) order theory. This PR makes that better, but not perfect because we still import Data.Nat.Order.Basic in a few List files.
  • It's Algebra.Order.BigOperators instead of Algebra.BigOperators.Order because algebraic order theory is more of a theory than big operators algebra. Another reason is that algebraic order theory is the only way to mix pure order and pure algebra, while there are more ways to mix pure finiteness and pure algebra than just big operators.
  • There are separate files for group/monoid lemmas vs ring lemmas. Groups/monoids are the natural setup for big operators, so their lemmas shouldn't be mixed with ring lemmas that involves both addition and multiplication. As a result, everything under Algebra.Order.BigOperators.Group should be additivisable (except a few Nat- or Int-specific lemmas). In contrast, things under Algebra.Order.BigOperators.Ring are more prone to having heavy imports.
  • Lemmas are separated according to List vs Multiset vs Finset. This is not strictly necessary, and can be relaxed in cases where there aren't that many lemmas to be had. As an example, I could split out the AbsoluteValue lemmas from Algebra.Order.BigOperators.Ring.Finset to a file Algebra.Order.BigOperators.Ring.AbsoluteValue and it could stay this way until too many lemmas are in this file (or a split is needed for import reasons), in which case we would need files Algebra.Order.BigOperators.Ring.AbsoluteValue.Finset, Algebra.Order.BigOperators.Ring.AbsoluteValue.Multiset, etc...
  • Finsupp big operator and finprod/finsum order lemmas also belong in Algebra.Order.BigOperators. I haven't done so in this PR because the diff is big enough like that.

Open in Gitpod

Take the content of
* some of `Algebra.BigOperators.List.Basic`
* some of `Algebra.BigOperators.List.Lemmas`
* `Algebra.BigOperators.Multiset.Basic`
* `Algebra.BigOperators.Multiset.lemmas`
* `Algebra.BigOperators.Order`

and sort it into six files:
* `Algebra.Order.BigOperators.Group.List`
* `Algebra.Order.BigOperators.Group.Multiset`
* `Algebra.Order.BigOperators.Group.Finset`
* `Algebra.Order.BigOperators.Ring.List`
* `Algebra.Order.BigOperators.Ring.Multiset`
* `Algebra.Order.BigOperators.Ring.Finset`

Here are the design decisions at play:
* Pure algebra and big operators algebra shouldn't import (algebraic) order theory. This PR makes that better, but not perfect because we still import `Data.Nat.Order.Basic` in a few `List` files.
* It's `Algebra.Order.BigOperators` instead of `Algebra.BigOperators.Order` because algebraic order theory is more a theory than big operators algebra. Another reason is that algebraic order theory is the only way to mix pure order and pure algebra, while there are more ways to mix pure finiteness and pure algebra than just big operators.
* There are separate files for group/monoid lemmas vs ring lemmas. Groups/monoids are the natural setup for big operators, so their lemmas shouldn't be mixed with ring lemmas that involves both addition and multiplication. As a result, everything under `Algebra.Order.BigOperators.Group` should be additivisable (except a few `Nat`- or `Int`-specific lemmas). In contrast, things under `Algebra.Order.BigOperators.Ring` are more prone to having heavy imports.
* Lemmas are separated according to `List` vs `Multiset` vs `Finset`. This is not strictly necessary, and can be relaxed in cases where there aren't that many lemmas to be had. As an example, I could split out the `AbsoluteValue` lemmas from `Algebra.Order.BigOperators.Ring.Finset` to a file `Algebra.Order.BigOperators.Ring.AbsoluteValue` and it could stay this way until too many lemmas are in this file (or a split is needed for import reasons), in which case we would need files `Algebra.Order.BigOperators.Ring.AbsoluteValue.Finset`, `Algebra.Order.BigOperators.Ring.AbsoluteValue.Multiset`, etc...
* `Finsupp` big operator and `finprod`/`finsum` order lemmas also belong in `Algebra.Order.BigOperators`. I haven't done so in this PR because the diff is big enough like that.
@YaelDillies YaelDillies added awaiting-review awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. t-algebra Algebra (groups, rings, fields, etc) t-order Order theory labels Mar 28, 2024
Comment thread Mathlib.lean Outdated
@YaelDillies
YaelDillies requested a review from kim-em March 28, 2024 20:46
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Mar 29, 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 Mar 30, 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 Mar 31, 2024
@YaelDillies
YaelDillies requested a review from fpvandoorn March 31, 2024 06:43
@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 5, 2024
@fpvandoorn

Copy link
Copy Markdown
Member

LGTM. It is hard to check from the diff that nothing got lost/changed, but if Mathlib builds, I'll trust that that's the case.

bors d+

@mathlib-bors

mathlib-bors Bot commented Apr 5, 2024

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Apr 5, 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 5, 2024
@YaelDillies

Copy link
Copy Markdown
Contributor Author

bors merge

mathlib-bors Bot pushed a commit that referenced this pull request Apr 5, 2024
Take the content of
* some of `Algebra.BigOperators.List.Basic`
* some of `Algebra.BigOperators.List.Lemmas`
* some of `Algebra.BigOperators.Multiset.Basic`
* some of `Algebra.BigOperators.Multiset.Lemmas`
* `Algebra.BigOperators.Multiset.Order`
* `Algebra.BigOperators.Order`

and sort it into six files:
* `Algebra.Order.BigOperators.Group.List`. I credit Yakov for leanprover-community/mathlib3#8543.
* `Algebra.Order.BigOperators.Group.Multiset`. Copyright inherited from `Algebra.BigOperators.Multiset.Order`.
* `Algebra.Order.BigOperators.Group.Finset`. Copyright inherited from `Algebra.BigOperators.Order`.
* `Algebra.Order.BigOperators.Ring.List`. I credit Stuart for leanprover-community/mathlib3#10184.
* `Algebra.Order.BigOperators.Ring.Multiset`. I credit Ruben for leanprover-community/mathlib3#8787.
* `Algebra.Order.BigOperators.Ring.Finset`. I credit Floris for leanprover-community/mathlib3#1294.

Here are the design decisions at play:
* Pure algebra and big operators algebra shouldn't import (algebraic) order theory. This PR makes that better, but not perfect because we still import `Data.Nat.Order.Basic` in a few `List` files.
* It's `Algebra.Order.BigOperators` instead of `Algebra.BigOperators.Order` because algebraic order theory is more of a theory than big operators algebra. Another reason is that algebraic order theory is the only way to mix pure order and pure algebra, while there are more ways to mix pure finiteness and pure algebra than just big operators.
* There are separate files for group/monoid lemmas vs ring lemmas. Groups/monoids are the natural setup for big operators, so their lemmas shouldn't be mixed with ring lemmas that involves both addition and multiplication. As a result, everything under `Algebra.Order.BigOperators.Group` should be additivisable (except a few `Nat`- or `Int`-specific lemmas). In contrast, things under `Algebra.Order.BigOperators.Ring` are more prone to having heavy imports.
* Lemmas are separated according to `List` vs `Multiset` vs `Finset`. This is not strictly necessary, and can be relaxed in cases where there aren't that many lemmas to be had. As an example, I could split out the `AbsoluteValue` lemmas from `Algebra.Order.BigOperators.Ring.Finset` to a file `Algebra.Order.BigOperators.Ring.AbsoluteValue` and it could stay this way until too many lemmas are in this file (or a split is needed for import reasons), in which case we would need files `Algebra.Order.BigOperators.Ring.AbsoluteValue.Finset`, `Algebra.Order.BigOperators.Ring.AbsoluteValue.Multiset`, etc...
* `Finsupp` big operator and `finprod`/`finsum` order lemmas also belong in `Algebra.Order.BigOperators`. I haven't done so in this PR because the diff is big enough like that.
@mathlib-bors

mathlib-bors Bot commented Apr 5, 2024

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore: Sort big operator order lemmas [Merged by Bors] - chore: Sort big operator order lemmas Apr 5, 2024
@mathlib-bors mathlib-bors Bot closed this Apr 5, 2024
@mathlib-bors
mathlib-bors Bot deleted the move_order_big_ops branch April 5, 2024 17:00
xgenereux pushed a commit that referenced this pull request Apr 15, 2024
Take the content of
* some of `Algebra.BigOperators.List.Basic`
* some of `Algebra.BigOperators.List.Lemmas`
* some of `Algebra.BigOperators.Multiset.Basic`
* some of `Algebra.BigOperators.Multiset.Lemmas`
* `Algebra.BigOperators.Multiset.Order`
* `Algebra.BigOperators.Order`

and sort it into six files:
* `Algebra.Order.BigOperators.Group.List`. I credit Yakov for leanprover-community/mathlib3#8543.
* `Algebra.Order.BigOperators.Group.Multiset`. Copyright inherited from `Algebra.BigOperators.Multiset.Order`.
* `Algebra.Order.BigOperators.Group.Finset`. Copyright inherited from `Algebra.BigOperators.Order`.
* `Algebra.Order.BigOperators.Ring.List`. I credit Stuart for leanprover-community/mathlib3#10184.
* `Algebra.Order.BigOperators.Ring.Multiset`. I credit Ruben for leanprover-community/mathlib3#8787.
* `Algebra.Order.BigOperators.Ring.Finset`. I credit Floris for leanprover-community/mathlib3#1294.

Here are the design decisions at play:
* Pure algebra and big operators algebra shouldn't import (algebraic) order theory. This PR makes that better, but not perfect because we still import `Data.Nat.Order.Basic` in a few `List` files.
* It's `Algebra.Order.BigOperators` instead of `Algebra.BigOperators.Order` because algebraic order theory is more of a theory than big operators algebra. Another reason is that algebraic order theory is the only way to mix pure order and pure algebra, while there are more ways to mix pure finiteness and pure algebra than just big operators.
* There are separate files for group/monoid lemmas vs ring lemmas. Groups/monoids are the natural setup for big operators, so their lemmas shouldn't be mixed with ring lemmas that involves both addition and multiplication. As a result, everything under `Algebra.Order.BigOperators.Group` should be additivisable (except a few `Nat`- or `Int`-specific lemmas). In contrast, things under `Algebra.Order.BigOperators.Ring` are more prone to having heavy imports.
* Lemmas are separated according to `List` vs `Multiset` vs `Finset`. This is not strictly necessary, and can be relaxed in cases where there aren't that many lemmas to be had. As an example, I could split out the `AbsoluteValue` lemmas from `Algebra.Order.BigOperators.Ring.Finset` to a file `Algebra.Order.BigOperators.Ring.AbsoluteValue` and it could stay this way until too many lemmas are in this file (or a split is needed for import reasons), in which case we would need files `Algebra.Order.BigOperators.Ring.AbsoluteValue.Finset`, `Algebra.Order.BigOperators.Ring.AbsoluteValue.Multiset`, etc...
* `Finsupp` big operator and `finprod`/`finsum` order lemmas also belong in `Algebra.Order.BigOperators`. I haven't done so in this PR because the diff is big enough like that.
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
Take the content of
* some of `Algebra.BigOperators.List.Basic`
* some of `Algebra.BigOperators.List.Lemmas`
* some of `Algebra.BigOperators.Multiset.Basic`
* some of `Algebra.BigOperators.Multiset.Lemmas`
* `Algebra.BigOperators.Multiset.Order`
* `Algebra.BigOperators.Order`

and sort it into six files:
* `Algebra.Order.BigOperators.Group.List`. I credit Yakov for leanprover-community/mathlib3#8543.
* `Algebra.Order.BigOperators.Group.Multiset`. Copyright inherited from `Algebra.BigOperators.Multiset.Order`.
* `Algebra.Order.BigOperators.Group.Finset`. Copyright inherited from `Algebra.BigOperators.Order`.
* `Algebra.Order.BigOperators.Ring.List`. I credit Stuart for leanprover-community/mathlib3#10184.
* `Algebra.Order.BigOperators.Ring.Multiset`. I credit Ruben for leanprover-community/mathlib3#8787.
* `Algebra.Order.BigOperators.Ring.Finset`. I credit Floris for leanprover-community/mathlib3#1294.

Here are the design decisions at play:
* Pure algebra and big operators algebra shouldn't import (algebraic) order theory. This PR makes that better, but not perfect because we still import `Data.Nat.Order.Basic` in a few `List` files.
* It's `Algebra.Order.BigOperators` instead of `Algebra.BigOperators.Order` because algebraic order theory is more of a theory than big operators algebra. Another reason is that algebraic order theory is the only way to mix pure order and pure algebra, while there are more ways to mix pure finiteness and pure algebra than just big operators.
* There are separate files for group/monoid lemmas vs ring lemmas. Groups/monoids are the natural setup for big operators, so their lemmas shouldn't be mixed with ring lemmas that involves both addition and multiplication. As a result, everything under `Algebra.Order.BigOperators.Group` should be additivisable (except a few `Nat`- or `Int`-specific lemmas). In contrast, things under `Algebra.Order.BigOperators.Ring` are more prone to having heavy imports.
* Lemmas are separated according to `List` vs `Multiset` vs `Finset`. This is not strictly necessary, and can be relaxed in cases where there aren't that many lemmas to be had. As an example, I could split out the `AbsoluteValue` lemmas from `Algebra.Order.BigOperators.Ring.Finset` to a file `Algebra.Order.BigOperators.Ring.AbsoluteValue` and it could stay this way until too many lemmas are in this file (or a split is needed for import reasons), in which case we would need files `Algebra.Order.BigOperators.Ring.AbsoluteValue.Finset`, `Algebra.Order.BigOperators.Ring.AbsoluteValue.Multiset`, etc...
* `Finsupp` big operator and `finprod`/`finsum` order lemmas also belong in `Algebra.Order.BigOperators`. I haven't done so in this PR because the diff is big enough like that.
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
Take the content of
* some of `Algebra.BigOperators.List.Basic`
* some of `Algebra.BigOperators.List.Lemmas`
* some of `Algebra.BigOperators.Multiset.Basic`
* some of `Algebra.BigOperators.Multiset.Lemmas`
* `Algebra.BigOperators.Multiset.Order`
* `Algebra.BigOperators.Order`

and sort it into six files:
* `Algebra.Order.BigOperators.Group.List`. I credit Yakov for leanprover-community/mathlib3#8543.
* `Algebra.Order.BigOperators.Group.Multiset`. Copyright inherited from `Algebra.BigOperators.Multiset.Order`.
* `Algebra.Order.BigOperators.Group.Finset`. Copyright inherited from `Algebra.BigOperators.Order`.
* `Algebra.Order.BigOperators.Ring.List`. I credit Stuart for leanprover-community/mathlib3#10184.
* `Algebra.Order.BigOperators.Ring.Multiset`. I credit Ruben for leanprover-community/mathlib3#8787.
* `Algebra.Order.BigOperators.Ring.Finset`. I credit Floris for leanprover-community/mathlib3#1294.

Here are the design decisions at play:
* Pure algebra and big operators algebra shouldn't import (algebraic) order theory. This PR makes that better, but not perfect because we still import `Data.Nat.Order.Basic` in a few `List` files.
* It's `Algebra.Order.BigOperators` instead of `Algebra.BigOperators.Order` because algebraic order theory is more of a theory than big operators algebra. Another reason is that algebraic order theory is the only way to mix pure order and pure algebra, while there are more ways to mix pure finiteness and pure algebra than just big operators.
* There are separate files for group/monoid lemmas vs ring lemmas. Groups/monoids are the natural setup for big operators, so their lemmas shouldn't be mixed with ring lemmas that involves both addition and multiplication. As a result, everything under `Algebra.Order.BigOperators.Group` should be additivisable (except a few `Nat`- or `Int`-specific lemmas). In contrast, things under `Algebra.Order.BigOperators.Ring` are more prone to having heavy imports.
* Lemmas are separated according to `List` vs `Multiset` vs `Finset`. This is not strictly necessary, and can be relaxed in cases where there aren't that many lemmas to be had. As an example, I could split out the `AbsoluteValue` lemmas from `Algebra.Order.BigOperators.Ring.Finset` to a file `Algebra.Order.BigOperators.Ring.AbsoluteValue` and it could stay this way until too many lemmas are in this file (or a split is needed for import reasons), in which case we would need files `Algebra.Order.BigOperators.Ring.AbsoluteValue.Finset`, `Algebra.Order.BigOperators.Ring.AbsoluteValue.Multiset`, etc...
* `Finsupp` big operator and `finprod`/`finsum` order lemmas also belong in `Algebra.Order.BigOperators`. I haven't done so in this PR because the diff is big enough like that.
callesonne pushed a commit that referenced this pull request Apr 22, 2024
Take the content of
* some of `Algebra.BigOperators.List.Basic`
* some of `Algebra.BigOperators.List.Lemmas`
* some of `Algebra.BigOperators.Multiset.Basic`
* some of `Algebra.BigOperators.Multiset.Lemmas`
* `Algebra.BigOperators.Multiset.Order`
* `Algebra.BigOperators.Order`

and sort it into six files:
* `Algebra.Order.BigOperators.Group.List`. I credit Yakov for leanprover-community/mathlib3#8543.
* `Algebra.Order.BigOperators.Group.Multiset`. Copyright inherited from `Algebra.BigOperators.Multiset.Order`.
* `Algebra.Order.BigOperators.Group.Finset`. Copyright inherited from `Algebra.BigOperators.Order`.
* `Algebra.Order.BigOperators.Ring.List`. I credit Stuart for leanprover-community/mathlib3#10184.
* `Algebra.Order.BigOperators.Ring.Multiset`. I credit Ruben for leanprover-community/mathlib3#8787.
* `Algebra.Order.BigOperators.Ring.Finset`. I credit Floris for leanprover-community/mathlib3#1294.

Here are the design decisions at play:
* Pure algebra and big operators algebra shouldn't import (algebraic) order theory. This PR makes that better, but not perfect because we still import `Data.Nat.Order.Basic` in a few `List` files.
* It's `Algebra.Order.BigOperators` instead of `Algebra.BigOperators.Order` because algebraic order theory is more of a theory than big operators algebra. Another reason is that algebraic order theory is the only way to mix pure order and pure algebra, while there are more ways to mix pure finiteness and pure algebra than just big operators.
* There are separate files for group/monoid lemmas vs ring lemmas. Groups/monoids are the natural setup for big operators, so their lemmas shouldn't be mixed with ring lemmas that involves both addition and multiplication. As a result, everything under `Algebra.Order.BigOperators.Group` should be additivisable (except a few `Nat`- or `Int`-specific lemmas). In contrast, things under `Algebra.Order.BigOperators.Ring` are more prone to having heavy imports.
* Lemmas are separated according to `List` vs `Multiset` vs `Finset`. This is not strictly necessary, and can be relaxed in cases where there aren't that many lemmas to be had. As an example, I could split out the `AbsoluteValue` lemmas from `Algebra.Order.BigOperators.Ring.Finset` to a file `Algebra.Order.BigOperators.Ring.AbsoluteValue` and it could stay this way until too many lemmas are in this file (or a split is needed for import reasons), in which case we would need files `Algebra.Order.BigOperators.Ring.AbsoluteValue.Finset`, `Algebra.Order.BigOperators.Ring.AbsoluteValue.Multiset`, etc...
* `Finsupp` big operator and `finprod`/`finsum` order lemmas also belong in `Algebra.Order.BigOperators`. I haven't done so in this PR because the diff is big enough like that.
Vierkantor added a commit that referenced this pull request Oct 24, 2024
This file seems to contain many unused imports. Some of them were around from the start of the file, and some were added in #11750 for reasons I don't entirely understand.

(Context: I'm checking which `Defs.lean` files actually only provide definitions.)
mathlib-bors Bot pushed a commit that referenced this pull request Oct 24, 2024
This file seems to contain many unused imports. Some of them were around from the start of the file, and some were added in #11750 for reasons I don't entirely understand.

(Context: I'm checking which `Defs.lean` files actually only provide definitions.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). t-algebra Algebra (groups, rings, fields, etc) t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants