Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

[Merged by Bors] - refactor(order/well_founded): ditch well_founded_iff_has_min' and well_founded_iff_has_max'#15071

Closed
vihdzp wants to merge 28 commits intomasterfrom
is_well_founded_iff_has_min'
Closed

[Merged by Bors] - refactor(order/well_founded): ditch well_founded_iff_has_min' and well_founded_iff_has_max'#15071
vihdzp wants to merge 28 commits intomasterfrom
is_well_founded_iff_has_min'

Conversation

@vihdzp
Copy link
Copy Markdown
Collaborator

@vihdzp vihdzp commented Jun 30, 2022

The predicate x ≤ y → y = x is no more convenient than ¬ x < y. For this reason, we ditch well_founded.well_founded_iff_has_min' and well_founded.well_founded_iff_has_max' in favor of well_founded.well_founded_iff_has_min (or in some cases, just well_founded.has_min. We also remove the misplaced lemma well_founded.eq_iff_not_lt_of_le, and we golf the theorems that used the removed theorems.

The lemma well_founded.well_founded_iff_has_min has a misleading name when applied on well_founded (>), and mildly screws over dot notation and rewriting by virtue of using >, but a future refactor will fix this.


If we wanted to, we could golf eq_iff_not_lt_of_le and move it to order/basic.lean, but I'd rather not bother. It's just the negation of lt_iff_le_and_ne.

Open in Gitpod

@vihdzp vihdzp added awaiting-review The author would like community review of the PR awaiting-CI The author would like to see what CI has to say before doing more work. labels Jun 30, 2022
@vihdzp vihdzp changed the title refactor(order/well_founded): ditch well_founded_iff_has_max' and well_founded_iff_has_min' refactor(order/well_founded): ditch well_founded_iff_has_min' and well_founded_iff_has_max' Jun 30, 2022
@ghost ghost added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jun 30, 2022
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Jun 30, 2022
@vihdzp vihdzp added the awaiting-CI The author would like to see what CI has to say before doing more work. label Jul 1, 2022
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Jul 1, 2022
@ghost ghost removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jul 12, 2022
@ghost
Copy link
Copy Markdown

ghost commented Jul 12, 2022

@kbuzzard
Copy link
Copy Markdown
Member

The change seems to make proofs smaller, or at least no bigger.

Copy link
Copy Markdown
Collaborator

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

The evidence from the refactor seems to show that has_min' and has_max' are typically not the right way to go, so I'm okay with removing them.

Could you merge master before bors mergeing?

bors d+

@bors
Copy link
Copy Markdown

bors bot commented Sep 30, 2022

✌️ vihdzp can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.


theorem is_artinian.set_has_minimal [is_artinian R M] (a : set $ submodule R M) (ha : a.nonempty) :
∃ M' ∈ a, ∀ I ∈ a, I ≤ M' → I = M' :=
∃ M' ∈ a, ∀ I ∈ a, ¬ I < M' :=
Copy link
Copy Markdown
Collaborator

@YaelDillies YaelDillies Feb 12, 2023

Choose a reason for hiding this comment

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

I'm not sure this is an improvement. ¬ a < b is the correct condition in the generality of preorders, but once you get to a partial_order a ≤ b → a = b is nicer empirically.

To be clear, I'm happy for you to ditch the two well-founded lemmas, but I think you shouldn't change unrelated lemma statements. You can keep the changes internal to the proofs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

"A minimal element is one for which no other element is lesser". I believe my restatement of the lemma much better captures this. Besides, from I ≤ M' and ¬ I < M' one can directly prove I = M' by using eq_of_le_of_not_lt.

Anyways, I won't be petty about this. I thought that the current statement of this lemma reflected the statement of the lemma I deleted, and thus I changed it accordingly. But if you still think this change is unhelpful, I'll revert it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah I think it's a matter of people not liking to write "a is such that if a ≤ b then a = b" on paper, even though it's better for formalisation.

@YaelDillies YaelDillies added awaiting-author A reviewer has asked the author a question or requested changes delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Feb 12, 2023
@vihdzp vihdzp added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes awaiting-review The author would like community review of the PR labels Mar 31, 2023
@vihdzp
Copy link
Copy Markdown
Collaborator Author

vihdzp commented Mar 31, 2023

bors r+

bors bot pushed a commit that referenced this pull request Mar 31, 2023
…well_founded_iff_has_max'` (#15071)

The predicate `x ≤ y → y = x` is no more convenient than `¬ x < y`. For this reason, we ditch `well_founded.well_founded_iff_has_min'` and `well_founded.well_founded_iff_has_max'` in favor of `well_founded.well_founded_iff_has_min` (or in some cases, just `well_founded.has_min`. We also remove the misplaced lemma `well_founded.eq_iff_not_lt_of_le`, and we golf the theorems that used the removed theorems.

The lemma `well_founded.well_founded_iff_has_min` has a misleading name when applied on `well_founded (>)`, and mildly screws over dot notation and rewriting by virtue of using `>`, but a future refactor will fix this.
@bors
Copy link
Copy Markdown

bors bot commented Apr 1, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title refactor(order/well_founded): ditch well_founded_iff_has_min' and well_founded_iff_has_max' [Merged by Bors] - refactor(order/well_founded): ditch well_founded_iff_has_min' and well_founded_iff_has_max' Apr 1, 2023
@bors bors bot closed this Apr 1, 2023
@bors bors bot deleted the is_well_founded_iff_has_min' branch April 1, 2023 01:35
bors bot pushed a commit to leanprover-community/mathlib4 that referenced this pull request Apr 12, 2023
eric-wieser pushed a commit to leanprover-community/mathlib4 that referenced this pull request Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

delegated The PR author may merge after reviewing final suggestions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants