(* ========================================================================= *)
(* Divergence of harmonic series.                                            *)
(* ========================================================================= *)

prioritize_real();;

let HARMONIC_DIVERGES = `~(?s. !e. &0 < e
             ==> ?N. !n. N <= n ==> abs(sum(1..n) (\i. &1 / &i) - s) < e)`;;

(* ------------------------------------------------------------------------- *)
(* Formulation in terms of limits.                                           *)
(* ------------------------------------------------------------------------- *)

needs "Library/analysis.ml";;

let HARMONIC_DIVERGES' = `~(convergent (\n. sum(1..n) (\i. &1 / &i)))`;;

(* ------------------------------------------------------------------------- *)
(* Lower bound on the partial sums.                                          *)
(* ------------------------------------------------------------------------- *)

let HARMONIC_LEMMA = `!m. sum(1..2 EXP m) (\n. &1 / &n) >= &m / &2`;;

(* ------------------------------------------------------------------------- *)
(* Germ of an alternative proof.                                             *)
(* ------------------------------------------------------------------------- *)

needs "Library/transc.ml";;

let LOG_BOUND = `&0 < x /\ x < &1 ==> ln(&1 + x) >= x / &2`;;