Definition Qfloor (x:Q) := let (n,d) := x in Z.div n (Zpos d).Definition Qceiling (x:Q) := (-(Qfloor (-x)))%Z.

(* Specifications: *)
Lemma Qfloor_Z : forall z:Z, Qfloor z = z.
Lemma Qceiling_Z : forall z:Z, Qceiling z = z.
Lemma Qfloor_le : forall x, Qfloor x <= x.
Lemma Qle_ceiling : forall x, x <= Qceiling x.
Lemma Qle_floor_ceiling : forall x, Qfloor x <= Qceiling x.
Lemma Qlt_floor : forall x, x < (Qfloor x+1)%Z.
Lemma Qceiling_lt : forall x, (Qceiling x-1)%Z < x.
Lemma Qfloor_resp_le : forall x y, x <= y -> (Qfloor x <= Qfloor y)%Z.
Lemma Qceiling_resp_le : forall x y, x <= y -> (Qceiling x <= Qceiling y)%Z.