anchor.diff:  
   let NSUM_RESTRICT_SET = 
       prove
  -        ((parse_term 
  -              "!P s f. nsum {x:A | x IN s /\ P x} f = nsum s (\x. if P x then f(x) else 0)"), 
  +        ((parse_term @"!P s f. nsum {x:A | x IN s /\ P x} f = nsum s (\x. if P x then f(x) else 0)"), 
            ONCE_REWRITE_TAC [GSYM NSUM_SUPPORT]
            |> THEN <| REWRITE_TAC [support; NEUTRAL_ADD; IN_ELIM_THM]
            |> THEN <| REWRITE_TAC [MESON [] 
  -                                     (parse_term 
  -                                          "~((if P x then f x else a) = a) <=> P x /\ ~(f x = a)")
  +                                     (parse_term @"~((if P x then f x else a) = a) <=> P x /\ ~(f x = a)")
                                    GSYM CONJ_ASSOC]
            |> THEN <| REPEAT GEN_TAC
            |> THEN <| MATCH_MP_TAC NSUM_EQ
  
positive.code: 
  let SUM_PAIR = 
      prove
          ((parse_term 
                "!f m n. sum(2*m..2*n+1) f = sum(m..n) (\i. f(2*i) + f(2*i+1))"), 
           MP_TAC(MATCH_MP ITERATE_PAIR MONOIDAL_REAL_ADD)
           |> THEN <| REWRITE_TAC [sum; NEUTRAL_REAL_ADD])
  let REAL_OF_NUM_SUM_NUMSEG = 
  
negative.code: 
  let NUMSEG_COMBINE_R = 
      prove
          ((parse_term @"!m p n. m <= p + 1 /\ p <= n ==> ((m..p) UNION ((p+1)..n) = m..n)"), 
           REWRITE_TAC [EXTENSION; IN_UNION; numseg; IN_ELIM_THM]
           |> THEN <| ARITH_TAC)
  let NUMSEG_COMBINE_L = 
      prove
          ((parse_term @"!m p n. m <= p /\ p <= n + 1 ==> ((m..(p-1)) UNION (p..n) = m..n)"), 
           REWRITE_TAC [EXTENSION; IN_UNION; numseg; IN_ELIM_THM]
           |> THEN <| ARITH_TAC)
  let NUMSEG_LREC = 
  