Definition move_forward {A}(i j:nat)(l:list A)(d:A) : list A :=
  firstn i l ++ firstn j (skipn (S i) l) ++ (nth i l d :: skipn (S (i+j)) l).

Lemma firstn_app2 : forall (A : Type) (l l' : list A) n, length l = n -> firstn n (l ++ l') = l .