anchor.diff:  (* ------------------------------------------------------------------------- *)
   (* Specialize them to sums over intervals of numbers.                        *)
   (* ------------------------------------------------------------------------- *)
  +
   let SUM_ADD_NUMSEG = 
       prove
           ((parse_term @"!f g m n. sum(m..n) (\i. f(i) + g(i)) = sum(m..n) f + sum(m..n) g"), 
  
positive.code:          |> THEN <| ASM_SIMP_TAC [NSUM_CLAUSES; FINITE_DELETE; IN_DELETE]
           |> THEN <| ASM_SIMP_TAC [LTE_ADD2; NSUM_LE; IN_DELETE; FINITE_DELETE])
  
  let NSUM_LT_ALL = prove((parse_term @"!f g s. FINITE s /\ ~(s = {}) /\ (!x. x IN s ==> f(x) < g(x))
             ==> nsum s f < nsum s g"), MESON_TAC [MEMBER_NOT_EMPTY; LT_IMP_LE; NSUM_LT])
  
  let NSUM_EQ = 
  
negative.code: (* Extend congruences to deal with sum. Note that we must have the eta       *)
  (* redex or we'll get a loop since f(x) will lambda-reduce recursively.      *)
  (* ------------------------------------------------------------------------- *)
  
  let th_001 =
      prove((parse_term @"(!f g s.   (!x. x IN s ==> f(x) = g(x)) 
              ==> sum s (\i. f(i)) = sum s g) /\ 
  