Fixpoint fisrtn_list_from_fun {A: Type} (f: nat -> A) (n: nat) : list A :=
  match n with
  | 0 => nil
  | S m => fisrtn_list_from_fun f m ++ f m :: nil
  end.Definition State: Type := {l: list A | P l}.Definition state_nil: State := exist _ nil H_init.Fixpoint step (n: nat): State := 
  match n with
  | 0 => state_nil
  | S m => exist _ _ (HF (step m))
  end.

(* Specifications: *)
Lemma fisrtn_list_step: forall n, fisrtn_list_from_fun (fun n0 : nat => F (step n0)) n = proj1_sig (step n).
Lemma nat_stepwise_choice: (forall l, P l -> exists a, P (l ++ a :: nil)) -> exists f, forall n, P (fisrtn_list_from_fun f n).
Lemma nat_coinduction {A: Type}: forall (P: A -> Prop) (R: A -> A -> Prop) a0, P a0 -> (forall a, P a -> exists b, R a b /\ P b) -> exists l: nat -> A, l 0 = a0 /\ (forall k, R (l k) (l (S k))).
Lemma nat_coinduction' {A: Type}: forall (P: A -> Prop) (R: A -> A -> Prop) a0, P a0 -> (forall a, P a -> exists b, R a b /\ P b) -> exists l: nat -> A, l 0 = a0 /\ (forall k, R (l k) (l (S k))) /\ (forall k, P (l k)).