(* KE EP TOGETHER> *)
rewrite Zmod_minus_distr_l with (a := x' mod 2 ^ w - x' mod 2 ^ p).
rewrite <- Zmod_minus_distr_l with (a := x'). rewrite <- Zmod_minus_distr_l. rewrite <- Zmod_plus_distr_l. fold x_i.
replace (x' - x' mod 2 ^ p - _Z y_i + x' mod 2 ^ p) with (x' - _Z y_i). rewrite x_i_eq.
rewrite <- Zmod_minus_distr_l. trivial. auto with a. ring. auto with a. auto with a. auto with a.
auto with a. Qed.

Lemma l'_i_eq : _Z l'_i = x' mod 2 ^ p.
unfold l'_i. rewrite Z_from_minusw. fold x_i. rewrite s'_i_eq. unfold x'. rewrite Zmod_km_plus. rewrite modred with (x := x_i).