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).

(* Worst-case time (read the full string) *)
Lemma Compare_steps_correct (str1 str2 : list X) (s1 s2 : X) rs1 rs2 t :
stop s1 = true ->
stop s2 = true ->
tape_local (fst t) = str1 ++ s1 :: rs1 ->
tape_local (snd t) = str2 ++ s2 :: rs2 ->
Compare_steps stop t <= 5 + 6 * max (length str1) (length str2).