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

Lemma sublist_extendr : forall {A} (l : list A) ls i j, sublist i j (extendr l ls) = extendr (sublist i j l) (sublist i j ls).