intros q; case q; simpl in |- *.
red in |- *; intros; discriminate.
intros q'; rewrite (fun x y => plus_comm x (S y)); simpl in |- *; red in |- *;
intros; discriminate.
intros p' H q; case q.
simpl in |- *; red in |- *; intros; discriminate.
intros q'; red in |- *; intros H0; case (H q').
replace (2 * q') with (2 * S q' - 2).
rewrite <- H0; simpl in |- *; auto.
repeat rewrite (fun x y => plus_comm x (S y)); simpl in |- *; auto.
simpl in |- *; repeat rewrite (fun x y => plus_comm x (S y)); simpl in |- *;
auto.
case q'; simpl in |- *; auto.
Qed.

Theorem Pdivless_correct :
forall bound p q base,
1 < nat_of_P base ->
nat_of_P p <= nat_of_P q ->
nat_of_P p =
oZ (fst (fst (Pdivless bound p base q))) *
exp (nat_of_P base) (snd (Pdivless bound p base q)) +
oZ (snd (fst (Pdivless bound p base q))) /\
(oZ (fst (fst (Pdivless bound p base q))) < nat_of_P bound /\
oZ (snd (fst (Pdivless bound p base q))) <
exp (nat_of_P base) (snd (Pdivless bound p base q))) /\
(forall bound',
nat_of_P bound = nat_of_P base * bound' ->
nat_of_P bound <= nat_of_P p ->
nat_of_P bound <=
nat_of_P base * oZ (fst (fst (Pdivless bound p base q)))).