intuition.
destruct r.
destruct (le_dec n (pred p)).
exists (p)%nat.
eapply leRat_trans.
eapply expRat_leRat_compat.
eapply leRat_terms.
eapply l.
eapply le_refl.
rewrite expRat_terms.
destruct p.
destruct x.
omega.
simpl.
destruct (eq_nat_dec x O); subst.
rewrite mult_0_l.
rewrite rat_num_0.
eapply rat0_le_all.
assert (nz (2 * (x * expnat x x))).
econstructor.
eapply mult_gt_0.
omega.
eapply mult_gt_0. omega.
edestruct (@expnat_nz x x).
econstructor.
omega.
eauto.
assert (nz ((expnat (S x) x + x * expnat (S x) x))).
econstructor.
assert (expnat (S x) x > O).
edestruct (expnat_nz).
econstructor.
eapply g.
eauto.
remember (x * expnat (S x) x)%nat as a.
omega.
assert (posnatToNat (pos (2 * (x * expnat x x))) <= posnatToNat (pos (expnat (S x) x + x * expnat (S x) x)))%nat.
unfold natToPosnat, posnatToNat.
rewrite mult_assoc.
rewrite (mult_comm 2 x).
rewrite <- mult_assoc.
rewrite <- (plus_0_l (x * (2 * expnat x x))).
eapply plus_le_compat.
intuition.
eapply mult_le_compat.
intuition.
eapply expnat_base_S_same.
omega.
eapply leRat_trans.
eapply leRat_terms.
rewrite <- (mult_1_l (x * expnat x x)).
eapply le_refl.
unfold natToPosnat, posnatToNat.
eapply H2.
assert (nz (x * expnat x x)).
econstructor.
eapply mult_gt_0.
omega.
edestruct (@expnat_nz x x).
econstructor.
omega.
eauto.
assert (posnatToNat (pos (2 * (x * expnat x x))) = posnatToNat (posnatMult (pos 2) (pos (x * expnat x x)))).
unfold posnatMult, posnatToNat, natToPosnat.
trivial.
eapply leRat_trans.
eapply eqRat_impl_leRat.
eapply eqRat_trans.
eapply eqRat_terms.
eapply eq_refl.
eapply H4.
eapply ratMult_num_den.
eapply leRat_trans.
2:{
eapply eqRat_impl_leRat.
rewrite <- (ratMult_1_r (1/2)).
eapply eqRat_refl.
}
eapply ratMult_leRat_compat.
intuition.
eapply eqRat_impl_leRat.
eapply num_dem_same_rat1.
unfold posnatToNat, natToPosnat.
trivial.
exfalso.
eapply H.
eapply rat_ge_1.
omega.
Grab Existential Variables.
eapply expnat_nz.
destruct p.
econstructor.
simpl.
trivial.
Qed.

(* Specifications: *)
Lemma expRat_half_le_exp_exists : forall d,
~ d == 0 ->
exists n,
expRat (1/2) n <= d.