intros m n f; generalize m; clear m; elim n; simpl in |- *; intros.
rewrite (plus_comm m); auto.
rewrite H; repeat (rewrite (plus_comm m); simpl in |- *); auto with arith.
Qed.

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).