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] - chore(Data/List): Depend less on big operators #11741
Conversation
* Make `Data.List.Count`, `Data.List.Dedup`, `Data.List.ProdSigma`, `Data.List.Range`, `Data.List.Rotate`, `Data.List.Zip` not depend on `Data.List.BigOperators.Basic`. * As a consequence, move the big operators lemmas that were in there to `Data.List.BigOperators.Basic`. For the lemmas that were `Nat`-specific, keep a version of themin the original file but stated using `Nat.sum`. * To help with this, add `Nat.sum_eq_listSum (l : List Nat) : Nat.sum l = l.sum`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once #11729 is merged, could you rebase / merge master? It seems likely to give merge conflicts.
I'm not convinced this move is the best way to go: List.BigOperators.Basic
is (turning into) a random assortment of lemmas, I definitely have trouble parsing its internal structure. Moreover, feel like Finset.prod
requires way too many imports already and this PR looks like that amount will increase even more.
On the other hand, the alternative would be lots of files named e.g. Algebra.BigOperators.List.Dedup
that contain only a few results each is also an unsatisfying outcome. (Especially when we start working with more list operators.) In my opinion, that would be a better option but only marginally. Or do you have a better idea?
To me this is a second-order concern: the primary concern is to stop algebra, order theory and finiteness from leaking into each other (this PR is specifically concerned about the algebra → finiteness leak, can you believe we need rings to define finite sets!). Organising each sublibrary is tomorrow's job, not today's. Concretely, this means:
There are avenues to improve
I could improve the situation in this PR but that would increase the diff. |
I suppose this PR indeed makes things strictly better than the current situation. Unfortunately my laptop is broken so I can't test that everything ended up moved correctly. @fpvandoorn, would you like to assign yourself and finish the review?
…On 28 March 2024 17.53.17 CET, "Yaël Dillies" ***@***.***> wrote:
To me this is a second-order concern: the primary concern is to stop algebra, order theory and finiteness from leaking into each other (this PR is specifically concerned about the algebra → finiteness leak, can you believe we need rings to define finite sets!). Organising each sublibrary is tomorrow's job, not today's.
Concretely, this means:
* These lemmas have to move. They can't stay where they are because they concern algebra but are in finiteness files.
* `Data.List.BigOperators.Basic` is a mess, but already was before, and it's not really this PR's job to make the situation better.
There are avenues to improve `Data.List.BigOperators.Basic` in the future:
* Delete `Data.List.BigOperators.Lemmas` (this is the infamous "too much import for Basic" file every folder has)
* Instead have files graded according to the algebra imports they need. Something like this would be much better than what we have now:
* Monoid/group lemmas
* Ring lemmas
* Funkier stuff
* Move the order stuff to a new `Algebra.Order.BigOperators.List` file (this is already done in #11725)
I could improve the situation in this PR but that would increase the diff.
--
Reply to this email directly or view it on GitHub:
#11741 (comment)
You are receiving this because you were assigned.
Message ID: ***@***.***>
|
Thanks! bors merge |
✌️ YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with |
* Make `Data.List.Count`, `Data.List.Dedup`, `Data.List.ProdSigma`, `Data.List.Range`, `Data.List.Rotate`, `Data.List.Zip` not depend on `Data.List.BigOperators.Basic`. * As a consequence, move the big operators lemmas that were in there to `Data.List.BigOperators.Basic`. For the lemmas that were `Nat`-specific, keep a version of them in the original file but stated using `Nat.sum`. * To help with this, add `Nat.sum_eq_listSum (l : List Nat) : Nat.sum l = l.sum`.
Pull request successfully merged into master. Build succeeded: |
* Make `Data.List.Count`, `Data.List.Dedup`, `Data.List.ProdSigma`, `Data.List.Range`, `Data.List.Rotate`, `Data.List.Zip` not depend on `Data.List.BigOperators.Basic`. * As a consequence, move the big operators lemmas that were in there to `Data.List.BigOperators.Basic`. For the lemmas that were `Nat`-specific, keep a version of them in the original file but stated using `Nat.sum`. * To help with this, add `Nat.sum_eq_listSum (l : List Nat) : Nat.sum l = l.sum`.
* Make `Data.List.Count`, `Data.List.Dedup`, `Data.List.ProdSigma`, `Data.List.Range`, `Data.List.Rotate`, `Data.List.Zip` not depend on `Data.List.BigOperators.Basic`. * As a consequence, move the big operators lemmas that were in there to `Data.List.BigOperators.Basic`. For the lemmas that were `Nat`-specific, keep a version of them in the original file but stated using `Nat.sum`. * To help with this, add `Nat.sum_eq_listSum (l : List Nat) : Nat.sum l = l.sum`.
* Make `Data.List.Count`, `Data.List.Dedup`, `Data.List.ProdSigma`, `Data.List.Range`, `Data.List.Rotate`, `Data.List.Zip` not depend on `Data.List.BigOperators.Basic`. * As a consequence, move the big operators lemmas that were in there to `Data.List.BigOperators.Basic`. For the lemmas that were `Nat`-specific, keep a version of them in the original file but stated using `Nat.sum`. * To help with this, add `Nat.sum_eq_listSum (l : List Nat) : Nat.sum l = l.sum`.
* Make `Data.List.Count`, `Data.List.Dedup`, `Data.List.ProdSigma`, `Data.List.Range`, `Data.List.Rotate`, `Data.List.Zip` not depend on `Data.List.BigOperators.Basic`. * As a consequence, move the big operators lemmas that were in there to `Data.List.BigOperators.Basic`. For the lemmas that were `Nat`-specific, keep a version of them in the original file but stated using `Nat.sum`. * To help with this, add `Nat.sum_eq_listSum (l : List Nat) : Nat.sum l = l.sum`.
Data.List.Count
,Data.List.Dedup
,Data.List.ProdSigma
,Data.List.Range
,Data.List.Rotate
,Data.List.Zip
not depend onData.List.BigOperators.Basic
.Data.List.BigOperators.Basic
. For the lemmas that wereNat
-specific, keep a version of them in the original file but stated usingNat.sum
.Nat.sum_eq_listSum (l : List Nat) : Nat.sum l = l.sum
.