Section Iter_nat.
Context {T : Type}.
Context (op : T -> T -> T).
Context (x0 : T).
Context (neutral_l : forall x, op x0 x = x).
Context (neutral_r : forall x, op x x0 = x).
Context (assoc : forall x y z, op x (op y z) = op (op x y) z).
Definition iter_nat (a : nat -> T) n m :=
iter op x0 (iota n (S m - n)) a.

(* Specifications: *)
Lemma iter_nat_ext_loc (a b : nat -> T) (n m : nat) :
(forall k, (n <= k <= m)%nat -> a k = b k) ->
iter_nat a n m = iter_nat b n m.
Lemma iter_nat_point a n :
iter_nat a n n = a n.
Lemma iter_nat_Chasles a n m k :
(n <= S m)%nat -> (m <= k)%nat ->
iter_nat a n k = op (iter_nat a n m) (iter_nat a (S m) k).
Lemma iter_nat_S a n m :
iter_nat (fun n => a (S n)) n m = iter_nat a (S n) (S m).