English
Mapping a plain function over a vector commutes with mapAccumr in the sense that the final mapped part depends only on the composed update along the vector.
Русский
Отображение простой функции через map над вектором коммутирует с mapAccumr в смысле того, что полученная финальная часть зависит только от составного обновления вдоль вектора.
LaTeX
$$$\text{map } f (\text{mapAccumr } g xs s).snd = \text{mapAccumr } (\lambda x s. (g\_s, f(x))) xs s$$$
Lean4
@[simp]
theorem map_map (f₁ : β → γ) (f₂ : α → β) : map f₁ (map f₂ xs) = map (fun x => f₁ <| f₂ x) xs := by
induction xs <;> simp_all