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

	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 inv_sum_nm : forall (P : nat -> Prop) (i n : nat) (f : nat -> nat), (forall a b : nat, P a -> P b -> P (a + b)) -> (forall x : nat, x <= n -> P (f (i + x))) -> P (sum_nm n i f).