Definition iter T (g : T -> T -> Prop) s1 s2 := exists n, iter' g n s1 s2.(* curry the iteration *)
Definition iterc A T (g : A -> T -> A -> T -> Prop) a1 s1 a2 s2 := 
  iter (fun (a b : A * T) => g a.1 a.2 b.1 b.2) (a1, s1) (a2, s2).Implicit Type g : T -> T -> Prop.

Lemma iter'_sub g g' n s1 s2 : (forall s1 s2, g s1 s2 -> g' s1 s2) -> iter' g n s1 s2 -> iter' g' n s1 s2.