Definition split_bits x :=
  let mm := Zpower 2 mw in
  let em := Zpower 2 ew in
  (Zle_bool (mm * em) x, Zmod x mm, Zmod (Zdiv x mm) em)%Z.

(* Specifications: *)
Theorem split_join_bits : forall s m e, (0 <= m < Zpower 2 mw)%Z -> (0 <= e < Zpower 2 ew)%Z -> split_bits (join_bits s m e) = (s, m, e).
Theorem join_split_bits : forall x, (0 <= x < Zpower 2 (mw + ew + 1))%Z -> let '(s, m, e) := split_bits x in join_bits s m e = x.
Theorem split_bits_inj : forall x y, (0 <= x < Zpower 2 (mw + ew + 1))%Z -> (0 <= y < Zpower 2 (mw + ew + 1))%Z -> split_bits x = split_bits y -> x = y.
Theorem split_join_bits : forall s m e, (0 <= m < Zpower 2 mw)%Z -> (0 <= e < Zpower 2 ew)%Z -> split_bits (join_bits s m e) = (s, m, e).
Theorem join_split_bits : forall x, (0 <= x < Zpower 2 (mw + ew + 1))%Z -> let '(s, m, e) := split_bits x in join_bits s m e = x.
Theorem split_bits_inj : forall x y, (0 <= x < Zpower 2 (mw + ew + 1))%Z -> (0 <= y < Zpower 2 (mw + ew + 1))%Z -> split_bits x = split_bits y -> x = y.