Notation Stream := (Stream A).(** Streams *)

CoInductive Stream (A : Type) :=
  Cons : A -> Stream A -> Stream A.Definition hd (x:Stream) := match x with
                            | Cons a _ => a
                            end.Definition tl (x:Stream) := match x with
                            | Cons _ s => s
                            end.Fixpoint Str_nth_tl (n:nat) (s:Stream) : Stream :=
  match n with
  | O => s
  | S m => Str_nth_tl m (tl s)
  end.Definition Str_nth (n:nat) (s:Stream) : A := hd (Str_nth_tl n s).

(* Specifications: *)
Lemma unfold_Stream : forall x:Stream, x = match x with | Cons a s => Cons a s end.
Lemma tl_nth_tl : forall (n:nat) (s:Stream), tl (Str_nth_tl n s) = Str_nth_tl n (tl s).
Lemma Str_nth_tl_plus : forall (n m:nat) (s:Stream), Str_nth_tl n (Str_nth_tl m s) = Str_nth_tl (n + m) s.
Lemma Str_nth_plus : forall (n m:nat) (s:Stream), Str_nth n (Str_nth_tl m s) = Str_nth (n + m) s.