unfold negligible in *.
intuition.
destruct (H (S c)).
destruct (H0 (S c)).
exists (max 1 (max x x0)).
intuition.
apply Nat.max_lub_lt_iff in H3.
intuition.
assert (1 / expnat x1 c <= 2/1 * (maxRat (f1 x1) (f2 x1)))%rat.
eapply leRat_trans.
eapply H4.
eapply ratAdd_2_ratMax.
assert (1 / expnat x1 (S c) <= RatIntro 1 (posnatMult (pos 2) (pos (expnat x1 c))))%rat.
eapply leRat_terms; intuition.
unfold natToPosnat, posnatToNat, posnatMult.
eapply expnat_double_le.
omega.
unfold maxRat in *.
case_eq (bleRat (f1 x1) (f2 x1)); intuition.
rewrite H8 in H3.
eapply H2.
eapply le_lt_trans.
eapply Max.le_max_r.
eauto.
rewrite H7.
rewrite rat_mult_den.
rewrite H3.
rewrite <- ratMult_assoc.
rewrite <- ratMult_num_den.
rewrite num_dem_same_rat1.
rewrite ratMult_1_l.
intuition.
unfold posnatMult, natToPosnat, posnatToNat.
omega.
rewrite H8 in H3.
eapply H1.
eapply le_lt_trans.
eapply Max.le_max_l.
eauto.
rewrite H7.
rewrite rat_mult_den.
rewrite H3.
rewrite <- ratMult_assoc.
rewrite <- ratMult_num_den.
rewrite num_dem_same_rat1.
rewrite ratMult_1_l.
intuition.
unfold posnatMult, natToPosnat, posnatToNat.
omega.
Qed.
(* We need several facts about arithmetic to show that an inverse exponential function is negligible. *)
Local Open Scope nat_scope.

(* Specifications: *)
Theorem double_log_plus_3_le_h :
forall y x,
y = Nat.log2 x ->
y >= 4 ->
2 * y + 3 <= x.