Section Parks.
Variable A : Type.
Variable R : Stream A -> Stream A -> Prop.
Hypothesis bisim1 : forall s1 s2:Stream A,
R s1 s2 -> hd s1 = hd s2.
Hypothesis bisim2 : forall s1 s2:Stream A,
R s1 s2 -> R (tl s1) (tl s2).
CoFixpoint park_ppl :
forall s1 s2:Stream A, R s1 s2 -> stream_equiv s1 s2 :=
fun s1 s2 (p : R s1 s2) =>
mkStreamEq _ _ _ (bisim1 s1 s2 p)
(park_ppl (tl s1)
(tl s2)
(bisim2 s1 s2 p)).
End Parks.
Program CoFixpoint iterate {A} (f : A -> A) (x : A) : Stream A :=
{| hd := x; tl := iterate f (f x) |}.
Program CoFixpoint map {A B} (f : A -> B) (s : Stream A) : Stream B :=
{| hd := f s.(hd); tl := map f s.(tl) |}.

Theorem map_iterate A (f : A -> A) (x : A) : stream_equiv (iterate f (f x))
(map f (iterate f x)).