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 interleave_combine : forall {A B} ls1 ls2 (l1 : list A) (l2 : list B) (Hls : Forall2 (fun la lb => length la = length lb) ls1 ls2) (Hlen : length l1 = length l2), interleave (map (fun x => let '(la, lb) := x in combine la lb) (combine ls1 ls2)) (combine l1 l2) -> interleave ls1 l1 /\ interleave ls2 l2.