Definition empty_stream_spec {A: Type}: forall n, @empty_stream A n = None.

Lemma empty_stream_is_empty {A: Type}: is_empty_stream (@empty_stream A).
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.