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_long_midtape (str1 str2 : list X) (x s1 s2 : X) ls1 rs1 ls2 m rs2 :
(forall x, In x str1 -> stop x = false) ->
stop m = false ->
stop x = false ->
stop s1 = true ->
stop s2 = true ->
Compare_fun stop (midtape ls2 m (str1 ++ s2 :: rs2),
midtape ls1 m (str1 ++ x :: str2 ++ s1 :: rs1)) =
(false, (midtape (rev str1 ++ m :: ls2) s2 rs2,
midtape (rev str1 ++ m :: ls1) x (str2 ++ s1 :: rs1))).