Definition strict_prefix_history {ora: RandomOracle} (h1 h2: RandomHistory): Prop :=
prefix_history h1 h2 /\ exists n, h1 n <> h2 n.
Definition n_bounded_prefix_history {ora: RandomOracle} (m: nat) (h1 h2: RandomHistory): Prop :=
forall n, (h1 n = None /\ h2 (n + m) = None) \/ h1 n = h2 n.
Definition n_conflict_history {ora: RandomOracle} (n: nat) (h1 h2: RandomHistory): Prop :=
match h1 n, h2 n with
| Some a1, Some a2 => projT1 a1 <> projT1 a2
| Some _, None => True
| None, Some _ => True
| None, None => False
end.
Definition conflict_history {ora: RandomOracle} (h1 h2: RandomHistory): Prop :=
exists n, history_coincide n h1 h2 /\ n_conflict_history n h1 h2.
Definition strict_conflict_history {ora: RandomOracle} (h1 h2: RandomHistory): Prop :=
exists n,
history_coincide n h1 h2 /\
match h1 n, h2 n with
| Some a1, Some a2 => projT1 a1 <> projT1 a2
| _, _ => False
end.

Lemma prefix_history_comparable {ora: RandomOracle}: forall h1 h2 h, prefix_history h1 h -> prefix_history h2 h -> prefix_history h1 h2 \/ prefix_history h2 h1.