feat(Order/WellFounded): characterize WellFoundedLT and IsWellOrder in terms of nonempty sets#37353
Open
SnirBroshi wants to merge 2 commits intoleanprover-community:masterfrom
Open
Conversation
…r` in terms of nonempty sets
PR summary 00fca21215Import changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diff
You can run this locally as follows## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>The doc-module for No changes to technical debt.You can run this locally as
|
Komyyy
requested changes
Apr 6, 2026
Contributor
Komyyy
left a comment
There was a problem hiding this comment.
Thank you for your contribution!
| simpa [lt_iff_le_not_ge] using hm x hxs | ||
| · have ⟨⟨m, hms⟩, hm⟩ := h s hs | ||
| refine ⟨m, hms, fun x hxs ↦ ?_⟩ | ||
| simpa [lt_iff_le_not_ge] using @hm ⟨x, hxs⟩ |
Contributor
There was a problem hiding this comment.
Minimal is more appropriate here:
Suggested change
| simpa [lt_iff_le_not_ge] using @hm ⟨x, hxs⟩ | |
| theorem wellFoundedLT_iff_exists_minimal [Preorder α] : | |
| WellFoundedLT α ↔ ∀ s : Set α, s.Nonempty → ∃ m, Minimal (· ∈ s) m := by |
| simpa [lt_iff_le_not_ge] using hm x hxs | ||
| · have ⟨⟨m, hms⟩, hm⟩ := h s hs | ||
| refine ⟨m, hms, fun x hxs ↦ ?_⟩ | ||
| simpa [lt_iff_le_not_ge] using @hm ⟨x, hxs⟩ |
Contributor
There was a problem hiding this comment.
Now you can prove more elegantly:
Suggested change
| simpa [lt_iff_le_not_ge] using @hm ⟨x, hxs⟩ | |
| simp only [WellFoundedLT, isWellFounded_iff, wellFounded_iff_has_min, not_lt_iff_le_imp_ge, | |
| Minimal] |
| refine ⟨m, hms, fun x hxs ↦ ?_⟩ | ||
| simpa [lt_iff_le_not_ge] using @hm ⟨x, hxs⟩ | ||
|
|
||
| theorem isWellOrder_iff_exists_not_lt_and_eq_or_lt : |
Contributor
There was a problem hiding this comment.
Better name:
Suggested change
| theorem isWellOrder_iff_exists_not_lt_and_eq_or_lt : | |
| theorem isWellOrder_iff_exists_not_lt_and_eq_or_gt : |
|
|
||
| theorem isWellOrder_iff_exists_not_lt_and_eq_or_lt : | ||
| IsWellOrder α r ↔ ∀ s : Set α, s.Nonempty → ∃ m ∈ s, ∀ x ∈ s, ¬r x m ∧ (m = x ∨ r m x) := by | ||
| refine ⟨fun h s hs ↦ ?_, fun h ↦ @IsWellOrder.mk α r ⟨?_⟩ ⟨fun a b ↦ ?_⟩⟩ |
Contributor
There was a problem hiding this comment.
Structure notation works well here:
Suggested change
| refine ⟨fun h s hs ↦ ?_, fun h ↦ @IsWellOrder.mk α r ⟨?_⟩ ⟨fun a b ↦ ?_⟩⟩ | |
| refine ⟨fun h s hs ↦ ?_, fun h ↦ { wf := ?_, trichotomous a b := ?_} ⟩ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both of these use the existing characterization of
WellFounded.