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_1: forall A size (contents: list A) j, Zlength contents = size -> 0 <= j -> size - j - 1 <= j <= size - j -> flip_ends j (size - j) contents = rev contents.