chore: add @[simp] to List.flatten_toArray (#7014)

This commit is contained in:
Kim Morrison 2025-02-10 21:30:41 +11:00 committed by GitHub
parent 0d95bf68cc
commit 47814f9da1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1878,7 +1878,8 @@ theorem append_eq_map_iff {f : α → β} :
rw [← flatten_map_toArray]
simp
theorem flatten_toArray (l : List (Array α)) :
-- We set this to lower priority so that `flatten_toArray_map` is applied first when relevant.
@[simp 500] theorem flatten_toArray (l : List (Array α)) :
l.toArray.flatten = (l.map Array.toList).flatten.toArray := by
apply ext'
simp
@ -2140,7 +2141,8 @@ theorem flatMap_eq_foldl (f : α → Array β) (l : Array α) :
| nil => simp
| cons a l ih =>
intro l'
simp [ih ((l' ++ (f a).toList)), toArray_append]
rw [List.foldl_cons, ih]
simp [toArray_append]
/-! ### mkArray -/