(* ========================================================================= *) (* Divergence of prime reciprocal series. *) (* ========================================================================= *) (* ------------------------------------------------------------------------- *) (* Now load other stuff needed. *) (* ------------------------------------------------------------------------- *) needs "100/bertrand.ml";; needs "100/divharmonic.ml";; (* ------------------------------------------------------------------------- *) (* Variant of induction. *) (* ------------------------------------------------------------------------- *)(* ------------------------------------------------------------------------- *) (* Evaluate sums over explicit intervals. *) (* ------------------------------------------------------------------------- *) let SUM_CONV = (* ------------------------------------------------------------------------- *) (* Lower bound relative to harmonic series. *) (* ------------------------------------------------------------------------- *) (* ------------------------------------------------------------------------- *) (* Hence an overall lower bound. *) (* ------------------------------------------------------------------------- *) (* ------------------------------------------------------------------------- *) (* General lemma. *) (* ------------------------------------------------------------------------- *)let INDUCTION_FROM_1 =prove (`!P. P 0 /\ P 1 /\ (!n. 1 <= n /\ P n ==> P(SUC n)) ==> !n. P n`,(* ------------------------------------------------------------------------- *) (* Hence divergence. *) (* ------------------------------------------------------------------------- *)let UNBOUNDED_DIVERGENT =prove (`!s. (!k. ?N. !n. n >= N ==> sum(1..n) s >= k) ==> ~(convergent(\n. sum(1..n) s))`,(* ------------------------------------------------------------------------- *) (* A perhaps more intuitive formulation. *) (* ------------------------------------------------------------------------- *)let PRIMERECIP_DIVERGES_NUMSEG =prove (`~(convergent (\n. sum (1..n) (\i. if prime i then &1 / &i else &0)))`,let PRIMERECIP_DIVERGES =prove (`~(convergent (\n. sum {p | prime p /\ p <= n} (\p. &1 / &p)))`,