anchor.diff:      prove
           ((parse_term @"!op f x s. x IN (support op f s) <=> x IN s /\ ~(f x = neutral op)"), 
            REWRITE_TAC [support; IN_ELIM_THM])
  +
   let SUPPORT_SUPPORT = 
       prove
           ((parse_term @"!op f s. support op f (support op f s) = support op f s"), 
            REWRITE_TAC [support; IN_ELIM_THM; EXTENSION]
            |> THEN <| REWRITE_TAC [CONJ_ACI])
  +
   let SUPPORT_EMPTY = 
       prove
           ((parse_term @"!op f s. (!x. x IN s ==> (f(x) = neutral op)) <=> (support op f s = {})"), 
            REWRITE_TAC [IN_SUPPORT; EXTENSION; IN_ELIM_THM; NOT_IN_EMPTY]
            |> THEN <| MESON_TAC [])
  +
   let SUPPORT_SUBSET = 
       prove
           ((parse_term @"!op f s. (support op f s) SUBSET s"), 
            SIMP_TAC [SUBSET; IN_SUPPORT])
  +
   let FINITE_SUPPORT = 
       prove
           ((parse_term @"!op f s. FINITE s ==> FINITE(support op f s)"), 
  
positive.code:                         |> THEN <| ASM_MESON_TAC []
                          ASM_SIMP_TAC [NSUM_CONST; LE_REFL]])
  
  let NSUM_BOUND_LT_ALL = prove((parse_term @"!s f b. FINITE s /\ ~(s = {}) /\ (!x. x IN s ==> f(x) < b)
             ==> nsum s f <  (CARD s) * b"), MESON_TAC [MEMBER_NOT_EMPTY; LT_IMP_LE; NSUM_BOUND_LT])
  
  let NSUM_BOUND_LT_GEN = 
  
negative.code: (* ------------------------------------------------------------------------- *)
  (* Partial summation and other theorems specific to number segments.         *)
  (* ------------------------------------------------------------------------- *)
  
  let SUM_PARTIAL_SUC = 
      prove((parse_term @"!f g m n.
          sum (m..n) (\k. f(k) * (g(k + 1) - g(k))) =
  