Corollary consistent_insert_rem : forall {A} (h1 h2 : hist A) a b p v (Hadds : forallb is_add h1 = true),
  consistent (h1 ++ h2) a b -> consistent (h1 ++ QRem p v :: h2) ((p, v) :: a) b.

Lemma add_first : forall {A} ls (h : hist A) a b (Hinter : interleave ls h) (Hcon : consistent h a b), exists h1 h2, interleave (map (filter is_add) ls) h1 /\ interleave (map (filter (fun a => negb (is_add a))) ls) h2 /\ consistent (h1 ++ h2) a b.