Skip to content

[Merged by Bors] - refactor(Order/Minimal): change minimality to a predicate#14721

Closed
apnelson1 wants to merge 45 commits intomasterfrom
minimal_pred
Closed

[Merged by Bors] - refactor(Order/Minimal): change minimality to a predicate#14721
apnelson1 wants to merge 45 commits intomasterfrom
minimal_pred

Conversation

@apnelson1
Copy link
Copy Markdown
Collaborator

@apnelson1 apnelson1 commented Jul 14, 2024

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!


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 14, 2024

PR summary cad9fd3a62

Import changes for modified files

Dependency changes

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.

@apnelson1 apnelson1 added the t-order Order theory label Jul 14, 2024
@jcommelin jcommelin requested a review from YaelDillies July 15, 2024 08:57
@YaelDillies YaelDillies changed the title feat(Order/Minimal): change minimality to a predicate refactor(Order/Minimal): change minimality to a predicate Jul 17, 2024
@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 17, 2024
apnelson1 and others added 3 commits July 18, 2024 09:53
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@apnelson1 apnelson1 removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 18, 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 Jul 24, 2024
@apnelson1 apnelson1 removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 31, 2024
@b-mehta
Copy link
Copy Markdown
Contributor

b-mehta commented Aug 5, 2024

bors merge

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Aug 5, 2024
mathlib-bors bot pushed a commit that referenced this pull request Aug 5, 2024
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!
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 5, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title refactor(Order/Minimal): change minimality to a predicate [Merged by Bors] - refactor(Order/Minimal): change minimality to a predicate Aug 5, 2024
@mathlib-bors mathlib-bors bot closed this Aug 5, 2024
@mathlib-bors mathlib-bors bot deleted the minimal_pred branch August 5, 2024 17:42
nomeata added a commit that referenced this pull request Aug 6, 2024
mathlib-bors bot pushed a commit that referenced this pull request Aug 7, 2024
…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)
mathlib-bors bot pushed a commit that referenced this pull request Aug 8, 2024
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
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
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!
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
…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)
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
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
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
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!
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
…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)
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
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
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 12, 2024
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!
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 12, 2024
…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)
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 12, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants