rewrite Z_mod_plus. rewrite Z_mod_plus. trivial. apply Zlt_gt. apply lt_0_Zpow. auto with a. apply Zlt_gt. apply lt_0_Zpow.
auto with a. cut (p < w). omega. auto with a. apply Zle_ge. auto with a. ring. Qed.

Lemma M1_r'_i_eq : M = 1 -> _Z r'_i = 0.
intro H. unfold r'_i. elim (Zle_or_lt c d_Si); intro H0. rewrite ltw_false. simpl. rewrite r_Si_eq_lit. fold M.