(* KEEP TOGETHER> *)

Definition ModRed := _Z r'''.

(* Specifications: *)
Lemma l_eq : u = x mod 2 ^ w.
Lemma v_eq : v = x / 2 ^ w.
Lemma s_eq : _Z s = x mod 2 ^ w / 2 ^ p.
Lemma lt_0_2ppw : 0 < 2 ^ (p + w).
Lemma lt_0_2pp : 0 < 2 ^ p.
Lemma lt_x_xmax : x < 2 ^ (p + w).
Lemma le_x_xmax : x <= 2 ^ (p + w) - 1.
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 s'_eq : _Z s' = x mod 2 ^ w - x mod 2 ^ p.
Lemma h_eq : _Z h = x / 2 ^ w * 2 ^ (w - p).
Lemma h'_eq : _Z h' = x / 2 ^ p.
Lemma q_eq : _Z q = x / 2 ^ p * (2 ^ (p + w) / M mod 2 ^ w) / 2 ^ w.
Lemma le_M_2pp : M <= 2 ^ p.
Lemma le_1_p : 1 <= p \/ M = 1.
Lemma lt_0_p : 0 < p \/ M = 1.
Lemma le_0_pm1 : 0 <= p - 1 \/ M = 1.
Lemma lt_2pm1_M : 2 ^ (p - 1) < M \/ M = 1.
Lemma div_M_1 : 2 ^ p / M = 1.
Lemma large_M'_eq : 2 ^ w + (2 ^ (p + w) / M) mod 2 ^ w = 2 ^ (p + w) / M.
Lemma q'_eq_pre : _Z q' = (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'_eq : _Z q' = (x / 2 ^ p * 2 ^ p / M) mod 2 ^ w \/ _Z q' = (x / 2 ^ p * 2 ^ p / M - 1) mod 2 ^ w.
Lemma y_eq : _Z y = x / 2 ^ p * 2 ^ p / M * M mod 2 ^ w \/ _Z y = (x / 2 ^ p * 2 ^ p / M * M - M) mod 2 ^ w.
Lemma lt_M_2pw : M < 2 ^ w.
Lemma le_M_2pw : M <= 2 ^ w.
Lemma d_eq : _Z d = x / 2 ^ p * 2 ^ p mod M \/ _Z d = x / 2 ^ p * 2 ^ p mod M + M.
Lemma r_eq : _Z r = (_Z d + x mod 2 ^ p) mod 2 ^ w.
Lemma r'_eq : _Z r' = x / 2 ^ p * 2 ^ p mod M + x mod 2 ^ p.
Lemma r'_small : _Z r' < M + 2 ^ p.
Lemma r'_x : _Z r' = x mod M \/ _Z r' = x mod M + M \/ _Z r' = x mod M + M + M.
Lemma r''_small : _Z r'' < 2 ^ p.
Lemma r''_eq : _Z r'' = x mod M \/ _Z r'' = x mod M + M.
Lemma r'''_eq : _Z r''' = x mod M.