You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
For a list with ends a and b, simp does not simplify its last' to some b:
import data.list
variable {α : Type*}
example (a b : α) (l : list α) : (a :: l ++ [b]).last' = some b :=
begin simp, sorryend
A possible workaround is to add the following simp lemma.
import data.list
variable {α : Type*}
@[simp]theoremlist.last'_cons_append_cons (a b : α) (l1 l2 : list α) :
(a :: (l1 ++ b :: l2)).last' = (b :: l2).last' :=
by revert a; induction l1 with c l1 ih; simp; intro; exact ih c
-- Now this worksexample (a b : α) (l : list α) : (a :: l ++ [b]).last' = some b := by simp
How about we add the lemma above to mathlib?
I think a similar lemma for list.last (without ticks) can be also proved.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For a list with ends
a
andb
,simp
does not simplify itslast'
tosome b
:A possible workaround is to add the following
simp
lemma.How about we add the lemma above to mathlib?
I think a similar lemma for
list.last
(without ticks) can be also proved.The text was updated successfully, but these errors were encountered: