Definition is_add {A} (a : @hist_el A):= match a with QAdd _ _ => true | _ => false end.

Lemma consistent_adds : forall {A} (h : hist A) (Hadds : forallb is_add h = true), exists l, h = map (fun x => let '(p, v) := x in QAdd p v) l /\ forall h2 a b, consistent (h ++ h2) a b <-> consistent h2 (a ++ l) b.