-
Notifications
You must be signed in to change notification settings - Fork 108
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
Conversation
Mathlib CI status (docs):
|
There was a problem hiding this 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.
Co-authored-by: François G. Dorais <[email protected]>
`some r` if `l = p' ++ r` for some `p'` which is paiwise `==` to `p`, | ||
and `none` otherwise. -/ | ||
def dropPrefix? [BEq α] : List α → List α → Option (List α) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
?
No description provided.