Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(Order/SuccPred): BddAbove.exists_isGreatest_of_nonempty #15944

Closed

Conversation

pechersky
Copy link
Collaborator

when IsSuccArchimedean


Open in Gitpod

@pechersky pechersky added the t-order Order theory label Aug 18, 2024
Copy link

github-actions bot commented Aug 18, 2024

PR summary 9a9e559fd9

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ BddAbove.exists_isGreatest_of_nonempty
+ BddBelow.exists_isLeast_of_nonempty

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.


lemma BddAbove.exists_isGreatest_of_nonempty {X : Type*} [LinearOrder X] [SuccOrder X]
[IsSuccArchimedean X] {S : Set X} (hS : BddAbove S) (hS' : S.Nonempty) :
∃ x, IsGreatest S x := by
Copy link
Member

Choose a reason for hiding this comment

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

@YaelDillies Are these the right typeclass assumptions?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess the right assumption is something like "locally cowell-founded", meaning "Iic x is cowell-founded for all x". We don't have that in mathlib, so the current generality seems okay.

Note however that LinearOrder shouldn't be necessary since the recent refactor on SuccOrder

Suggested change
∃ x, IsGreatest S x := by
lemma BddAbove.exists_isGreatest_of_nonempty {X : Type*} [Preorder X] [SuccOrder X]
[IsSuccArchimedean X] {S : Set X} (hS : BddAbove S) (hS' : S.Nonempty) :
∃ x, IsGreatest S x := by

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can't generalize to Preorder because I use Order.le_succ_iff_eq_or_le in the inductive step proof of Succ.rec.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The end result is still true, though (although I've noticed you also need to assume that the set is directed). Can you try using another lemma?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Command-Master, didn't you prove that the assumptions above imply SemilatticeSup X?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I now see the results got split

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've left a TODO to come back to this after that PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I won't merge this for now because I suspect you don't even need the lemmas in the current PR. Please first coordinate with @Command-Master to get #16272 (or rather the preliminary part) merged.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

@pechersky pechersky Sep 17, 2024

Choose a reason for hiding this comment

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

I tried to bring in the relevant lemmas from that PR, but I still don't have a proof. I also can't assume that my set is OrdConnected. I need help with this if the blocker is generalization.

@urkud
Copy link
Member

urkud commented Sep 2, 2024

LGTM but I'm not sure if it can be generalized to some other *Order class we have, so delegating to @YaelDillies .
bors d=@YaelDillies

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Sep 2, 2024

✌️ 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.

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 8, 2024
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 8, 2024
@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes label Sep 9, 2024
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 16, 2024
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 17, 2024
@YaelDillies YaelDillies removed the awaiting-author A reviewer has asked the author a question or requested changes label Oct 9, 2024
@YaelDillies
Copy link
Collaborator

I am not super happy with the generality of this PR, but since @Command-Master's PRs that would unlock the greater generality are currently stalled, let's press on.

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Oct 9, 2024
when `IsSuccArchimedean`




Co-authored-by: Yakov Pechersky <[email protected]>
Co-authored-by: Yakov Pechersky <[email protected]>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 9, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Order/SuccPred): BddAbove.exists_isGreatest_of_nonempty [Merged by Bors] - feat(Order/SuccPred): BddAbove.exists_isGreatest_of_nonempty Oct 9, 2024
@mathlib-bors mathlib-bors bot closed this Oct 9, 2024
@mathlib-bors mathlib-bors bot deleted the pechersky/bddabove-exists-is-greatest-succarch branch October 9, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants