Local Notation " ' x " := (Zpos x) (at level 20, no associativity) : Z_scope.Fixpoint pos_power2 (n:nat) : positive := match n with
  | O => 1%positive
  | S m => ((pos_power2 m)~0)%positive
end.Definition dr2Q (x:dyadic_rational) : Q :=
  match x with
  | m_over_2_to_n m n => (Z_of_nat m) # (pos_power2 n)
  end.

(* Specifications: *)
Lemma dr2Q_wd: forall x y:dyadic_rational, dr_eq x y -> dr2Q x == dr2Q y.
Lemma dr2Q_incr: forall x y:dyadic_rational, dr_lt x y -> dr2Q x < dr2Q y.
Lemma Qlt_dr_lt: forall x y:dyadic_rational, (dr2Q x < dr2Q y)%Q -> dr_lt x y.
Lemma dyadic_rationals_dense_in_reals: forall x y:R, 0 <= x < y -> exists q:dyadic_rational, x < Q2R (dr2Q q) < y.