[Merged by Bors] - refactor(Order/Minimal): change minimality to a predicate#14721
[Merged by Bors] - refactor(Order/Minimal): change minimality to a predicate#14721
Conversation
PR summary cad9fd3a62
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Order.Minimal | 351 | 347 | -4 (-1.14%) |
| Mathlib.Data.Finset.Lattice | 455 | 451 | -4 (-0.88%) |
Import changes for all files
| Files | Import difference |
|---|---|
| There are 495 files with changed transitive imports: this is too many to display! |
Declarations diff
+ Indep.exists_insert_of_not_maximal
+ IsAntichain.eq_setOf_maximal
+ IsAntichain.eq_setOf_minimal
+ IsAntichain.maximal_mem_iff
+ IsAntichain.maximal_mem_lowerClosure_iff_mem
+ IsAntichain.minimal_mem_iff
+ IsAntichain.minimal_mem_upperClosure_iff_mem
+ IsGreatest.maximal
+ IsGreatest.maximal_iff
+ IsLeast.minimal
+ IsLeast.minimal_iff
+ Maximal
+ Maximal.and_left
+ Maximal.and_right
+ Maximal.dual
+ Maximal.eq_of_ge
+ Maximal.eq_of_le
+ Maximal.eq_of_subset
+ Maximal.eq_of_superset
+ Maximal.le_of_ge
+ Maximal.mem_of_prop_insert
+ Maximal.mono
+ Maximal.not_gt
+ Maximal.not_prop_of_gt
+ Maximal.not_prop_of_ssuperset
+ Maximal.not_ssuperset
+ Maximal.of_dual
+ Maximal.or
+ Maximal.prop
+ Minimal
+ Minimal.and_left
+ Minimal.and_right
+ Minimal.dual
+ Minimal.eq_of_ge
+ Minimal.eq_of_le
+ Minimal.eq_of_subset
+ Minimal.eq_of_superset
+ Minimal.le_of_le
+ Minimal.mono
+ Minimal.not_lt
+ Minimal.not_mem_of_prop_diff_singleton
+ Minimal.not_prop_of_lt
+ Minimal.not_prop_of_ssubset
+ Minimal.not_ssubset
+ Minimal.of_dual
+ Minimal.or
+ Minimal.prop
+ Set.Subsingleton.maximal_mem_iff
+ Set.Subsingleton.minimal_mem_iff
+ Set.exists_diff_singleton_of_not_minimal
+ Set.exists_insert_of_not_maximal
+ Set.maximal_iff_forall_insert
+ Set.maximal_iff_forall_ssuperset
+ Set.minimal_iff_forall_diff_singleton
+ Set.minimal_iff_forall_ssubset
+ base_compl_iff_maximal_disjoint_base
+ basis_iff_maximal
+ exists_gt_of_not_maximal
+ exists_lt_of_not_minimal
+ image_antitone_setOf_maximal
+ image_antitone_setOf_maximal_mem
+ image_antitone_setOf_minimal
+ image_antitone_setOf_minimal_mem
+ image_monotone_setOf_maximal
+ image_monotone_setOf_maximal_mem
+ image_monotone_setOf_minimal
+ image_monotone_setOf_minimal_mem
+ inter_preimage_setOf_maximal_eq_of_subset
+ inter_preimage_setOf_minimal_eq_of_subset
+ mapSetOfMaximal
+ mapSetOfMinimal
+ map_maximal_mem
+ map_minimal_mem
+ maximal_and_iff_left_of_imp
+ maximal_and_iff_right_of_imp
+ maximal_apply_iff
+ maximal_apply_mem_inter_range_iff
+ maximal_eq_iff
+ maximal_false
+ maximal_ge_iff
+ maximal_gt_iff
+ maximal_iff
+ maximal_iff_eq
+ maximal_iff_forall_gt
+ maximal_iff_forall_insert
+ maximal_iff_isMax
+ maximal_iff_maximal_of_imp_of_forall
+ maximal_le_iff
+ maximal_maximal
+ maximal_mem_Icc
+ maximal_mem_Ioc
+ maximal_mem_iff
+ maximal_mem_image
+ maximal_mem_image_antitone
+ maximal_mem_image_antitone_iff
+ maximal_mem_image_iff
+ maximal_mem_image_monotone
+ maximal_mem_image_monotone_iff
+ maximal_subset_iff
+ maximal_subset_iff'
+ maximal_subtype
+ maximal_toDual
+ maximal_true
+ maximal_true_subtype
+ minimal_and_iff_left_of_imp
+ minimal_and_iff_right_of_imp
+ minimal_apply_mem_iff
+ minimal_apply_mem_inter_range_iff
+ minimal_eq_iff
+ minimal_false
+ minimal_ge_iff
+ minimal_iff
+ minimal_iff_eq
+ minimal_iff_forall_diff_singleton
+ minimal_iff_forall_lt
+ minimal_iff_isMin
+ minimal_iff_minimal_of_imp_of_forall
+ minimal_le_iff
+ minimal_lt_iff
+ minimal_mem_Icc
+ minimal_mem_Ico
+ minimal_mem_iff
+ minimal_mem_image
+ minimal_mem_image_antitone
+ minimal_mem_image_antitone_iff
+ minimal_mem_image_iff
+ minimal_mem_image_monotone
+ minimal_mem_image_monotone_iff
+ minimal_minimal
+ minimal_subset_iff
+ minimal_subset_iff'
+ minimal_subtype
+ minimal_toDual
+ minimal_true
+ minimal_true_subtype
+ not_maximal_iff
+ not_maximal_iff_exists_gt
+ not_maximal_subset_iff
+ not_minimal_iff
+ not_minimal_iff_exists_lt
+ not_minimal_subset_iff
+ setOfMaximalIsoSetOfMinimal
+ setOfMinimalIsoSetOfMaximal
+ setOf_maximal_antichain
+ setOf_maximal_subset
+ setOf_minimal_antichain
+ setOf_minimal_subset
++ _
++ image_setOf_maximal
++ image_setOf_minimal
- Indep.exists_insert_of_not_mem_maximals
- IsAntichain.max_maximals
- IsAntichain.max_minimals
- IsAntichain.maximals_eq
- IsAntichain.maximals_lowerClosure
- IsAntichain.minimals_eq
- IsAntichain.minimals_upperClosure
- IsGreatest.maximals_eq
- IsGreatest.mem_maximals
- IsLeast.mem_minimals
- IsLeast.minimals_eq
- OrderIso.mapMaximals
- OrderIso.mapMinimals
- OrderIso.map_mem_maximals
- OrderIso.map_mem_minimals
- OrderIso.maximalsIsoMinimals
- OrderIso.minimalsIsoMaximals
- RelEmbedding.image_maximals_eq
- RelEmbedding.image_minimals_eq
- RelEmbedding.inter_preimage_maximals_eq
- RelEmbedding.inter_preimage_maximals_eq_of_subset
- RelEmbedding.inter_preimage_minimals_eq
- RelEmbedding.inter_preimage_minimals_eq_of_subset
- RelEmbedding.maximals_preimage_eq
- RelEmbedding.minimals_preimage_eq
- RelIso.maximals_preimage_eq
- RelIso.minimals_preimage_eq
- Set.Subsingleton.maximals_eq
- Set.Subsingleton.minimals_eq
- Set.mem_maximals_iff_forall_insert
- Set.mem_minimals_iff_forall_diff_singleton
- base_compl_iff_mem_maximals_disjoint_base
- basis_iff_mem_maximals
- basis_iff_mem_maximals_Prop
- eq_of_mem_maximals
- eq_of_mem_minimals
- image_maximals_of_rel_iff_rel
- image_maximals_univ
- image_minimals_of_rel_iff_rel
- image_minimals_univ
- inter_maximals_preimage_inter_eq_of_rel_iff_rel_on
- inter_maximals_subset
- inter_minimals_preimage_inter_eq_of_rel_iff_rel_on
- inter_minimals_subset
- inter_preimage_maximals_eq_of_rel_iff_rel_on_of_subset
- inter_preimage_minimals_eq_of_rel_iff_rel_on_of_subset
- map_mem_maximals
- map_mem_maximals_iff
- map_mem_minimals
- map_mem_minimals_iff
- maximals
- maximals_Icc
- maximals_Iic
- maximals_Ioc
- maximals_antichain
- maximals_empty
- maximals_eq_maximals_of_subset_of_forall
- maximals_eq_minimals
- maximals_idem
- maximals_inter_subset
- maximals_mono
- maximals_of_symm
- maximals_singleton
- maximals_subset
- maximals_swap
- maximals_union
- mem_maximals_iff
- mem_maximals_iff_forall_insert
- mem_maximals_iff_forall_lt_not_mem
- mem_maximals_iff_forall_lt_not_mem'
- mem_maximals_iff_forall_ssubset_not_mem
- mem_maximals_setOf_iff
- mem_minimals_iff
- mem_minimals_iff_forall_erase
- mem_minimals_iff_forall_lt_not_mem
- mem_minimals_iff_forall_lt_not_mem'
- mem_minimals_iff_forall_ssubset_not_mem
- mem_minimals_setOf_iff
- minimals
- minimals_Icc
- minimals_Ici
- minimals_Ico
- minimals_antichain
- minimals_empty
- minimals_eq_minimals_of_subset_of_forall
- minimals_idem
- minimals_inter_subset
- minimals_mono
- minimals_of_symm
- minimals_singleton
- minimals_subset
- minimals_swap
- minimals_union
- setOf_base_eq_maximals_setOf_indep
- setOf_basis_eq
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.
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
|
bors merge |
This PR changes the notion of minimality from being a set with an unbundled relation `r` (i.e. having type signature `minimals (r : α → α → Prop) (s : Set α) : Set α`) to being a predicate with a bundled order relation in a typeclass: `Minimal [LE α] (P : α → Prop) : α → Prop`. It also does the same for maximality. This is hopefully an improvement, for a few reasons : * ergonomic API with dot notation (eg `Minimal.eq_of_le`, `Minimal.not_lt`), * no need to specify a particular relation explicitly (no use of `minimals`/`maximals` for a relation that was not defeq to `LE.le` currently appears anywhere in mathlib), * the potential in future to unify ad hoc notions of min/maximality appearing in various locations in mathlib (eg `zorn_preorder`, `Sylow.is_maximal'` to name a couple of random examples). Since this change removes the definitions `minimals` and `maximals` and all their API, it required a total overhaul of the contents of `Order.Minimal`, and necessarily required updating all uses of `maximals`/`minimals` elsewhere. There were not all too many of these; this PR is designed to be the smallest it could be while making this change. The changes required outside `Order.Minimal` were: - redefinition of `Ideal.minimalPrimes` in `RingTheory/Ideal/MinimalPrime` to use `Minimal` rather than `minimals`, with the necessary minor changes to proofs that used the old definition, including in `AlgebraicGeometry/PrimeSpectrum/Basic`. - redefinition of `irreducibleComponents` in `Topology/Irreducible` to use `Minimal` rather than `minimals`, with necessary minor changes to proofs that used the old definition. - updating of the maximality used in the definition of a matroid in `Data/Matroid/Basic` from `maximals` to `Maximal`, with the necessary changes to everywhere in `Data/Matroid/*` that a matroid was specified using the definition directly. - the necessary changes to two lemmas in `Data/Finset/Lattice` that used `minimals`/`maximals` in the statements. I attempted to clean up the API in `Order.Minimal` to work smoothly with the new definitions, but numerous judgment calls were needed; I removed a few lemmas about `maximals/minimals` that were used nowhere, and seemed unlikely to be useful with the new definition. Comment is welcome!
|
Pull request successfully merged into master. Build succeeded: |
…5554) We add a lemma stating that for `p : α -> Prop` we have `p = (· ∈ {a | p a})`. This lemma fills a gap that came up a couple of times when adapting `minimals` to the new `Minimal`, the alternative being an awkward `show`/`change` or `funext`. (See [this example from mathlib](#14721 (review)) (@j-loreaux 's first comment) and [this example](https://github.com/fpvandoorn/carleson/pull/109/files#r1705631209) from the Carleson project)
We change statements of Zorn's lemma to use the new `Maximal` API from #14721. The new definitions eliminate the need for separate `PartialOrder` and `Preorder` versions of Zorn's lemma, and slightly simplify most of its applications. The new statements of Zorn aren't defeq to the old ones, so a good number of files are touched, but very few theorem statements outside `Order.Zorn` itself are actually changed - most changes are small modifications of existing proofs. - [x] depends on: #14721
This PR changes the notion of minimality from being a set with an unbundled relation `r` (i.e. having type signature `minimals (r : α → α → Prop) (s : Set α) : Set α`) to being a predicate with a bundled order relation in a typeclass: `Minimal [LE α] (P : α → Prop) : α → Prop`. It also does the same for maximality. This is hopefully an improvement, for a few reasons : * ergonomic API with dot notation (eg `Minimal.eq_of_le`, `Minimal.not_lt`), * no need to specify a particular relation explicitly (no use of `minimals`/`maximals` for a relation that was not defeq to `LE.le` currently appears anywhere in mathlib), * the potential in future to unify ad hoc notions of min/maximality appearing in various locations in mathlib (eg `zorn_preorder`, `Sylow.is_maximal'` to name a couple of random examples). Since this change removes the definitions `minimals` and `maximals` and all their API, it required a total overhaul of the contents of `Order.Minimal`, and necessarily required updating all uses of `maximals`/`minimals` elsewhere. There were not all too many of these; this PR is designed to be the smallest it could be while making this change. The changes required outside `Order.Minimal` were: - redefinition of `Ideal.minimalPrimes` in `RingTheory/Ideal/MinimalPrime` to use `Minimal` rather than `minimals`, with the necessary minor changes to proofs that used the old definition, including in `AlgebraicGeometry/PrimeSpectrum/Basic`. - redefinition of `irreducibleComponents` in `Topology/Irreducible` to use `Minimal` rather than `minimals`, with necessary minor changes to proofs that used the old definition. - updating of the maximality used in the definition of a matroid in `Data/Matroid/Basic` from `maximals` to `Maximal`, with the necessary changes to everywhere in `Data/Matroid/*` that a matroid was specified using the definition directly. - the necessary changes to two lemmas in `Data/Finset/Lattice` that used `minimals`/`maximals` in the statements. I attempted to clean up the API in `Order.Minimal` to work smoothly with the new definitions, but numerous judgment calls were needed; I removed a few lemmas about `maximals/minimals` that were used nowhere, and seemed unlikely to be useful with the new definition. Comment is welcome!
…5554) We add a lemma stating that for `p : α -> Prop` we have `p = (· ∈ {a | p a})`. This lemma fills a gap that came up a couple of times when adapting `minimals` to the new `Minimal`, the alternative being an awkward `show`/`change` or `funext`. (See [this example from mathlib](#14721 (review)) (@j-loreaux 's first comment) and [this example](https://github.com/fpvandoorn/carleson/pull/109/files#r1705631209) from the Carleson project)
We change statements of Zorn's lemma to use the new `Maximal` API from #14721. The new definitions eliminate the need for separate `PartialOrder` and `Preorder` versions of Zorn's lemma, and slightly simplify most of its applications. The new statements of Zorn aren't defeq to the old ones, so a good number of files are touched, but very few theorem statements outside `Order.Zorn` itself are actually changed - most changes are small modifications of existing proofs. - [x] depends on: #14721
This PR changes the notion of minimality from being a set with an unbundled relation `r` (i.e. having type signature `minimals (r : α → α → Prop) (s : Set α) : Set α`) to being a predicate with a bundled order relation in a typeclass: `Minimal [LE α] (P : α → Prop) : α → Prop`. It also does the same for maximality. This is hopefully an improvement, for a few reasons : * ergonomic API with dot notation (eg `Minimal.eq_of_le`, `Minimal.not_lt`), * no need to specify a particular relation explicitly (no use of `minimals`/`maximals` for a relation that was not defeq to `LE.le` currently appears anywhere in mathlib), * the potential in future to unify ad hoc notions of min/maximality appearing in various locations in mathlib (eg `zorn_preorder`, `Sylow.is_maximal'` to name a couple of random examples). Since this change removes the definitions `minimals` and `maximals` and all their API, it required a total overhaul of the contents of `Order.Minimal`, and necessarily required updating all uses of `maximals`/`minimals` elsewhere. There were not all too many of these; this PR is designed to be the smallest it could be while making this change. The changes required outside `Order.Minimal` were: - redefinition of `Ideal.minimalPrimes` in `RingTheory/Ideal/MinimalPrime` to use `Minimal` rather than `minimals`, with the necessary minor changes to proofs that used the old definition, including in `AlgebraicGeometry/PrimeSpectrum/Basic`. - redefinition of `irreducibleComponents` in `Topology/Irreducible` to use `Minimal` rather than `minimals`, with necessary minor changes to proofs that used the old definition. - updating of the maximality used in the definition of a matroid in `Data/Matroid/Basic` from `maximals` to `Maximal`, with the necessary changes to everywhere in `Data/Matroid/*` that a matroid was specified using the definition directly. - the necessary changes to two lemmas in `Data/Finset/Lattice` that used `minimals`/`maximals` in the statements. I attempted to clean up the API in `Order.Minimal` to work smoothly with the new definitions, but numerous judgment calls were needed; I removed a few lemmas about `maximals/minimals` that were used nowhere, and seemed unlikely to be useful with the new definition. Comment is welcome!
…5554) We add a lemma stating that for `p : α -> Prop` we have `p = (· ∈ {a | p a})`. This lemma fills a gap that came up a couple of times when adapting `minimals` to the new `Minimal`, the alternative being an awkward `show`/`change` or `funext`. (See [this example from mathlib](#14721 (review)) (@j-loreaux 's first comment) and [this example](https://github.com/fpvandoorn/carleson/pull/109/files#r1705631209) from the Carleson project)
We change statements of Zorn's lemma to use the new `Maximal` API from #14721. The new definitions eliminate the need for separate `PartialOrder` and `Preorder` versions of Zorn's lemma, and slightly simplify most of its applications. The new statements of Zorn aren't defeq to the old ones, so a good number of files are touched, but very few theorem statements outside `Order.Zorn` itself are actually changed - most changes are small modifications of existing proofs. - [x] depends on: #14721
This PR changes the notion of minimality from being a set with an unbundled relation `r` (i.e. having type signature `minimals (r : α → α → Prop) (s : Set α) : Set α`) to being a predicate with a bundled order relation in a typeclass: `Minimal [LE α] (P : α → Prop) : α → Prop`. It also does the same for maximality. This is hopefully an improvement, for a few reasons : * ergonomic API with dot notation (eg `Minimal.eq_of_le`, `Minimal.not_lt`), * no need to specify a particular relation explicitly (no use of `minimals`/`maximals` for a relation that was not defeq to `LE.le` currently appears anywhere in mathlib), * the potential in future to unify ad hoc notions of min/maximality appearing in various locations in mathlib (eg `zorn_preorder`, `Sylow.is_maximal'` to name a couple of random examples). Since this change removes the definitions `minimals` and `maximals` and all their API, it required a total overhaul of the contents of `Order.Minimal`, and necessarily required updating all uses of `maximals`/`minimals` elsewhere. There were not all too many of these; this PR is designed to be the smallest it could be while making this change. The changes required outside `Order.Minimal` were: - redefinition of `Ideal.minimalPrimes` in `RingTheory/Ideal/MinimalPrime` to use `Minimal` rather than `minimals`, with the necessary minor changes to proofs that used the old definition, including in `AlgebraicGeometry/PrimeSpectrum/Basic`. - redefinition of `irreducibleComponents` in `Topology/Irreducible` to use `Minimal` rather than `minimals`, with necessary minor changes to proofs that used the old definition. - updating of the maximality used in the definition of a matroid in `Data/Matroid/Basic` from `maximals` to `Maximal`, with the necessary changes to everywhere in `Data/Matroid/*` that a matroid was specified using the definition directly. - the necessary changes to two lemmas in `Data/Finset/Lattice` that used `minimals`/`maximals` in the statements. I attempted to clean up the API in `Order.Minimal` to work smoothly with the new definitions, but numerous judgment calls were needed; I removed a few lemmas about `maximals/minimals` that were used nowhere, and seemed unlikely to be useful with the new definition. Comment is welcome!
…5554) We add a lemma stating that for `p : α -> Prop` we have `p = (· ∈ {a | p a})`. This lemma fills a gap that came up a couple of times when adapting `minimals` to the new `Minimal`, the alternative being an awkward `show`/`change` or `funext`. (See [this example from mathlib](#14721 (review)) (@j-loreaux 's first comment) and [this example](https://github.com/fpvandoorn/carleson/pull/109/files#r1705631209) from the Carleson project)
We change statements of Zorn's lemma to use the new `Maximal` API from #14721. The new definitions eliminate the need for separate `PartialOrder` and `Preorder` versions of Zorn's lemma, and slightly simplify most of its applications. The new statements of Zorn aren't defeq to the old ones, so a good number of files are touched, but very few theorem statements outside `Order.Zorn` itself are actually changed - most changes are small modifications of existing proofs. - [x] depends on: #14721
This PR changes the notion of minimality from being a set with an unbundled relation
r(i.e. having type signatureminimals (r : α → α → Prop) (s : Set α) : Set α) to being a predicate with a bundled order relation in a typeclass:Minimal [LE α] (P : α → Prop) : α → Prop.It also does the same for maximality.
This is hopefully an improvement, for a few reasons :
Minimal.eq_of_le,Minimal.not_lt),minimals/maximalsfor a relation that was not defeq toLE.lecurrently appears anywhere in mathlib),zorn_preorder,Sylow.is_maximal'to name a couple of random examples).Since this change removes the definitions
minimalsandmaximalsand all their API, it required a total overhaul of the contents ofOrder.Minimal, and necessarily required updating all uses ofmaximals/minimalselsewhere. There were not all too many of these; this PR is designed to be the smallest it could be while making this change.The changes required outside
Order.Minimalwere:Ideal.minimalPrimesinRingTheory/Ideal/MinimalPrimeto useMinimalrather thanminimals, with the necessary minor changes to proofs that used the old definition, including inAlgebraicGeometry/PrimeSpectrum/Basic.irreducibleComponentsinTopology/Irreducibleto useMinimalrather thanminimals, with necessary minor changes to proofs that used the old definition.Data/Matroid/BasicfrommaximalstoMaximal, with the necessary changes to everywhere inData/Matroid/*that a matroid was specified using the definition directly.Data/Finset/Latticethat usedminimals/maximalsin the statements.I attempted to clean up the API in
Order.Minimalto work smoothly with the new definitions, but numerous judgment calls were needed; I removed a few lemmas aboutmaximals/minimalsthat were used nowhere, and seemed unlikely to be useful with the new definition.Comment is welcome!