(`!b. &2 <= b /\ b <= #2.52 ==> (\x. -- arclength x b (&2))
REPEAT STRIP_TAC THEN
MP_TAC (SPECL [`\x. --arclength x b (&2)`;
`\x. (x * x - (b * b - &4)) / x * inv (
sqrt (&4 * (x * x) * (b * b) - (x * x + b * b - &4) pow 2))`;
`\x. inv (
sqrt (&4 * (x * x) * (b * b) - (x * x + b * b - &4) pow 2)) * ((x * x + (b * b - &4)) / (x * x) - ((&2 * b * b - &2 * x * x + &8) * (x * x - (b * b - &4))) / (&4 * (x * x) * (b * b) - (x * x + b * b - &4) pow 2))`;
`
real_interval [&2,#2.52]`
]
REAL_CONVEX_ON_SECOND_DERIVATIVE) THEN
ANTS_TAC THENL
[
REWRITE_TAC[
IS_REALINTERVAL_INTERVAL] THEN
CONJ_TAC THENL
[
REWRITE_TAC[
NOT_EXISTS_THM] THEN GEN_TAC THEN
DISCH_TAC THEN
SUBGOAL_THEN `&2 = a /\ #2.52 = a` MP_TAC THENL
[
REWRITE_TAC[GSYM
IN_SING] THEN
POP_ASSUM (fun
th -> REWRITE_TAC[SYM
th]) THEN
REWRITE_TAC[
IN_REAL_INTERVAL] THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
CONJ_TAC THENL
[
REWRITE_TAC[
IN_REAL_INTERVAL] THEN
GEN_TAC THEN DISCH_TAC THEN
REWRITE_TAC[REAL_ARITH `a * inv(b) = --(a * --inv(b))`] THEN
MATCH_MP_TAC
HAS_REAL_DERIVATIVE_NEG THEN
MP_TAC (SPEC_ALL
arc_derivative) THEN
ASM_REWRITE_TAC[] THEN
REWRITE_TAC[REAL_ARITH `(x + x) * &2 * x * b - (x * x + b * b - &2 * &2) * &2 * b = &2 * b * (x * x - (b * b - &4))`] THEN
SUBGOAL_THEN `&0 < &2 * x * b` ASSUME_TAC THENL
[
MATCH_MP_TAC
REAL_LT_MUL THEN
REWRITE_TAC[REAL_ARITH `&0 < &2`] THEN
MATCH_MP_TAC
REAL_LT_MUL THEN
ASM_SIMP_TAC[REAL_ARITH `&2 <= x ==> &0 < x`];
ALL_TAC
] THEN
SUBGOAL_THEN `(&2 * b * (x * x - (b * b - &4))) / (&2 * x * b) pow 2 = (x * x - (b * b - &4)) / x * inv(&2 * x * b)` (fun
th -> REWRITE_TAC[
th]) THENL
[
POP_ASSUM MP_TAC THEN
CONV_TAC REAL_FIELD;
ALL_TAC
] THEN
SUBGOAL_THEN `!a b c. (c * inv(a)) * --inv(b) = c * --inv(a * b)` (fun
th -> ONCE_REWRITE_TAC[
th]) THENL
[
REWRITE_TAC[
REAL_INV_MUL] THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
SUBGOAL_THEN `&0 <= &1 - ((x * x + b * b - &2 * &2) / (&2 * x * b)) pow 2` ASSUME_TAC THENL
[
REWRITE_TAC[
REAL_POW_DIV] THEN
REWRITE_TAC[REAL_ARITH `&0 <= a - b <=> b <= a`] THEN
MATCH_MP_TAC Trigonometry2.REAL_LE_LDIV THEN
CONJ_TAC THENL
[
REWRITE_TAC[REAL_POW_2] THEN
MATCH_MP_TAC
REAL_LT_MUL THEN
ASM_REWRITE_TAC[];
ALL_TAC
] THEN
MATCH_MP_TAC
REAL_POW_LE2 THEN
CONJ_TAC THENL
[
SUBGOAL_THEN `&2 * &2 <= x * x /\ &2 * &2 <= b * b` MP_TAC THENL
[
REWRITE_TAC[GSYM REAL_POW_2] THEN
REWRITE_TAC[GSYM
REAL_LE_SQUARE_ABS] THEN
REPEAT (POP_ASSUM MP_TAC) THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
REWRITE_TAC[REAL_ARITH `x * x + b * b - &2 * &2 <= &2 * x * b <=> (x - b) pow 2 <= &2 pow 2`] THEN
REWRITE_TAC[GSYM
REAL_LE_SQUARE_ABS] THEN
REPEAT (POP_ASSUM MP_TAC) THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
FIRST_ASSUM (ASSUME_TAC o MATCH_MP
REAL_LT_IMP_LE) THEN
ASM_SIMP_TAC[Trigonometry1.SQRT_MUL_L] THEN
SUBGOAL_THEN `(&2 * x * b) pow 2 * (&1 - ((x * x + b * b - &2 * &2) / (&2 * x * b)) pow 2) = &4 * (x * x) * b * b - (x * x + b * b - &4) pow 2` MP_TAC THENL
[
REWRITE_TAC[
REAL_POW_DIV; REAL_ARITH `a * (&1 - c) = a - a * c`] THEN
FIRST_ASSUM (ASSUME_TAC o MATCH_MP
REAL_POW_LT) THEN
ASM_SIMP_TAC[REAL_FIELD `&0 < a ==> a * c / a = c`] THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
DISCH_THEN (fun
th -> REWRITE_TAC[
th]);
ALL_TAC
] THEN
REWRITE_TAC[
IN_REAL_INTERVAL] THEN
GEN_TAC THEN DISCH_TAC THEN
REAL_DIFF_TAC THEN
SUBGOAL_THEN `&0 < &4 * (x * x) * b * b - (x * x + b * b - &4) pow 2` ASSUME_TAC THENL
[
REWRITE_TAC[REAL_RING `&4 * (x * x) * b * b - (x * x + b * b - &4) pow 2 = (&2 pow 2 - (x - b) pow 2) * ((x + b) pow 2 - &2 pow 2)`] THEN
MATCH_MP_TAC
REAL_LT_MUL THEN
ONCE_REWRITE_TAC[REAL_ARITH `&0 < a - b <=> b < a`] THEN
REWRITE_TAC[GSYM
REAL_LT_SQUARE_ABS] THEN
REPEAT (POP_ASSUM MP_TAC) THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
CONJ_TAC THENL
[
ASM_SIMP_TAC[] THEN
FIRST_X_ASSUM (ASSUME_TAC o MATCH_MP
SQRT_POS_LT) THEN
ASM_SIMP_TAC[
REAL_POS_NZ; REAL_ARITH `&2 <= x ==> ~(x = &0)`];
ALL_TAC
] THEN
REWRITE_TAC[REAL_MUL_LID;
REAL_MUL_RID;
REAL_ADD_RID; ARITH_RULE `2 - 1 = 1`;
REAL_POW_1;
REAL_SUB_RZERO] THEN
REWRITE_TAC[
REAL_INV_MUL] THEN
FIRST_ASSUM (ASSUME_TAC o MATCH_MP
REAL_LT_IMP_LE) THEN
ASM_SIMP_TAC[
SQRT_POW_2] THEN
REPEAT (POP_ASSUM MP_TAC) THEN
CONV_TAC REAL_FIELD;
ALL_TAC
] THEN
DISCH_THEN (fun
th -> REWRITE_TAC[
th]) THEN
REWRITE_TAC[
IN_REAL_INTERVAL] THEN
GEN_TAC THEN DISCH_TAC THEN
MATCH_MP_TAC
REAL_LE_MUL THEN
SUBGOAL_THEN `&0 < &4 * (x * x) * b * b - (x * x + b * b - &4) pow 2` ASSUME_TAC THENL
[
REWRITE_TAC[REAL_RING `&4 * (x * x) * b * b - (x * x + b * b - &4) pow 2 = (&2 pow 2 - (x - b) pow 2) * ((x + b) pow 2 - &2 pow 2)`] THEN
MATCH_MP_TAC
REAL_LT_MUL THEN
ONCE_REWRITE_TAC[REAL_ARITH `&0 < a - b <=> b < a`] THEN
REWRITE_TAC[GSYM
REAL_LT_SQUARE_ABS] THEN
REPEAT (POP_ASSUM MP_TAC) THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
CONJ_TAC THENL
[
MATCH_MP_TAC
REAL_LE_INV THEN
MATCH_MP_TAC
SQRT_POS_LE THEN
MATCH_MP_TAC
REAL_LT_IMP_LE THEN
ASM_REWRITE_TAC[];
ALL_TAC
] THEN
ABBREV_TAC `t:real = x * x` THEN
ABBREV_TAC `u:real = b * b` THEN
REWRITE_TAC[REAL_ARITH `&0 <= a - b <=> b <= a`] THEN
SUBGOAL_THEN `&0 < t` ASSUME_TAC THENL
[
EXPAND_TAC "t" THEN
MATCH_MP_TAC
REAL_LT_MUL THEN
ASM_SIMP_TAC[REAL_ARITH `&2 <= x ==> &0 < x`];
ALL_TAC
] THEN
ASM_SIMP_TAC[
RAT_LEMMA4] THEN
ONCE_REWRITE_TAC[REAL_ARITH `a <= b <=> &0 <= b - a`] THEN
ABBREV_TAC `f = \t. (t + u - &4) * (&4 * t * u - (t + u - &4) pow 2) - ((&2 * u - &2 * t + &8) * (t - (u - &4))) * t` THEN
FIRST_ASSUM (MP_TAC o (fun
th -> AP_THM
th `t:real`)) THEN
BETA_TAC THEN
DISCH_THEN (fun
th -> REWRITE_TAC[
th]) THEN
ABBREV_TAC `f' = \t. &3 * (-- &2 * t * u + t * (t + &8) + u pow 2) + &8 * u - &80` THEN
ABBREV_TAC `f'' = \t. &6 * (t - u + &4)` THEN
SUBGOAL_THEN `&4 <= t /\ &4 <= u /\ t <= #6.3504 /\ u <= #6.3504` ASSUME_TAC THENL
[
REWRITE_TAC[REAL_ARITH `&4 = &2 * &2`; REAL_ARITH `#6.3504 = #2.52 * #2.52`] THEN
EXPAND_TAC "t" THEN EXPAND_TAC "u" THEN
REWRITE_TAC[GSYM REAL_POW_2] THEN
REWRITE_TAC[GSYM
REAL_LE_SQUARE_ABS] THEN
FIRST_X_ASSUM (MP_TAC o check (is_conj o concl)) THEN
REPEAT (FIRST_X_ASSUM (MP_TAC o check (is_binop `(<=):real->real->bool` o concl))) THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
SUBGOAL_THEN `&0 <= t /\ &0 <= u` ASSUME_TAC THENL
[
ASM_SIMP_TAC[REAL_ARITH `&4 <= t ==> &0 <= t`];
ALL_TAC
] THEN
MATCH_MP_TAC
REAL_LE_TRANS THEN
EXISTS_TAC `(f:real->
real) (&4)` THEN
CONJ_TAC THENL
[
EXPAND_TAC "f" THEN
REWRITE_TAC[REAL_ARITH `&4 + u - &4 = u`] THEN
REWRITE_TAC[REAL_ARITH `a - &2 * &4 + &8 = a`] THEN
REWRITE_TAC[REAL_ARITH `u * (&4 * &4 * u - u pow 2) - ((&2 * u) * (&4 - (u - &4))) * &4 = u * (&24 * u - u * u - &64)`] THEN
MATCH_MP_TAC
REAL_LE_MUL THEN
ASM_REWRITE_TAC[] THEN
ABBREV_TAC `g = \u. &24 * u - u * u - &64` THEN
FIRST_ASSUM (MP_TAC o (fun
th -> AP_THM
th `u:real`)) THEN
BETA_TAC THEN DISCH_THEN (fun
th -> REWRITE_TAC[
th]) THEN
MATCH_MP_TAC
REAL_LE_TRANS THEN
EXISTS_TAC `(g:real->
real) (&4)` THEN
CONJ_TAC THENL
[
EXPAND_TAC "g" THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
MATCH_MP_TAC
HAS_REAL_DERIVATIVE_INCREASING_IMP THEN
EXISTS_TAC `\u. &24 - &2 * u` THEN
EXISTS_TAC `
real_interval [&4,#6.3504]` THEN
REWRITE_TAC[
IS_REALINTERVAL_INTERVAL] THEN
CONJ_TAC THENL
[
REPEAT STRIP_TAC THEN
EXPAND_TAC "g" THEN
REAL_DIFF_TAC THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
ASM_REWRITE_TAC[
IN_REAL_INTERVAL; REAL_ARITH `&4 <= &4 /\ &4 <= #6.3504`] THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
MATCH_MP_TAC
HAS_REAL_DERIVATIVE_INCREASING_IMP THEN
MAP_EVERY EXISTS_TAC [`f':real->
real`; `
real_interval [&4,#6.3504]`] THEN
ASM_REWRITE_TAC[
IN_REAL_INTERVAL; REAL_ARITH `&4 <= &4 /\ &4 <= #6.3504`] THEN
REWRITE_TAC[
IS_REALINTERVAL_INTERVAL] THEN
CONJ_TAC THENL
[
REPEAT STRIP_TAC THEN
EXPAND_TAC "f" THEN EXPAND_TAC "f'" THEN
REAL_DIFF_TAC THEN
REWRITE_TAC[ARITH_RULE `2 - 1 = 1`] THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
X_GEN_TAC `y:real` THEN DISCH_TAC THEN
MATCH_MP_TAC
REAL_LE_TRANS THEN
EXISTS_TAC `(f':real->
real) (&4)` THEN
CONJ_TAC THENL
[
EXPAND_TAC "f'" THEN
REWRITE_TAC[REAL_ARITH `&3 * (-- &2 * &4 * u + &4 * (&4 + &8) + u pow 2) + &8 * u - &80 = &3 * (u - &8 / &3) pow 2 + &128 / &3`] THEN
MATCH_MP_TAC
REAL_LE_ADD THEN
CONJ_TAC THENL
[
MATCH_MP_TAC
REAL_LE_MUL THEN
REWRITE_TAC[REAL_POW_2;
REAL_LE_SQUARE] THEN
REAL_ARITH_TAC;
REAL_ARITH_TAC
];
ALL_TAC
] THEN
MATCH_MP_TAC
HAS_REAL_DERIVATIVE_INCREASING_IMP THEN
MAP_EVERY EXISTS_TAC [`f'':real->
real`; `
real_interval [&4,#6.3504]`] THEN
ASM_REWRITE_TAC[
IN_REAL_INTERVAL; REAL_ARITH `&4 <= &4 /\ &4 <= #6.3504`] THEN
REWRITE_TAC[
IS_REALINTERVAL_INTERVAL] THEN
CONJ_TAC THENL
[
REPEAT STRIP_TAC THEN
EXPAND_TAC "f'" THEN EXPAND_TAC "f''" THEN
REAL_DIFF_TAC THEN
REAL_ARITH_TAC;
ALL_TAC
] THEN
EXPAND_TAC "f''" THEN
REPLICATE_TAC 3 (POP_ASSUM MP_TAC) THEN
REAL_ARITH_TAC);;