Fixpoint extend {A} (l : list A) ls :=
match l, ls with
| x :: xs, y :: ys => (x :: y) :: extend xs ys
| _, _ => ls
end.

(* Specifications: *)
Lemma Zlength_extend : forall {A} (l : list A) ls, Zlength (extend l ls) = Zlength ls.
Lemma Znth_extend_in : forall {A}{d: Inhabitant A}  (l : list A) ls i, 0 <= i < Zlength l -> Zlength l <= Zlength ls ->
Znth i (extend l ls) = Znth i l :: Znth i ls.
Lemma Znth_extend_ge : forall {A}{d: Inhabitant A}  (l : list A) ls i, Zlength l <= i ->
Znth i (extend l ls) = Znth i ls.