( `!(S:real^N->bool).
GEN_TAC THEN REWRITE_TAC[
affine;
affine_comb] THEN
DISCH_THEN (LABEL_TAC "1") THEN INDUCT_TAC THENL
[ SIMP_TAC[
SUM_CLAUSES_NUMSEG; ARITH_RULE `~(1=0) /\ ~ ( &1 = &0)`]; ALL_TAC ] THEN
REPEAT GEN_TAC THEN REWRITE_TAC[
ADD1] THEN ASM_CASES_TAC `( n = 0)` THENL
[ ASM_SIMP_TAC[ARITH_RULE `0+1=1`] THEN REWRITE_TAC[
SUM_SING_NUMSEG;
NUMSEG_SING;
VSUM_SING] THEN
STRIP_TAC THEN ASM_SIMP_TAC[
VECTOR_MUL_LID] THEN FIRST_ASSUM (MATCH_MP_TAC o SPEC `1`) THEN
REWRITE_TAC[
IN_SING; GSYM
IN]; ALL_TAC ] THEN
DISCH_THEN(CONJUNCTS_THEN2 (LABEL_TAC "3") (LABEL_TAC "4")) THEN
UNDISCH_TAC (`
sum (1..n + 1) (\i. t i) = &1`) THEN UNDISCH_TAC (`~(n=0)`) THEN
REWRITE_TAC[IMP_IMP] THEN DISCH_THEN (LABEL_TAC "5") THEN
FIRST_ASSUM(MP_TAC o (MATCH_MP
comb_trans)) THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN
ABBREV_TAC `(f:num->real^N) (i:num) = (&n * (t:num->
real) i) % (v:num->real^N) i + (&1 - &n * t i) % v (n + 1)` THEN
FIRST_X_ASSUM ((LABEL_TAC "6") o GSYM) THEN
ABBREV_TAC `(ts:num->
real) (i:num) = &1 / &n` THEN
FIRST_X_ASSUM ((LABEL_TAC "7") o GSYM) THEN
FIRST_ASSUM(MATCH_MP_TAC o (SPECL [`(ts:num->
real)`;`(f:num->real^N)`])) THEN CONJ_TAC THENL
[ ASM_REWRITE_TAC[
SUM_CONST_NUMSEG; ARITH_RULE ` (n+1) - 1 = n`] THEN
USE_THEN "5" (MP_TAC o (MATCH_MP (TAUT ` A/\B ==> A`))) THEN
MESON_TAC[
REAL_OF_NUM_NOT_EQ;
REAL_DIV_LMUL]; GEN_TAC ] THEN ASM_REWRITE_TAC[] THEN
DISCH_THEN (LABEL_TAC "8") THEN
USE_THEN "1" (MATCH_MP_TAC o (SPECL [`(v:num->real^N) (i:num)`;`(v:num->real^N) ((n:num) +1)`;`(&n * t i):real`])) THEN
CONJ_TAC THENL
[ USE_THEN "4" (MATCH_MP_TAC o (SPEC `i:num`)) THEN UNDISCH_TAC (`(1..n) i`) THEN
REWRITE_TAC[
numseg;
IN_ELIM_THM] THEN ARITH_TAC;
USE_THEN "4" (MATCH_MP_TAC o (SPEC `(n+1):num`)) THEN UNDISCH_TAC (`(1..n) i`) THEN
REWRITE_TAC[
numseg;
IN_ELIM_THM] THEN ARITH_TAC]);;