proposition: Theorem sigma_last : forall low high:nat, (low < high)%nat -> sigma low high = f high + sigma low (pred high).
proof: Proof. intros low high H1; generalize (proj2 (Nat.le_succ_l low high) H1); intro H2; generalize (Nat.lt_le_incl low high H1); intro H3; replace (f high) with (sigma high high). - rewrite Rplus_comm; cut (high = S (pred high)). + intro; pattern high at 3; rewrite H. apply sigma_split. * apply le_S_n; rewrite <- H; apply Nat.le_succ_l; assumption. * apply Nat.lt_pred_l, Nat.neq_0_lt_0; apply Nat.le_lt_trans with low; [ apply Nat.le_0_l | assumption ]. + symmetry; apply Nat.lt_succ_pred with 0%nat; apply Nat.le_lt_trans with low; [ apply Nat.le_0_l | assumption ]. - unfold sigma; rewrite Nat.sub_diag; simpl; replace (high + 0)%nat with high; [ reflexivity | ring ]. Qed.
imports: Rbase Rfunctions Rseries PartSum Lia