Definition hists_mono (h1 h2 : list (hist * hist)) := Forall2 (fun a b =>
(exists l, fst b = fst a ++ l) /\ (exists l, snd b = snd a ++ l)) h1 h2.
Instance hists_mono_refl : RelationClasses.Reflexive hists_mono.
Hint Resolve hists_mono_refl.
Instance hists_mono_trans : RelationClasses.Transitive hists_mono.

Lemma one_add_succeeds : forall lr keys
(Hadd : Forall (fun '(la, h) => add_items_trace empty_hists la h) lr)
(Hfullk : Forall2 full_hist' (map fst (fold_right join_hists empty_hists (map snd lr))) (map (fun x => vint x) keys))
(Hkeys : Forall2 (fun h v => forall t e, In (t, e) h -> value_of e <> vint 0 -> vint v = value_of e)
(map fst (fold_right join_hists empty_hists (map snd lr))) keys)
(Hrepk : Forall repable_signed keys)
(Hnzk : Forall (fun x => Forall (fun x => let '(k, _, _, _) := x in k <> 0 /\ repable_signed k) (fst x)) lr)
k (Hin : In k (map fst (map fst (map fst (concat (map fst lr)))))),
exists v i th t, In (k, v, i, true) (fst (Znth th lr ([], []))) /\
In (t, CAS (vint 0) (vint 0) (vint k)) (fst (Znth i (snd (Znth th lr ([], []))) ([], []))).