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

refactor: move theorems about lists from mathlib #756

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

chabulhwi
Copy link
Contributor

@chabulhwi chabulhwi commented Apr 19, 2024

List.isEmpty_iff_eq_nil and List.modifyHead_modifyHead are from
Mathlib.Data.List.Basic. We need these theorems to prove
String.splitOn_of_valid. See
#743.

Batteries bump PR in Mathlib: leanprover-community/mathlib4#12540

Co-authored-by: Kim Morrison [email protected]


@chabulhwi
Copy link
Contributor Author

awaiting-review

@github-actions github-actions bot added the awaiting-review This PR is ready for review; the author thinks it is ready to be merged. label Apr 19, 2024
@chabulhwi chabulhwi force-pushed the list-theorems branch 2 times, most recently from 23a45f4 to 075ff99 Compare April 19, 2024 14:20
@kim-em
Copy link
Collaborator

kim-em commented Apr 30, 2024

Is there a Mathlib adaptation PR ready? A lot of things are in flight at the moment so I'd like to be confident that after merging I can get everything working quickly. See e.g. what Yury did at #758.

@kim-em kim-em added awaiting-author Waiting for PR author to address issues and removed awaiting-review This PR is ready for review; the author thinks it is ready to be merged. labels Apr 30, 2024
@chabulhwi chabulhwi force-pushed the list-theorems branch 2 times, most recently from 64e8be0 to 5e535c8 Compare April 30, 2024 07:35
chabulhwi added a commit to leanprover-community/mathlib4 that referenced this pull request Apr 30, 2024
* `List.isEmpty_iff_eq_nil` and `List.modifyHead_modifyHead` are from
  `Mathlib.Data.List.Basic`.
* `List.cons_prefix_iff` is from `Mathlib.Data.List.Infix`.
* We need these theorems to prove `String.splitOn_of_valid`.

See leanprover-community/batteries#756.
@chabulhwi
Copy link
Contributor Author

chabulhwi commented Apr 30, 2024

Is there a Mathlib adaptation PR ready? A lot of things are in flight at the moment so I'd like to be confident that after merging I can get everything working quickly. See e.g. what Yury did at #758.

@semorrison I opened a Mathlib PR that removes the theorems I brought to Std Batteries. See leanprover-community/mathlib4#12540.

@chabulhwi
Copy link
Contributor Author

awaiting-review

@github-actions github-actions bot added awaiting-review This PR is ready for review; the author thinks it is ready to be merged. and removed awaiting-author Waiting for PR author to address issues labels Apr 30, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author. label May 2, 2024
@github-actions github-actions bot added awaiting-review This PR is ready for review; the author thinks it is ready to be merged. and removed awaiting-review This PR is ready for review; the author thinks it is ready to be merged. labels May 3, 2024
@chabulhwi
Copy link
Contributor Author

I resolved merge conflicts.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author. label May 3, 2024
Std/Data/List/Lemmas.lean Outdated Show resolved Hide resolved
Std/Data/List/Lemmas.lean Outdated Show resolved Hide resolved
Std/Data/List/Lemmas.lean Outdated Show resolved Hide resolved
Std/Data/List/Lemmas.lean Outdated Show resolved Hide resolved
Std/Data/List/Lemmas.lean Outdated Show resolved Hide resolved
Std/Data/List/Lemmas.lean Outdated Show resolved Hide resolved
chabulhwi added a commit to chabulhwi/batteries that referenced this pull request Jun 15, 2024
* `List.isEmpty_iff_eq_nil` and `List.modifyHead_modifyHead` are from
  `Mathlib.Data.List.Basic`. I removed the `simp` priority and `nolint`
  attribute from `modifyHead_modifyHead` because we don't need them
  anymore.
* `List.cons_prefix_cons` is from `Mathlib.Data.List.Infix`. Its
  previous name was `List.cons_prefix_iff`.

We need these theorems to prove `String.splitOn_of_valid`. See
leanprover-community#756.

Co-authored-by: Kim Morrison <[email protected]>
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author. label Aug 5, 2024
chabulhwi added a commit to chabulhwi/batteries that referenced this pull request Sep 3, 2024
`List.isEmpty_iff_eq_nil` and `List.modifyHead_modifyHead` are from
`Mathlib.Data.List.Basic`. I removed the `simp` priority and `nolint`
attribute from `modifyHead_modifyHead` because we don't need them
anymore.

We need these theorems to prove `String.splitOn_of_valid`. See
leanprover-community#756.

Co-authored-by: Kim Morrison <[email protected]>
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author. label Sep 3, 2024
chabulhwi added a commit to leanprover-community/mathlib4 that referenced this pull request Sep 3, 2024
The simplifier used to always unfold the definition of the function
`List.modifyHead` because it had the `simp` attribute. This behavior
hindered the simplifier from using lemmas about the function. To fix
this issue, I opened leanprover-community/batteries#790 and it was
merged on May 10.

Now, the `simp` priority in the theorem `List.modifyHead_modifyHead` is
no longer needed. leanprover-community/batteries#756 was supposed to
remove the priority from it while also moving it from Mathlib to
Batteries. But the pull request hasn't been merged for almost five
months, hence this PR.
chabulhwi added a commit to leanprover-community/mathlib4 that referenced this pull request Sep 3, 2024
`List.isEmpty_iff_eq_nil` and `List.modifyHead_modifyHead` are from
`Mathlib.Data.List.Basic`. We need these theorems to prove
`String.splitOn_of_valid`. See
leanprover-community/batteries#743.

This is a Batteries bump PR corresponding to
leanprover-community/batteries#756.
chabulhwi added a commit to leanprover-community/mathlib4 that referenced this pull request Sep 3, 2024
`List.isEmpty_iff_eq_nil` and `List.modifyHead_modifyHead` are from
`Mathlib.Data.List.Basic`. We need these theorems to prove
`String.splitOn_of_valid`. See
leanprover-community/batteries#743.

Corresponding Batteries PR:
leanprover-community/batteries#756
`List.isEmpty_iff_eq_nil` and `List.modifyHead_modifyHead` are from
`Mathlib.Data.List.Basic`. We need these theorems to prove
`String.splitOn_of_valid`. See
leanprover-community#743.

Batteries bump PR in Mathlib: leanprover-community/mathlib4#12540

Co-authored-by: Kim Morrison <[email protected]>
mathlib-bors bot pushed a commit to leanprover-community/mathlib4 that referenced this pull request Sep 4, 2024
The simplifier used to always unfold the definition of the function
`List.modifyHead` because it had the `simp` attribute. This behavior
hindered the simplifier from using lemmas about the function. To fix
this issue, I opened leanprover-community/batteries#790 and it was
merged on May 10.

Now, the `simp` priority in the theorem `List.modifyHead_modifyHead` is
no longer needed. leanprover-community/batteries#756 was supposed to
remove the priority from it while also moving it from Mathlib to
Batteries. But the pull request hasn't been merged for almost five
months, hence this PR.
mathlib-bors bot pushed a commit to leanprover-community/mathlib4 that referenced this pull request Sep 5, 2024
The simplifier used to always unfold the definition of the function
`List.modifyHead` because it had the `simp` attribute. This behavior
hindered the simplifier from using lemmas about the function. To fix
this issue, I opened leanprover-community/batteries#790 and it was
merged on May 10.

Now, the `simp` priority in the theorem `List.modifyHead_modifyHead` is
no longer needed. leanprover-community/batteries#756 was supposed to
remove the priority from it while also moving it from Mathlib to
Batteries. But the pull request hasn't been merged for almost five
months, hence this PR.
bjoernkjoshanssen pushed a commit to leanprover-community/mathlib4 that referenced this pull request Sep 9, 2024
The simplifier used to always unfold the definition of the function
`List.modifyHead` because it had the `simp` attribute. This behavior
hindered the simplifier from using lemmas about the function. To fix
this issue, I opened leanprover-community/batteries#790 and it was
merged on May 10.

Now, the `simp` priority in the theorem `List.modifyHead_modifyHead` is
no longer needed. leanprover-community/batteries#756 was supposed to
remove the priority from it while also moving it from Mathlib to
Batteries. But the pull request hasn't been merged for almost five
months, hence this PR.
bjoernkjoshanssen pushed a commit to leanprover-community/mathlib4 that referenced this pull request Sep 9, 2024
The simplifier used to always unfold the definition of the function
`List.modifyHead` because it had the `simp` attribute. This behavior
hindered the simplifier from using lemmas about the function. To fix
this issue, I opened leanprover-community/batteries#790 and it was
merged on May 10.

Now, the `simp` priority in the theorem `List.modifyHead_modifyHead` is
no longer needed. leanprover-community/batteries#756 was supposed to
remove the priority from it while also moving it from Mathlib to
Batteries. But the pull request hasn't been merged for almost five
months, hence this PR.
bjoernkjoshanssen pushed a commit to leanprover-community/mathlib4 that referenced this pull request Sep 12, 2024
The simplifier used to always unfold the definition of the function
`List.modifyHead` because it had the `simp` attribute. This behavior
hindered the simplifier from using lemmas about the function. To fix
this issue, I opened leanprover-community/batteries#790 and it was
merged on May 10.

Now, the `simp` priority in the theorem `List.modifyHead_modifyHead` is
no longer needed. leanprover-community/batteries#756 was supposed to
remove the priority from it while also moving it from Mathlib to
Batteries. But the pull request hasn't been merged for almost five
months, hence this PR.
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author. label Sep 26, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author. label Oct 3, 2024
@kim-em kim-em added this pull request to the merge queue Oct 14, 2024
Merged via the queue into leanprover-community:main with commit 405f949 Oct 14, 2024
2 checks passed
@chabulhwi chabulhwi deleted the list-theorems branch October 14, 2024 06:33
chabulhwi added a commit to leanprover-community/mathlib4 that referenced this pull request Oct 14, 2024
`List.modifyHead_modifyHead` is from `Mathlib.Data.List.Basic`. I need
it to prove `String.splitOn_of_valid`. See
leanprover-community/batteries#743.

Corresponding Batteries PR:
leanprover-community/batteries#756
chabulhwi added a commit to leanprover-community/mathlib4 that referenced this pull request Oct 14, 2024
`List.modifyHead_modifyHead` is from `Mathlib.Data.List.Basic`. I need
it to prove `String.splitOn_of_valid`. See
leanprover-community/batteries#743.

Corresponding Batteries PR:
leanprover-community/batteries#756
mathlib-bors bot pushed a commit to leanprover-community/mathlib4 that referenced this pull request Oct 14, 2024
`List.modifyHead_modifyHead` is from `Mathlib.Data.List.Basic`. I need
it to prove `String.splitOn_of_valid`. See
leanprover-community/batteries#743.

Corresponding Batteries PR:
leanprover-community/batteries#756



Co-authored-by: Kim Morrison <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review This PR is ready for review; the author thinks it is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants