[Merged by Bors] - chore(Data/Set): split Finite.lean into Defs, Basic, Lemmas#18619
[Merged by Bors] - chore(Data/Set): split Finite.lean into Defs, Basic, Lemmas#18619Vierkantor wants to merge 21 commits intomasterfrom
Defs, Basic, Lemmas#18619Conversation
PR summary fdb9025585Import changes exceeding 2%
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Data.DFinsupp.Defs | 510 | 449 | -61 (-11.96%) |
| Mathlib.Order.Interval.Set.Infinite | 510 | 450 | -60 (-11.76%) |
| Mathlib.Data.MLList.BestFirst | 514 | 455 | -59 (-11.48%) |
| Mathlib.Algebra.Group.FiniteSupport | 519 | 460 | -59 (-11.37%) |
| Mathlib.Data.Finite.Defs | 133 | 148 | +15 (+11.28%) |
| Mathlib.Algebra.Star.Pointwise | 573 | 525 | -48 (-8.38%) |
| Mathlib.Data.Finset.Grade | 589 | 547 | -42 (-7.13%) |
| Mathlib.Combinatorics.SimpleGraph.Basic | 516 | 482 | -34 (-6.59%) |
| Mathlib.Data.Set.Pointwise.Finite | 526 | 492 | -34 (-6.46%) |
| Mathlib.Data.Finsupp.Defs | 528 | 497 | -31 (-5.87%) |
| Mathlib.Data.Fintype.Order | 531 | 500 | -31 (-5.84%) |
| Mathlib.Data.Finset.Preimage | 512 | 484 | -28 (-5.47%) |
| Mathlib.Order.SupClosed | 513 | 487 | -26 (-5.07%) |
| Mathlib.Combinatorics.Hall.Finite | 510 | 485 | -25 (-4.90%) |
| Mathlib.Order.CompleteSublattice | 516 | 493 | -23 (-4.46%) |
| Mathlib.Data.Fintype.Fin | 526 | 503 | -23 (-4.37%) |
| Mathlib.Data.Set.Countable | 527 | 504 | -23 (-4.36%) |
| Mathlib.Order.SuccPred.LinearLocallyFinite | 588 | 564 | -24 (-4.08%) |
| Mathlib.GroupTheory.GroupAction.Basic | 576 | 553 | -23 (-3.99%) |
| Mathlib.Algebra.BigOperators.Group.Finset | 526 | 505 | -21 (-3.99%) |
| Mathlib.Data.Finset.NAry | 510 | 490 | -20 (-3.92%) |
| Mathlib.Data.Finset.Slice | 531 | 511 | -20 (-3.77%) |
| Mathlib.Combinatorics.SetFamily.Shatter | 532 | 512 | -20 (-3.76%) |
| Mathlib.Data.Finset.Interval | 595 | 573 | -22 (-3.70%) |
| Mathlib.Order.Partition.Finpartition | 537 | 518 | -19 (-3.54%) |
| Mathlib.RingTheory.NonUnitalSubsemiring.Basic | 588 | 568 | -20 (-3.40%) |
| Mathlib.Algebra.BigOperators.Ring | 564 | 545 | -19 (-3.37%) |
| Mathlib.Data.Setoid.Partition | 538 | 520 | -18 (-3.35%) |
| Mathlib.Data.Set.MemPartition | 510 | 493 | -17 (-3.33%) |
| Mathlib.Order.Filter.Basic | 511 | 494 | -17 (-3.33%) |
| Mathlib.Order.PartialSups | 512 | 495 | -17 (-3.32%) |
| Mathlib.Algebra.Ring.Subsemiring.Basic | 606 | 586 | -20 (-3.30%) |
| Mathlib.Order.UpperLower.LocallyFinite | 523 | 506 | -17 (-3.25%) |
| Mathlib.Order.Atoms.Finite | 529 | 512 | -17 (-3.21%) |
| Mathlib.Order.ConditionallyCompleteLattice.Finset | 512 | 496 | -16 (-3.12%) |
| Mathlib.Data.Nat.PrimeFin | 549 | 532 | -17 (-3.10%) |
| Mathlib.Algebra.Order.Rearrangement | 665 | 645 | -20 (-3.01%) |
| Mathlib.Algebra.Module.Submodule.Range | 616 | 598 | -18 (-2.92%) |
| Mathlib.Combinatorics.SimpleGraph.Dart | 517 | 502 | -15 (-2.90%) |
| Mathlib.Order.Category.NonemptyFinLinOrd | 646 | 628 | -18 (-2.79%) |
| Mathlib.Order.KonigLemma | 594 | 578 | -16 (-2.69%) |
| Mathlib.Algebra.BigOperators.Finprod | 595 | 579 | -16 (-2.69%) |
| Mathlib.RingTheory.Localization.Defs | 684 | 666 | -18 (-2.63%) |
| Mathlib.Order.Partition.Equipartition | 602 | 587 | -15 (-2.49%) |
| Mathlib.GroupTheory.Perm.ClosureSwap | 646 | 631 | -15 (-2.32%) |
| Mathlib.Combinatorics.SimpleGraph.Maps | 519 | 507 | -12 (-2.31%) |
| Mathlib.Data.Fintype.Pi | 441 | 451 | +10 (+2.27%) |
| Mathlib.GroupTheory.Perm.Sign | 672 | 657 | -15 (-2.23%) |
| Mathlib.Algebra.Group.Pointwise.Finset.Basic | 675 | 666 | -9 (-1.33%) |
| Mathlib.Combinatorics.HalesJewett | 534 | 527 | -7 (-1.31%) |
| Mathlib.Data.Fintype.CardEmbedding | 532 | 526 | -6 (-1.13%) |
| Mathlib.AlgebraicTopology.SplitSimplicialObject | 823 | 814 | -9 (-1.09%) |
| Mathlib.Combinatorics.SimpleGraph.Finite | 555 | 549 | -6 (-1.08%) |
| Mathlib.Order.Filter.AtTopBot | 540 | 535 | -5 (-0.93%) |
| Mathlib.SetTheory.Cardinal.Basic | 640 | 635 | -5 (-0.78%) |
| Mathlib.GroupTheory.GroupAction.Quotient | 720 | 715 | -5 (-0.69%) |
| Mathlib.MeasureTheory.SetAlgebra | 548 | 547 | -1 (-0.18%) |
| Mathlib.LinearAlgebra.Multilinear.Basic | 745 | 744 | -1 (-0.13%) |
| Mathlib.Algebra.Group.ConjFinite | 752 | 751 | -1 (-0.13%) |
Import changes for all files
| Files | Import difference |
|---|---|
| There are 3087 files with changed transitive imports taking up over 133114 characters: this is too many to display! | |
You can run scripts/import_trans_difference.sh all locally to see the whole output. |
Declarations diff
No declarations were harmed in the making of this PR! 🐙
You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>The doc-module for script/declarations_diff.sh contains some details about this script.
Increase in tech debt: (relative, absolute) = (0.14, 0.00)
| Current number | Change | Type |
|---|---|---|
| 65 | -1 | large files |
| 220 | 4 | bare open (scoped) Classical |
Current commit fdb9025585
Reference commit 6ae3e986f0
You can run this locally as
./scripts/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
|
Hmm, Bhavik and I had another plan. I will write more later |
1a666e1 to
034a398
Compare
|
@YaelDillies please do, when you're able:) |
|
Sorry for the delay. My wrists feel better today, so here are my thoughts:
Therefore, Bhavik and I's plan was to/I would suggest you do the following:
|
|
Thanks for writing out your suggestions, I'll try them out and see how it goes. |
1cf3f03 to
6f234b2
Compare
e88f9c2 to
bf06429
Compare
|
Okay, everything builds so I think this is ready for review again. Does this match your plans somewhat, @YaelDillies? :) |
|
Something seems off. Why is this PR adding 600 more lines than it is removing? |
YaelDillies
left a comment
There was a problem hiding this comment.
Having gone through the entire diff, it looks like those 600 new lines are all accounted for by the module docs of the new files! 😳
I like the new file structure, but I would still like Finite and Set.Finite to be closer to each other. See below for concrete suggestions.
Mathlib/Data/Set/CoeSort.lean
Outdated
There was a problem hiding this comment.
Why are you splitting this off Data.Set.Operations? Should this be a separate PR?
There was a problem hiding this comment.
Data.Set.Operations pulls in quite a bit of unneeded imports via Logic.Function.Basic and Mathlib.Data.SProd. But looking at the import graph right now, it doesn't seem quite as hefty as I remembered, so I'm not opposed to dropping the change, or adding it to a separate PR for further debate. What would you prefer?
There was a problem hiding this comment.
I thought Data.Set.Operations was supposed to be very light, so I am wary of atomising it even further. Either dropping the change or moving it to a separate PR would be fine
There was a problem hiding this comment.
I just dropped the change.
There was a problem hiding this comment.
Oh, now there's a build error in Mathlib/Algebra/Group/Int.lean:20:18: Declaration @Set.range is not allowed to be imported by this file.
It is defined in Mathlib.Data.Set.Operations,
which is imported by Mathlib.Data.Finite.Defs,
which is imported by Mathlib.Algebra.Group.TypeTags,
which is imported by Mathlib.Algebra.Group.Even,
which is imported by Mathlib.Algebra.Group.Nat,
which is imported by this file.
There was a problem hiding this comment.
I have reverted the revert of the splitting, and I'll make a new PR for it. (Which this one will need to depend on.)
There was a problem hiding this comment.
That assert_not_exists seems... too stringent
There was a problem hiding this comment.
True, and I don't like the dependency on the other PR. I think I will drop the assert_not_exists and make a note to readd it in #19031.
aabae69 to
825cf38
Compare
This reverts commit 90aa687.
8f0f1d0 to
53e7997
Compare
|
Thanks! This looks very good now. The extra 10 imports to maintainer merge |
|
Thanks 🎉 bors merge |
…8619) `Data.Set.Finite` had a lot of imports and in turn was imported often. So let's split it up along import lines: * `Data/Finite/Defs.lean` now contains the definition of `Set.Finite` * `Data/Set/Finite/Basic.lean` knows only `Set.Finite` and `Finset` * `Data/Finite/Prod.lean` now contains finiteness results of products of sets * `Data/Fintype/Pi.lean` now contains finiteness results of sets of functions * `Data/Set/Finite/Lattice.lean` contains finiteness results of lattice operations on sets * `Data/Set/Finite/List.lean` contains finiteness results on lists converted to sets * `Data/Set/Finite/Monad.lean` also knows about the monad structure on `Set` * `Data/Set/Finite/Powerset.lean` contains finiteness results on powersets * `Data/Set/Finite/Range.lean` contains finiteness results on `Set.range` * `Data/Set/Finite/Lemmas.lean` is for lemmas *about* `Set.Finite` (and therefore does not contain any `Finite` instances itself). Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
|
Pull request successfully merged into master. Build succeeded: |
Defs, Basic, LemmasDefs, Basic, Lemmas
Although `Data.Set.Operations` is somewhat light-weight, it still pulls in a few imports. In particular, if we want to move the definition of `Set.Finite` to `Data.Finite.Defs`, then `Algebra.Group.Int` will complain that it's not allowed to import `Set.range` from `Data.Set.Operations`; this split will allow us to do the move without removing an `assert_not_exists`. See also this discussion on GitHub: #18619 (comment)
…8619) `Data.Set.Finite` had a lot of imports and in turn was imported often. So let's split it up along import lines: * `Data/Finite/Defs.lean` now contains the definition of `Set.Finite` * `Data/Set/Finite/Basic.lean` knows only `Set.Finite` and `Finset` * `Data/Finite/Prod.lean` now contains finiteness results of products of sets * `Data/Fintype/Pi.lean` now contains finiteness results of sets of functions * `Data/Set/Finite/Lattice.lean` contains finiteness results of lattice operations on sets * `Data/Set/Finite/List.lean` contains finiteness results on lists converted to sets * `Data/Set/Finite/Monad.lean` also knows about the monad structure on `Set` * `Data/Set/Finite/Powerset.lean` contains finiteness results on powersets * `Data/Set/Finite/Range.lean` contains finiteness results on `Set.range` * `Data/Set/Finite/Lemmas.lean` is for lemmas *about* `Set.Finite` (and therefore does not contain any `Finite` instances itself). Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Although `Data.Set.Operations` is somewhat light-weight, it still pulls in a few imports. In particular, if we want to move the definition of `Set.Finite` to `Data.Finite.Defs`, then `Algebra.Group.Int` will complain that it's not allowed to import `Set.range` from `Data.Set.Operations`; this split will allow us to do the move without removing an `assert_not_exists`. See also this discussion on GitHub: #18619 (comment)
Although `Data.Set.Operations` is somewhat light-weight, it still pulls in a few imports. In particular, if we want to move the definition of `Set.Finite` to `Data.Finite.Defs`, then `Algebra.Group.Int` will complain that it's not allowed to import `Set.range` from `Data.Set.Operations`; this split will allow us to do the move without removing an `assert_not_exists`. See also this discussion on GitHub: #18619 (comment) Zulip thread: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Splitting.20docs.23Set.2EinstCoeSortType.20to.20its.20own.20file.3F
Although `Data.Set.Operations` is somewhat light-weight, it still pulls in a few imports. In particular, if we want to move the definition of `Set.Finite` to `Data.Finite.Defs`, then `Algebra.Group.Int` will complain that it's not allowed to import `Set.range` from `Data.Set.Operations`; this split will allow us to do the move without removing an `assert_not_exists`. See also this discussion on GitHub: #18619 (comment) Zulip thread: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Splitting.20docs.23Set.2EinstCoeSortType.20to.20its.20own.20file.3F
Data.Set.Finitehad a lot of imports and in turn was imported often. So let's split it up along import lines:Data/Finite/Defs.leannow contains the definition ofSet.FiniteData/Set/Finite/Basic.leanknows onlySet.FiniteandFinsetData/Finite/Prod.leannow contains finiteness results of products of setsData/Fintype/Pi.leannow contains finiteness results of sets of functionsData/Set/Finite/Lattice.leancontains finiteness results of lattice operations on setsData/Set/Finite/List.leancontains finiteness results on lists converted to setsData/Set/Finite/Monad.leanalso knows about the monad structure onSetData/Set/Finite/Powerset.leancontains finiteness results on powersetsData/Set/Finite/Range.leancontains finiteness results onSet.rangeData/Set/Finite/Lemmas.leanis for lemmas aboutSet.Finite(and therefore does not contain anyFiniteinstances itself).