Corollary fold_join_hists_length : forall lh h, Forall (fun h' => Zlength h' = Zlength h) lh ->
  Zlength (fold_right join_hists h lh) = Zlength h.Corollary join_hists_empty_length : forall lh, Forall (fun h => Zlength h = size) lh ->
  Zlength (fold_right join_hists empty_hists lh) = size.

Lemma add_items_hist_length : forall h lr, Forall (fun '(la, h') => add_items_trace h la h') lr -> Forall (fun h' => Zlength h' = Zlength h) (map snd lr).