Skip to content

[Merged by Bors] - chore: deprecate bad lemmas about WithTop/WithBot - #13128

Closed
eric-wieser wants to merge 11 commits into
masterfrom
eric-wieser/cases_eliminator
Closed

eric-wieser wants to merge 11 commits into
masterfrom
eric-wieser/cases_eliminator

Conversation

@eric-wieser

@eric-wieser eric-wieser commented May 22, 2024 •

Copy link
Copy Markdown
Member

Order/WithBot.lean seems to frequently confuse WithBot.some and Option.some, and some of the lemmas are strange as a result.

By teaching cases not to introduce Option.some, we no longer need these weird lemmas.

This deprecates:

  • List.maximum_eq_none → List.maximum_eq_bot
  • List.minimum_eq_none → List.maximum_eq_top
  • WithBot.some_le_some → WithBot.coe_le_coe
  • WithBot.some_lt_some → WithBot.coe_lt_coe
  • WithBot.none_lt_some → WithBot.bot_lt_coe
  • WithBot.not_lt_none → WithBot.not_lt_bot
  • WithBot.none_le → bot_le
  • WithTop.some_le_some → WithTop.coe_le_coe
  • WithTop.some_lt_some → WithTop.coe_lt_coe
  • WithTop.some_lt_none → WithTop.coe_lt_top
  • WithTop.not_none_lt → WithTop.not_top_lt
  • WithTop.le_none → le_top

It's still occasionally possible to end up with Option.some a : WithTop A, but when this happens you can rewrite by some_eq_coe first to fix it.


Open in Gitpod

@grunweg

grunweg commented May 23, 2024

Copy link
Copy Markdown
Contributor

Does since syntax work in this case --- if so, can you also add a deprecation date? Thanks!
(Seeing this PR is not marked as awaiting-review, perhaps you intended to do this. In this case, sorry for the redundant advice!)

@grunweg

grunweg commented May 24, 2024

Copy link
Copy Markdown
Contributor

Let me mark this as awaiting-author, to reflect its apparent current state.
awaiting-author

@github-actions github-actions Bot added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label May 24, 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 May 24, 2024
@eric-wieser

eric-wieser commented May 25, 2024 •

Copy link
Copy Markdown
Member Author

I think I will probably split this PR into a cleanup PR and a deprecation PR, once CI passes

@eric-wieser eric-wieser added awaiting-review awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels May 26, 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 May 26, 2024
@eric-wieser
eric-wieser requested a review from urkud May 27, 2024 14:03
@eric-wieser eric-wieser removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 27, 2024
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label May 27, 2024
@urkud

urkud commented Jun 1, 2024

Copy link
Copy Markdown
Member

Thanks! 🎉
bors merge

@github-actions github-actions Bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Jun 1, 2024
mathlib-bors Bot pushed a commit that referenced this pull request Jun 1, 2024
`Order/WithBot.lean` seems to frequently confuse `WithBot.some` and `Option.some`, and some of the lemmas are strange as a result.

By teaching `cases` not to introduce `Option.some`, we no longer need these weird lemmas.

This deprecates:

* `List.maximum_eq_none` → `List.maximum_eq_bot`
* `List.minimum_eq_none` → `List.maximum_eq_top`
* `WithBot.some_le_some` → `WithBot.coe_le_coe`
* `WithBot.some_lt_some` → `WithBot.coe_lt_coe`
* `WithBot.none_lt_some` → `WithBot.bot_lt_coe`
* `WithBot.not_lt_none` → `WithBot.not_lt_bot`
* `WithBot.none_le` → `bot_le`
* `WithTop.some_le_some` → `WithTop.coe_le_coe`
* `WithTop.some_lt_some` → `WithTop.coe_lt_coe`
* `WithTop.some_lt_none` → `WithTop.coe_lt_top`
* `WithTop.not_none_lt` → `WithTop.not_top_lt`
* `WithTop.le_none` → `le_top`

It's still occasionally possible to end up with `Option.some a : WithTop A`, but when this happens you can rewrite by `some_eq_coe` first to fix it.
@mathlib-bors

mathlib-bors Bot commented Jun 1, 2024

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore: deprecate bad lemmas about WithTop/WithBot [Merged by Bors] - chore: deprecate bad lemmas about WithTop/WithBot Jun 1, 2024
@mathlib-bors mathlib-bors Bot closed this Jun 1, 2024
@mathlib-bors
mathlib-bors Bot deleted the eric-wieser/cases_eliminator branch June 1, 2024 03:56
callesonne pushed a commit that referenced this pull request Jun 4, 2024
`Order/WithBot.lean` seems to frequently confuse `WithBot.some` and `Option.some`, and some of the lemmas are strange as a result.

By teaching `cases` not to introduce `Option.some`, we no longer need these weird lemmas.

This deprecates:

* `List.maximum_eq_none` → `List.maximum_eq_bot`
* `List.minimum_eq_none` → `List.maximum_eq_top`
* `WithBot.some_le_some` → `WithBot.coe_le_coe`
* `WithBot.some_lt_some` → `WithBot.coe_lt_coe`
* `WithBot.none_lt_some` → `WithBot.bot_lt_coe`
* `WithBot.not_lt_none` → `WithBot.not_lt_bot`
* `WithBot.none_le` → `bot_le`
* `WithTop.some_le_some` → `WithTop.coe_le_coe`
* `WithTop.some_lt_some` → `WithTop.coe_lt_coe`
* `WithTop.some_lt_none` → `WithTop.coe_lt_top`
* `WithTop.not_none_lt` → `WithTop.not_top_lt`
* `WithTop.le_none` → `le_top`

It's still occasionally possible to end up with `Option.some a : WithTop A`, but when this happens you can rewrite by `some_eq_coe` first to fix it.
AntoineChambert-Loir pushed a commit that referenced this pull request Jun 20, 2024
`Order/WithBot.lean` seems to frequently confuse `WithBot.some` and `Option.some`, and some of the lemmas are strange as a result.

By teaching `cases` not to introduce `Option.some`, we no longer need these weird lemmas.

This deprecates:

* `List.maximum_eq_none` → `List.maximum_eq_bot`
* `List.minimum_eq_none` → `List.maximum_eq_top`
* `WithBot.some_le_some` → `WithBot.coe_le_coe`
* `WithBot.some_lt_some` → `WithBot.coe_lt_coe`
* `WithBot.none_lt_some` → `WithBot.bot_lt_coe`
* `WithBot.not_lt_none` → `WithBot.not_lt_bot`
* `WithBot.none_le` → `bot_le`
* `WithTop.some_le_some` → `WithTop.coe_le_coe`
* `WithTop.some_lt_some` → `WithTop.coe_lt_coe`
* `WithTop.some_lt_none` → `WithTop.coe_lt_top`
* `WithTop.not_none_lt` → `WithTop.not_top_lt`
* `WithTop.le_none` → `le_top`

It's still occasionally possible to end up with `Option.some a : WithTop A`, but when this happens you can rewrite by `some_eq_coe` first to fix it.
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants