(* KE EP TOGETHER> *)
simpl. rewrite H. fold M. replace (x mod M + M - M) with (x mod M). apply modred.
apply Zmod_le_0_z. omega. apply Zlt_trans with M. apply Zmod_lt_z_m. omega. unfold M. apply lt_z__Z. ring. rewrite H. fold M.
cut (0 <= x mod M). omega. apply Zmod_le_0_z. omega. Qed.

(* Specifications: *)
Lemma r'_small : r'_i < 2 ^ p + M.
unfold r'_i. elim (Zle_or_lt c d_Si); intro H. rewrite ltw_false. simpl. rewrite r_Si_eq_lit. rewrite <- Zmod_minus_distr_l.