feat: add simp theorem for List, (as.map f).length = as.length

This commit is contained in:
casavaca 2022-03-18 10:53:43 -07:00 committed by Leonardo de Moura
parent 72b6f4d528
commit bf4ba1583d

View file

@ -499,6 +499,10 @@ def dropLast {α} : List α → List α
| nil => simp
| cons a as ih => simp [ih, Nat.succ_add]
@[simp] theorem length_map (as : List α) (f : α → β) : (as.map f).length = as.length := by
induction as with
| nil => simp [List.map]
| cons a as ih => simp [List.map, ih]
@[simp] theorem length_reverse (as : List α) : (as.reverse).length = as.length := by
induction as with