(* ========================================================================= *)
(* Nice little result that harmonic sum never gives an integer. *)
(* ========================================================================= *)
needs "Library/prime.ml";;
needs "Library/products.ml";;
needs "Library/floor.ml";;
(* ------------------------------------------------------------------------- *)
(* In any contiguous range, index (order) of 2 has a strict maximum. *)
(* ------------------------------------------------------------------------- *)
"l"] THEN
REWRITE_TAC[LT_MULT_LCANCEL; EXP_EQ_0; ARITH_EQ] THEN DISCH_TAC THENL
[FIRST_X_ASSUM(MP_TAC o SPEC `2 EXP index 2 k * (q + 1)`);
FIRST_X_ASSUM(MP_TAC o SPEC `2 EXP index 2 k * (p + 1)`)] THEN
ASM_SIMP_TAC[INDEX_MUL; PRIME_2; EXP_EQ_0; ADD_EQ_0; ARITH; NOT_IMP;
INDEX_EXP; INDEX_REFL] THEN
REWRITE_TAC[ARITH_RULE `n * 1 + k <= n <=> k = 0`; INDEX_EQ_0] THEN
ASM_REWRITE_TAC[ADD_EQ_0; ARITH; DIVIDES_2; EVEN_ADD; NOT_EVEN] THEN
MATCH_MP_TAC(ARITH_RULE
`!p. m <= e * q /\ e * (q + 1) <= e * p /\ e * p <= n
==> m <= e * (q + 1) /\ e * (q + 1) <= n`)
THENL [EXISTS_TAC `p:num`; EXISTS_TAC `q:num`] THEN
REWRITE_TAC[LE_MULT_LCANCEL] THEN ASM_REWRITE_TAC[] THEN
ASM_ARITH_TAC);;
(* ------------------------------------------------------------------------- *)
(* Hence the result. *)
(* ------------------------------------------------------------------------- *)