Skip to content

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

Closed
eric-wieser wants to merge 11 commits intomasterfrom
eric-wieser/cases_eliminator
Closed

[Merged by Bors] - chore: deprecate bad lemmas about WithTop/WithBot#13128
eric-wieser wants to merge 11 commits intomasterfrom
eric-wieser/cases_eliminator

Conversation

@eric-wieser
Copy link
Copy Markdown
Member

@eric-wieser eric-wieser commented May 22, 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_noneList.maximum_eq_bot
  • List.minimum_eq_noneList.maximum_eq_top
  • WithBot.some_le_someWithBot.coe_le_coe
  • WithBot.some_lt_someWithBot.coe_lt_coe
  • WithBot.none_lt_someWithBot.bot_lt_coe
  • WithBot.not_lt_noneWithBot.not_lt_bot
  • WithBot.none_lebot_le
  • WithTop.some_le_someWithTop.coe_le_coe
  • WithTop.some_lt_someWithTop.coe_lt_coe
  • WithTop.some_lt_noneWithTop.coe_lt_top
  • WithTop.not_none_ltWithTop.not_top_lt
  • WithTop.le_nonele_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
Copy link
Copy Markdown
Contributor

grunweg commented May 23, 2024

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
Copy link
Copy Markdown
Contributor

grunweg commented May 24, 2024

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

@github-actions github-actions bot added the awaiting-author A reviewer has asked the author a question or requested changes. 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
Copy link
Copy Markdown
Member Author

eric-wieser commented May 25, 2024

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 A reviewer has asked the author a question or requested changes. 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
Copy link
Copy Markdown
Member

urkud commented Jun 1, 2024

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
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jun 1, 2024

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