rewrite modred with (x := b mod M). rewrite <- Zmod_mult_distr_l. rewrite <- Zmod_plus_distr_l. trivial. omega. omega.
apply Zmod_le_0_z. omega. apply Zmod_lt_z_m. omega. omega. ring. omega. omega. Qed.

(* Specifications: *)
Lemma r'0_eq_6 : forall b : Z, (b * 2 ^ w + l) mod 2 ^ p = l mod 2 ^ p.
intro b. replace w with (w - p + p). rewrite Zpower_exp. rewrite Zmult_assoc. rewrite Zplus_comm. rewrite Z_mod_plus. trivial.