Require RndHoare.axiom. Import RndHoare.axiom.NatChoice.
Fixpoint app_fin_inf {ora: RandomOracle} (l: list RandomQA) (f: nat -> RandomQA) :=
match l with
| nil => f
| qa :: l0 => fun n =>
match n with
| 0 => qa
| S m => app_fin_inf l0 f m
end
end.

Lemma inf_history_construction {ora: RandomOracle}: forall (P: RandomHistory -> Prop) (init: list RandomQA),
P (fin_history init) ->
(forall l, P (fin_history l) -> exists qa, P (fin_history (l ++ qa :: nil))) ->
exists h, is_inf_history h /\ forall n, n >= length init -> P (fstn_history n h).