val SUMMING_INTEGRATOR = store_thm(“SUMMING_INTEGRATOR”,
“!x. 0<=x ==> (integral(0, x) ( t. (m * cos t) + (n * sin t)) = m * sin x + n *(cos 0 − cos x))”,
RW_TAC std_ss THEN REWRITE_TAC integral THEN
SELECT_ELIM_TAC THEN CONJ_TAC THENL
EXISTS_TAC“m * sin x + n * (cos 0 − cos x)” THEN
MATCH_MP_TAC DINT_LINEAR THEN CONJ_TAC THENL
SUBGOAL_THEN“sin x = sin x − sin 0”ASSUME_TAC THENL
   SIMP_TAC std_ss SIN_0 THEN REAL_ARITH_TAC, ONCE_ASM_REWRITE_TAC THEN
MATCH_MP_TAC FTC1 THEN RW_TAC std_ss THEN
  ASM_SIMP_TAC arith_ss DIFF_SIN , ALL_TAC THEN
SUBGOAL_THEN“cos 0 − cos x = −cos x − cos 0”ASSUME_TAC THENL
REWRITE_TAC REAL_SUB_NEG2 , ALL_TAC THEN
ONCE_ASM_REWRITE_TAC THEN HO_MATCH_MP_TAC FTC1 THEN
ASM_SIMP_TAC std_ss DIFF_NEG_COS ,ALL_TAC THEN
RW_TAC std_ss THEN MATCH_MP_TAC DINT_UNIQ THEN
MAP_EVERY EXISTS_TAC “0:real”,“x:real”,
          “(t. (m * cos t) + (n * sin t)):real->real” THEN
ASM_REWRITE_TAC THEN MATCH_MP_TAC DINT_LINEAR THEN
CONJ_TAC THENL
SUBGOAL_THEN “sin x = sin x − sin 0”ASSUME_TAC THENL
SIMP_TAC std_ss SIN_0 THEN REAL_ARITH_TAC,
ONCE_ASM_REWRITE_TAC THEN MATCH_MP_TAC FTC1 THEN
  RW_TAC std_ss THEN ASM_SIMP_TAC arith_ss DIFF_SIN , ALL_TAC THEN
SUBGOAL_THEN“cos 0 − cos x = −cos x − cos 0”ASSUME_TAC THENL
REWRITE_TAC REAL_SUB_NEG2 , ONCE_ASM_REWRITE_TAC THEN
HO_MATCH_MP_TAC FTC1 THEN ASM_SIMP_TAC std_ss DIFF_NEG_COS );
Algorithm 1: The formalization and proof of SUMMING_INTEGRATOR.