chore(Data/List): Depend less on big operators
- Make
Data.List.Count,Data.List.Dedup,Data.List.ProdSigma,Data.List.Range,Data.List.Rotate,Data.List.Zipnot depend onData.List.BigOperators.Basic. - As a consequence, move the big operators lemmas that were in there to
Data.List.BigOperators.Basic. For the lemmas that wereNat-specific, keep a version of themin the original file but stated usingNat.sum. - To help with this, add
Nat.sum_eq_listSum (l : List Nat) : Nat.sum l = l.sum.
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.Basicis 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.Listfile (this is already done in #11725)
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.Basicis 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.Basicin 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.Listfile (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: https://github.com/leanprover-community/mathlib4/pull/11741#issuecomment-2025680801 You are receiving this because you were assigned.
Message ID: @.***>
Thanks!
bors merge bors d+
:v: 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.
Pull request successfully merged into master.
Build succeeded: