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_simpl : forall A B (l : list A) (l2 : list B), length l2 = length l -> firstn (length l2) l = l.