Fixpoint edelta (e : expr) :=
match e with
| nil => None
| (c,l) :: e1  =>
match has_delta c l e1 with
| None => edelta e1
| Some r => Some ((c,l), r) end
end.

(* Specifications: *)
Lemma edelta_in e :
match edelta e with None => True | Some (p,(p1,_)) =>
In p e /\ In p1 e end.
Lemma edelta_c e :
match edelta e with None => True | Some ((c,l),((c1,l1),(c2,l2))) =>
({c[c]} * {l[l]} + {c[c1]} * {l[l1]} =  {c[c2]} * {l[l2]})%f
end.