(* functional or *)
Definition fun_or (pred1 pred2 : E -> bool) (a : E) := pred1 a || pred2 a.(* functional sum *)
Definition fun_sum (f1 f2 : E -> Z) (a : E) := (f1 a + f2 a)%Z.Definition fun_minus (f1 f2 : E -> Z) (a : E) := (f1 a - f2 a)%Z.

Lemma reduce_first_out : forall (q : queue data) (m : data), first data q = value data m -> reduce data f (first_out data q) = (reduce data f q - f m)%Z.