Program Definition stream_map {A B: Type} (f: A -> B) (h: stream A): stream B :=
  fun n => match h n return option B with
           | Some a => Some (f a)
           | None => None
           end.

Lemma stream_map_inf_stream {A B: Type}: forall (f: A -> B) (h: stream A), is_inf_stream h <-> is_inf_stream (stream_map f h).