Section Compare_fun_lemmas.
Variable (X : finType) (stop : X -> bool).
Definition swap (A B : Type) : A*B->B*A := ltac:(intros [b a]; now constructor).

Lemma Compare_correct_short (str1 str2 rs1 rs2 : list X) (x : X) (s1 s2 : X) t :
(forall x, In x str1 -> stop x = false) ->
stop x = false ->
stop s1 = true ->
stop s2 = true ->
tape_local (fst t) = str1 ++ x :: str2 ++ s1 :: rs1 ->
tape_local (snd t) = str1 ++ s2 :: rs2 ->
Compare_fun stop t =
(false, (midtape (rev str1 ++ left (fst t)) x (str2 ++ s1 :: rs1),
midtape (rev str1 ++ left (snd t)) s2 rs2)).