Fixpoint iter_pos (n : positive) (x : A) {struct n} : A :=
  match n with
  | xI n' => iter_pos n' (iter_pos n' (f x))
  | xO n' => iter_pos n' (iter_pos n' x)
  | xH => f x
  end.

(* Specifications: *)
Lemma iter_pos_nat : forall (p : positive) (x : A), iter_pos p x = iter_nat (Pos.to_nat p) x.
Lemma iter_pos_nat : forall (p : positive) (x : A), iter_pos p x = iter_nat (Pos.to_nat p) x.