exact lt_2wm1_2w. Qed.
Definition Z__from_Mset (M : Mset) := exist (in_Z_ (2 ^ w)) M (in_Z__if_in_Mset M).
Coercion Z__from_Mset : Mset >-> sig.
(* <KEEP TOGETHER - Cdef *)
Definition C (M : Mset) :=
( exist (in_Z_ w)       (Zlog_sup M)                       (pex M),
exist (in_Z_ w)       (w - Zlog_sup M - 1 / M)           (tex M),
exist (in_Z_ (2 ^ w)) (2 ^ (Zlog_sup M + w) / M - 2 ^ w) (M'ex M)).
(* KEEP TOGETHER> *)

(* Specifications: *)
(* <KEEP TOGETHER - modred_equality *)
Theorem ModRed_eq : forall (M : Mset)
(x : Z_ (2 ^ (Zlog_sup M + w))),
ModRed M
(C M)
(exist (in_Z_ (2 ^ w)) (x / 2 ^ w)   (xhex M x))
(exist (in_Z_ (2 ^ w)) (x mod 2 ^ w) (xlex x))     =
x mod M.