Section LoopLift.
Variable A B : Type. (* Abstract state *)
Variable lift : A -> B. (* Lifting function between state *)
Variable (f : A -> A) (f' : B -> B). (* Abstract steps *)
Variable (h : A -> bool) (h' : B -> bool). (* Abstract halting state *)
Hypothesis halt_lift_comp : forall x:A, h' (lift x) = h x.
Hypothesis step_lift_comp : forall x:A, h x = false -> f' (lift x) = lift (f x).

Lemma loop_unlift (k : nat) (a : A) (b' : B) :
loop f' h' (lift a) k = Some b' ->
exists a' : A, loop f h a k = Some a' /\ b' = lift a'.