α : Type u
β : Type v
f : ℕ → α → β
l : List α
e : α
⊢ mapIdx f (l ++ [e]) = mapIdx f l ++ [f (length l) e]
α : Type u
β : Type v
⊢ ∀ (f : ℕ → α → β) (l : List α) (e : α), mapIdx f (l ++ [e]) = mapIdx f l ++ [f (length l) e]
intros f l e
α : Type u
β : Type v
f : ℕ → α → β
l : List α
e : α
⊢ mapIdx.go f (l ++ [e]) #[] = mapIdx.go f l #[] ++ [f (length l) e]
α : Type u
β : Type v
f : ℕ → α → β
l : List α
e : α
⊢ mapIdx f (l ++ [e]) = mapIdx f l ++ [f (length l) e]
unfold mapIdx
α : Type u
β : Type v
f : ℕ → α → β
l : List α
e : α
⊢ mapIdx.go f [e] (toArray (mapIdx.go f l #[])) = mapIdx.go f l #[] ++ [f (length l) e]
α : Type u
β : Type v
f : ℕ → α → β
l : List α
e : α
⊢ mapIdx.go f (l ++ [e]) #[] = mapIdx.go f l #[] ++ [f (length l) e]
rw [mapIdxGo_append f l [e]]
no goals
α : Type u
β : Type v
f : ℕ → α → β
l : List α
e : α
⊢ mapIdx.go f [e] (toArray (mapIdx.go f l #[])) = mapIdx.go f l #[] ++ [f (length l) e]
simp only [mapIdx.go, Array.size_toArray, mapIdxGo_length, length_nil, add_zero, Array.toList_eq,
  Array.push_data, Array.data_toArray]