Skip to content

[Merged by Bors] - feat(Order/Maximal): maximality/minimality with insertion/removal for sets#13638

Closed
apnelson1 wants to merge 11 commits intomasterfrom
minimals_insert
Closed

[Merged by Bors] - feat(Order/Maximal): maximality/minimality with insertion/removal for sets#13638
apnelson1 wants to merge 11 commits intomasterfrom
minimals_insert

Conversation

@apnelson1
Copy link
Copy Markdown
Collaborator

We add a lemma showing that if P is a downwards-closed predicate on sets, then s is maximal w.r.t. P
iff s has property P but no proper insertion of s has property P. We also add the dual lemma for single removals and upwards-closed predicates.


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 8, 2024

PR summary afc393f6cc

Import changes

Dependency changes

File Base Count Head Count Change
Mathlib.Data.Finset.Lattice 423 435 +12 (+2.84%)

Declarations diff

+ Set.mem_maximals_iff_forall_insert
+ Set.mem_minimals_iff_forall_diff_singleton
+ mem_maximals_iff_forall_insert
+ mem_minimals_iff_forall_erase

You can run this locally as follows
## summary with just the declaration names:
./scripts/no_lost_declarations.sh short <optional_commit>

## more verbose report:
./scripts/no_lost_declarations.sh <optional_commit>

Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is more generally true for P : α → Prop where α is a distributive atomic lattice ("proof": The same as your current proof, but with insert x s replaced by t = s ⊔ a such that s ⋖ t and a is an atom),

Do you think you could generalise (and then specialise back to Set and Finset)?

@YaelDillies YaelDillies added awaiting-author A reviewer has asked the author a question or requested changes. t-order Order theory and removed awaiting-review labels Jun 18, 2024
@apnelson1
Copy link
Copy Markdown
Collaborator Author

apnelson1 commented Jun 18, 2024

I believe this is more generally true for P : α → Prop where α is a distributive atomic lattice ("proof": The same as your current proof, but with insert x s replaced by t = s ⊔ a such that s ⋖ t and a is an atom),

Do you think you could generalise (and then specialise back to Set and Finset)?

The right generality is really covers rather than unions with atoms, and it works in any order that is 'strongly atomic' (even non-lattice), which probably should get its own typeclass. For instance, it should be true for distributive + atomic or for modular + complemented + atomic, neither of which implies the other. I will add the finset versions, but I don't think a lattice version make sense until it has the right generality, which doesn't belong in this PR.

@apnelson1 apnelson1 added awaiting-review and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Jun 18, 2024
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit problematic that you import finsets in a basic order theory file. Can you move the finset lemmas somewhere else?

@apnelson1
Copy link
Copy Markdown
Collaborator Author

It is a bit problematic that you import finsets in a basic order theory file. Can you move the finset lemmas somewhere else?

I've moved them to Finset.Lattice - I can't see a better place for them, and making a new file seems out of scope here.

@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 Jun 19, 2024
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maintainer merge

@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 20, 2024
@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Jun 20, 2024

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Jun 20, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jun 20, 2024
… sets (#13638)

We add a lemma showing that if `P` is a downwards-closed predicate on sets, then `s` is maximal w.r.t. `P` 
iff `s` has property `P` but no proper insertion of `s` has property `P`. We also add the dual lemma for single removals and upwards-closed predicates.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jun 20, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Order/Maximal): maximality/minimality with insertion/removal for sets [Merged by Bors] - feat(Order/Maximal): maximality/minimality with insertion/removal for sets Jun 20, 2024
@mathlib-bors mathlib-bors bot closed this Jun 20, 2024
@mathlib-bors mathlib-bors bot deleted the minimals_insert branch June 20, 2024 04:24
AntoineChambert-Loir pushed a commit that referenced this pull request Jun 20, 2024
… sets (#13638)

We add a lemma showing that if `P` is a downwards-closed predicate on sets, then `s` is maximal w.r.t. `P` 
iff `s` has property `P` but no proper insertion of `s` has property `P`. We also add the dual lemma for single removals and upwards-closed predicates.
kbuzzard pushed a commit that referenced this pull request Jun 26, 2024
… sets (#13638)

We add a lemma showing that if `P` is a downwards-closed predicate on sets, then `s` is maximal w.r.t. `P` 
iff `s` has property `P` but no proper insertion of `s` has property `P`. We also add the dual lemma for single removals and upwards-closed predicates.
dagurtomas pushed a commit that referenced this pull request Jul 2, 2024
… sets (#13638)

We add a lemma showing that if `P` is a downwards-closed predicate on sets, then `s` is maximal w.r.t. `P` 
iff `s` has property `P` but no proper insertion of `s` has property `P`. We also add the dual lemma for single removals and upwards-closed predicates.
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.

3 participants