Fixpoint extendr {A} (l : list A) ls :=
match l, ls with
| x :: xs, y :: ys => (y ++ [x]) :: extendr 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).