Definition d_i := minusw s'_i y_i.Definition r_i := minusw x_i_in_Z_ y_i.(* only needed after the loop *)

Definition r'''0 := ltw r''0 M_in_Z_ r''0 (minusw r''0 M_in_Z_).Definition g' := r'''0.

(* Specifications: *)
Lemma x_i_eq : x_i = x' mod 2 ^ w.
Lemma lt_0_2ppw : 0 < 2 ^ (p + w).
Lemma lt_0_2pp : 0 < 2 ^ p.
Lemma le_0_wm1 : 0 <= w - 1.
Lemma lt_p_w : p < w.
Lemma le_p_w : p <= w.
Lemma le_0_wmp : 0 <= w - p.
Lemma lt_M_2pw : M < 2 ^ w.
Lemma le_M_2pw : M <= 2 ^ w.
Lemma d_Si_eq : _Z d_Si = (h mod M * 2 ^ w + l) / 2 ^ p * 2 ^ p mod M \/ _Z d_Si = (h mod M * 2 ^ w + l) / 2 ^ p * 2 ^ p mod M + M \/ _Z d_Si = ((h mod M + M) * 2 ^ w + l) / 2 ^ p * 2 ^ p mod M \/ _Z d_Si = ((h mod M + M) * 2 ^ w + l) / 2 ^ p * 2 ^ p mod M + M.
Lemma r_Si_eq_lit : _Z r_Si = (d_Si + l mod 2 ^ p) mod 2 ^ w.
Lemma r_Si_eq_a : _Z r_Si = ( d_Si + (h mod M * 2 ^ w + l) mod 2 ^ p) mod 2 ^ w.
Lemma r_Si_eq_b : _Z r_Si = ( d_Si + ((h mod M + M) * 2 ^ w + l) mod 2 ^ p) mod 2 ^ w.
Lemma p2wp : 2 ^ w = 2 ^ (w - p) * 2 ^ p.
Lemma mod2p : forall a b c', (a * 2 ^ w + b) mod 2 ^ p = (c' * 2 ^ w + b) mod 2 ^ p.
Lemma r'_i_eq : _Z r'_i = (h mod M * 2 ^ w + l) / 2 ^ p * 2 ^ p mod M + (h mod M * 2 ^ w + l) mod 2 ^ p.
Lemma sum_r'_i : forall a b : Z, (a mod M + b mod M) / M = 0 \/ (a mod M + b mod M) / M = 1.
Lemma div_r'_i : forall a : Z, a mod 2 ^ p / M = 0 \/ a mod 2 ^ p / M = 1.
Lemma r'_i_eq'_i : _Z r'_i = x mod M \/ _Z r'_i = x mod M + M \/ _Z r'_i = x mod M + M + M.
Lemma s_i_eq : _Z s_i = x' mod 2 ^ w / 2 ^ p.
Lemma s'_i_eq : _Z s'_i = x' mod 2 ^ w - x' mod 2 ^ p.
Lemma le_0_x' : 0 <= x'.
Lemma r''0_small : r''0 < 2 ^ p.
Lemma r''0_eq : _Z r''0 = x mod M \/ _Z r''0 = x mod M + M.
Lemma r'''0_eq : _Z r'''0 = x mod M.
Lemma lt_x'_x'max : x' < 2 ^ (p + w).
Lemma le_x'_x'max : x' <= 2 ^ (p + w) - 1.
Lemma Meq_ir''0 : M = 1 -> _Z r''0 = 0.
Lemma h_i'_eq : _Z h_i' = x' / 2 ^ w * 2 ^ (w - p).
Lemma h'_i'_eq : _Z h'_i' = x' / 2 ^ p.
Lemma h'_i'h'_i_eq : _Z h'_i' = _Z h'_i.
Lemma q_i_eq : _Z q_i = x' / 2 ^ p * (2 ^ (p + w) / M mod 2 ^ w) / 2 ^ w.
Lemma q'_i_eq_pre : _Z q'_i = (x' / 2 ^ p * (2 ^ (p + w) / M) / 2 ^ w) mod 2 ^ w.
Lemma mod_ab_mod : forall z a b m : Z, 0 < m -> z = a \/ z = b -> z mod m = a mod m \/ z mod m = b mod m.
Lemma q'_i_eq : _Z q'_i = (x' / 2 ^ p * 2 ^ p / M) mod 2 ^ w \/ _Z q'_i = (x' / 2 ^ p * 2 ^ p / M - 1) mod 2 ^ w.
Lemma y_i_eq : _Z y_i = x' / 2 ^ p * 2 ^ p / M * M mod 2 ^ w \/ _Z y_i = (x' / 2 ^ p * 2 ^ p / M * M - M) mod 2 ^ w.
Lemma d_i_eq : _Z d_i = x' / 2 ^ p * 2 ^ p mod M \/ _Z d_i = x' / 2 ^ p * 2 ^ p mod M + M.
Lemma r_i_eq : _Z r_i = (_Z d_i + x' mod 2 ^ p) mod 2 ^ w.