Instance CompSpecs : compspecs.Definition Vprog : varspecs.Definition flip_ends {A} lo hi (contents: list A) :=
  sublist 0 lo (rev contents)
  ++ sublist lo hi contents
  ++ sublist hi (Zlength contents) (rev contents).

Lemma flip_fact_2: forall {A}{d: Inhabitant A} (al: list A) size j, Zlength al = size -> j < size - j - 1 -> 0 <= j -> Znth (size - j - 1) al = Znth (size - j - 1) (flip_ends j (size - j) al).