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

feat: List.dropPrefix? / dropSuffix? / dropInfix? and specification lemmas #1066

Merged
merged 4 commits into from
Nov 27, 2024

Conversation

kim-em
Copy link
Collaborator

@kim-em kim-em commented Nov 25, 2024

No description provided.

@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 Nov 25, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 25, 2024
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Nov 25, 2024

Mathlib CI status (docs):

Copy link
Collaborator

@fgdorais fgdorais left a comment

Choose a reason for hiding this comment

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

Minor edit for after #1065 is merged.

Batteries/Data/List/Basic.lean Outdated Show resolved Hide resolved
Co-authored-by: François G. Dorais <[email protected]>
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 26, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 26, 2024
@fgdorais fgdorais added this pull request to the merge queue Nov 27, 2024
Merged via the queue into main with commit c933dd9 Nov 27, 2024
3 checks passed
@github-actions github-actions bot removed the awaiting-review This PR is ready for review; the author thinks it is ready to be merged. label Nov 27, 2024
Comment on lines +1069 to +1071
`some r` if `l = p' ++ r` for some `p'` which is paiwise `==` to `p`,
and `none` otherwise. -/
def dropPrefix? [BEq α] : List α → List α → Option (List α)
Copy link
Member

Choose a reason for hiding this comment

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

Should this return p' too? Otherwise it seems rather annoying to extract it

@@ -15,6 +15,26 @@ namespace List
@[simp] theorem getElem_mk {xs : List α} {i : Nat} (h : i < xs.length) :
(Array.mk xs)[i] = xs[i] := rfl

/-! ### == -/

@[simp] theorem beq_nil_iff [BEq α] {l : List α} : (l == []) = l.isEmpty := by
Copy link
Member

Choose a reason for hiding this comment

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

Should this not be beq_nil_eq?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants