(***********************************************************************
**********************************************************************
**********************************************************************

	ITERATED SUMS
*)

Fixpoint sum_nm (n : nat) : nat -> (nat -> nat) -> nat :=
  fun (m : nat) (f : nat -> nat) =>
  match n with
  | O => f m
  | S n' => f m + sum_nm n' (S m) f
  end.

Lemma sum_nm_ext : forall (m n : nat) (f g : nat -> nat), (forall x : nat, x <= n -> f (m + x) = g (m + x)) -> sum_nm n m f = sum_nm n m g.