Fixpoint sigma_but (l1 : list E) : (E -> Z) -> Z :=
  fun f : E -> Z =>
  match l1 with
  | nil => 0%Z
  | e :: l2 =>
      if eq_E_dec e x0
      then sigma_but l2 f
      else (f e + sigma_but l2 f)%Z
  end.

(* Specifications: *)
Lemma sigma_but_pos : forall (f : E -> Z) (l : list E), (forall x_ : E, (f x_ >= 0)%Z) -> (sigma_but l f >= 0)%Z.
Lemma sigma_sigma_but_not_in : forall l : list E, ~ In x0 l -> sigma E l f = sigma_but l f.
Lemma sigma_sigma_but : forall l : list E, only_once E eq_E_dec x0 l -> sigma E l f = (sigma_but l f + f x0)%Z.
Lemma sigma_but_simpl : forall (l : list E) (f g : E -> Z), (forall x : E, x <> x0 -> In x l -> f x = g x) -> sigma_but l f = sigma_but l g.